<?xml version="1.0" encoding="UTF-8"?><npc name="Caraminholas na cabeça" script="data/npc/scripts/Caraminholas na cabeça.lua" walkinterval="2000" floorchange="0"> <mana now="100" max="100"/> <health now="100" max="100"/> <look type="4" head="40" body="30" legs="40" feet="50"/> <parameters> <parameter key="module_shop" value="0" /> <parameter key="message_greet" value="Qual dessas caracteristicas mais combinam com você?" /> </parameters></npc>
lua:
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction creatureSayCallback(cid, type, msg)if not npcHandler:isFocused(cid) thenreturn falseendlocal talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cidlocal pos1 = {x=3073, y=3016, z=7} -- coragemlocal pos2 = {x=3073, y=3016, z=7} -- lealdadelocal pos3 = {x=3073, y=3016, z=7} -- inteligencialocal pos4 = {x=3073, y=3016, z=7} -- astuciaif msgcontains(msg, 'coragem') thenselfSay('Boa sorte em sua aventura.', cid)doTeleportThing(cid, pos1)endif msgcontains(msg, 'lealdade') thenselfSay('Boa sorte em sua aventura.', cid)doTeleportThing(cid, pos2)endif msgcontains(msg, 'inteligencia') thenselfSay('Boa sorte em sua aventura.', cid)doTeleportThing(cid, pos3)endif msgcontains(msg, 'astucia') thenselfSay('Boa sorte em sua aventura.', cid)doTeleportThing(cid, pos4)endreturn trueendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())
esta bem fácil de configurar, qualquer dúvida manda ai.