spell_data: value2

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

spell_data: value2

Post by John Adams » Wed Dec 03, 2008 1:29 pm

LE, is there any way we can start using value2 again for range data? Having to put index_fields in for min/max is actually going to make scripting more complex. I am hoping to minimize the number of scripts necessary to handle our spells. Things start getting pretty complex when you have ranges for damage and/or siphons on some spells, while others are static.
Example:
One spell will do between 1-5 slashing damage, and then apply a DOT for 1 damage (no range).
Another may do crushing damage for 5 (only), and heal the caster for 4hp.
Yet another may want a range for the DOT, too. min/max damage.
As you can see, using a single generic script becomes problematic in that you are now forced to set spell_data values to fill in the otherwise unused parameters (DType, DMin, DMax, Effect, EMin, EMax - etc).
If we used the value / value2 fields already in spell_data, we could set one record for the damage type, the next for the range of damage for the type - then in the script, simply check if value2 ~= nil to determine the need for a math.random().
We talked about this before, but I do not remember the reason value2 was no longer used. What do you think?

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Wed Dec 03, 2008 3:28 pm

I'm not sure what your referring to, but your LUA scripts should be fine having more variables than what was passed in, IE: testfunction(var1, var2, var3) should work just fine if called with 2 or 3 parameters and if the 3rd parameter is not passed it is nil.
One of the reasons I got away from the value2 field was for simplicity sake. If you are specifying every variable that you are passing on the command line and suddenly a single entry in the table creates two variables (min and max) that could get pretty confusing.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Wed Dec 03, 2008 4:01 pm

Actually now that you remind me... I guess it would be no different to LUA if I pass:
Idx 0: damageType, 0
Idx 1: value, 1
Idx 2: value2, 5
or
Idx 0: damageType, 0
Idx 1: value, 1
Idx 2: value, 5
heh... uh, nevermind. I wrote that when I was hip deep in attempting to make "the most generic script possible" to handle the 6 params from my other posts. After going through that nightmare scenario all day, I am caving in and asking that we create as many scripts as we need to get the job done easier. :)
Too much time on my hands, I tell ya. Thanks tho.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests