Spells - target_type request

EQ2Emulator Development forum.

Moderator: Team Members

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:

Spells - target_type request

Post by John Adams » Wed Jan 06, 2010 1:25 am

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

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

Re: Spells - target_type request

Post by LethalEncounter » Wed Jan 06, 2010 5:45 pm

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.

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: Spells - target_type request

Post by John Adams » Fri Jan 08, 2010 5:05 pm

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.

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: Spells - target_type request

Post by Scatman » Fri Jan 08, 2010 5:17 pm

I added a whole bunch of checks in SpellProcess.cpp for spells and I believe this is the problem:

Code: Select all

if (caster != target && target->IsEntity() && target->appearance.attackable == 0)
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?

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

Re: Spells - target_type request

Post by Zcoretri » Fri Jan 08, 2010 7:09 pm

I will log in and capture the snowball spell from live and let you know what I find.

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

Re: Spells - target_type request

Post by Zcoretri » Sat Jan 09, 2010 12:27 am

Well, I could not capture the actual spell 'Throw Snowball' :evil:

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: Spells - target_type request

Post by John Adams » Sat Jan 09, 2010 10:34 am

Zcoretri wrote:Well, I could not capture the actual spell 'Throw Snowball' :evil:
Why not? Just nothing shows up in the packet, or something's broken?

User avatar
Arremis
Retired
Posts: 388
Joined: Sun Sep 02, 2007 10:11 am
Location: Memphis, TN

Re: Spells - target_type request

Post by Arremis » Sun Jan 10, 2010 1:49 pm

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.

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: Spells - target_type request

Post by John Adams » Sun Aug 18, 2013 1:08 pm

/uber-necro

This is a bug(?) that apparently never got fixed, due to the misunderstanding of the spell type "Enemy".
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 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.

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

Post by Jabantiz » Sun Aug 18, 2013 1:55 pm

If enemy = any then how do we handle enemy only spells?

As for the snowball's
Arremis wrote:Throwing snowballs is an item-activated emote...kind of like the Fireworks illusion :)
so couldn't we use an entity command?

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.

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: Spells - target_type request

Post by John Adams » Sun Aug 18, 2013 2:20 pm

Jabantiz wrote:If enemy = any then how do we handle enemy only spells?
I imagine "friendly_spell" being false would make it a hostile "ANY" spell? FWIW this isn't really about Snowballs :D but caused me to research how to handle casting on NPCs in a friendly manner.


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			1
to

Code: Select all

#define SPELL_TARGET_ANY			1
just so it's original intent is clearer. Anything that referenced SPELL_TARGET_ENEMY changes to SPELL_TARGET_ANY (which was only a few lines of code)


SpellProcess.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
to

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
inside the friendly_spell check

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*/)
also inside the friendly_spell check

I thought the original code might block things like Pet beneficials, but I guess Pet NPCs are flagged "attackable"?

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: Spells - target_type request

Post by John Adams » Sun Aug 18, 2013 2:35 pm

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~

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");
Think that's a problem? :oops: :oops: :oops:

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

Re: Spells - target_type request

Post by Jabantiz » Sun Aug 18, 2013 2:45 pm

Also want to point out that target_type = 1 (enemy) and is_friendly = 1 makes the examine show "Friend"

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: Spells - target_type request

Post by John Adams » Sun Aug 18, 2013 2:46 pm

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

Post by Jabantiz » Sun Aug 18, 2013 2:49 pm

Damn channelers and there dissonance :twisted:

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests