Postado Junho 11, 2014 11 anos Preciso de um npc que teleporta para 3 Lugares Ex: Jirachi : Parabéns , você quer ir para qual cidade ? Saffron , Cerulean , Cinnabar Ajudei ? Resp+ Assim o Tibia King vai crescer rsrs.
Postado Junho 11, 2014 11 anos -- < Script by Frenesy > -- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local Saffron = {x=000,y=000,z=00} -- Configurar Aqui local Cerulean = {x=000,y=000,z=00} -- Configurar Aqui local Cinnabar = {x=000,y=000,z=00} -- Configurar Aqui local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'Saffron') or msgcontains(msg, 'saffron')) then selfSay('Adeus!', cid) doTeleportThing(cid, Saffron) elseif(msgcontains(msg, 'Cerulean') or msgcontains(msg, 'celurean')) then selfSay('Adeus!', cid) doTeleportThing(cid, Celurean) elseif(msgcontains(msg, 'Cinnabar') or msgcontains(msg, 'cinnabar')) then selfSay('Adeus!', cid) doTeleportThing(cid, Cinnabar) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Não sei se precisava de dinheiro.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.