
heylike
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
heylike deu reputação a didito em Vender promotion no gesior 0.3.8Então seja mais exato amigo rs.
function onUse(cid, item, frompos, item2, topos) setPlayerStorageValue(cid,10011,os.time()) doPlayerSetVocation(cid, getPlayerVocation(cid)+4) doRemoveItem(item.uid,1) doPlayerSendTextMessage(cid,31, "OMG! I now i can see new warrior in my world") return TRUE end function onLogin(cid) local config = { storage = 10001, time = 30 * 24 * 60 * 60, msg = "Sua promotion acabou", } if (os.time() - getPlayerStorageValue(cid,config.storage)) >= config.time then doPlayerSetVocation(cid,getPlayerVocation(cid) - 4) doPlayerSendTextMessage(cid,31,config.msg) end end
-
heylike deu reputação a Carinhah em NPC que vende runas atraves de falar!ta ae manolo... demorei um pouco para entregar por motivos pessoais
troquei algumas coisinhas que tu pediu apenas pq o sistema nao estava reconhecendo fazendo assim bugar o NPC...
mudanças:
Antes / Depois
Event I >> Event 1
Event II >> Event 2
Event III >> Event 3
-- script by Carinhah 'TibiaKing.com' -- 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 player_gold = getPlayerItemCount(cid,2148) local player_plat = getPlayerItemCount(cid,2152)*100 local player_crys = getPlayerItemCount(cid,2160)*10000 local player_money = player_gold + player_plat + player_crys if(msgcontains(msg, 'Event 1')) then selfSay('gostaria de comprar ' .. getItemNameById(2270) .. '?}', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Event 2')) then selfSay('gostaria de comprar ' .. getItemNameById(2296) .. '?}', cid) talkState[talkUser] = 2 elseif(msgcontains(msg, 'Event 3')) then selfSay('gostaria de comprar ' .. getItemNameById(2290) .. '?}', cid) talkState[talkUser] = 3 elseif(msgcontains(msg, 'Event Castle')) then selfSay('gostaria de comprar ' .. getItemNameById(2280) .. '?}', cid) talkState[talkUser] = 4 elseif(msgcontains(msg, 'yes')) then if(talkState[talkUser] == 1) then if doPlayerRemoveMoney(cid,1000) then doPlayerAddItem(cid, 2270, 1) else selfSay('You no have money', cid) end elseif(talkState[talkUser] == 2) then if doPlayerRemoveMoney(cid,2000) then doPlayerAddItem(cid, 2296, 1) else selfSay('You no have money', cid) end elseif(talkState[talkUser] == 3) then if doPlayerRemoveMoney(cid,3000) then doPlayerAddItem(cid, 2290, 1) else selfSay('You no have money', cid) end elseif(talkState[talkUser] == 4) then if doPlayerRemoveMoney(cid,4000) then doPlayerAddItem(cid, 2280, 1) else selfSay('You no have money', cid) end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then selfSay('Ok then.', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())