Re: Damage over time spells
Posted: Wed Jan 13, 2016 4:08 pm
[quote="John Adams"]Well this:
is not going to do anything. dmgMin of 0 is not going to generate aggro.
When I say do the initial damage in cast, I mean the first mathematical split of the total / frequency, since the start of frequency should be the exact instant of casting (not 4 seconds later). [/quote]
That code won't do anything. I changed it locally to cause the initial tick of damage. I just haven't committed it yet because of a crashing bug. I know it applies the initial damage and agro now though.
[quote="John Adams"]
And, all functions in the Spell Script should be receiving the exact same parameters, regardless of if cast uses "ticks" or not. Not really sure yet why you are passing "ticks" anyway, that should all be in c++ - meaning each min/max damage sent to function tick() should be calculated in code, not in Lua. Lua scripter should just pass SpellDamage(Caster, dmgType, dmgMin, dmgMax) then, without having to do math.[/quote]
I'm doing this because there is no guarantee which order the parameters will fall in from the LuaData. Take Sealed Fate again, it does initial damage and then applies a range of damage for 1 min and then another range of damage for 10 minutes after that. The LuaData is basically a vector of numbers. In a regular dot, the low and high damage could be spots 2 and 3 in the vector. For Sealed fate, its 3, 4, 5, 6, 7. When building the lua state, I may not be able to write an algorithm that handles all cases reliably.
I think this is a fairly generic tradeoff. Similarly, I am creating and passing the current runtime of the dot so that for Sealed Fate, I can put in the script if runtime > 6000 use the dmgMin2 and dmgMax2 values.
Code: Select all
function cast(Caster, dmgType, dmgMin, dmgMax)
SpellDamage(Caster, dmgType, 0)
end
When I say do the initial damage in cast, I mean the first mathematical split of the total / frequency, since the start of frequency should be the exact instant of casting (not 4 seconds later). [/quote]
That code won't do anything. I changed it locally to cause the initial tick of damage. I just haven't committed it yet because of a crashing bug. I know it applies the initial damage and agro now though.
[quote="John Adams"]
Code: Select all
function cast(Caster, dmgType, dmgMin, dmgMax)
dmgMin = math.floor((dmgMin / ticks) + 0.5)
dmgMax = math.floor((dmgMax / ticks) + 0.5)
SpellDamage(Caster, dmgType, dmgMin, dmgMax)
end
I'm doing this because there is no guarantee which order the parameters will fall in from the LuaData. Take Sealed Fate again, it does initial damage and then applies a range of damage for 1 min and then another range of damage for 10 minutes after that. The LuaData is basically a vector of numbers. In a regular dot, the low and high damage could be spots 2 and 3 in the vector. For Sealed fate, its 3, 4, 5, 6, 7. When building the lua state, I may not be able to write an algorithm that handles all cases reliably.
I think this is a fairly generic tradeoff. Similarly, I am creating and passing the current runtime of the dot so that for Sealed Fate, I can put in the script if runtime > 6000 use the dmgMin2 and dmgMax2 values.