Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. não funcionou essa função?
  2. local config = { pos = {x = 1000, y = 1500, z = 13}, level = 100000, levelreset = 10000, msgWelcome = "Use !magiasnovas", msgWelcomeReset = "Bem-vindo!", msgCancel = "Vc Precisa 100k , upe nos rotworms, use !magiasnovas" } function getPlayerReset(cid) local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return qr:getDataInt("reset") <= 0 and 0 or qr:getDataInt("reset") end function onStepIn(cid, item, position, fromPosition) if getPlayerLevel(cid) >= config.level or getPlayerLevel(cid) >= config.levelreset and getPlayerReset(cid) == 1 then doTeleportThing(cid, config.pos) doPlayerSendTextMessage(cid, 22, config.msgWelcomeReset) else doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerPopupFYI(cid, config.msgCancel) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) end return true end
  3. Muito bom, tem código que vem com isso mesmo, até já passei para os admin e até hoje não foi resolvido, infelizmente.
  4. --[[ PERFECT UPGRADE SYSTEM 2.0 Criado por Oneshot É proibido a venda ou a cópia sem os devidos créditos desse script. ]]-- UpgradeHandler = { levels = { [1] = {100, true, true}, [2] = {90, true, true}, [3] = {75, true, true}, [4] = {60, true, true}, [5] = {45, true, true}, [6] = {30, true, true}, [7] = {25, true, true}, [8] = {20, true, true}, [9] = {15, true, true}, [10] = {5, true, true} }, broadcast = 9, attributes = { ["attack"] = 2, ["defense"] = 2, ["armor"] = 2, }, message = { console = "{Upgrade System} Refinando %s para o level adiante você tem %s%% de conseguir.", success = "{Upgrade System} Você conseguiu Refinar %s para o level +%s.", fail = "{Upgrade System} Você falhou a sua refinação.", downgrade = "{Upgrade System} Seu item %s voltou para o level +%s.", erase = "{Upgrade System} O level da refinação %s foi apagado.", maxlevel = "{Upgrade System} O item %s ja esta no level maximo.", notupgradeable = "{Upgrade System} Este item não é refinavel.", broadcast = "{Upgrade System} The player %s was successful in upgrading %s to level +%s.\nCongratulations!!", invalidtool = "{Upgrade System} Este não é um item de refinação valido.", toolrange = "{Upgrade System} Você so pode usar o refinamento do level +%s ate +%s." }, tools = { [8300] = {range = {0, 10}, info = {chance = 0, removeable = true}}, [8306] = {range = {0, 10}, info = {chance = 100, removeable = true}} }, isEquipment = function(self) local weaponType = self:getItemWeaponType() return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0) end, setItemName = function(self, name) return doItemSetAttribute(self.item.uid, "name", name) end, chance = function(self) local chances = {} chances.upgrade = (self.levels[self.item.level + 1][1] or 100) chances.downgrade = (self.item.level * 5) chances.erase = (self.item.level * 11) return chances end } function UpgradeHandler:new(item) local obj, ret = {} obj.item = {} obj.item.level = 0 obj.item.uid = item.uid for key, value in pairs(getItemInfo(item.itemid)) do obj.item[key] = value end ret = setmetatable(obj, {__index = function(self, index) if _G[index] then return (setmetatable({callback = _G[index]}, {__call = function(self, ...) return self.callback(item.uid, ...) end})) else return UpgradeHandler[index] end end}) if ret:isEquipment() then ret:update() return ret end return false end function UpgradeHandler:update() self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0) end function UpgradeHandler:refine(uid, item) if not self.item then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable) return "miss" end local tool = self.tools[item.itemid] if(tool == nil) then doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool) return "miss" end if(self.item.level > #self.levels) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name)) return "miss" end if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range))) return "miss" end local chance = (self:chance().upgrade + tool.info.chance) doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance))) if(tool.info.removeable == true) then doRemoveItem(item.uid, 1) end local r = chance * 100 if r > 10000 then r = 10000 end if r > math.random(1, 10000) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1))) self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1"))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value) end end return "success" elseif item.itemid == 8300 then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.downgrade:format(self.item.name, (self.item.level - 1))) self:setItemName((self.item.level == 1 and self.item.name or self:getItemName():gsub("%+(%d+)", "+".. (self.item.level - 1)))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item[key] + value * (self.item.level - 1))) end end return "fail" end end
  5. https://tibiaking.com/forums/topic/77283-critical-e-dodge-no-look/
  6. @Phineasz que estranho, eu testei no meu ot e o buff sai quando reloga/morre.
  7. @HisokaFail local ret = { {{x = 1083, y = 1036, z = 13}, {x = 1067, y = 1035, z = 13}}, ---- [{pisa aqui}] = {vai parar aqui} {{x = 1085, y = 1037, z = 13}, {x = 1069, y = 1038, z = 13}}, } function onStepIn(cid, item, fromPosition, item2, topos) if not isPlayer(cid) then return true end for i = 1,#ret do if isPosEqualPos(ret[i][1], topos) then doTeleportThing(cid, ret[i][2]) break end end return true end
  8. Vodkart postou uma resposta no tópico em Sistemas, Mods & Funções .lua
    @Phineasz Você praticamente teria que editar todas as quest, npc, globalevents, etc... para colocar as frases em inglês, espanhol, pt e tal... ai sim vai ter diferença.
  9. acho que nesse caso teria que editar a lib do npc para aceitar as linguagens diferentes dentro de uma tabela...
  10. no script do onLogin você deixa assim então, aquela parte que te falei pra adc lá em cima lembra? deixa assim: doRemoveConditions(cid, false) for store, buff in pairs(command_buffs_storages) do setPlayerStorageValue(cid, store, 0) end
  11. @Phineasz então quando testar avisa...
  12. @Phineasz no caso das tuas spells, quando o jogador é buffado e reloga/morre... os atributos do buff somem né?
  13. @Phineasz --[[ PERFECT UPGRADE SYSTEM 2.0 Criado por Oneshot É proibido a venda ou a cópia sem os devidos créditos desse script. ]]-- UpgradeHandler = { levels = { [1] = {100, true, true}, [2] = {90, true, true}, [3] = {75, true, true}, [4] = {60, true, true}, [5] = {45, true, true}, [6] = {30, true, true}, [7] = {25, true, true}, [8] = {20, true, true}, [9] = {15, true, true}, [10] = {5, true, true} }, broadcast = 9, attributes = { ["attack"] = 2, ["defense"] = 2, ["armor"] = 2, }, message = { console = "{Upgrade System} Refinando %s para o level adiante você tem %s%% de conseguir.", success = "{Upgrade System} Você conseguiu Refinar %s para o level +%s.", fail = "{Upgrade System} Você falhou a sua refinação.", downgrade = "{Upgrade System} Seu item %s voltou para o level +%s.", erase = "{Upgrade System} O level da refinação %s foi apagado.", maxlevel = "{Upgrade System} O item %s ja esta no level maximo.", notupgradeable = "{Upgrade System} Este item não é refinavel.", broadcast = "{Upgrade System} The player %s was successful in upgrading %s to level +%s.\nCongratulations!!", invalidtool = "{Upgrade System} Este não é um item de refinação valido.", toolrange = "{Upgrade System} Você so pode usar o refinamento do level +%s ate +%s." }, tools = { [8300] = {range = {0, 10}, info = {chance = 0, removeable = true}}, [8306] = {range = {0, 10}, info = {chance = 100, removeable = true}} }, isEquipment = function(self) local weaponType = self:getItemWeaponType() return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0) end, setItemName = function(self, name) return doItemSetAttribute(self.item.uid, "name", name) end, chance = function(self) local chances = {} chances.upgrade = (self.levels[self.item.level + 1][1] or 100) chances.downgrade = (self.item.level * 5) chances.erase = (self.item.level * 11) return chances end } function UpgradeHandler:new(item) local obj, ret = {} obj.item = {} obj.item.level = 0 obj.item.uid = item.uid for key, value in pairs(getItemInfo(item.itemid)) do obj.item[key] = value end ret = setmetatable(obj, {__index = function(self, index) if _G[index] then return (setmetatable({callback = _G[index]}, {__call = function(self, ...) return self.callback(item.uid, ...) end})) else return UpgradeHandler[index] end end}) if ret:isEquipment() then ret:update() return ret end return false end function UpgradeHandler:update() self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0) end function UpgradeHandler:refine(uid, item) if not self.item then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable) return "miss" end local tool = self.tools[item.itemid] if(tool == nil) then doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool) return "miss" end if(self.item.level > #self.levels) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name)) return "miss" end if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range))) return "miss" end local chance = (self:chance().upgrade + tool.info.chance) doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance))) if(tool.info.removeable == true) then doRemoveItem(item.uid, 1) end local r = chance * 100 if r >= 10000 or r < 10000 and r > math.random(1, 10000) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1))) self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1"))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value) end end return "success" elseif item.itemid == 8300 then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.downgrade:format(self.item.name, (self.item.level - 1))) self:setItemName((self.item.level == 1 and self.item.name or self:getItemName():gsub("%+(%d+)", "+".. (self.item.level - 1)))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item[key] + value * (self.item.level - 1))) end end return "fail" end end
  14. ué, o da party eu ja coloquei ali em cima, todos ganham storage. for _, pid in ipairs(affectedList) do doAddCondition(pid, condition) setPlayerStorageValue(pid, store, os.time()+ret.tempo) -- aqui storage end
  15. Ficou bem completo e bem desenvolvido esses teus códigos!! parabéns, sempre excelentes trabalhos. GGWP!
  16. verdade, vou usar o do Vita Sio como exemplo, ficou assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 39) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local config = { tempo = 600, --- tempo que vai durar a spell percent = 20 -- quanto % vai aumentar } local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, config.tempo*1000) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 100+config.percent) setCombatCondition(combat, condition) function onCastSpell(cid, var) local store = 789651 -- valor da storage escolhido setPlayerStorageValue(variantToNumber(var), store, os.time()+config.tempo) return doCombat(cid, combat, var) end ------------------------------------------------------------------------ Testa a spell do Vita Sio - Vida // e fala se funcionou.
  17. @Phineasz Não entendi, que storage? esse ele adiciona storage para todos na party. deixa eu ver a tag nos script que da pra buffar o target?
  18. @Phineasz pois é, testa esse Gran Mas Sio que editei pra vc: local ret = { tempo = 600, --- tempo que vai durar a spell percent = 40 -- quanto % vai aumentar } local store = 789653 -- aqui valor da storage local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, ret.tempo*1000) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 100+ret.percent) local config = { baseMana = 120, pvpManaSpent = getConfigValue("addManaSpentInPvPZone") } function onCastSpell(cid, var) local pos, membersList = getCreaturePosition(cid), getPartyMembers(cid) if not membersList then doPlayerSendTextMessage(cid,22,"Voce precisa esta em party para usar esse buff.") doSendMagicEffect(pos, CONST_ME_POFF) return false end if table.maxn(membersList) <= 1 then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE) doSendMagicEffect(pos, CONST_ME_POFF) return false end local affectedList = {} for _, pid in ipairs(membersList) do if(getDistanceBetween(getCreaturePosition(pid), pos) <= 36) then table.insert(affectedList, pid) end end local tmp = table.maxn(affectedList) if(tmp <= 1) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE) doSendMagicEffect(pos, CONST_ME_POFF) return false end local mana = math.ceil((0.9 ^ (tmp - 1) * config.baseMana) * tmp) if(getCreatureMana(cid) < mana) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA) doSendMagicEffect(pos, CONST_ME_POFF) return false end doCreatureAddMana(cid, -(mana - config.baseMana), false) if(not getPlayerFlagValue(cid, PlayerFlag_NotGainMana) and (not getTileInfo(getThingPosition(cid)).pvp or config.pvpManaSpent)) then doPlayerAddSpentMana(cid, (mana - config.baseMana)) end for _, pid in ipairs(affectedList) do doAddCondition(pid, condition) setPlayerStorageValue(pid, store, os.time()+ret.tempo) -- aqui storage end return true end
  19. @Phineasz No Vita Gran Mas Sio tinha duas tabelas com o mesmo nome... ------------------------------ sobre os demais scripts, o buff não é só em si mesmo? tbm dá para colocar no target? em todos eles?
  20. @viniciusgdesousa faltou só um end no final rs function onStepIn(cid, item, position, fromPosition) if getPlayerLevel(cid) < 200 then doTeleportThing(cid, fromPosition, true) doPlayerPopupFYI(cid, "Você não tem level o suficiente para passar.") return true end if getPlayerStorageValue(cid, 13602) - os.time() <= 0 then doTeleportThing(cid, fromPosition, true) doPlayerPopupFYI(cid, "[Tesouro] Você não é Ultimate. Para Ter Acesso faça a quest Ultimate!") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end doPlayerPopupFYI(cid, "[Tesouro] Bem Vindo a área Ultimate!") return true end
  21. @Phineasz vou te ensinar como fazer, é meio chato mas vou fazer em 3 script diferentes para você. Presta atenção: Vita Sio - Vida Vita Gran Sio - Vida Vita Gran Mas Sio - Vida. ---------------------------------------------- agora vou na lib e coloco em qualquer arquivo la no final essa tabela: -- buffs info command_buffs_storages = { [789651] = "Vida up - tempo restante: %s.", [789652] = "Super vida up - tempo restante: %s.", [789653] = "Party Vida Up - tempo restante: %s." } -------------------------------------------------- agora vou no creaturescript e no arquivo do login.lua adiciona antes do último return true: for store, buff in pairs(command_buffs_storages) do setPlayerStorageValue(cid, store, 0) end e o script vc deixa assim a talk:
  22. @douglas0000777 testei e funcionou... colou o evento no xml do monstro? 15:42 Parabéns, Você destriu o monstro Pythius The Rotten. Suas recompensas: 20 scarab coin, 100 crystal coin. -------------------------- no arquivo do monstro tem que ficar assim olha: <?xml version="1.0" encoding="UTF-8"?> <monster name="Pythius the rotten" nameDescription="a Pythius the rotten" race="undead" experience="100" speed="300" manacost="0"> <health now="8350" max="8350"/> <look type="231" corpse="6306"/> <targetchange interval="5000" chance="8"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="1"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" skill="95" attack="95"/> <attack name="fire" interval="2000" chance="20" range="7" radius="4" target="1" min="-300" max="-395"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="redspark"/> </attack> <attack name="death" interval="3000" chance="20" range="7" min="-0" max="-600"> <attribute key="shootEffect" value="suddendeath"/> </attack> <attack name="poison" interval="2000" chance="20" range="7" radius="4" target="1" min="-120" max="-390"> <attribute key="shootEffect" value="poison"/> <attribute key="areaEffect" value="poison"/> </attack> <attack name="poison" interval="1000" chance="10" range="7" min="-50" max="-180"> <attribute key="shootEffect" value="poison"/> <attribute key="areaEffect" value="poison"/> </attack> <attack name="fire" interval="4000" chance="25" length="8" spread="3" min="-500" max="-600"> <attribute key="areaEffect" value="firearea"/> </attack> <attack name="poison" interval="2000" chance="23" length="8" spread="3" min="-200" max="-685"> <attribute key="areaEffect" value="poison"/> </attack> <attack name="lifedrain" interval="3000" chance="25" length="8" spread="3" min="-300" max="-600"> <attribute key="areaEffect" value="greenshimmer"/> </attack> </attacks> <defenses armor="35" defense="30"> </defenses> <elements> <element physicalPercent="10"/> <element icePercent="10"/> <element holyPercent="-10"/> </elements> <immunities> <immunity death="1"/> <immunity earth="1"/> <immunity fire="1"/> <immunity drown="1"/> <immunity lifedrain="1"/> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <summons maxSummons="2"> <summon name="Undead Gladiator" interval="1000" chance="8"/> </summons> <voices interval="5000" chance="10"> <voice sentence="YOU'LL NEVER GET MY TREASURE!"/> </voices> <script> <event name="RewaMonster"/> </script> </monster> você precisa registrar essa parte : <script> <event name="RewaMonster"/> </script>
  23. show de bola, muitos membros procuram por isso! parabéns.
  24. @douglas0000777 vc copiou errado ta vendo essa linha: local chance, itemid, amount = items[i].chance, items[i].itemid,items[i].amount na sua sumiu os "i" entendeu? ai da esses erros mesmo... tente copiar certinho brother. COPIA DIRETO DAQUI O CODIGO PRA NAO BUGAR: https://pastebin.com/raw/38hjyntG
  25. @douglas0000777 deixa eu ver como ficou seu script

Informação Importante

Confirmação de Termo