vitorlegal12345
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
vitorlegal12345 deu reputação a Dwarfer em Spell de nívellocal config = { effects_per_level = { [1] = 25, -- efeito no [level 1] [2] = 177 -- efeito no [level 2] }, casts_to_up = 300, -- quantas vezes tem que soltar para alcançar o level 2 storages = {level = 46890, cast = 46891} -- só modifique se necessário } local function getPlayerRasenganLevel(cid) return getPlayerStorageValue(cid, config.storages.level) end local function getPlayerRasenganCasts(cid) return getPlayerStorageValue(cid, config.storages.cast) > 0 and getPlayerStorageValue(cid, config.storages.cast) or 0 end local function doPlayerRasenganUp(cid, round) return setPlayerStorageValue(cid, config.storages.cast, getPlayerRasenganCasts(cid) + round) end local combat = {} for i = 1, 2 do combat[i] = createCombatObject() setCombatParam(combat[i] , COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat[i] , COMBAT_PARAM_EFFECT, config.effects_per_level[i]) function onGetFormulaValues(cid, level, maglevel) min = -(level * 0.28 + maglevel * 1.48) * 1.0 * getPlayerRasenganLevel(cid) max = -(level * 0.34 + maglevel * 2.34) * 1.0 * getPlayerRasenganLevel(cid) return min, max end setCombatCallback(combat[i], CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") end function onCastSpell(cid, var) if getPlayerRasenganLevel(cid) == -1 then setPlayerStorageValue(cid, config.storages.level, 1) end if getPlayerRasenganLevel(cid) ~= 2 then doPlayerRasenganUp(cid, 1) local casts, str = getPlayerRasenganCasts(cid), '' if casts == 1 then str = "First time casting Rasengan! You need "..config.casts_to_up.." casts to advance to level 2 and improve its power!" elseif casts == (config.casts_to_up / 2) then str = "You reached 50% on Rasengan level 1. Now you need "..(config.casts_to_up/2).. " casts to advance to level 2." elseif casts == config.casts_to_up then str = "Congratulations! You advanced the Rasengan jutsu from level 1 to level 2." setPlayerStorageValue(cid, config.storages.level, 2) end if str ~= '' then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, str) end end return doCombat(cid, combat[getPlayerRasenganLevel(cid)], var) end No level 2, vai dar um dano 2x maior que no nível 1.
Não tive como testar o script.