TrinityCore
TrinityCore copied to clipboard
Core/Spells: Unintended orientation overriding for SPELL_EFFECT_TELEPORT_UNITS?
Description
While reviewing #27980 i noticed that spellid 171229 should be using orientation 0 for the teleport, but its overridden by player orientation in the core here: https://github.com/TrinityCore/TrinityCore/blob/8f537b96868647d73aacd576bbe90bda138dd589/src/server/game/Spells/SpellEffects.cpp#L902-L903
So the question is if there are any additional conditions required to override db2 orientation with target orientation or if the code is just outdated.
Related sniff data
ServerToClient: SMSG_SPELL_GO (0x2C39) Length: 144 ConnIdx: 1 Time: 06/11/2022 14:46:21.434 Number: 4986
(Cast) CasterGUID: Full:-snip- Player/0 R1408/S0 Map: 0 (Eastern Kingdoms) Low: -snip-
(Cast) CasterUnit: Full: -snip- Player/0 R1408/S0 Map: 0 (Eastern Kingdoms) Low: -snip-
(Cast) CastID: Full: -snip- Cast/3 R4235/S10998 Map: 1 (Kalimdor) Low: -snip-
(Cast) OriginalCastID: Full: 0x0
(Cast) SpellID: 171229 (Portal Effect: Shattered Landing, Horde)
(Cast) (Visual) SpellXSpellVisualID: 0
(Cast) (Visual) ScriptVisualID: 0
(Cast) CastFlags: 781
(Cast) CastFlagsEx: 16
(Cast) CastTime: 1389173573
(Cast) (MissileTrajectory) TravelTime: 0
(Cast) (MissileTrajectory) Pitch: 0
(Cast) Ammo.DisplayID: 0
(Cast) DestLocSpellCastIndex: 2
(Cast) (Immunities) School: 0
(Cast) (Immunities) Value: 0
(Cast) (Predict) Points: 0
(Cast) (Predict) Type: 0
(Cast) (Predict) BeaconGUID: Full: 0x0
(Cast) HitTargetsCount: 1
(Cast) MissTargetsCount: 0
(Cast) HitStatusCount: 1
(Cast) MissStatusCount: 0
(Cast) RemainingPowerCount: 0
(Cast) HasRuneData: False
(Cast) TargetPointsCount: 0
(Cast) (Target) Flags: 66 (Unit, DestinationLocation)
(Cast) (Target) HasSrcLocation: False
(Cast) (Target) HasDstLocation: True
(Cast) (Target) HasOrientation: True
(Cast) (Target) hasMapID : True
(Cast) (Target) Unit: Full: -snip- Player/0 R1408/S0 Map: 0 (Eastern Kingdoms) Low: -snip-
(Cast) (Target) Item: Full: 0x0
(DstLocation) Transport: Full: 0x0
(DstLocation) Location: X: -11788.7 Y: -3855.65 Z: 60.03
(Cast) (Target) Orientation: 0
(Cast) (Target) MapID: 0
(Cast) (Target) Name:
(Cast) [0] HitTarget: Full: -snip- Player/0 R1408/S0 Map: 0 (Eastern Kingdoms) Low: -snip-
(Cast) [0] HitStatus: 0
ServerToClient: SMSG_NEW_WORLD (0x2598) Length: 44 ConnIdx: 1 Time: 06/11/2022 14:46:22.469 Number: 5084
Map: 0 (Eastern Kingdoms)
Position: X: -11788.7 Y: -3855.65 Z: 60.03 O: 0
Unused901_1: -1
Unused901_2: -1
Reason: 6
MovementOffset: X: 0 Y: 0 Z: 0
Expected behaviour
Orientation should not be overridden
Steps to reproduce the problem
- Use horde character
- Add quest 34398
- Talk to npc entry 149626
- Select first gossip option
- notice orientation isn't 0 after teleport
Branch
master
TC rev. hash/commit
8f537b96868647d73aacd576bbe90bda138dd589
Operating system
Win10
Custom changes
None
#25273 I forgot what I found, something like 'let's remove it because orientation is in spelleffect.EffectPos_facing and doesn't look like there are NULLs or -1 or something like that, so if it's 0, it's 0 and that's it'
would be good if anyone has a good example of a spell where it should actually be set to targets orientation to compare stuff in db2
Maybe we should check spell attributes: https://wow.tools/dbc/?dbc=enumeratedstring&build=2.5.1.39640#page=1&colFilter[1]=Fac&colFilter[4]=134