Implementing: Implied Targets

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:

Re: Implementing: Implied Targets

Post by John Adams » Sat Mar 10, 2012 1:12 pm

Holy crap there is a lot to consider when doing cast-through targeting. Just now testing, I found that by targeting my tank and casting Divine Smite, my tank's combat window says HE is smiting the mob with divine smite :(

This keeps growing and growing lol :(

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: Implementing: Implied Targets

Post by alfa » Sat Mar 10, 2012 6:25 pm

Not think there is a lot things to take care.

Simply set an event at player cast,

If player (you) target a mob :
- If mob's target is ally (or yourself) all "good spell" cast on mob target (so ally or you), all "attack" spells cast on your target.
- If mob's target is ennemy, don't take care, "good spell" cast on you and "attack spell" cast on your target

If player (you) target another player (ally) :
- If ally's target is ennemy, All "good spell" cast on your target, all "attack" spells cast on ally's target.
- If ally's target is ally, don't take care, "good spell" cast on your target "attack spell" cannot be cast.
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

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: Implementing: Implied Targets

Post by John Adams » Sat Mar 10, 2012 11:09 pm

Since that is so simple, please have it coded for us to try out quickly :)

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: Implementing: Implied Targets

Post by alfa » Sun Mar 11, 2012 3:10 am

Yep, you know J.A. If you don't need help, call me :p
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

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: Implementing: Implied Targets

Post by John Adams » Sun Mar 11, 2012 9:44 am

LOL alfa :D

Just so you understand, it is no simple thing. There are dozens of checks to consider throughout many functions across many modules. As my notes above state, lots more being discovered than simply "target, attack, beneficial" etc. I have been staring at this code for days, and while it makes sense what I need to do, I have yet to discover all the details of what have to be changed so I ask my questions here hoping for help in at least understanding.

"Cast Through" is also more than just casting spells/abilities. Apparently, it is also melee and other forms of attack. I hadn't considered that in my initial implementation, that's why I removed it before committing other work. We'll get it working, just might take longer than I had hoped (being a novice C++ developer that I am).

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: Implementing: Implied Targets

Post by alfa » Sun Mar 11, 2012 1:01 pm

I know John, same here just know VB.net nothing else...

If you need some info about game mechanics, just ask, I have spent a long time to understand all that.
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

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: Implementing: Implied Targets

Post by John Adams » Mon Mar 12, 2012 11:45 am

Back to the targets target question then.

If I have an NPC targeted, and that NPC is beating the snot out of my tank, I can cast "Heal" on my target (the NPC) and it will >cast-through< to my tank, saving his life?

And otherwise, my attack (melee or detrimental spells/abilities) will hit the NPC only?

Thanks

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: Implementing: Implied Targets

Post by alfa » Mon Mar 12, 2012 12:08 pm

Yes, if you cast a heal, it goes to the tank, cause is benefict spell
Also if you attack it goes on npc only or npc group if you cast a group attack spell
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

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

Re: Implementing: Implied Targets

Post by Jabantiz » Sun Aug 05, 2012 7:46 pm

Did you guys ever get the window to open/update?

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

Re: Implementing: Implied Targets

Post by Zcoretri » Mon Aug 06, 2012 6:52 am

Not that I'm aware of.

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: Implementing: Implied Targets

Post by John Adams » Mon Aug 06, 2012 9:51 am

No, being I am not a packet junky, all I was trying to do was get the attack/cast-thru to work, which I did (see my commented code) but too many variables to consider, and I ran into a lack of knowledge. Decided to wait.

It's on 0.7.1 only because you are messing with Combat now, but it can wait til next release if it's too big. Something we've needed in emu since combat was first implemented, but keeps slipping through the cracks.

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

Re: Implementing: Implied Targets

Post by Zcoretri » Mon Aug 06, 2012 10:32 am

Don't know if we have tried to figure out what the unknowns do in these two structs, but throwing the idea out there that maybe setting the unknown to a non zero value enables implied target?

Code: Select all

<Struct Name="WS_UpdateTarget" ClientVersion="1" OpcodeName="OP_UpdateTargetMsg">
<Data ElementName="spawn_index" Type="int16" Size="1" />
<Data ElementName="unknown" Type="int8" Size="1" />
</Struct>

<Struct Name="WS_ServerUpdateTarget" ClientVersion="1" OpcodeName="OP_ClientCmdMsg" OpcodeType="OP_EqUpdateTargetCmd">
<Data ElementName="spawn_id" Type="int32" Size="1" />
<Data ElementName="unknown" Type="int8" Size="1" />
EDIT: Looked at a log tonight that is supposed to have implied targets in log and never saw the unknown be anything different than a 0 :(

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

Re: Implementing: Implied Targets

Post by Jabantiz » Fri May 10, 2013 3:59 pm

EQ2EmuImpliedTargetUI.png
Got the implied target window to show in CoE+ clients. It is actually part of the spawn info struct which poses a problem. Spawns save packets for different client versions for quick reference, I had to bypass this so now the info struct is recreated every time an update packet is sent. I have to do this as I need to put a spawn id in the info struct and the id can vary across clients. Not sure why it isn't working in the DoV client, must have the element placed wrong in the struct, it also doesn't seem to update right away on CoE, so lot of work to get the ui portion working properly but at least we know where it is.

Also, the id used is (spawn_id * -1) - 1 no clue why they do this but I am starting to notice this pop up a lot (in the pet packet, also the follow target in the info packet)
You do not have the required permissions to view the files attached to this post.

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

Re: Implementing: Implied Targets

Post by Jabantiz » Fri May 24, 2013 7:26 pm

Got this to update properly now, should work in DoV as well as CoE+ clients.

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

Re: Implementing: Implied Targets

Post by thefoof » Sun Jul 14, 2013 2:41 pm

Going to see if I can attempt to work on this a little bit, I've gotten spells to cast through target but the range-check is still applied to the first target, and when in combat the player does not face the implied target, or auto attack.

Testing the spell casting code a little more before I commit.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests