Spells - target_type request
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:
Spells - target_type request
Since Spells are now required to be more accurate in their data, I am discovering a missing option for target_type, and that is "Any". If I want to toss a snowball at a guard, I cannot find a proper setting to use where the guard, not in my group, not on my raid, and not my enemy, where it will let me hit the guard with a snowball.
Not sure if this is some other bug, or a result of the new data considerations for Spells LE has mentioned.
Thanks
Not sure if this is some other bug, or a result of the new data considerations for Spells LE has mentioned.
Thanks
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: Spells - target_type request
Enemy is the Any option. Enemy should probably be renamed, but it doesn't actually mean anything other than the target spawn. The hate and damage and such associated with enemy spells are set via the spell data itself.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Spells - target_type request
Then it doesn't work
I set my spell to Enemy (all) and am told "Target is not an enemy", oddly enough.
I want to throw snowballs, damnit.
I want to throw snowballs, damnit.
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Spells - target_type request
I added a whole bunch of checks in SpellProcess.cpp for spells and I believe this is the problem:
I added that in there because I too thought that the enemy target type was for hostile spells so I didn't want you to be able to cast a hostile spell on a spawn that wasn't attackable. Hmm I'll have to think about how to handle that, is there another flag for the spell to determine if it's a hostile spell with an enemy target or if it's a fun? spell with an enemy target?
Code: Select all
if (caster != target && target->IsEntity() && target->appearance.attackable == 0)- Zcoretri
- Team Member
- Posts: 1642
- Joined: Fri Jul 27, 2007 12:55 pm
- Location: SoCal
Re: Spells - target_type request
I will log in and capture the snowball spell from live and let you know what I find.
- Zcoretri
- Team Member
- Posts: 1642
- Joined: Fri Jul 27, 2007 12:55 pm
- Location: SoCal
Re: Spells - target_type request
Well, I could not capture the actual spell 'Throw Snowball' 
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Spells - target_type request
Why not? Just nothing shows up in the packet, or something's broken?Zcoretri wrote:Well, I could not capture the actual spell 'Throw Snowball'
- Arremis
- Retired
- Posts: 388
- Joined: Sun Sep 02, 2007 10:11 am
- Location: Memphis, TN
Re: Spells - target_type request
Throwing snowballs is an item-activated emote...kind of like the Fireworks illusion 
I am the UI Master...there is no charge for my awesomeness.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Spells - target_type request
/uber-necro
This is a bug(?) that apparently never got fixed, due to the misunderstanding of the spell type "Enemy".
I recommend we fix this (undo Scat's fix?) before I start going nuts trying to make spells work. I've wasted lots of hours on things not working the way I expect them to, thinking it was my lack of understanding. But maybe it's code?
Please review the "Enemy" spell type, and let's rename it to "Any" as LE suggested, though I fear the code has all changed drastically in 3 years... so that's why I need your help, Jabantiz. Scatman. derFoof.
Thanks
This is a bug(?) that apparently never got fixed, due to the misunderstanding of the spell type "Enemy".
I am once again trying something as simple as tossing a snowball at Galinda Goodfaith and no matter what parameters I set in the spell, or how I work the LUA function, the "Self" spell only lands on me... freezing me out.LethalEncounter wrote:Enemy is the Any option. Enemy should probably be renamed, but it doesn't actually mean anything other than the target spawn. The hate and damage and such associated with enemy spells are set via the spell data itself.
I recommend we fix this (undo Scat's fix?) before I start going nuts trying to make spells work. I've wasted lots of hours on things not working the way I expect them to, thinking it was my lack of understanding. But maybe it's code?
Please review the "Enemy" spell type, and let's rename it to "Any" as LE suggested, though I fear the code has all changed drastically in 3 years... so that's why I need your help, Jabantiz. Scatman. derFoof.
Thanks
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Spells - target_type request
If enemy = any then how do we handle enemy only spells?
As for the snowball's
I will have to log on live and look for an any spell and try and collect it to see if there is a difference.
As for the snowball's
so couldn't we use an entity command?Arremis wrote:Throwing snowballs is an item-activated emote...kind of like the Fireworks illusion
I will have to log on live and look for an any spell and try and collect it to see if there is a difference.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Spells - target_type request
I imagine "friendly_spell" being false would make it a hostile "ANY" spell? FWIW this isn't really about SnowballsJabantiz wrote:If enemy = any then how do we handle enemy only spells?
While you're thinking that over, here's a change I am testing now just to see if I can get this to work. I will not commit my changes until we all agree it is viable.
My notes:
I'm realizing now there is the added complexity of "Implied Targets" recently added, but I believe with target_type and the proper spell toggles set, we can still achieve this goal.
Proposed Changes
Spells.h
Code: Select all
#define SPELL_TARGET_ENEMY 1Code: Select all
#define SPELL_TARGET_ANY 1SpellProcess.cpp, GetSpellTargets() change
Code: Select all
else if (target->IsPlayer()) // else it is not raid, group only or group spell
luaspell->targets.push_back(target); // return target for single spell
else
luaspell->targets.push_back(caster); // and if no target, cast on self
Code: Select all
else if (target->IsPlayer() || target->IsNPC()) // else it is not raid, group only or group spell, and could be NPC receiving friendly spell
luaspell->targets.push_back(target); // return target for single spell
else
luaspell->targets.push_back(caster); // and if no target, cast on self
And to prevent the "Not a friend" warning, in ProcessSpell(zoneserver...)
Code: Select all
else if (spell->GetSpellData()->friendly_spell && target->IsNPC() /*&& target->appearance.attackable*/)I thought the original code might block things like Pet beneficials, but I guess Pet NPCs are flagged "attackable"?
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Spells - target_type request
I found one of my problems... seems though my spell is set to friendly_spell = 1, when I hit the check mentioned above, the data says it is 0.
Stand by... there might not be anything wrong at all, could be how I am loading the spell data now (??)
Btw, in the client, the target_type = 1 (ANY) definitely says "Enemy" so... not sure where LE was going with his initial statement, unless he was thinking Emu-internal processing only.
Edit: OMFG... ~blush~
Think that's a problem?

Stand by... there might not be anything wrong at all, could be how I am loading the spell data now (??)
Btw, in the client, the target_type = 1 (ANY) definitely says "Enemy" so... not sure where LE was going with his initial statement, unless he was thinking Emu-internal processing only.
Edit: OMFG... ~blush~
Code: Select all
/* Toggles */
data->interruptable = ( result.GetInt8Str("interruptable") == 1);
data->duration_until_cancel = ( result.GetInt8Str("duration_until_cancel") == 1);
data->can_effect_raid = result.GetInt8Str("dissonance_req_percent");
data->affect_only_group_members = result.GetInt8Str("dissonance_req_percent");
data->display_spell_tier = result.GetInt8Str("dissonance_req_percent");
data->friendly_spell = result.GetInt8Str("dissonance_req_percent");
data->group_spell = result.GetInt8Str("dissonance_req_percent");
data->is_active = result.GetInt8Str("is_active");
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Spells - target_type request
Also want to point out that target_type = 1 (enemy) and is_friendly = 1 makes the examine show "Friend"
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Spells - target_type request
Yeah, because of my copy/paste mess up, I'm sure my spell will now be Friend 
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Spells - target_type request
Damn channelers and there dissonance 
Who is online
Users browsing this forum: No registered users and 0 guests