Page 2 of 3

Re: Implementing: Implied Targets

Posted: Sat Mar 10, 2012 1:12 pm
by John Adams
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 :(

Re: Implementing: Implied Targets

Posted: Sat Mar 10, 2012 6:25 pm
by alfa
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.

Re: Implementing: Implied Targets

Posted: Sat Mar 10, 2012 11:09 pm
by John Adams
Since that is so simple, please have it coded for us to try out quickly :)

Re: Implementing: Implied Targets

Posted: Sun Mar 11, 2012 3:10 am
by alfa
Yep, you know J.A. If you don't need help, call me :p

Re: Implementing: Implied Targets

Posted: Sun Mar 11, 2012 9:44 am
by John Adams
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).

Re: Implementing: Implied Targets

Posted: Sun Mar 11, 2012 1:01 pm
by alfa
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.

Re: Implementing: Implied Targets

Posted: Mon Mar 12, 2012 11:45 am
by John Adams
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

Re: Implementing: Implied Targets

Posted: Mon Mar 12, 2012 12:08 pm
by alfa
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

Re: Implementing: Implied Targets

Posted: Sun Aug 05, 2012 7:46 pm
by Jabantiz
Did you guys ever get the window to open/update?

Re: Implementing: Implied Targets

Posted: Mon Aug 06, 2012 6:52 am
by Zcoretri
Not that I'm aware of.

Re: Implementing: Implied Targets

Posted: Mon Aug 06, 2012 9:51 am
by John Adams
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.

Re: Implementing: Implied Targets

Posted: Mon Aug 06, 2012 10:32 am
by Zcoretri
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 :(

Re: Implementing: Implied Targets

Posted: Fri May 10, 2013 3:59 pm
by Jabantiz
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)

Re: Implementing: Implied Targets

Posted: Fri May 24, 2013 7:26 pm
by Jabantiz
Got this to update properly now, should work in DoV as well as CoE+ clients.

Re: Implementing: Implied Targets

Posted: Sun Jul 14, 2013 2:41 pm
by thefoof
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.