Lakus
New Member
- Joined
- May 9, 2009
- Messages
- 27
- Reaction score
- 0
Hello, i came here because i need help with a Spell, i want to change the effect and the type for vocation..
I mean, if my vocation is 1, then i want an energy attack. Else if my vocation is 2, i want fire attack.
I have this, but is not working.
Could you help me, please.
I mean, if my vocation is 1, then i want an energy attack. Else if my vocation is 2, i want fire attack.
I have this, but is not working.
Could you help me, please.
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + (maglevel * 1.4) + 8
local max = (level / 5) + (maglevel * 2.2) + 14
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
combat1:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
if getPlayerVocation(cid) == 1 then
return combat:execute(creature, var)
elseif getPlayerVocation(cid) == 2 then
return combat1:execute(creature, var)
end
end