Postado Fevereiro 17, 2015 10 anos 1* local outfit = 126 -- numero da outfit local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 300000) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 20) local function healthTime(cid, time, percent, count, i, storage) if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, storage) > os.time() then if count <= i then if isPlayer(cid) then doCreatureAddHealth(cid, percent) doSendMagicEffect(getThingPos(cid), 14) print(percent) end end else doRemoveCondition(cid, CONDITION_OUTFIT) return true end addEvent(healthTime, time*1000, cid, time, percent, count + 1, i, storage) end function onCastSpell(cid, var) if not isPlayer(cid) then return true end local config = { count = 1, i = 300, time = 5, percent = 60, storage = 2020, } if(getPlayerStorageValue(cid, config.storage) > os.time() and getPlayerStorageValue(cid, config.storage) < 400+os.time()) then return doPlayerSendTextMessage(cid, 24, "You are buffed.") end doSetCreatureOutfit(cid, {lookType = outfit}, -1) doAddCondition(cid, condition) setPlayerStorageValue(cid, config.storage, os.time() + config.i) healthTime(cid, config.time, config.percent, config.count, config.i, config.storage) return true end 2* local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onGetFormulaValues(cid, level, skill, attack, element, factor) local levelTotal, formula = level / 5, 0.0496 local normal, elemental = -(skill * attack * formula + levelTotal), math.ceil((skill * element * formula + levelTotal)) return normal/2, normal, -math.random(elemental/2, elemental) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) local config = { storage = 2020, } if getPlayerStorageValue(cid, config.storage) > os.time() then doCombat(cid, combat, var) else doPlayerSendCancel(cid, "You need activated buff.") end return true end Editado Fevereiro 17, 2015 10 anos por xBen (veja o histórico de edições)
Postado Fevereiro 18, 2015 10 anos Autor xBen deu entre aspas; quando você usa a transformação pela primeira vez dá certo, se você usar depois o personagem não transforma mais, o exori ta funcionando sem precisar da spells, se possível só conserte o primeiro pedido, só vou precisar dela. Obrigado
Postado Fevereiro 18, 2015 10 anos pedrizito é porque eu coloquei pra durar 300 segundos, durante os 300 segundos não pode usar de novo, e coloque no seu login.lua pra setar a storage pra 0 assim, qnd o player logar não dara problema
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.