From 74133edce17236d65915cb510768b80eee968c1f Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 27 Dec 2021 18:11:38 -0500 Subject: [PATCH] Misc fixes/missed stuff --- Source/Framework/Constants/UnitConst.cs | 1 - Source/Game/Calendar/CalendarManager.cs | 2 +- Source/Game/Entities/Player/Player.cs | 4 +- Source/Game/Entities/Unit/Unit.cs | 15 +---- Source/Game/Maps/Instances/InstanceScript.cs | 58 +------------------- Source/Game/Spells/SpellManager.cs | 14 +++++ 6 files changed, 20 insertions(+), 74 deletions(-) diff --git a/Source/Framework/Constants/UnitConst.cs b/Source/Framework/Constants/UnitConst.cs index 510011620..a23466c41 100644 --- a/Source/Framework/Constants/UnitConst.cs +++ b/Source/Framework/Constants/UnitConst.cs @@ -487,7 +487,6 @@ namespace Framework.Constants Unattackable = InFlight, Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove, Controlled = Confused | Stunned | Fleeing, - CantClientControl = Charmed | Fleeing | Confused | Possessed, LostControl = Controlled | Possessed | Jumping | Charging, CannotAutoattack = Controlled | Charging | Casting, Sightless = LostControl | Evade, diff --git a/Source/Game/Calendar/CalendarManager.cs b/Source/Game/Calendar/CalendarManager.cs index 54fbe20e0..f7cd10b6c 100644 --- a/Source/Game/Calendar/CalendarManager.cs +++ b/Source/Game/Calendar/CalendarManager.cs @@ -311,7 +311,7 @@ namespace Game return eventId; } - void FreeInviteId(ulong id) + public void FreeInviteId(ulong id) { if (id == _maxInviteId) --_maxInviteId; diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index fa095136f..ed79a27f1 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -7393,8 +7393,8 @@ namespace Game.Entities } } - public Gender GetNativeGender() { return (Gender)(byte)m_playerData.NativeSex; } - public void SetNativeGender(Gender sex) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.NativeSex), (byte)sex); } + public override Gender GetNativeGender() { return (Gender)(byte)m_playerData.NativeSex; } + public override void SetNativeGender(Gender sex) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.NativeSex), (byte)sex); } public void SetPvpTitle(byte pvpTitle) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.PvpTitle), pvpTitle); } public void SetArenaFaction(byte arenaFaction) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.ArenaFaction), arenaFaction); } public void ApplyModFakeInebriation(int mod, bool apply) { ApplyModUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.FakeInebriation), mod, apply); } diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index fac451e6a..605ccb362 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -921,17 +921,10 @@ namespace Game.Entities if (vehicle.GetBase().IsCreature()) { - // If a player entered a vehicle that is part of a formation, remove it from said formation and replace current movement generator with MoveIdle (no movement) + // If a player entered a vehicle that is part of a formation, remove it from said formation CreatureGroup creatureGroup = vehicle.GetBase().ToCreature().GetFormation(); if (creatureGroup != null) - { creatureGroup.RemoveMember(vehicle.GetBase().ToCreature()); - vehicle.GetBase().GetMotionMaster().MoveIdle(); - } - - // If the vehicle has the random movement generator active, replace it with MoveIdle (no movement) so it won't override player control - if (vehicle.GetBase().GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Random) - vehicle.GetBase().GetMotionMaster().MoveIdle(); } } @@ -1040,14 +1033,8 @@ namespace Game.Entities GetMotionMaster().LaunchMoveSpline(init, EventId.VehicleExit, MovementGeneratorPriority.Highest); if (player != null) - { player.ResummonPetTemporaryUnSummonedIfAny(); - // When a player exits a creature vehicle, restore its default motion generator (if any) - if (vehicle.GetBase().IsCreature()) - vehicle.GetBase().GetMotionMaster().InitializeDefault(); - } - if (vehicle.GetBase().HasUnitTypeMask(UnitTypeMask.Minion) && vehicle.GetBase().IsTypeId(TypeId.Unit)) if (((Minion)vehicle.GetBase()).GetOwner() == this) vehicle.GetBase().ToCreature().DespawnOrUnsummon(vehicle.GetDespawnDelay()); diff --git a/Source/Game/Maps/Instances/InstanceScript.cs b/Source/Game/Maps/Instances/InstanceScript.cs index d5f0532d4..a2acc3c05 100644 --- a/Source/Game/Maps/Instances/InstanceScript.cs +++ b/Source/Game/Maps/Instances/InstanceScript.cs @@ -639,34 +639,7 @@ namespace Game.Maps { var playerList = instance.GetPlayers(); foreach (var player in playerList) - { - player.RemoveAurasDueToSpell(spell); - - if (!includePets) - continue; - - for (byte i = 0; i < SharedConst.MaxSummonSlot; ++i) - { - ObjectGuid summonGUID = player.m_SummonSlot[i]; - if (!summonGUID.IsEmpty()) - { - Creature summon = instance.GetCreature(summonGUID); - if (summon != null) - summon.RemoveAurasDueToSpell(spell); - } - } - - if (!includeControlled) - continue; - - for (var i = 0; i < player.m_Controlled.Count; ++i) - { - Unit controlled = player.m_Controlled[i]; - if (controlled != null) - if (controlled.IsInWorld && controlled.IsCreature()) - controlled.RemoveAurasDueToSpell(spell); - } - } + DoRemoveAurasDueToSpellOnPlayer(player, spell, includePets, includeControlled); } public void DoRemoveAurasDueToSpellOnPlayer(Player player, uint spell, bool includePets = false, bool includeControlled = false) @@ -707,34 +680,7 @@ namespace Game.Maps { var playerList = instance.GetPlayers(); foreach (var player in playerList) - { - player.CastSpell(player, spell, true); - - if (!includePets) - continue; - - for (var i = 0; i < SharedConst.MaxSummonSlot; ++i) - { - ObjectGuid summonGUID = player.m_SummonSlot[i]; - if (!summonGUID.IsEmpty()) - { - Creature summon = instance.GetCreature(summonGUID); - if (summon != null) - summon.CastSpell(player, spell, true); - } - } - - if (!includeControlled) - continue; - - for (var i = 0; i < player.m_Controlled.Count; ++i) - { - Unit controlled = player.m_Controlled[i]; - if (controlled != null) - if (controlled.IsInWorld && controlled.IsCreature()) - controlled.CastSpell(player, spell, true); - } - } + DoCastSpellOnPlayer(player, spell, includePets, includeControlled); } public void DoCastSpellOnPlayer(Player player, uint spell, bool includePets = false, bool includeControlled = false) diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 82f5404d8..32908c842 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -3543,6 +3543,7 @@ namespace Game.Entities }); ApplySpellFix(new[] { + 15538, // Gout of Flame 42490, // Energized! 42492, // Cast Energized 43115 // Plague Vial @@ -3656,6 +3657,12 @@ namespace Game.Entities spellInfo.RecoveryTime = 20000; }); + // Summon Frigid Bones + ApplySpellFix(new[] { 53525 }, spellInfo => + { + spellInfo.DurationEntry = CliDB.SpellDurationStorage.LookupByKey(4); // 2 minutes + }); + // // VIOLET HOLD SPELLS // @@ -4260,6 +4267,13 @@ namespace Game.Entities spellInfo.AttributesEx3 |= SpellAttr3.NoInitialAggro; }); + // Spore - Spore Visual + ApplySpellFix(new[] { 42525 }, spellInfo => + { + spellInfo.AttributesEx3 |= SpellAttr3.DeathPersistent; + spellInfo.AttributesEx2 |= SpellAttr2.CanTargetDead; + }); + // // FIRELANDS SPELLS //