AA Spell Mods

EQ2Emulator Development forum.

Moderator: Team Members

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

AA Spell Mods

Post by Jabantiz » Sat Jan 14, 2012 8:52 pm

This was just an idea I had of how to implement spell mods. I would like to start off by saying this is just an idea, haven't looked to deeply into it and all feedback is welcome, even if it is a completely diffrent way to do it. Also I have no plans to implement this myself any time soon, just brainstorming right now, so any one else can feel free to do it.

The idea is basically to add a map<> to the player class, something like map<int, vector<spellmods>> where int is the spell id to be modified and the vector (probably of a struct) to store the various mods for that spell. When a spell is examined or cast it would then need to check this map for the player casting/examining and make the modifications.

Assuming AA's that modify spells will be treated as passive spells then a lua function will need to be added to insert data into the new map and nothing will need to be stored in the DB.

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: AA Spell Mods

Post by John Adams » Sat Jan 14, 2012 9:07 pm

Thanks, Jabantiz. I'll wait for Scatman to be online tomorrow (Sun) and see what he thinks. I think this (passive spells and AA) might be our starting 0.7.1 list. Woot!

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: AA Spell Mods

Post by Scatman » Sun Jan 15, 2012 3:13 pm

It's been a while, but isn't this how we handle spells now? It can probably just be added to the existing logic, just tweaked a bit?

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

Re: AA Spell Mods

Post by Jabantiz » Sun Jan 15, 2012 5:11 pm

I thought it only stored a spell id and tier and then looked it up in the master_spell_list, wich being a global list cant make mods to the spells. Also won't we have to go through the entire player spell list to find the mods every time the player uses a spell or examines it?

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: AA Spell Mods

Post by Scatman » Sun Jan 15, 2012 6:40 pm

Well for spell effects I think each player has a map, similar to what you mentioned.

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

Re: AA Spell Mods

Post by Jabantiz » Sun Jan 15, 2012 9:27 pm

I found the spell effect stuff you were refering to, it is just an array of SpellEffects, wich that will work but what I noticed is the array size is hardcoded

Code: Select all

SpellEffects	spell_effects[45];
I am not sure what else uses this array but will 45 be enough? I know AA's, items, and some spells can modify various aspects of a spell, plus whatever else that this array is already used for. Is 45 a client restriction or can we cahnge that to make it work? Also it looks like the function for this array were never finished, like the following

Code: Select all

bool Player::HasActiveSpellEffect(Spell* spell, Spawn* target){
	return false;
}
Didn't check the rest of them though.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: AA Spell Mods

Post by Scatman » Mon Jan 16, 2012 12:54 am

Yeah I think it's a limit on how the character sheet is setup. I believe it always sends an array of 45 spell effects but zeroes out the elements if a spell effect doesn't exist in that slot. So maybe using that wouldn't be the best idea.

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: AA Spell Mods

Post by John Adams » Mon Jan 16, 2012 7:08 am

Is "45" the max number of spell effects the client can display? Maybe that's why it is hard-coded.

I'm beginning to suspect we'll be building a whole new structure to hold this data and reference it.

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

Re: AA Spell Mods

Post by Zcoretri » Mon Jan 16, 2012 8:56 am

John Adams wrote:Is "45" the max number of spell effects the client can display? Maybe that's why it is hard-coded.

I'm beginning to suspect we'll be building a whole new structure to hold this data and reference it.
Yes, 45 is the max number of spell effects that the client can display. 45 for Maintained effects and 30 for detrimental effects.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: AA Spell Mods

Post by Scatman » Tue Jan 17, 2012 8:29 am

Zcoretri wrote:
John Adams wrote:Is "45" the max number of spell effects the client can display? Maybe that's why it is hard-coded.

I'm beginning to suspect we'll be building a whole new structure to hold this data and reference it.
Yes, 45 is the max number of spell effects that the client can display. 45 for Maintained effects and 30 for detrimental effects.
From the character sheet. This is what I meant when I said 45 effects and detrimental effects are always sent:

Code: Select all

<Data ElementName="detrimental_spell_effects" Substruct="Substruct_SpellEffects" Size="45" />
<Data ElementName="maintained_effects" Substruct="Substruct_MaintainedEffects" Size="45" />

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests