Description: Many (not all) spawned vehicles that have an accessory, have initial orientation 0 when spawned. I wasn't able to find out where is the exact problem, because parameters in vehicle_template_accessory were always different.
Expected behaviour: Creatures should inherit orientation from DB->creature->orientation field or from summoner.
Steps to reproduce the problem:
Branch(es): 6.x
TC hash/commit: 468dbd8a65e6362552edcc2f24f94b9e394d37b7
TDB version: 6.04
Operating system: Win7 x64
@Treeston will not like this, but it's related to spell facing: https://github.com/TrinityCore/TrinityCore/pull/17120
How is it related to spell facing?
Spells casted to install accessories changes the orientation of the vehicular to 0
Are those spells targeted at anything?
wut >.< those vehicles are common vehicles with accessories. something like this:
INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES
(55918, 56663, 1, 1, 'Ji Firepaw', 8, 0),
(55918, 65476, 2, 1, 'Balloon Air Spirit Bunny', 8, 0),
(55918, 65477, 3, 1, 'Balloon Fire Spirit Bunny', 8, 0);
INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES
(55918, 46598, 0, 0);
And when you spawn 55918, its orientation will be 0.
Same with those NPCs I mentioned in description.
I don"t know if they target accessories or not : http://wotlk.openwow.com/spell=46598
Kologarn example:
id: 65343 [Ride Vehicle Kologarn Arms] effmask: 3 charges: 0 stack: 1 slot 1 duration: -1 maxduration: -1 caster: creature guid: 977
id: 65343 [Ride Vehicle Kologarn Arms] effmask: 3 charges: 0 stack: 1 slot 2 duration: -1 maxduration: -1 caster: creature guid: 978
@Killyana no, the accessory casts that on the vehicle, not the other way round
So yeah @Killyana will not like this, but it's not related to spell facing.
I think it comes from some spells:
1- .go c 6565
2- .gps (Orientation: 3.298670)
3- .cast self 54350
4- .gps (Orientation: 0.000000) notice visually the npc doesn't change the orientation on client side
5- Go far to unload the grid then come back to this npc, the orientation=0 will be updated on client side
I just tried this with debug code in spell facing methods.
Maybe it helps, call stack from killyana's repro steps:
game.dll!Position::SetOrientation(float orientation=0.000000000) Line 103 C++
game.dll!Position::Relocate(float x=0.000000000, float y=0.000000000, float z=0.000000000, float orientation=0.000000000) Line 87 C++
> game.dll!SpellDestination::SpellDestination() Line 63 C++
game.dll!SpellCastTargets::SpellCastTargets() Line 109 C++
game.dll!Unit::CastSpell(Unit * victim=0x0000020590e1c2f0, const SpellInfo * spellInfo=0x00000205b64bac90, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item * castItem=0x0000000000000000, const AuraEffect * triggeredByAura=0x0000000000000000, ObjectGuid originalCaster={...}) Line 919 C++
game.dll!Unit::CastSpell(Unit * victim=0x0000020590e1c2f0, unsigned int spellId=54350, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item * castItem=0x0000000000000000, const AuraEffect * triggeredByAura=0x0000000000000000, ObjectGuid originalCaster={...}) Line 910 C++
game.dll!Unit::CastSpell(Unit * victim=0x0000020590e1c2f0, unsigned int spellId=54350, bool triggered=false, Item * castItem=0x0000000000000000, const AuraEffect * triggeredByAura=0x0000000000000000, ObjectGuid originalCaster={...}) Line 898 C++
scripts_commands.0.dll!cast_commandscript::HandleCastSelfCommand(ChatHandler * handler=0x0000005b2b9ed2e8, const char * args=0x00000205866f965b) Line 197 C++
@sirikfoll are you sure that this Position::Relocate call affects the _Unit_? It's a call on the SpellDestination::_position, the way I see it...
any news?
6 months and nothing. This is fucking up my spawning.
Most helpful comment
@Treeston will not like this, but it's related to spell facing: https://github.com/TrinityCore/TrinityCore/pull/17120