Trinitycore: [3.3.5] Issue with MoveJump in Trial of Crusader

Created on 24 Nov 2017  路  12Comments  路  Source: TrinityCore/TrinityCore

Description: In the Northrend Beasts fight, Icehowl should use spell Jump Back (66733) in the middle of room.
Issue is: after casting it, he will go underground of the object.
Spell Jump Back is a SPELL_EFFECT_LEAP_BACK .

https://youtu.be/dRUI65GxwLI

Steps to reproduce the problem:

  1. Go to Trial of Crusader in the middle of room (.go xyz 563.67297 139.571 393.837006 649) - sniffed position
  2. Summon a Icehowl (.npc add temp 34797)
  3. Use Macro in Icehowl .cast self 66733

He will fall off the map and ignore walls too.

PS: MMaps is disabled in Trial of Crusader.
PS虏: Even with MMaps enabled in Trial of Crusader this issue happens.
PS鲁: Spell works fine if cast by a Player.

This spell is not present in the current script of Icehowl (it is handled by a MoveJump directly) - https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp#L1092

But this spell will enter in your script soon...

Branch(es): 3.3.5

TC rev. hash/commit: b70a923714d8a6afc7850010404c8ed3f238803f

Scripts like the one below don't work.

class spell_icehowl_jump_back : public SpellScript
{
    PrepareSpellScript(spell_icehowl_jump_back);

    void RelocatePositionOffset(SpellEffIndex /*effIndex*/)
    {
        Unit* caster = GetCaster();
        WorldLocation* location = GetHitDest();
        float z = caster->GetMap()->GetHeight(caster->GetPhaseMask(), location->GetPositionX(), location->GetPositionY(), location->GetPositionZ() + 5.0f);
        location->RelocateOffset({ 0.0f, 0.0f, z, 0.0f });
    }

    void Register() override
    {
        OnEffectHitTarget += SpellEffectFn(spell_icehowl_jump_back::RelocatePositionOffset, EFFECT_1, SPELL_EFFECT_LEAP_BACK);
    }
};
Branch-3.3.5a Comp-Core Sub-Instances Sub-Spells

Most helpful comment

Got a fix on local which would fix https://github.com/TrinityCore/TrinityCore/issues/19976 as well (or at least i hope so). Only thing I tested was this issue so I would have to look at most caves etc to see if I did not break anything / made thing worse. Maybe a PR tomorrow :p

All 12 comments

@chaodhib any idea?

I think the core is using the the function to get the ground level which probably ignores the platform. Players probably do not have that problem since they can kinda skip the drop throuh the ground by cmsg movement messages ( I guess)

With the given position he did not go undermap with me (always jumped to the entrance), so I tried other places where it bugged.
Also, he never jumped backwards with me D: so I might be missing something

GetNearPoint2D(x, y, distance2d+searcher_size, absAngle); may give an x,y value not in LoS. It may be a place behind a wall where there no direct floor either, so when UpdateAllowedPositionZ is called, the z value will be lower than the current value.
Leading to a movejump call with coordinates below the floor.
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Movement/MotionMaster.cpp#L460

Try in X: 556.255798 Y: 139.220856 Z: 393.990173 Orientation: 3.109080

https://youtu.be/dRUI65GxwLI

Okay nvm what I just said :D
620.541931 139.220840 393.990173 this is the coordinate used before UpdateAllowedPositionZ in GetNearPoint (in the loop), it's also the same x,y he will jump to. this is slightly below the gameobject (yet it is in line of sight) so when UpdateAllowedPositionZ is called z will be 377.851746

Edit: (screenshot) https://puu.sh/ysHEL/ef13c9a35b.png

https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Object/Object.cpp#L1237
Pretty sure that +2.0f is the reason it says it is in line of sight.
Edit: it is

Any sniffs of where he should/could land ? :p

I made some changes to include midsection height when calculating LoS as well as adding CollisionHeight to z in UpdateAllowedPositionZ before calculating the ground/floor but it now none of the positions are in LoS so it's going back to the first one it found. Doubt on retail he is jumping out of LoS

He always land in diff place.
Because he target a random player and use spell Jump Back (and Jump Back will change dest target based in boss orientation)
Btw, check if it can help you and if you need a complete sniff, talk to me on irc

ServerToClient: SMSG_ON_MONSTER_MOVE (0x00DD) Length: 56 ConnIdx: 0 Time: 08/12/2010 17:01:01.000
GUID: Full: 0xF1300087ED0000C9 Type: Creature Entry: 34797 (Icehowl) Low: 201
Toggle AnimTierInTrans: false
Position: X: 526.9581 Y: 113.0944 Z: 395.211
Move Ticks: 1132
Spline Type: Normal (0)
Spline Flags: Trajectory, WalkMode (6144)
Move Time: 711
Vertical Speed: 31.65051
Async-time in ms: 0
Waypoints: 1
Waypoint Endpoint: X: 563.6129 Y: 139.9931 Z: 394.7847


ServerToClient: SMSG_SPELL_START (0x0131) Length: 35 ConnIdx: 0 Time: 08/12/2010 17:01:11.000 
Caster GUID: Full: 0xF1300087ED0000C9 Type: Creature Entry: 34797 (Icehowl) Low: 201
Caster Unit GUID: Full: 0xF1300087ED0000C9 Type: Creature Entry: 34797 (Icehowl) Low: 201
Cast Count: 0
Spell ID: Jump Back (66733)
Cast Flags: HasTrajectory, Unknown3 (10)
Time: 250
Target Flags: Unit (2)
Target GUID: Full: 0xF1300088F60000CB Type: Creature Entry: 35062 (Furious Charge Stalker) Low: 203

ServerToClient: SMSG_SPELL_GO (0x0132) Length: 53 ConnIdx: 0 Time: 08/12/2010 17:01:11.000
Caster GUID: Full: 0xF1300087ED0000C9 Type: Creature Entry: 34797 (Icehowl) Low: 201
Caster Unit GUID: Full: 0xF1300087ED0000C9 Type: Creature Entry: 34797 (Icehowl) Low: 201
Cast Count: 0
Spell ID: Jump Back (66733)
Cast Flags: Unknown3, Unknown7 (264)
Time: 1732226856
Hit Count: 2
[0] Hit GUID: Full: 0xF1300088F60000CB Type: Creature Entry: 35062 (Furious Charge Stalker) Low: 203
[1] Hit GUID: Full: 0xF1300087ED0000C9 Type: Creature Entry: 34797 (Icehowl) Low: 201
Miss Count: 0
Target Flags: Unit (2)
Target GUID: Full: 0xF1300088F60000CB Type: Creature Entry: 35062 (Furious Charge Stalker) Low: 203

ServerToClient: SMSG_ON_MONSTER_MOVE (0x00DD) Length: 56 ConnIdx: 0 Time: 08/12/2010 17:01:11.000
GUID: Full: 0xF1300087ED0000C9 Type: Creature Entry: 34797 (Icehowl) Low: 201
Toggle AnimTierInTrans: false
Position: X: 563.6129 Y: 139.9931 Z: 394.7847
Move Ticks: 1144
Spline Type: Normal (0)
Spline Flags: Trajectory, WalkMode, Knockback (22528)
Move Time: 1037
Vertical Speed: 19.2911
Async-time in ms: 0
Waypoints: 1
Waypoint Endpoint: X: 599.7919 Y: 142.7794 Z: 394.6787

That's enough for me :D
GetClosePoint in MoveJumpTo gets called with the combatreach which is the cause of going to a point behind the walls. I think we can safely remove that part (I don't think it should matter when jumping)

Got a fix on local which would fix https://github.com/TrinityCore/TrinityCore/issues/19976 as well (or at least i hope so). Only thing I tested was this issue so I would have to look at most caves etc to see if I did not break anything / made thing worse. Maybe a PR tomorrow :p

95456ab5d8bd623481d315ae55dfbb44b45ba9f5

Was this page helpful?
0 / 5 - 0 ratings