Trinitycore: [3.3.5][6.x] Core/Vehicle: Spawn orientation

Created on 30 May 2016  路  14Comments  路  Source: TrinityCore/TrinityCore

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:

  1. spawn vehicle with accessory in-game either with .npc add command or insert in DB (example NPC entries: 52812, 52809, 35768, 35641, 35640, 32930, all creatures on Wandering Isle with accessories, not yet in DB)

Branch(es): 6.x

TC hash/commit: 468dbd8a65e6362552edcc2f24f94b9e394d37b7

TDB version: 6.04

Operating system: Win7 x64

Branch-3.3.5a Branch-master Comp-Core Sub-Spells Sub-Vehicles

Most helpful comment

@Treeston will not like this, but it's related to spell facing: https://github.com/TrinityCore/TrinityCore/pull/17120

All 14 comments

@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.

  • Creature::FocusTarget never gets past the initial validity checks for this cast. The spell is discarded because it is instant cast and untargeted.
  • Spell facing uses SetFacingTo, e.g. movesplines. The orientation would change client-side if this was caused by spell facing.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rushor picture Rushor  路  3Comments

Jonne733 picture Jonne733  路  3Comments

tje3d picture tje3d  路  3Comments

Teppic1 picture Teppic1  路  3Comments

Rochet2 picture Rochet2  路  3Comments