Postado Janeiro 19, 2012 13 anos Desculpa demora, estava com dedo machucado.. violão é assassino. Primeiro NPC 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local name = getCreatureName(cid) if msgcontains(msg, 'missao') or msgcontains (msg, 'hi') then if isInArray({2, 6}, getPlayerVocation(cid)) then selfSay('Olá '..name..' quer ser nosso aliado ?{aliar} salve nosso leader', cid) talkState[talkUser] = 1 else selfSay('Desculpe,mas sua vocacao nao pode fazer a missao', cid) end elseif msgcontains(msg, 'trombeta') or msgcontains (msg, 'entregar') then if getPlayerStorageValue(cid, 505052) < 1 then selfSay('Óla tocou o trompete!Parabêns agora como recompença por nós ajudar seremos seus aliados e você aprendera a magia para chamar 2 de nós.', cid) talkState[talkUser] = 2 else selfSay('Voce deve terminar todas as missoes antes de tudo.', cid) end elseif talkState[talkUser] == 1 then if msgcontains(msg, 'aliar') then selfSay('Vá na vila minotauro mate todos eles e fale como o leader para ele tedar o trompete pra chamar as tropas Orc.', cid) setPlayerStorageValue(cid,505051) talkState[talkUser] = 0 end elseif talkState[talkUser] == 2 then if msgcontains(msg, 'yes') then selfSay('teste', cid) setPlayerStorageValue(cid,505052) talkState[talkUser] = 0 end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) 2 NPC: 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local name = getCreatureName(cid) if msgcontains(msg, 'missao') or msgcontains (msg, 'hi') then if getPlayerStorageValue(cid, 505051) < 1 then selfSay('Óla soube que minha aprendiz te mandou aqui pois vou lhe dar um trompete por me salvar toque-o e chame minha tropa {trompete}', cid) talkState[talkUser] = 1 else selfSay('Voce deve falar com o outro npc', cid) end elseif talkState[talkUser] == 1 then if msgcontains(msg, 'trombeta') then selfSay('Tome-o!.', cid) doPlayerAddItem(cid,2160,1) talkState[talkUser] = 0 end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ITEM: function onUse(cid, item, frompos, item2, topos) setPlayerStorageValue(cid,505052) return TRUE end http://baiakuza.com/IP: baiakuza.com TIBIA: 10.96 Baiak Custom [ High Exp Rate ]
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.