Ir para conteúdo

vinicios thiago

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    vinicios thiago deu reputação a Sanieg em Galera Lvl para falar com npc   
    local tasks = { [1] = {questStarted = 1539, questStorage = 65029, killsRequired = 200, raceName = "Demons", rewards = {{enable = true, type = "storage", values = {65535, 1}}}} } local rankStorage = 32150 local storage = 64521 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local voc = {} 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) local s = getCreatureStorage(cid, storage) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid if msgcontains(msg, "task") then if(s < 1) then doCreatureSetStorage(cid, storage, 1) s = getCreatureStorage(cid, storage) end if(getCreatureStorage(cid, rankStorage) < 1) then doCreatureSetStorage(cid, rankStorage, 0) end if tasks[s] then if(getCreatureStorage(cid, tasks[s].questStarted) < 1) then if(getCreatureStorage(cid, tasks[s].creatureStorage) < 0) then doCreatureSetStorage(cid, tasks[s].creatureStorage, 0) end if(getCreatureStorage(cid, tasks[s].questStorage) < 0) then doCreatureSetStorage(cid, tasks[s].questStorage, 0) end if getPlayerLevel(cid) < 400 then  selfSay("You need be level 400.", cid) return false end doCreatureSetStorage(cid, tasks[s].questStarted, 1) selfSay("You have started the task number " .. getPlayerStorageValue(cid, storage) .. ", in this task you need to kill " .. tasks[s].killsRequired .. " " .. tasks[s].raceName .. ".", cid) else selfSay("You are currently making the task about " .. tasks[s].raceName .. ", task number " .. getPlayerStorageValue(cid, storage) .. ".", cid) end else print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.") end elseif msgcontains(msg, "report") then if tasks[s] and tasks[s].questStarted > 0 then if(getCreatureStorage(cid, tasks[s].creatureStorage) < 0) then doCreatureSetStorage(cid, tasks[s].creatureStorage, 0) end if(getCreatureStorage(cid, tasks[s].questStorage) < 0) then doCreatureSetStorage(cid, tasks[s].questStorage, 0) end if(getCreatureStorage(cid, tasks[s].questStorage) >= tasks[s].killsRequired) then for i = 1, table.maxn(tasks[s].rewards) do if(tasks[s].rewards[i].enable) then if isInArray({"vocation", "demon", 1}, tasks[1].rewards[i].type) then doPlayerSetVocation(cid, 21) elseif isInArray({"storage", "stor", 5}, tasks[s].rewards[i].type) then doCreatureSetStorage(cid, tasks[s].rewards[i].values[1], tasks[s].rewards[i].values[2]) elseif isInArray({"points", "rank", 2}, tasks[s].rewards[i].type) then doCreatureSetStorage(cid, rankStorage, getCreatureStorage(cid, rankStorage) + tasks[s].rewards[i].values) else print("[Warning - Error::Killing in the name of::Tasks config] Bad reward type: " .. tasks[s].rewards[i].type .. ", reward could not be loaded.") end end end local rank = getCreatureStorage(cid, rankStorage) selfSay("Great!... you have finished the task number " .. s .. "" .. (rank > 4 and ", you are a " or "") .. "" .. (((rank > 4 and rank < 10) and ("Huntsman") or (rank > 9 and rank < 20) and ("Ranger") or (rank > 19 and rank < 30) and ("Big Game Hunter") or (rank > 29 and rank < 50) and ("Trophy Hunter") or (rank > 49) and ("Elite Hunter")) or "") .. ". Good job.", cid) doCreatureSetStorage(cid, storage, s + 1) else selfSay("Current " .. getCreatureStorage(cid, tasks[s].questStorage) .. " " .. tasks[s].raceName .. " killed, you need to kill " .. tasks[s].killsRequired .. ".", cid) end else selfSay("You do not have started any task.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  2. Gostei
    vinicios thiago deu reputação a nookia em (Resolvido)Trocando blueberry por potions   
    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 local items = { item = {2677, 7620} -- item que será pedido e item que será dado na troca } local counts = { count = {100, 20} -- quantidade que será pedido e quantidade que será dado na troca } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'trocar') then if getPlayerItemCount(cid, items.item[1]) >= counts.count[1] then doPlayerRemoveItem(cid, items.item[1], counts.count[1]) doPlayerAddItem(cid, items.item[2], counts.count[2]) selfSay('Você trocou '.. counts.count[1] ..' '.. getItemNameById(items.item[1]) ..' for '.. counts.count[2] ..' '.. getItemNameById(items.item[2]) ..'.', cid) else selfSay('Você não possui '.. counts.count[1] ..' '.. getItemNameById(items.item[1]) ..'.', cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Testei e funcionando 100%, abraço.
  3. Gostei
    vinicios thiago deu reputação a nookia em Ajudem Urgente   
    function onUse(cid, item, fromPosition, itemEx, toPosition) doCreateItem(2677, math.random(5, 10), fromPosition) doTransformItem(item.uid, 2786) doDecayItem(item.uid) return true end Testei e funcionando 100%, abraço.
  4. Gostei
    vinicios thiago deu reputação a GOD Falumir em Galera Estou Tendo Problema Com Nuker Mage Bomb   
    Boa tarde, lhe recomendo essa script, pois esse sistema de banir quem tentar fazer isso sempre da problema banindo gente que não tem nada a ver com a história assim você perderia players, esse ai funciona 100% já foi testado por mim em um baiak versão 8.6, boa sorte! se ajudei por favor não esqueça do +REP
     
    http://www.tibiaking.com/forum/topic/21405-anti-nuker-com-account-manager/
  5. Gostei
    vinicios thiago deu reputação a CarlosHenrique7457 em Galera Estou Tendo Problema Com Nuker Mage Bomb   
    Nem um desses sistemas que indiquei da ban, pfv verifique antes de falar merda. 
    e esse msm ja foi citado por min
     
  6. Gostei
    vinicios thiago deu reputação a Ken Kaneki em Zombie Event Ramdon items   
    Testa ai...
    function loseOnZombieArena(cid)kickPlayerFromZombiesArea(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.") local players = getZombiesEventPlayers() if(#players <= 1) then local winner = players[1] if(winner) then local items = {2160, 2157, 2121} a = math.random(winner ,1, #items) doPlayerAddItem(winner, a, 1) doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.") doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!") kickPlayerFromZombiesArea(winner) else doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!") end doSetStorage(ZE_STATUS, 0) doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS) doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0) doSetStorage(ZE_ZOMBIES_SPAWNED, 0) local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1 local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1 local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z} for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do centerPos.z = z for i, uid in pairs(getSpectators(centerPos, width, height, false)) do if(isMonster(uid)) then doRemoveCreature(uid) end end end end end function onStatsChange(target, cid, changetype, combat, value) if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then doCreatureAddHealth(target, getCreatureMaxHealth(target)) loseOnZombieArena(target) return false end return true end
  7. Gostei
    vinicios thiago deu reputação a Ken Kaneki em Zombie Event Ramdon items   
    Editei tenta lá.
  8. Gostei
    vinicios thiago deu reputação a Ken Kaneki em Zombie Event Ramdon items   
    Um amigo me ajudou tenta ai.
    function loseOnZombieArena(cid)kickPlayerFromZombiesArea(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.") local players = getZombiesEventPlayers() if(#players <= 1) then local winner = players[1] if(winner) then local items = {2160, 2157} local index = math.random(1, #items) local item = items[index] doPlayerAddItem(winner, item, 1)doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.") doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!") kickPlayerFromZombiesArea(winner) else doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!") end doSetStorage(ZE_STATUS, 0) doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS) doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0) doSetStorage(ZE_ZOMBIES_SPAWNED, 0) local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1 local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1 local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z} for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do centerPos.z = z for i, uid in pairs(getSpectators(centerPos, width, height, false)) do if(isMonster(uid)) then doRemoveCreature(uid) end end end end end function onStatsChange(target, cid, changetype, combat, value) if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then doCreatureAddHealth(target, getCreatureMaxHealth(target)) loseOnZombieArena(target) return false end return true end
  9. Gostei
    vinicios thiago deu reputação a Ken Kaneki em Zombie Event Ramdon items   
    Tem certeza ? as chance de cair o mesmo item é infinita tenta denovo.
  10. Gostei
    vinicios thiago deu reputação a Ken Kaneki em Zombie Event Ramdon items   
    doPlayerAddItem(winner, item, 1)
     
    1 = Quantidade
     
    Caso venha + vez repitido, altere o id do item e veja se vai ver o mesmo.
  11. Gostei
    vinicios thiago deu reputação a nookia em Comando Potions Apenas Sem Pz ou Battlen   
    function onSay(cid, words, param) local t = string.explode(param, ",") if (getPlayerCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendCancel(cid, "Você só pode usar o comando se não estiver com battle.") return FALSE end if (words == "!mp") then if isPremium(cid) == TRUE and param == '' then if doPlayerRemoveMoney(cid, 5000) == TRUE then local bp = doPlayerAddItem(cid, 7620, 100) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Você precisa ser premium e ter money para usar esse comando.") return true end end elseif (words == "!gmp") then if isPremium(cid) == TRUE and param == '' then if doPlayerRemoveMoney(cid, 12000) == TRUE then local bp = doPlayerAddItem(cid, 7590, 100) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Você precisa ser premium e ter money para usar esse comando.") return true end end elseif (words == "!ghp") then if isPremium(cid) == TRUE and param == '' then if doPlayerRemoveMoney(cid, 19000) == TRUE then local bp = doPlayerAddItem(cid, 7591, 100) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Você precisa ser premium e ter money para usar esse comando.") return true end end elseif (words == "!gsp") then if isPremium(cid) == TRUE and param == '' then if doPlayerRemoveMoney(cid, 19000) == TRUE then local bp = doPlayerAddItem(cid, 8472, 100) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Você precisa ser premium e ter money para usar esse comando.") return true end end elseif (words == "!hp") then if isPremium(cid) == TRUE and param == '' then if doPlayerRemoveMoney(cid, 4500) == TRUE then local bp = doPlayerAddItem(cid, 7618, 100) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Você precisa ser premium e ter money para usar esse comando.") return true end end elseif (words == "!shp") then if isPremium(cid) == TRUE and param == '' then if doPlayerRemoveMoney(cid, 10000) == TRUE then local bp = doPlayerAddItem(cid, 7588, 100) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Você precisa ser premium e ter money para usar esse comando.") return true end end elseif (words == "!smp") then if isPremium(cid) == TRUE and param == '' then if doPlayerRemoveMoney(cid, 8000) == TRUE then local bp = doPlayerAddItem(cid, 7589, 100) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Você precisa ser premium e ter money para usar esse comando.") return true end end elseif (words == "!uhp") then if isPremium(cid) == TRUE and param == '' then if doPlayerRemoveMoney(cid, 31000) == TRUE then local bp = doPlayerAddItem(cid, 8473, 100) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Você precisa ser premium e ter money para usar esse comando.") return true end end end return TRUE end
  12. Gostei
    vinicios thiago deu reputação a Wise em Comando Potions Apenas Sem Pz ou Battlen   
    Simplifiquei o seu script, optando pelo uso de parâmetros:

    Ex: !buy mp
    Usando o parâmetro "mp" (sendo as siglas de mana potion), o player irá comprar 100 mana potions pelo custo de 5000 gold coins.

    Basta configurar na tabela do script (já ajustei conforme o seu estava).

    buypotions.lua (data/talkactions/scripts):
    local tab = {     ["mp"] = {potion = {7620, 100}, cost = 5000}, -- ["siglas da poção"] = {potion = {itemID da poção, quantidade}, cost = custo pelas poções},     ["gmp"] = {potion = {7590, 100}, cost = 12000},     ["ghp"] = {potion = {7591, 100}, cost = 19000},     ["gsp"] = {potion = {8472, 100}, cost = 19000},     ["hp"] = {potion = {7618, 100}, cost = 4500},     ["shp"] = {potion = {7588, 100}, cost = 10000},     ["smp"] = {potion = {7589, 100}, cost = 8000},     ["uhp"] = {potion = {8473, 100}, cost = 31000} } function onSay(cid, words, param, channel)     local sparam = string.lower(param)     if param == "" then         doPlayerSendCancel(cid, "Enter the acronym of the potion you want to buy.")     end              if not tab[sparam] then             doPlayerSendCancel(cid, "Potion not found.")         end          if not isPlayerPzLocked(cid) then         if doPlayerRemoveMoney(cid, tab[sparam].cost) then             doPlayerAddItem(cid, tab[sparam].potion[1], tab[sparam].potion[2])             doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought "..tab[sparam].potion[2].." "..getItemNameById(tab[sparam].potion[1]).."s.")         else             doPlayerSendCancel(cid, "You need "..tab[sparam].cost.." gold coins to buy these potions.")         end     else         doPlayerSendCancel(cid, "You can only buy potions if you are out of battle.")     end          return true end

     
    A tag ficará então como sendo:

    talkactions.xml (data/talkactions):
    <talkaction words="!buy" script="buypotions.lua"/>
  13. Gostei
    vinicios thiago deu reputação a GiovaneCampos em (Resolvido)Comprar Potions Pro Comandos   
    Já ajudei ele skype fecha topico.
  14. Gostei
    vinicios thiago deu reputação a Naze em (Resolvido)Comprar Potions Pro Comandos   
    Irei fazer uma e edito aqui.
     
    @Edit
    Cria no talkaction/scripts um arquivo sellpotion.lua e adicione isso dentro
    -- Script by Naze Saria p/ Tibia King -- function onSay(cid, words, param) local t = string.explode(param, ",") if (words == "!mp") then if isPremium(cid) == TRUE and param == '' then doPlayerRemoveMoney(cid, XXX) doPlayerAddItem(cid, YYY, ZZZ) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Voce precisa ser premium e ter money para usar esse comando.") return true end elseif (words == "!gmp") then if isPremium(cid) == TRUE and param == '' then doPlayerRemoveMoney(cid, XXX) doPlayerAddItem(cid, YYY, ZZZ) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Voce precisa ser premium e ter money para usar esse comando.") return true end -- adiciona mais aqui em cima         end return TRUE end  
    Irei explicar:
     
    Aonde está XXX voce troca pelo tanto em gold coins.
    aonde está YYY voce trocara pelo id do item
    aonda esta ZZZ voce trocara pela quantidade
    Lembrando trocando os da mesma linha da mesma função exemplo se quero trocar o da !mp editarei aqui 
    if (words == "!mp") then if isPremium(cid) == TRUE and param == '' then doPlayerRemoveMoney(cid, XXX) doPlayerAddItem(cid, YYY, ZZZ) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Voce precisa ser premium e ter money para usar esse comando.") return true end Agora para você adicionar mais coisas a ser vendida adicione isso que irei passar em cima donde ta escreito "-- adiciona mais aqui em cima"
     
    adiciona isso:
    elseif (words == "!texto") then if isPremium(cid) == TRUE and param == '' then doPlayerRemoveMoney(cid, XXX) doPlayerAddItem(cid, YYY, ZZZ) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Voce precisa ser premium e ter money para usar esse comando.") return true end ficando assim
    -- Script by Naze Saria p/ Tibia King -- function onSay(cid, words, param) local t = string.explode(param, ",") if (words == "!mp") then if isPremium(cid) == TRUE and param == '' then doPlayerRemoveMoney(cid, XXX) doPlayerAddItem(cid, YYY, ZZZ) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Voce precisa ser premium e ter money para usar esse comando.") return true end elseif (words == "!gmp") then if isPremium(cid) == TRUE and param == '' then doPlayerRemoveMoney(cid, XXX) doPlayerAddItem(cid, YYY, ZZZ) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Voce precisa ser premium e ter money para usar esse comando.") return true end elseif (words == "!texto") then if isPremium(cid) == TRUE and param == '' then doPlayerRemoveMoney(cid, XXX) doPlayerAddItem(cid, YYY, ZZZ) doSendMagicEffect(getPlayerPosition(cid), 30) else doPlayerSendCancel(cid, "Voce precisa ser premium e ter money para usar esse comando.") return true end -- adiciona mais aqui em cima end return TRUE end apenas mude o !texto
     
    agora adicione essa tag no talkaction.xml
    <talkaction words="!mp;!gmp" event="script" value="sellpotion.lua"/> lembrese de quando adicionar mais um pra vender modifca na tag colocando ele tipo voce adicionou mais um q chama !exp entao na tag tem que ficar
    <talkaction words="!mp;!gmp;!exp" event="script" value="sellpotion.lua"/>

Informação Importante

Confirmação de Termo