lekmat 0 Postado Fevereiro 8, 2009 Share Postado Fevereiro 8, 2009 ai esta u npc eli nao esta funfando no meu server local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end function onThink() npcHandlernThink() end function creatureSayCallback(cid, type, msg) if(npcHandler.focus ~= cid) then return false end local real = false if (real == true) then tradeMsg = 'Me can make good item from item me need. Me make uth\'kean, za\'ralator, uth\'lokr, uth\'prta and nasty lil\' bolts.' crownMsg = 'Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil\' one want to trade?' devilMsg = 'Hellsteel is. Cursed and evil. Dangerous to work with. Me can make from evil helmet. Lil\' one want to trade?' dragoMsg = 'Firy steel it is. Need green ones\' breath to melt. Or red even better. Me can make from shield. Lil\' one want to trade?' giantMsg = 'Good iron is. Me friends use it much for fight. Me can make from weapon. Lil\' one want to trade?' souloMsg = 'Uh. Me can make some nasty lil\' bolt from soul orbs. Lil\' one want to trade all?' hasNoMsg = 'Lil\' one no have item I want.' noMsg = 'Lil\' one no want item?' else tradeMsg = 'I can forge you royal steel from crown armors, hell steel from devil helmets, draconian steel from dragon shields, crude iron from giant swords and infernal bolts from soul orbs.' crownMsg = 'Do you want trade a crown armor for royal steel?' devilMsg = 'Do you want trade a devil helmet for hell steel?' dragoMsg = 'Do you want trade a dragon shield for draconian steel?' giantMsg = 'Do you want trade a giant sword for crude iron?' souloMsg = 'Do you want trade a soul orb for 2 infernal bolts?' hasNoMsg = 'Come back when you have more!' noMsg = 'Ok than.' end if msgcontains(msg, 'items') or msgcontains(msg, 'item') or msgcontains(msg, 'forge') then selfSay(tradeMsg) elseif msgcontains(msg, 'royal steel') or msgcontains(msg, 'royal') or msgcontains(msg, 'crown') or msgcontains(msg, 'crown armor') or msgcontains(msg, 'uth\'kean') then selfSay(crownMsg) talkState = 1 elseif msgcontains(msg, 'hell steel') or msgcontains(msg, 'hell') or msgcontains(msg, 'devil') or msgcontains(msg, 'devil helmet') or msgcontains(msg, 'za\'ralator') then selfSay(devilMsg) talkState = 2 elseif msgcontains(msg, 'draconian steel') or msgcontains(msg, 'draconian') or msgcontains(msg, 'dragon') or msgcontains(msg, 'dragon shield') or msgcontains(msg, 'uth\'lokr') then selfSay(dragoMsg) talkState = 3 elseif msgcontains(msg, 'crude iron') or msgcontains(msg, 'crude') or msgcontains(msg, 'giant') or msgcontains(msg, 'gs') or msgcontains(msg, 'giant sword') or msgcontains(msg, 'uth\'prta') then selfSay(giantMsg) talkState = 4 elseif msgcontains(msg, 'infernal') or msgcontains(msg, 'infernal bolt') or msgcontains(msg, 'infernal bolts') or msgcontains(msg, 'soul') or msgcontains(msg, 'soul orb') or msgcontains(msg, 'soul orbs') or msgcontains(msg, 'nasty lil\' bolt') then selfSay(souloMsg) talkState = 5 elseif msgcontains(msg, 'yes') and talkState == 1 then if getPlayerItemCount(cid,2487) >= 1 then if doPlayerTakeItem(cid,2487,1) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5887,1) end else selfSay(hasNoMsg) end talkState = 0 elseif msgcontains(msg, 'yes') and talkState == 2 then if getPlayerItemCount(cid,2462) >= 1 then if doPlayerTakeItem(cid,2462,1) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5888,1) end else selfSay(hasNoMsg) end talkState = 0 elseif msgcontains(msg, 'yes') and talkState == 3 then if getPlayerItemCount(cid,2516) >= 1 then if doPlayerTakeItem(cid,2516,1) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5889,1) end else selfSay(hasNoMsg) end talkState = 0 elseif msgcontains(msg, 'yes') and talkState == 4 then if getPlayerItemCount(cid,2393) >= 1 then if doPlayerTakeItem(cid,2393,1) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,5892,1) end else selfSay(hasNoMsg) end talkState = 0 elseif msgcontains(msg, 'yes') and talkState == 5 then if getPlayerItemCount(cid,5944) >= 1 then if doPlayerTakeItem(cid,5944,1) == 0 then selfSay('Here you are.') doPlayerAddItem(cid,6529,2) end else selfSay(hasNoMsg) end talkState = 0 elseif msgcontains(msg, 'no') and (talkState >= 1 and talkState <= 6) then selfSay(noMsg) talkState = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ajudem ai vlews Link para o comentário https://xtibia.com/forum/topic/107366-npc-a-sweaty-cyclops/ Compartilhar em outros sites More sharing options...
Merchant 0 Postado Fevereiro 8, 2009 Share Postado Fevereiro 8, 2009 :button_cancel: Tópico Fechado. Abraços Link para o comentário https://xtibia.com/forum/topic/107366-npc-a-sweaty-cyclops/#findComment-692986 Compartilhar em outros sites More sharing options...
Posts Recomendados