Postado Outubro 26, 2018 6 anos Boa Noite :), talvez o tópico esteja um pouco complicado de entender mais é assim, meus scripts de Dodge Stone e Critical Stone estão com uma proporção diferentes, são 100 dodge para ficar full mais você precisa de 101 dodge para ficar com 100 dodge, o script ele só aumenta a skill do dodge/critical quando usa 2 vezes o mesmo e eu queria que assim que você usasse 1 dodge/critical o sistema já começasse a contar e você não precisaria de 101 dodge/critical para ficar full, se ficou meio difícil de entender pode dizer que eu tenho explicar melhor. O meu obrigado e rep+ para quem me ajudar. Dodge Stone Spoiler local config = { effectonuse = 29, -- efeito que sai levelscrit = 100, --- leveis que terão storagecrit = 98798644 -- storage que será verificado } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) doPlayerSendTextMessage(cid,22,"Voce elevou seus dodges para ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/100].") setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1) elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then doPlayerSendTextMessage(cid,22,"Voce ja chegou no nivel Maximo de Dodges.\nParabéns.") return 0 end return 1 end Critical Stone Spoiler local config = { effectonuse = 28, -- efeito que sai levelscrit = 100, --- leveis que terão storagecrit = 48903 -- storage que será verificado } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) doPlayerSendTextMessage(cid,22,"Voce elevou seu critical para ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/100].") setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1) elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then doPlayerSendTextMessage(cid,22,"Voce ja chegou no nivel Maximo de Critical.\nParabéns.") return 0 end return 1 end
Postado Outubro 26, 2018 6 anos Solução Critical: local config = { effectonuse = 28, -- efeito que sai levelscrit = 100, --- leveis que terão storagecrit = 48903 -- storage que será verificado } function onUse(cid, item, frompos, item2, topos) if (getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit) then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) if (getPlayerStorageValue(cid, config.storagecrit) == -1) then setPlayerStorageValue(cid, config.storagecrit, 0) end doPlayerSendTextMessage(cid,22,"Voce elevou seu critical para ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/100].") setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1) elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then doPlayerSendTextMessage(cid,22,"Voce ja chegou no nivel Maximo de Critical.\nParabéns.") return 0 end return 1 end Dodge: local config = { effectonuse = 29, -- efeito que sai levelscrit = 100, --- leveis que terão storagecrit = 98798644 -- storage que será verificado } function onUse(cid, item, frompos, item2, topos) if (getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit) then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) if (getPlayerStorageValue(cid, config.storagecrit) == -1) then setPlayerStorageValue(cid, config.storagecrit, 0) end doPlayerSendTextMessage(cid,22,"Voce elevou seus dodges para ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/100].") setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1) elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then doPlayerSendTextMessage(cid,22,"Voce ja chegou no nivel Maximo de Dodges.\nParabéns.") return 0 end return 1 end
Postado Outubro 27, 2018 6 anos Autor @lordzetros se não for muito incomodo, você poderia ver como resolve esse erro do script de outra stone? essa stone é de refinamento de itens upgradesystem <LIB> Spoiler --[[ 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, false, false}, [2] = {90, false, false}, [3] = {75, false, 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 = 7, 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 * 3) 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 if chance * 100 > math.random(1, 10000) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1))) if (self.item.level + 1) >= self.broadcast then end 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" else if(self.levels[self.item.level][3] == true and (self:chance().erase * 100) > math.random(1, 10000)) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.erase:format(self.item.name)) self:setItemName(self.item.name) for key, value in pairs(self.attributes) do if self.item[key] > 0 then doItemSetAttribute(self.item.uid, key, self.item[key]) end end elseif(self.levels[self.item.level][2] == true and (self:chance().downgrade * 100) > math.random(1, 10000)) 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 else doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.fail:format(self.item.name, (self.item.level + 1))) end return "fail" end end upgrade <ACTIONS> Spoiler function onUse(cid, item, fromPosition, itemEx, toPosition) if isCreature(itemEx.uid) then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end local obj = UpgradeHandler:new(itemEx) if(obj == false) then return doPlayerSendCancel(cid, UpgradeHandler.message.notupgradeable) end local status = obj:refine(cid, item) if status == "success" then --doSendAnimatedText(toPosition, "Success!", COLOR_GREEN) doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) elseif status == "fail" then --doSendAnimatedText(toPosition, "Fail!", COLOR_RED) doSendMagicEffect(toPosition, CONST_ME_POFF) else doSendMagicEffect(toPosition, CONST_ME_POFF) end return true end o código está registrado assim no Actions.Xml <action itemid="8300;8306" event="script" value="upgrade.lua"/>
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.