From af29d3158e068ce995962fedcc91ffc48a6eb421 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 30 May 2022 15:09:02 -0400 Subject: [PATCH] Misc stuff --- Source/Game/Entities/Unit/Unit.Movement.cs | 8 ++--- .../Networking/Packets/MovementPackets.cs | 2 +- Source/Game/Spells/SpellManager.cs | 3 +- Source/Scripts/Spells/Generic.cs | 29 +++++++++++++++++++ Source/Scripts/World/GameObject.cs | 20 ------------- 5 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index b1b86ad6f..7504bc517 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -685,7 +685,7 @@ namespace Game.Entities return IsInDist(obj, objBoundaryRadius); } - public bool SetDisableGravity(bool disable, bool updateAnimationTier = true) + public bool SetDisableGravity(bool disable, bool updateAnimTier = true) { if (disable == IsGravityDisabled()) return false; @@ -718,7 +718,7 @@ namespace Game.Entities SendMessageToSet(packet, true); } - if (IsCreature() && updateAnimationTier && IsAlive() && !HasUnitState(UnitState.Root) && !ToCreature().GetMovementTemplate().IsRooted()) + if (IsCreature() && updateAnimTier && IsAlive() && !HasUnitState(UnitState.Root) && !ToCreature().GetMovementTemplate().IsRooted()) { if (IsGravityDisabled()) SetAnimTier(AnimTier.Fly); @@ -1047,7 +1047,7 @@ namespace Game.Entities return true; } - public bool SetHover(bool enable, bool updateAnimationTier = true) + public bool SetHover(bool enable, bool updateAnimTier = true) { if (enable == HasUnitMovementFlag(MovementFlag.Hover)) return false; @@ -1093,7 +1093,7 @@ namespace Game.Entities SendMessageToSet(packet, true); } - if (IsCreature() && updateAnimationTier && IsAlive() && !HasUnitState(UnitState.Root) && !ToCreature().GetMovementTemplate().IsRooted()) + if (IsCreature() && updateAnimTier && IsAlive() && !HasUnitState(UnitState.Root) && !ToCreature().GetMovementTemplate().IsRooted()) { if (IsGravityDisabled()) SetAnimTier(AnimTier.Fly); diff --git a/Source/Game/Networking/Packets/MovementPackets.cs b/Source/Game/Networking/Packets/MovementPackets.cs index 688fc5abf..ca742a212 100644 --- a/Source/Game/Networking/Packets/MovementPackets.cs +++ b/Source/Game/Networking/Packets/MovementPackets.cs @@ -229,7 +229,7 @@ namespace Game.Networking.Packets data.WriteBit(false); // HasSplineFilter data.WriteBit(moveSpline.spell_effect_extra != null); // HasSpellEffectExtraData bool hasJumpExtraData = data.WriteBit(moveSpline.splineflags.HasFlag(SplineFlag.Parabolic) && (moveSpline.spell_effect_extra == null || moveSpline.effect_start_time != 0)); - data.WriteBit(moveSpline.anim_tier != null); // HasAnimationTierTransition + data.WriteBit(moveSpline.anim_tier != null); // HasAnimTierTransition data.WriteBit(false); // HasUnknown901 data.FlushBits(); diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 11b5caadd..860ad669c 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -3279,7 +3279,8 @@ namespace Game.Entities 46008, // Negative Energy 45641, // Fire Bloom 55665, // Life Drain - Sapphiron (H) - 28796 // Poison Bolt Volly - Faerlina + 28796, // Poison Bolt Volly - Faerlina + 37135 // Domination }, spellInfo => { spellInfo.MaxAffectedTargets = 5; diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index cdbbcea3f..c2fe5a12c 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -3398,6 +3398,35 @@ namespace Scripts.Spells.Generic } } + [Script] + class spell_gen_whisper_to_controller : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return CliDB.BroadcastTextStorage.HasRecord((uint)spellInfo.GetEffect(0).CalcValue()); + } + + void HandleScript(uint effIndex) + { + Unit caster = GetCaster(); + if (caster != null) + { + TempSummon casterSummon = caster.ToTempSummon(); + if (casterSummon != null) + { + Player target = casterSummon.GetSummonerUnit().ToPlayer(); + if (target != null) + casterSummon.Whisper((uint)GetEffectValue(), target, false); + } + } + } + + public override void Register() + { + OnEffectHit.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect)); + } + } + [Script] class spell_gen_eject_all_passengers : SpellScript { diff --git a/Source/Scripts/World/GameObject.cs b/Source/Scripts/World/GameObject.cs index b09cf5cbe..0636bb562 100644 --- a/Source/Scripts/World/GameObject.cs +++ b/Source/Scripts/World/GameObject.cs @@ -544,26 +544,6 @@ namespace Scripts.World.GameObjects } } - [Script] - class go_frostblade_shrine : GameObjectAI - { - public go_frostblade_shrine(GameObject go) : base(go) { } - - public override bool OnGossipHello(Player player) - { - me.UseDoorOrButton(10); - if (!player.HasAura(SpellIds.RecentMeditation)) - { - if (player.GetQuestStatus(QuestIds.TheCleansingHorde) == QuestStatus.Incomplete || player.GetQuestStatus(QuestIds.TheCleansingAlliance) == QuestStatus.Incomplete) - { - player.CastSpell(player, SpellIds.CleansingSoul); - player.SetStandState(UnitStandStateType.Sit); - } - } - return true; - } - } - [Script] class go_midsummer_bonfire : GameObjectAI {