From 6035dc5224c4aaace9a4776eb494df31c295ea36 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 17 Dec 2021 17:20:01 -0500 Subject: [PATCH] Script/Creature: calculate Traveler's Tundra Mammoth's NPCs' exit position based on current player's position Port From (https://github.com/TrinityCore/TrinityCore/commit/b3e7be5387f1350c7eefe242b6da8b2caa8447d1) --- Source/Scripts/World/NpcSpecial.cs | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Source/Scripts/World/NpcSpecial.cs b/Source/Scripts/World/NpcSpecial.cs index 70b88fd20..3d4a59bc1 100644 --- a/Source/Scripts/World/NpcSpecial.cs +++ b/Source/Scripts/World/NpcSpecial.cs @@ -112,6 +112,12 @@ namespace Scripts.World.NpcSpecial public const uint TheStuffingChair = 34819; public const uint TheSweetPotatoChair = 34824; public const uint ThePieChair = 34822; + + // TravelerTundraMammothNPCs + public const uint HakmudOfArgus = 32638; + public const uint Gnimo = 32639; + public const uint DrixBlackwrench = 32641; + public const uint Mojodishu = 32642; } struct GameobjectIds @@ -2345,6 +2351,32 @@ namespace Scripts.World.NpcSpecial } } + [Script] + class npc_traveler_tundra_mammoth_exit_pos : UnitScript + { + public npc_traveler_tundra_mammoth_exit_pos() : base("npc_traveler_tundra_mammoth_exit_pos") { } + + public override void ModifyVehiclePassengerExitPos(Unit passenger, Vehicle vehicle, Position pos) + { + if (passenger.IsCreature()) + { + switch (passenger.GetEntry()) + { + // Right side + case CreatureIds.DrixBlackwrench: + case CreatureIds.Gnimo: + pos.RelocateOffset(new Position(-2.0f, -2.0f, 0.0f, 0.0f)); + break; + // Left side + case CreatureIds.Mojodishu: + case CreatureIds.HakmudOfArgus: + pos.RelocateOffset(new Position(-2.0f, 2.0f, 0.0f, 0.0f)); + break; + } + } + } + } + class CastFoodSpell : BasicEvent { Unit _owner;