From 5bb3eb95b4f8469bdd6f7594a289fc1d998d6da9 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 14 Aug 2019 23:38:58 -0400 Subject: [PATCH] Core/Spells: Corrected summon category SUMMON_CATEGORY_VEHICLE Port TrinityCore Commit: https://github.com/TrinityCore/TrinityCore/commit/68cc366d88fd9cb4c759dc991568d994a29ba23e --- Source/Game/Spells/SpellEffects.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 9f5b5a3b7..243a998c7 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -1843,12 +1843,19 @@ namespace Game.Spells // The spell that this effect will trigger. It has SPELL_AURA_CONTROL_VEHICLE uint spellId = SharedConst.VehicleSpellRideHardcoded; - SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo((uint)effectInfo.CalcValue()); - if (spellInfo != null && spellInfo.HasAura(m_originalCaster.GetMap().GetDifficultyID(), AuraType.ControlVehicle)) - spellId = spellInfo.Id; + int basePoints = effectInfo.CalcValue(); + if (basePoints > SharedConst.MaxVehicleSeats) + { + SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo((uint)basePoints); + if (spellInfo != null && spellInfo.HasAura(m_originalCaster.GetMap().GetDifficultyID(), AuraType.ControlVehicle)) + spellId = spellInfo.Id; + } - // Hard coded enter vehicle spell - m_originalCaster.CastSpell(summon, spellId, true); + // if we have small value, it indicates seat position + if (basePoints > 0 && basePoints < SharedConst.MaxVehicleSeats) + m_originalCaster.CastCustomSpell(spellId, SpellValueMod.BasePoint0, basePoints, summon, true); + else + m_originalCaster.CastSpell(summon, spellId, true); uint faction = properties.Faction; if (faction == 0)