Ir para conteúdo

Movie

Membro
  • Registro em

  • Última visita

Tudo que Movie postou

  1. local items = { -- {id = id do item, price = valor da venda}, {id = 2487, price = 100000}, -- crown armor {id = 2488, price = 110000}, -- crown legs {id = 2514, price = 110000}, -- mastermind shield } function onUse(cid, item,fromPosition, itemEx, toPosition) local a = items[itemEx.itemid] local b = items[].id if a ~= b then doPlayerSendTextMessage(cid, 25,"Não foi possivel vender esse item.") return true end for _, i in pairs(items) do if itemEx.itemid == i.id then doRemoveItem(itemEx.uid) doPlayerAddMoney(cid, i.price) end end return true end Posso estar errando em relação à lógica, mas não custa tentar.
  2. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Troca o db.executeQuery por db.query
  3. Tenta assim local function warnTp(cid, x) if x <= 0 then return end doPlayerSendTextMessage(cid, 22, "Você será teleportado em ".. x .. " segundos.") local playerName = getCreatureName(cid) addEvent(function() if playerName then warnTp(x - 1) end end, 1000) end function onUse(cid, item, fromPosition, item2, toPosition) local teleport = {x = 433, y = 992, z = 15} doTeleportThing(cid, teleport) doSendMagicEffect(getPlayerPosition(cid), 10) warnTp(cid, 5) end
  4. To pensando na melhor lógica pra ele, desculpa a demora, ando meio ocupado..
  5. E se por exemplo, tivermos o que puxou a alavanca level 10, e os outros estiverem nível 3. Ao tentar pegar a recompensa todos pegarão a recompensa do level 10, mesmo estando nível 3?
  6. Você poderia me detalhar como funciona a quest? Eu sei apenas o básico dela...
  7. Qual a versão do seu TFS?
  8. Na pasta lib, procure a pasta compat. Dentro dela abra o compat.lua e adicione essa função function getStringTimeEnglish(tempo) local result = {} result.hours = math.floor(tempo / 3600) tempo = math.max(0, tempo - (result.hours * 3600)) result.minutes = math.floor(tempo / 60) tempo = math.max(0, tempo - (result.minutes * 60)) result.seconds = tempo return result end
  9. Se até sábado ninguém tiver feito, eu faço pra você
  10. No sábado eu posto a parte do script que tá faltando nesse código.
  11. Da pra fazer por weapons também, você tá interessado em aprender a fazer ou quer o script pronto?
  12. Pego meu computador dia 05/01, se ninguém tiver feito pra você eu faço. Qual a versão da sua distro?
  13. Movie postou uma resposta no tópico em Mapas de Tibia
    Ficou muito bom! Obrigado por disponibilizar
  14. Nesse code aí só está falando do botão do WhatsApp. Não tem nada relacionado às guilds.
  15. Qual TFS?
  16. Fala pessoal, hoje venho trazer um sisteminha básico que eu fiz pro meu OT e achei bacana e resolvi postar aqui. Ele está baseado no 1.3, porém em breve posso postar para 0.x. Como ele funciona? Ao usar uma poção, você não irá receber o vial ou a flask, e ao invés disso você irá ganhar uma storage. Ao chega no NPC e falar vial ou flasks ele irá te perguntar se você gostaria de receber pelo preço das poções utilizadas. O sistema é baseado na storage 75123. Em actions, ache o arquivo potions.lua Como era: local berserk = Condition(CONDITION_ATTRIBUTES) berserk:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) berserk:setParameter(CONDITION_PARAM_SKILL_MELEE, 5) berserk:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10) berserk:setParameter(CONDITION_PARAM_BUFF_SPELL, true) local mastermind = Condition(CONDITION_ATTRIBUTES) mastermind:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) mastermind:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 3) mastermind:setParameter(CONDITION_PARAM_BUFF_SPELL, true) local bullseye = Condition(CONDITION_ATTRIBUTES) bullseye:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) bullseye:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 5) bullseye:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10) bullseye:setParameter(CONDITION_PARAM_BUFF_SPELL, true) local potions = { [6558] = {transform = {7588, 7589}, effect = CONST_ME_DRAWBLOOD}, [7439] = {condition = berserk, vocations = {4, 8}, effect = CONST_ME_MAGIC_RED, description = "Only knights may drink this potion.", text = "You feel stronger."}, [7440] = {condition = mastermind, vocations = {1, 2, 5, 6}, effect = CONST_ME_MAGIC_BLUE, description = "Only sorcerers and druids may drink this potion.", text = "You feel smarter."}, [7443] = {condition = bullseye, vocations = {3, 7}, effect = CONST_ME_MAGIC_GREEN, description = "Only paladins may drink this potion.", text = "You feel more accurate."}, [7588] = {health = {250, 350}, vocations = {3, 4, 7, 8}, level = 50, flask = 7634, description = "Only knights and paladins of level 50 or above may drink this fluid."}, [7589] = {mana = {115, 185}, vocations = {1, 2, 3, 5, 6, 7}, level = 50, flask = 7634, description = "Only sorcerers, druids and paladins of level 50 or above may drink this fluid."}, [7590] = {mana = {150, 250}, vocations = {1, 2, 5, 6}, level = 80, flask = 7635, description = "Only druids and sorcerers of level 80 or above may drink this fluid."}, [7591] = {health = {425, 575}, vocations = {4, 8}, level = 80, flask = 7635, description = "Only knights of level 80 or above may drink this fluid."}, [7618] = {health = {125, 175}, flask = 7636}, [7620] = {mana = {75, 125}, flask = 7636}, [8472] = {health = {250, 350}, mana = {100, 200}, vocations = {3, 7}, level = 80, flask = 7635, description = "Only paladins of level 80 or above may drink this fluid."}, [8473] = {health = {650, 850}, vocations = {4, 8}, level = 130, flask = 7635, description = "Only knights of level 130 or above may drink this fluid."}, [8474] = {antidote = true, flask = 7636}, [8704] = {health = {60, 90}, flask = 7636}, [26029] = {mana = {425, 575}, vocations = {1, 2, 5, 6}, level = 130, flask = 7635, description = "Only druids and sorcerers of level 130 or above may drink this fluid."}, [26030] = {health = {420, 580}, mana = {250, 350}, vocations = {3, 7}, level = 130, flask = 7635, description = "Only paladins of level 130 or above may drink this fluid."}, [26031] = {health = {875, 1125}, vocations = {4, 8}, level = 200, flask = 7635, description = "Only knights of level 200 or above may drink this fluid."} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if type(target) == "userdata" and not target:isPlayer() then return false end local potion = potions[item:getId()] if potion.level and player:getLevel() < potion.level or potion.vocations and not table.contains(potion.vocations, player:getVocation():getId()) then player:say(potion.description, TALKTYPE_MONSTER_SAY) return true end if potion.condition then player:addCondition(potion.condition) player:say(potion.text, TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(potion.effect) elseif potion.transform then item:transform(potion.transform[math.random(#potion.transform)]) item:getPosition():sendMagicEffect(potion.effect) return true else if potion.health then doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health[1], potion.health[2]) end if potion.mana then doTargetCombatMana(0, target, potion.mana[1], potion.mana[2]) end if potion.antidote then target:removeCondition(CONDITION_POISON) end player:addItem(potion.flask) target:say("Aaaah...", TALKTYPE_MONSTER_SAY) target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end item:remove(1) return true end Como ficou: local berserk = Condition(CONDITION_ATTRIBUTES) berserk:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) berserk:setParameter(CONDITION_PARAM_SKILL_MELEE, 5) berserk:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10) berserk:setParameter(CONDITION_PARAM_BUFF_SPELL, true) local mastermind = Condition(CONDITION_ATTRIBUTES) mastermind:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) mastermind:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 3) mastermind:setParameter(CONDITION_PARAM_BUFF_SPELL, true) local bullseye = Condition(CONDITION_ATTRIBUTES) bullseye:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) bullseye:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 5) bullseye:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10) bullseye:setParameter(CONDITION_PARAM_BUFF_SPELL, true) local potions = { [6558] = {transform = {7588, 7589}, effect = CONST_ME_DRAWBLOOD}, [7439] = {condition = berserk, vocations = {4, 8, 12}, effect = CONST_ME_MAGIC_RED, description = "Only knights may drink this potion.", text = "You feel stronger."}, [7440] = {condition = mastermind, vocations = {1, 2, 5, 6, 9, 10}, effect = CONST_ME_MAGIC_BLUE, description = "Only sorcerers and druids may drink this potion.", text = "You feel smarter."}, [7443] = {condition = bullseye, vocations = {3, 7, 11}, effect = CONST_ME_MAGIC_GREEN, description = "Only paladins may drink this potion.", text = "You feel more accurate."}, [7588] = {health = {250, 350}, vocations = {3, 4, 7, 8, 11, 12}, level = 50, flask = 7634, description = "Only knights and paladins of level 50 or above may drink this fluid."}, [7589] = {mana = {115, 185}, vocations = {1, 2, 3, 5, 6, 7, 9, 10, 11}, level = 50, flask = 7634, description = "Only sorcerers, druids and paladins of level 50 or above may drink this fluid."}, [7590] = {mana = {150, 250}, vocations = {1, 2, 5, 6, 9, 10}, level = 80, flask = 7635, description = "Only druids and sorcerers of level 80 or above may drink this fluid."}, [7591] = {health = {425, 575}, vocations = {4, 8, 12}, level = 80, flask = 7635, description = "Only knights of level 80 or above may drink this fluid."}, [7618] = {health = {125, 175}, flask = 7636}, [7620] = {mana = {75, 125}, flask = 7636}, [8472] = {health = {250, 350}, mana = {100, 200}, vocations = {3, 7, 11}, level = 80, flask = 7635, description = "Only paladins of level 80 or above may drink this fluid."}, [8473] = {health = {650, 850}, vocations = {4, 8, 12}, level = 130, flask = 7635, description = "Only knights of level 130 or above may drink this fluid."}, [8474] = {antidote = true, flask = 7636}, [8704] = {health = {60, 90}, flask = 7636}, [26029] = {mana = {425, 575}, vocations = {1, 2, 5, 6, 9, 10}, level = 130, flask = 7635, description = "Only druids and sorcerers of level 130 or above may drink this fluid."}, [26030] = {health = {420, 580}, mana = {250, 350}, vocations = {3, 7, 11}, level = 130, flask = 7635, description = "Only paladins of level 130 or above may drink this fluid."}, [26031] = {health = {875, 1125}, vocations = {4, 8, 12}, level = 200, flask = 7635, description = "Only knights of level 200 or above may drink this fluid."} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if type(target) == "userdata" and not target:isPlayer() then return false end local potion = potions[item:getId()] if potion.level and player:getLevel() < potion.level or potion.vocations and not table.contains(potion.vocations, player:getVocation():getId()) then player:say(potion.description, TALKTYPE_MONSTER_SAY) return true end if potion.condition then player:addCondition(potion.condition) player:say(potion.text, TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(potion.effect) elseif potion.transform then item:transform(potion.transform[math.random(#potion.transform)]) item:getPosition():sendMagicEffect(potion.effect) return true else if potion.health then doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health[1], potion.health[2]) end if potion.mana then doTargetCombatMana(0, target, potion.mana[1], potion.mana[2]) end if potion.antidote then target:removeCondition(CONDITION_POISON) end player:setStorageValue(75132, (player:getStorageValue(75132) + 1)) target:say("Aaaah...", TALKTYPE_MONSTER_SAY) target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end item:remove(1) return true end Em creaturescripts, ache o arquivo login.lua Após if player:getLastLoginSaved() <= 0 then Adicione player:setStorageValue(75132, 0) -- Vial/Flask System Agora vamos para a parte do NPC. Irei deixar baseado no Eryn, um NPC que é comum. Na pasta npc/scripts, ache o arquivo que relaciona com seu NPC mágico. Estou me baseando nesse script: https://github.com/nekiro/forgottenserver/blob/8.6-downgrade/data/npc/scripts/runes.lua Antes local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook') shopModule:addBuyableItem({'magic lightwand'}, 2163, 400, 'magic lightwand') shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion') shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion') shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion') shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion') shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion') shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion') shopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion') shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion') shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion') shopModule:addBuyableItem({'antidote potion'}, 8474, 50, 1, 'antidote potion') shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask') shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask') shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask') shopModule:addBuyableItem({'instense healing'}, 2265, 95, 1, 'intense healing rune') shopModule:addBuyableItem({'ultimate healing'}, 2273, 175, 1, 'ultimate healing rune') shopModule:addBuyableItem({'magic wall'}, 2293, 350, 3, 'magic wall rune') shopModule:addBuyableItem({'destroy field'}, 2261, 45, 3, 'destroy field rune') shopModule:addBuyableItem({'light magic missile'}, 2287, 40, 10, 'light magic missile rune') shopModule:addBuyableItem({'heavy magic missile'}, 2311, 120, 10, 'heavy magic missile rune') shopModule:addBuyableItem({'great fireball'}, 2304, 180, 4, 'great fireball rune') shopModule:addBuyableItem({'explosion'}, 2313, 250, 6, 'explosion rune') shopModule:addBuyableItem({'sudden death'}, 2268, 350, 3, 'sudden death rune') shopModule:addBuyableItem({'death arrow'}, 2263, 300, 3, 'death arrow rune') shopModule:addBuyableItem({'paralyze'}, 2278, 700, 1, 'paralyze rune') shopModule:addBuyableItem({'animate dead'}, 2316, 375, 1, 'animate dead rune') shopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune') shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune') shopModule:addBuyableItem({'desintegrate'}, 2310, 80, 3, 'desintegreate rune') shopModule:addBuyableItemContainer({'bp ap'}, 2002, 8378, 2000, 1, 'backpack of antidote potions') shopModule:addBuyableItemContainer({'bp slhp'}, 2000, 8610, 400, 1, 'backpack of small health potions') shopModule:addBuyableItemContainer({'bp hp'}, 2000, 7618, 900, 1, 'backpack of health potions') shopModule:addBuyableItemContainer({'bp mp'}, 2001, 7620, 1000, 1, 'backpack of mana potions') shopModule:addBuyableItemContainer({'bp shp'}, 2000, 7588, 2000, 1, 'backpack of strong health potions') shopModule:addBuyableItemContainer({'bp smp'}, 2001, 7589, 1600, 1, 'backpack of strong mana potions') shopModule:addBuyableItemContainer({'bp ghp'}, 2000, 7591, 3800, 1, 'backpack of great health potions') shopModule:addBuyableItemContainer({'bp gmp'}, 2001, 7590, 2400, 1, 'backpack of great mana potions') shopModule:addBuyableItemContainer({'bp gsp'}, 1999, 8376, 3800, 1, 'backpack of great spirit potions') shopModule:addBuyableItemContainer({'bp uhp'}, 2000, 8377, 6200, 1, 'backpack of ultimate health potions') shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of vortex') shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 'wand of dragonbreath') shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000, 'wand of decay') shopModule:addBuyableItem({'wand of draconia', 'draconia'}, 8921, 7500, 'wand of draconia') shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'wand of cosmic energy') shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno') shopModule:addBuyableItem({'wand of starstorm', 'starstorm'}, 8920, 18000, 'wand of starstorm') shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 'wand of voodoo') shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod') shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod') shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 5000, 'necrotic rod') shopModule:addBuyableItem({'northwind rod', 'northwind'}, 8911, 7500, 'northwind rod') shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 'terra rod') shopModule:addBuyableItem({'hailstorm rod', 'hailstorm'}, 2183, 15000, 'hailstorm rod') shopModule:addBuyableItem({'springsprout rod', 'springsprout'}, 8912, 18000, 'springsprout rod') shopModule:addBuyableItem({'underworld rod', 'underworld'}, 8910, 22000, 'underworld rod') shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 250, 'wand of vortex') shopModule:addSellableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 500, 'wand of dragonbreath') shopModule:addSellableItem({'wand of decay', 'decay'}, 2188, 2500, 'wand of decay') shopModule:addSellableItem({'wand of draconia', 'draconia'}, 8921, 3750, 'wand of draconia') shopModule:addSellableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 5000, 'wand of cosmic energy') shopModule:addSellableItem({'wand of inferno', 'inferno'},2187, 7500, 'wand of inferno') shopModule:addSellableItem({'wand of starstorm', 'starstorm'}, 8920, 9000, 'wand of starstorm') shopModule:addSellableItem({'wand of voodoo', 'voodoo'}, 8922, 11000, 'wand of voodoo') shopModule:addSellableItem({'snakebite rod', 'snakebite'}, 2182, 250,'snakebite rod') shopModule:addSellableItem({'moonlight rod', 'moonlight'}, 2186, 500, 'moonlight rod') shopModule:addSellableItem({'necrotic rod', 'necrotic'}, 2185, 2500, 'necrotic rod') shopModule:addSellableItem({'northwind rod', 'northwind'}, 8911, 3750, 'northwind rod') shopModule:addSellableItem({'terra rod', 'terra'}, 2181, 5000, 'terra rod') shopModule:addSellableItem({'hailstorm rod', 'hailstorm'}, 2183, 7500, 'hailstorm rod') shopModule:addSellableItem({'springsprout rod', 'springsprout'}, 8912, 9000, 'springsprout rod') shopModule:addSellableItem({'underworld rod', 'underworld'}, 8910, 11000, 'underworld rod') function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) local vocationId = player:getVocation():getId() local items = { [1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182 } if msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand') then if table.contains({1, 2, 5, 6}, vocationId) then if player:getStorageValue(30002) == -1 then selfSay('So you ask me for a {' .. ItemType(items[vocationId]):getName() .. '} to begin your advanture?', cid) npcHandler.topic[cid] = 1 else selfSay('What? I have already gave you one {' .. ItemType(items[vocationId]):getName() .. '}!', cid) end else selfSay('Sorry, you aren\'t a druid either a sorcerer.', cid) end elseif msgcontains(msg, 'yes') then if npcHandler.topic[cid] == 1 then player:addItem(items[vocationId], 1) selfSay('Here you are young adept, take care yourself.', cid) player:setStorageValue(30002, 1) end npcHandler.topic[cid] = 0 elseif msgcontains(msg, 'no') and npcHandler.topic[cid] == 1 then selfSay('Ok then.', cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Depois local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook') shopModule:addBuyableItem({'magic lightwand'}, 2163, 400, 'magic lightwand') shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion') shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion') shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion') shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion') shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion') shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion') shopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion') shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion') shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion') shopModule:addBuyableItem({'antidote potion'}, 8474, 50, 1, 'antidote potion') shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask') shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask') shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask') shopModule:addBuyableItem({'instense healing'}, 2265, 95, 1, 'intense healing rune') shopModule:addBuyableItem({'ultimate healing'}, 2273, 175, 1, 'ultimate healing rune') shopModule:addBuyableItem({'magic wall'}, 2293, 350, 3, 'magic wall rune') shopModule:addBuyableItem({'destroy field'}, 2261, 45, 3, 'destroy field rune') shopModule:addBuyableItem({'light magic missile'}, 2287, 40, 10, 'light magic missile rune') shopModule:addBuyableItem({'heavy magic missile'}, 2311, 120, 10, 'heavy magic missile rune') shopModule:addBuyableItem({'great fireball'}, 2304, 180, 4, 'great fireball rune') shopModule:addBuyableItem({'explosion'}, 2313, 250, 6, 'explosion rune') shopModule:addBuyableItem({'sudden death'}, 2268, 350, 3, 'sudden death rune') shopModule:addBuyableItem({'death arrow'}, 2263, 300, 3, 'death arrow rune') shopModule:addBuyableItem({'paralyze'}, 2278, 700, 1, 'paralyze rune') shopModule:addBuyableItem({'animate dead'}, 2316, 375, 1, 'animate dead rune') shopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune') shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune') shopModule:addBuyableItem({'desintegrate'}, 2310, 80, 3, 'desintegreate rune') shopModule:addBuyableItemContainer({'bp ap'}, 2002, 8378, 2000, 1, 'backpack of antidote potions') shopModule:addBuyableItemContainer({'bp slhp'}, 2000, 8610, 400, 1, 'backpack of small health potions') shopModule:addBuyableItemContainer({'bp hp'}, 2000, 7618, 900, 1, 'backpack of health potions') shopModule:addBuyableItemContainer({'bp mp'}, 2001, 7620, 1000, 1, 'backpack of mana potions') shopModule:addBuyableItemContainer({'bp shp'}, 2000, 7588, 2000, 1, 'backpack of strong health potions') shopModule:addBuyableItemContainer({'bp smp'}, 2001, 7589, 1600, 1, 'backpack of strong mana potions') shopModule:addBuyableItemContainer({'bp ghp'}, 2000, 7591, 3800, 1, 'backpack of great health potions') shopModule:addBuyableItemContainer({'bp gmp'}, 2001, 7590, 2400, 1, 'backpack of great mana potions') shopModule:addBuyableItemContainer({'bp gsp'}, 1999, 8376, 3800, 1, 'backpack of great spirit potions') shopModule:addBuyableItemContainer({'bp uhp'}, 2000, 8377, 6200, 1, 'backpack of ultimate health potions') shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of vortex') shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 'wand of dragonbreath') shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000, 'wand of decay') shopModule:addBuyableItem({'wand of draconia', 'draconia'}, 8921, 7500, 'wand of draconia') shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'wand of cosmic energy') shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno') shopModule:addBuyableItem({'wand of starstorm', 'starstorm'}, 8920, 18000, 'wand of starstorm') shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 'wand of voodoo') shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod') shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod') shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 5000, 'necrotic rod') shopModule:addBuyableItem({'northwind rod', 'northwind'}, 8911, 7500, 'northwind rod') shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 'terra rod') shopModule:addBuyableItem({'hailstorm rod', 'hailstorm'}, 2183, 15000, 'hailstorm rod') shopModule:addBuyableItem({'springsprout rod', 'springsprout'}, 8912, 18000, 'springsprout rod') shopModule:addBuyableItem({'underworld rod', 'underworld'}, 8910, 22000, 'underworld rod') shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 250, 'wand of vortex') shopModule:addSellableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 500, 'wand of dragonbreath') shopModule:addSellableItem({'wand of decay', 'decay'}, 2188, 2500, 'wand of decay') shopModule:addSellableItem({'wand of draconia', 'draconia'}, 8921, 3750, 'wand of draconia') shopModule:addSellableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 5000, 'wand of cosmic energy') shopModule:addSellableItem({'wand of inferno', 'inferno'},2187, 7500, 'wand of inferno') shopModule:addSellableItem({'wand of starstorm', 'starstorm'}, 8920, 9000, 'wand of starstorm') shopModule:addSellableItem({'wand of voodoo', 'voodoo'}, 8922, 11000, 'wand of voodoo') shopModule:addSellableItem({'snakebite rod', 'snakebite'}, 2182, 250,'snakebite rod') shopModule:addSellableItem({'moonlight rod', 'moonlight'}, 2186, 500, 'moonlight rod') shopModule:addSellableItem({'necrotic rod', 'necrotic'}, 2185, 2500, 'necrotic rod') shopModule:addSellableItem({'northwind rod', 'northwind'}, 8911, 3750, 'northwind rod') shopModule:addSellableItem({'terra rod', 'terra'}, 2181, 5000, 'terra rod') shopModule:addSellableItem({'hailstorm rod', 'hailstorm'}, 2183, 7500, 'hailstorm rod') shopModule:addSellableItem({'springsprout rod', 'springsprout'}, 8912, 9000, 'springsprout rod') shopModule:addSellableItem({'underworld rod', 'underworld'}, 8910, 11000, 'underworld rod') function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) local vocationId = player:getVocation():getId() local items = { [1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182 } local precoVial = (3 * player:getStorageValue(75132)) if (msgcontains(msg, 'vial') or msgcontains(msg, 'flask')) and player:getStorageValue(75132) >= 1 then npcHandler:say('Do you want to sell {' .. player:getStorageValue(75132) .. '} flasks for 3 gps each?', cid) npcHandler.topic[cid] = 3 else npcHandler:say('You have no vials or flasks in our system.', cid) end if (msgcontains(msg, 'yes') and npcHandler.topic[cid] == 3) then npcHandler:say('You received '.. precoVial ..' gold coins.', cid) player:setStorageValue(75132, 0) player:addItem(2148, precoVial) npcHandler.topic[cid] = 0 elseif (msgcontains(msg, 'no') and npcHandler.topic[cid] == 3) then npcHandler.topic[cid] = 0 npcHandler:say('Ok then.', cid) end if msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand') then if table.contains({1, 2, 5, 6}, vocationId) then if player:getStorageValue(30002) == -1 then selfSay('So you ask me for a {' .. ItemType(items[vocationId]):getName() .. '} to begin your advanture?', cid) npcHandler.topic[cid] = 1 else selfSay('What? I have already gave you one {' .. ItemType(items[vocationId]):getName() .. '}!', cid) end else selfSay('Sorry, you aren\'t a druid either a sorcerer.', cid) end elseif msgcontains(msg, 'yes') then if npcHandler.topic[cid] == 1 then player:addItem(items[vocationId], 1) selfSay('Here you are young adept, take care yourself.', cid) player:setStorageValue(30002, 1) end npcHandler.topic[cid] = 0 elseif msgcontains(msg, 'no') and npcHandler.topic[cid] == 1 then selfSay('Ok then.', cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Sendo que você altera o preço que você paga por vial/flask na variável precoVial. Pronto, agora só chegar no seu NPC Mágico e falar vial ou flasks. Creio que tenha ficado entendido o tópico, caso dê algum erro, favor postar aqui.
  17. Movie postou uma resposta no tópico em Mapas de Tibia
    Mandando bem, como sempre!
  18. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Strange?
  19. Carai, ficou o brabo em... Saudades mapas para 8.60
  20. To pelo celular, volto pra casa na segunda, caso ninguém faça eu faço.
  21. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Posta o script inteiro que eu te mostro como fazer.
  22. Caso fosse PVP teria que fazer algumas verificações, por que ao morrer ele iria para o templo e não para a prisão. Está somente para ir para a prisão, não está perdendo XP Tenta desmembrar o script em dois pra ver se dá certo.. Separa o function onLogin e o function onThink
  23. Tentarei criar o seguinte comando então: /jail nome,tempo /unjail nome Outra coisa, o PVP será aberto na prisão? Fiz aqui rapidinho sendo que a prisão não é PVP. Em talkactions, crie um arquivo lua com o nome jail.lua local posPrison = Position(x,y,z) function onSay(player, words, param) if not player:getGroup():getAccess() then return true end if player:getAccountType() < ACCOUNT_TYPE_GOD then return false end local split = param:split(",") local preso = (split[1]) local tempo = (split[2]) tempo = tempo * 60 * 24 if not preso then player:sendCancelMessage("A player with that name is not online.") return false end if not tempo then player:sendCancelMessage("Insufficient parameters.") return false end if preso:getStorageValue(41234) > os.time() then player:sendCancelMessage("The player ".. preso .." is already arrested.") return false end if preso and tempo then preso:setStorageValue(41234, (tempo) + os.time()) preso:getPosition():sendMagicEffect(11) preso:sendTextMessage(MESSAGE_STATUS_DEFAULT, "You were arrested until ".. tempo .." days.") preso:teleportTo(posPrison) posPrison:sendMagicEffect(11) else player:sendCancelMessage("You need to inform the player and the time (in days) he will be stuck.") end return true end Em talkactions, crie um arquivo lua com o nome unjail.lua function onSay(player, words, param) if not player:getGroup():getAccess() then return true end if player:getAccountType() < ACCOUNT_TYPE_GOD then return false end local targetPlayer = Player(param) if targetPlayer == nil then return false end if not targetPlayer then player:sendCancelMessage("Insufficient parameters.") return false end if targetPlayer:getStorageValue(41234) <= os.time() then player:sendCancelMessage("The player ".. targetPlayer .." is already free.") return false end local town = targetPlayer:getTown():getTemplePosition() if targetPlayer then targetPlayer:setStorageValue(41234, 0) targetPlayer:getPosition():sendMagicEffect(11) targetPlayer:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Congratulations ".. targetPlayer ..", now you are free.") targetPlayer:teleportTo(town) else player:sendCancelMessage("The player is offline.") end return true end Em talkactions.xml adicione as seguintes tags <talkaction words="/jail" separator=" " script="jail.lua" /> <talkaction words="/unjail" script="unjail.lua" /> Agora em creaturescript, crie um arquivo chamado unjail.lua function onLogin(player) player:registerEvent("unjailLogin") player:registerEvent("unjailThink") local town = player:getTown():getTemplePosition() if player:getStorageValue(41234) > 0 then player:teleportTo(town) player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Congratulations ".. player ..", now you are free.") player:getPosition():sendMagicEffect(11) end end function OnThink(creature, interval) local player = creature:getPlayer() local town = player:getTown():getTemplePosition() if player:getStorageValue(41234) > 0 then player:teleportTo(town) player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Congratulations ".. player ..", now you are free.") player:getPosition():sendMagicEffect(11) end end Em creaturescript.xml adicione as seguintes tags <event type="login" name="unjailLogin" script="unjail_creature.lua"/> <event type="think" name="unjailThink" interval="60" script="unjail_creature.lua"/> Não é necessário registrar no login.lua Qualquer erro me avisa aqui que eu tento arrumar pra você.

Informação Importante

Confirmação de Termo