Designing Spells

Creating the Spells and Abilities for EQ2Emulator

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:

Re: LUA Tables

Post by John Adams » Tue Dec 10, 2013 5:04 pm

thefoof wrote:So if we didn't want to use tables another way we could do this would be, make a function to pull the size of a group, and run a while or for loop like we do in the server with another function to pull the spawn ->at(i).
In this particular instance I am perfectly okay with letting the server do the heavy lifting of calculations. While I want complete control over parameters, I do not think we should be doing complex code in LUA, as most people are already terrified of scripting ~raises hand~

I'm not clear if targets > 1 absolutely do not work now? At all? Or if you weren't aware of the functions Jab demonstrated. I know spells like Pathfinding work. Or, worked once upon a time anyway...

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Designing Spells

Post by thefoof » Tue Dec 10, 2013 5:17 pm

I'll try and explain, alot of the functions we use in spells (SpellDamage, SpellHeal, AddSpellBonus ect) pull the list of targets directly out of the spell and that's how they work properly, the server generates a list of targets and the function itself is what gets those spawn pointers from the spell not the spawn param used (unless overridden like we changed in SpellHeal).


When the cast function gets called it only sends the Caster of the spell and the "initial_target" (the target that the spell was directly cast on after implied target does it's thing). So if a function isn't made specifically for spells, passing the Target param will only use this intial target of the spell, not every target involved.



So, if you need to use extra functions to check each target to see if it's viable, you can't currently do this with more than 1 target of the spell. An example of this which I found last night is the warden spell Armor of Seasons, it's a group buff that either increases Max HP if the group member is a fighter, or Mitigation if the group member isn't. We can't check for this currently. Infact this might not even be enough code support for that because of how group buffs are applied in the server, just a general example where something like this might be needed, but it probably wouldn't work for this particular case.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Designing Spells

Post by thefoof » Wed Dec 11, 2013 4:24 am

Working on resurrections now, FYI :mrgreen:

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:

Re: Designing Spells

Post by John Adams » Wed Dec 11, 2013 9:46 am

thefoof wrote:So, if you need to use extra functions to check each target to see if it's viable, you can't currently do this with more than 1 target of the spell.
Yup, that makes perfect sense now. My example of Pathfinding (or Aego etc) is kinda a one-for-all buff, which I think is all that's working right now... if it is even working properly.

I think this will also open the doorway to what Jab had mentioned before, where Target(s) must be a specific spawn type. Ie all Undead. If that's the case, unless you parameterize it, maybe it does have to loop in LUA? I hope not. That'll just make script writing like coding, and that scares people.

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:

Re: Designing Spells

Post by John Adams » Wed Dec 11, 2013 9:46 am

thefoof wrote:Working on resurrections now, FYI :mrgreen:
Just in time for Easter! :shock: :lol: :mrgreen:

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Designing Spells

Post by Zcoretri » Wed Dec 11, 2013 10:55 am

FYI, I found this post from a developer dude who maintains a web site pulling SOE data.
There are several issues related to spells in Census that I'm trying to work around. First being that the spell data in Census is exported in a way that it's reflective of a dummy character which slightly tweaks the stats. Second, there are no flags indicating if any particular stat is excluded in calculation.
So this is why the values for casting time, recast etc come out like 161, 8.93234 and such.

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:

Re: Designing Spells

Post by John Adams » Wed Dec 11, 2013 12:23 pm

That dummy.

Fortunately for us we will be able to update any of our spells with the push of a single button once they figure it all out. I can easily change the harvesting scripts if needed. Let me know if they announced they fixed it because I do not read forums besides this one :)

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Designing Spells

Post by Zcoretri » Wed Dec 11, 2013 1:12 pm

John Adams wrote:That dummy.

Fortunately for us we will be able to update any of our spells with the push of a single button once they figure it all out. I can easily change the harvesting scripts if needed. Let me know if they announced they fixed it because I do not read forums besides this one :)
Will do.

Also, looks like SOE is now pushing out Quest and Recipe data also. Partial quote taken from the SOE data forum.
Quests are broken down into Stages (steps), and each stage can have multiple Branches (parts) like Kill 10 Rats, Find 4 roots, etc. I highly recommend looking up a quest you are familiar with, and then comparing the walkthrough on Zam or Wikia to see how the data is encoded.

Now, everyone should understand that this data is NOT perfect, but it is what we can get for the time being until sometime in 2014, and I thought it more important to have imperfect data now, then perfect data months from now.

Limitations of this data which will hopefully be fixed next year...

Recipes give Components and Fuel as item names, instead of unique itemids. This will make linking up recipes a bit tougher. The reason for this is, some recipes accept more than one item to make the recipe. For instance, some recipes take "fluid" as a component, or older types of malachite.
Quests are not exported with Quest Giver info. -- This could be an NPC, a book, a spawncamp (an object you click), or by a triggered event.
Quests are not exported with Starting Zone. However quests ARE exported with finishing zone for each step!
Quests do not include complete/consistent Reward data. Quest rewards can be in several different formats, and we only got support for the simplest type.
The active quest journal section of /character_misc/ is exporting in German, French, Japanese, or Russian for players on those servers. This will make matching up and displaying your active quest journal outside the game pretty much impossible for these players. Sorry! :(

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:

Re: Designing Spells

Post by John Adams » Wed Dec 11, 2013 4:37 pm

Zcoretri wrote:Also, looks like SOE is now pushing out Quest and Recipe data also. Partial quote taken from the SOE data forum.
Haha, I just got all excited and posted this in the data.soe.com post before reading this... I guess it is new then. Cool.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Designing Spells

Post by Jabantiz » Fri Dec 13, 2013 5:02 pm

thefoof wrote:*Selo's Accelerando (speed buff) - scripted but speed needs to be added into spellbonuses for it to work properly
Just committed code for speed. To buff speed you would use AddSpellBonus()/RemoveSpellBonus() with these types

Code: Select all

#define ITEM_STAT_SPEED					609 // Out of combat run speed
#define ITEM_STAT_MOUNTSPEED			611
#define ITEM_STAT_MOUNTAIRSPEED			612
#define ITEM_STAT_OFFENSIVESPEED		616	// In combat run speed
I also added a SetSpeedMultiplier() lua function that will adjust the over all speed, setting to 0 will root the target, 1 will be normal

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Designing Spells

Post by Jabantiz » Fri Dec 13, 2013 5:21 pm

Going to work on mystics level 1 - 20

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Designing Spells

Post by Jabantiz » Fri Dec 13, 2013 6:17 pm

Ran into a buff (Runic Armor) that wards every one in the group and gives all non fighters in the group physical resistence, I am capable of getting the fighters in the group I am not able to apply the bonus to just that group member though as AddSPellBonus will use spell targets, I am probably going to add an extra optional param to that function to force it to use the provided target and not the spell targets, thoughts?

Any other ideas about how to handle this as we will porbably need to do the same to other functions.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Designing Spells

Post by Jabantiz » Fri Dec 13, 2013 9:09 pm

Jabantiz wrote:Going to work on mystics level 1 - 20
Done.

The only issues with mystics spells is the above post, shape change the caster, see stealth, and a few ward issues.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Designing Spells

Post by thefoof » Fri Dec 13, 2013 11:25 pm

Adding a param to override the target sounds fine, since we've used the function so much already not worth redoing the syntax. Just a random thought on illusions, we could probably create like an illusion list where priority goes to the first illusion cast, that's about how it works on live.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Designing Spells

Post by thefoof » Sat Dec 14, 2013 12:07 am

Just thought about this again and I think we would run into a problem again with the loop of reapplying group buffs for that spell like I mentioned with the other warden spell.

What we'll probably have to do is create a way to set a check in the spellscript when applying group buffs to see if a target is eligible. Check out ApplyGroupBuffs() and RemoveGroupBuffs() in world.cpp and you'll see what I mean. I'm open to a redesign of that if we need to do it, as spells are complicated.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests