Albanon
New Member
- Joined
- Mar 5, 2011
- Messages
- 93
- Reaction score
- 1
I'd like to take a simple spell like energy strike
and make it so that if you do not wait 5 seconds before casting it again it will drain twice as much mana the second time you cast it, and then, twice as much mana again the third, and then the fourth, and fifith ect
but I am not sure how to go about doing something like that
so, lets say it costs 2 mana to cast the first time, you cast it....then you decide to spam it over and over - 2 becomes 4, 4 becomes 8, 8 becomes 16, 16 becomes 32, and it just keeps adding up - then after 5 seconds, it goes back down to 2 mana again
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
and make it so that if you do not wait 5 seconds before casting it again it will drain twice as much mana the second time you cast it, and then, twice as much mana again the third, and then the fourth, and fifith ect
but I am not sure how to go about doing something like that
so, lets say it costs 2 mana to cast the first time, you cast it....then you decide to spam it over and over - 2 becomes 4, 4 becomes 8, 8 becomes 16, 16 becomes 32, and it just keeps adding up - then after 5 seconds, it goes back down to 2 mana again