Question about Spell Durations
Moderator: Team Members
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Question about Spell Durations
I searched through the code, and I cannot identify anything that tells the LUA system what a spells "duration" is. Ie., a DOT that lasts 12 seconds. I know I can pass a param via spell_data, but that defeats the purpose behind the spell_tiers.duration* fields. I am hoping to set durations in only one place for all spell types.
For testing some new scripts, I will hard-code some durations... but I am asking/wondering, does the system magically know how long to loop a DOT (like it magically knows how to evaluate and subtract power requirements)?
Thanks
For testing some new scripts, I will hard-code some durations... but I am asking/wondering, does the system magically know how long to loop a DOT (like it magically knows how to evaluate and subtract power requirements)?
Thanks
John Adams
EQ2Emulator - Project Ghost
"Everything should work now, except the stuff that doesn't" ~Xinux
EQ2Emulator - Project Ghost
"Everything should work now, except the stuff that doesn't" ~Xinux
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
You shouldn't have to worry about telling the LUA script how long the effect will last. The first time the spell lands it will call the "cast" LUA function, after that it calls the "tick" LUA function if the spell lasts longer than 1 tick. The magical field you are looking for that determines the number of ticks that a spell lasts for is call_frequency. The way it works is this:
Your duration is 60 seconds. Because SOE uses tenths of a second, the value for BOTH duration1 and duration2 would be 600 (if they aren't even then the system thinks you meant a range and determines a random number in the range). Now this spell has an effect that it does at the beginning of the spell and then every tick it does another effect.
In the cast function you would put the effect that hits if the spell is effective. In the tick function you put the effect that hits every tick. The call_frequency tells the system how long each 'tick' is. Unlike the normal EQ system a tick does not have to be 6 seconds. The spell continues to call the tick function every tick until the duration is met.
Your duration is 60 seconds. Because SOE uses tenths of a second, the value for BOTH duration1 and duration2 would be 600 (if they aren't even then the system thinks you meant a range and determines a random number in the range). Now this spell has an effect that it does at the beginning of the spell and then every tick it does another effect.
In the cast function you would put the effect that hits if the spell is effective. In the tick function you put the effect that hits every tick. The call_frequency tells the system how long each 'tick' is. Unlike the normal EQ system a tick does not have to be 6 seconds. The spell continues to call the tick function every tick until the duration is met.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Yah that makes perfect sense.
So dots in everquest2 have an effect that hits only when it first lands and a second, seperate, effect every tick. So lets say the call_frequency is 2 seconds (meaning the dot ticks every 2 seconds), and duration1 and duration2 are 10 seconds, it will tick a maximum of 5 times PLUS do the initial effect.
So dots in everquest2 have an effect that hits only when it first lands and a second, seperate, effect every tick. So lets say the call_frequency is 2 seconds (meaning the dot ticks every 2 seconds), and duration1 and duration2 are 10 seconds, it will tick a maximum of 5 times PLUS do the initial effect.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Ok, I think I got it. Let me use a real example and see if I understand correctly.
Assassin: Quick Strike (level 1)
duration1: 120
duration2: 120
call_frequency: 4
And the script would be:
My 6 params are in spells_data in the order of the function() params: 0, 5, 9, 8, 1, 1.
Is this correct? I'm going to mess with this today, because I'd like to build a generic Damage.lua that handles most of our needs instead of having 12 dd/dot lua's like we originally planned.
Btw, we do not have a Melee Damage type in the emu. What should I use for Melee damage? Currently leaving as 0 (slashing).
Assassin: Quick Strike (level 1)
So initial function cast() would land between 5-9 Melee damage, then for 12 seconds will do an additional 1 Slashing damage every 4 seconds. So my setup in spell_tiers would be:Inflicts melee damage on target
Inflicts slashing damage on target every 4 seconds
duration1: 120
duration2: 120
call_frequency: 4
And the script would be:
Code: Select all
function cast(Caster, Target, DDType, MinDDVal, MaxDDVal, EffectType, MinEffectVal, MaxEffectVal)
-- DD component
damage = math.random(MinDDVal, MaxDDVal)
SpellDamage(Target, DDType, damage)
-- Effect (DOT) component
if EffectType ~= nil then
-- only process this code if there is an EffectType param passed (ie, dot, heal, siphon, etc)
-- if there is more than 1 effect, use a more specific script
EffectDamage = math.random(MinEffectVal, MaxEffectVal)
SpellDamage(Target, EffectType, EffectDamage)
end
end
function tick(Caster, Target, DDType, MinDDVal, MaxDDVal, EffectType, MinEffectVal, MaxEffectVal)
EffectDamage = math.random(MinEffectVal, MaxEffectVal)
SpellDamage(Target, EffectType, EffectDamage)
endIs this correct? I'm going to mess with this today, because I'd like to build a generic Damage.lua that handles most of our needs instead of having 12 dd/dot lua's like we originally planned.
Btw, we do not have a Melee Damage type in the emu. What should I use for Melee damage? Currently leaving as 0 (slashing).
Last edited by John Adams on Wed Dec 03, 2008 12:10 pm, edited 1 time in total.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Scatman, about this... if Quick Strike does melee and disease damage, are you saying the Disease (DOT) component does NOT land on the initial strike, and THEN every 4 seconds for 12 seconds (so only 2 land and not 3)?Scatman wrote:So dots in everquest2 have an effect that hits only when it first lands and a second, seperate, effect every tick.
I thought the effects landed with the initial strike, and ALSO landed every tick for the duration. If this is wrong, I will remove the Effect (DOT) component from cast() and leave it only in Tick.
One more LE question
What determines if the DOT lands or not? Like resistance and such. My DOT will hit once, then on the next tick may be resisted and do no damage? Is that handled in the SpellDamage() function?
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
No you're right it does. But I'm not sure exactly when the tick() function is first called. If tick() is called also when cast() is called then there is no reason for having the DOT effect also in the cast() function.John Adams wrote:Scatman, about this... if Quick Strike does melee and disease damage, are you saying the Disease (DOT) component does NOT land on the initial strike, and THEN every 4 seconds for 12 seconds (so only 2 land and not 3)?
I thought the effects landed with the initial strike, and ALSO landed every tick for the duration. If this is wrong, I will remove the Effect (DOT) component from cast() and leave it only in Tick.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Ok, apparently call_frequency is also 10ths of a second hehe. At first, I was getting BAM BAM BAM disease flying out my blade killing anything in my way. Bumped that sucker to 40, and now the tick timer appears to be working as designed.
Awesome! This is very exciting. Spells may be coming to Tess soon!
Scat, here is the results of my test:
Awesome! This is very exciting. Spells may be coming to Tess soon!
Scat, here is the results of my test:
As you can see, the initial slashing strike + disease DOT in the first strike. Then, 2 more disease DOTs after which is exactly what I expected.(1228334821)[Wed Dec 03 13:07:01 2008] YOUR Quick Strike hits an elk calf for 9 slashing damage.
(1228334821)[Wed Dec 03 13:07:01 2008] YOUR Quick Strike hits an elk calf for 1 disease damage.
(1228334821)[Wed Dec 03 13:07:01 2008] an elk calf hits YOU for 3 crushing damage.
(1228334824)[Wed Dec 03 13:07:04 2008] an elk calf hits YOU for 2 crushing damage.
(1228334825)[Wed Dec 03 13:07:05 2008] YOUR Quick Strike hits an elk calf for 1 disease damage.
(1228334826)[Wed Dec 03 13:07:06 2008] an elk calf hits YOU for 4 crushing damage.
(1228334828)[Wed Dec 03 13:07:08 2008] an elk calf hits YOU for 3 crushing damage.
(1228334829)[Wed Dec 03 13:07:09 2008] YOUR Quick Strike hits an elk calf for 1 disease damage.
(1228334829)[Wed Dec 03 13:07:09 2008] an elk calf hits YOU for 3 crushing damage.
(1228334831)[Wed Dec 03 13:07:11 2008] an elk calf hits YOU for 3 crushing damage.
(1228334834)[Wed Dec 03 13:07:14 2008] an elk calf hits YOU for 2 crushing damage.
(1228334836)[Wed Dec 03 13:07:16 2008] an elk calf tries to crush YOU, but YOU deflect.
(1228334838)[Wed Dec 03 13:07:18 2008] an elk calf hits YOU for 4 crushing damage.
(1228334839)[Wed Dec 03 13:07:19 2008] an elk calf tries to crush YOU, but YOU deflect.
(1228334841)[Wed Dec 03 13:07:21 2008] an elk calf tries to crush YOU, but YOU deflect.
(1228334843)[Wed Dec 03 13:07:23 2008] You gain experience!
(1228334843)[Wed Dec 03 13:07:23 2008] You have killed an elk calf.
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Current client 5280L is locked out of the loginserver til LE bumps it. Pretty sure it'll still be compatible. You can always do what I do - have a live EQ2 and a EQ2Emu client folder, and use a tool like SynchronizeIT! to see what the differences are - then only back up the files about to be changed. Usually SOE only patches vpk's and Everquest2.exe, which should be small enough to keep an archive of. That way if it doesn't work, copy your backed up files back and you're still in business!Scatman wrote:but I'm hesitant to patch my live eq folder.
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- alfa
- Team Member
- Posts: 550
- Joined: Fri Jul 27, 2007 6:24 pm
- Location: France
- Contact:
Some spells have one more value like the example of John
There is a way to call a function like "final tick"Inflicts melee damage on target
Inflicts slashing damage on target every 4 seconds
At end Inflicts slashing damage on target
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Who is online
Users browsing this forum: No registered users and 0 guests