Trinitycore: [3.3.5] Spells with TARGET_DEST_DEST_BACK

Created on 17 Jan 2018  路  17Comments  路  Source: TrinityCore/TrinityCore

Description: Spells with TARGET_DEST_DEST_BACK is hitting targets in left/right of caster.

Current behaviour: In encounters like Sindragosa, you get hits of SPELL_TAIL_SMASH (71077) even if you not in Sindragosa back.

Expected behaviour: You get hits of Tail Smash only when you are in Sindragosa Back.

It's not caused by "Dragon model", it is broken to players too.

Try it putting 2 characters in Duel. use macro: .cast self 71077 in Character A, and check that you can got hits in Character B even when you not in Character A back.

Branch(es): 3.3.5

TC rev. hash/commit: ccf0807be0974dfb8080cb2fc6ea616cc96f062c

@chaodhib / @Golrag can take a look?
maybe can be related with recent changes of range stuffs xd

Branch-3.3.5a Comp-Core Sub-Spells

Most helpful comment

What happens right now:

  • SelectImplicitDestDestTargets is called and select caster position + spell range (20yards) to the back as destination for the spell, then SearchAreaTargets looks for players within 20 yards from this point (which is too close and hit players that are not supposed to)
  • SelectImplicitDestDestTargets is called again and adds another 20yards to the old position, this one is used for the packet and is not the intented position.

What should happen (probably):

  • SelectImplicitDestDestTargets needs to select a destination calculated as (caster's combat reach / 2 + spell range) at the back of caster positionl, then SearchAreaTargets looks for players within 20 yards from this point (here the 360潞 check might be right)

The (caster's combat reach / 2 + spell range) formula is a guess, but looks very accurate when comparing with the ones present in sniffs. Also, destination positionZ should be at ground level.

In the piture I marked some points of interest:
1 - Center of the boss
2 - Position where core is selecting targets right now (wrong)
3 - Blizzlike hit position where core should be selecting target
4 - TC final hit position (wrong)
wowscrnshot_090918_231332

Code I used for testing (this is not a fix!):

diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index ea26f14c5a..723914bd9f 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1474,7 +1474,8 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
             if (targetType.GetTarget() == TARGET_DEST_DEST_RANDOM)
                 dist *= float(rand_norm());

-            Position pos = dest._position;
+            Position pos = m_caster->GetPosition();
+            dist += m_caster->GetCombatReach() / 2;
             m_caster->MovePositionToFirstCollision(pos, dist, angle);

             dest.Relocate(pos);

All 17 comments

depends on how core defines "back". i guess we use 180掳 right now, and it should be less - but how much? is it identical for all spells?

To me it seems to be something like 360潞 right now, Sindragosa's tank takes spell sometimes :P

yeah, but right now 90潞 and 270潞 is included xD

i meant cone of 180掳 radius, so from 90掳 to 270掳 relative, yes. the fact that the cone is centered on the dragon's rearside is to be assumed.

try with a player, i think that you can see better xd

So the remaining question is, what should be the opening angle of the cone. Less than 180掳 most likely. But is it more than 90掳? Less?

The answer lies somewhere in the sniffs. Or by experimenting with that class of spell in retail (by moving a bit, launching the spell. take note of position and if hit or not. then repeat).

Or, alternatively the answer lies in legion spell data (it is now in the client)

I haven't really looked at it very closely but it seems to me that you only get knocked back if you are within the range of the effect (20y). The effect hits at some distance at his back, like it should but does indeed just a "circle" aoe around it instead of a cone ? Seems like in Spell::SelectImplicitAreaTargets calls SearchAreaTargets which does not really care about a cone.
I might be completely misunderstanding the issue tho

@Golrag put 2 characters side by side in duel and try cast Tail
You will got knockback in a place that is not character back.

Yea I got that. What I'm trying to say here is that right now you are hit when you're in front of the caster only when you are in range (20y) might include combatreach, not sure.

Screenshot: cow is where the "center" of the aoe takes place.
Here Orcwarrior got knocked back when Golrag did the cast.
wowscrnshot_011818_131905

Here Orcwarrior did not get knocked back when Golrag did the cast.
wowscrnshot_011818_132039

So, to make sure I got this correctly - you're saying tail swipe should hit in a circle centered on the back point of the dragon's hitbox?

Well I'm not sure how it works on retail and so how it should work. I just commented what I noticed right now and how it works with our data. If the spell data is correct and should indeed do a circle aoe at that location then maybe we should take a look at the range of it or check if the circle aoe is spawned far enough.

@Shauren what does the client data you allude to say?

From my understanding, and from previous raid experience, a tail swipe from a dragon in this case originates from the center of the creature, backwards in a cone to the end of the tail model (depending on spell range i imagine). That's why we usually grouped up at the hind legs of the dragon during most fights, as it was outside of said cone, but still considered behind the creature, for rogue backstabs etc.

Not sure if this would be considered a proper source, but I remember using this addon during wrath. It marked areas on the ground, like the cone of a dragons tail swipe, and from what I can recall it was very accurate in most fights like Onyxia, sapphiron and sindragosa.

https://www.wowace.com/projects/avr

this is part of the solution. The angles need proper calculations.

See:
https://gist.github.com/Langerz82/371ab2e61c0dd774c7baa252cadb17a6

Do NOT apply patch for testing.

What happens right now:

  • SelectImplicitDestDestTargets is called and select caster position + spell range (20yards) to the back as destination for the spell, then SearchAreaTargets looks for players within 20 yards from this point (which is too close and hit players that are not supposed to)
  • SelectImplicitDestDestTargets is called again and adds another 20yards to the old position, this one is used for the packet and is not the intented position.

What should happen (probably):

  • SelectImplicitDestDestTargets needs to select a destination calculated as (caster's combat reach / 2 + spell range) at the back of caster positionl, then SearchAreaTargets looks for players within 20 yards from this point (here the 360潞 check might be right)

The (caster's combat reach / 2 + spell range) formula is a guess, but looks very accurate when comparing with the ones present in sniffs. Also, destination positionZ should be at ground level.

In the piture I marked some points of interest:
1 - Center of the boss
2 - Position where core is selecting targets right now (wrong)
3 - Blizzlike hit position where core should be selecting target
4 - TC final hit position (wrong)
wowscrnshot_090918_231332

Code I used for testing (this is not a fix!):

diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index ea26f14c5a..723914bd9f 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1474,7 +1474,8 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
             if (targetType.GetTarget() == TARGET_DEST_DEST_RANDOM)
                 dist *= float(rand_norm());

-            Position pos = dest._position;
+            Position pos = m_caster->GetPosition();
+            dist += m_caster->GetCombatReach() / 2;
             m_caster->MovePositionToFirstCollision(pos, dist, angle);

             dest.Relocate(pos);

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rushor picture Rushor  路  3Comments

cbcs picture cbcs  路  3Comments

Lopfest picture Lopfest  路  3Comments

tje3d picture tje3d  路  3Comments

Jildor picture Jildor  路  3Comments