Ir para conteúdo

raspas

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    raspas deu reputação a Vodkart em Segunda Promotion AJUDA !   
    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 msg = string.lower(msg) local t = { ["first promote"] = {items = {2160,2}, level = 20, promotion = 1}, ["second promote"] = {items = {2157,10}, level = 40, promotion = 2}, ["third promote"] = {items = {2157,20}, level = 60, promotion = 3} } if isInArray({"promot","promotion", "promover", "promo", "promote"}, msg) then npcHandler:say("I can promote you for {first promote}, {second promote} and {third promote}.", cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if t[msg] then if getPlayerLevel(cid) >= t[msg].level then if (getPlayerPromotionLevel(cid) < t[msg].promotion) then if doPlayerRemoveItem(cid, t[msg].items[1], t[msg].items[2]) then setPlayerPromotionLevel(cid, t[msg].promotion) npcHandler:say("Congratulations! You are now promoted.", cid) else npcHandler:say("You need "..t[msg].items[2].." "..getItemNameById(t[msg].items[1]).."!", cid) end else npcHandler:say("You are already promoted!", cid) end else npcHandler:say("Sorry, You need level "..t[msg].level.." or more to buy promotion!", cid) talkState[talkUser] = 0 end end elseif isInArray({"no","nao"}, msg) then selfSay("Then not.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())

Informação Importante

Confirmação de Termo