From 64bafe8d737f2b2065555213faf5e08a4d71e668 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 4 Mar 2021 11:47:12 -0500 Subject: [PATCH] Misc cleanups --- Source/Game/Entities/Object/WorldObject.cs | 19 +++++++++---------- Source/Game/Entities/Unit/Unit.Combat.cs | 2 +- Source/Game/Spells/Spell.cs | 4 ++-- Source/Game/Spells/SpellManager.cs | 2 ++ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index c82040008..d437d9371 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -1412,27 +1412,26 @@ namespace Game.Entities return null; } - public TempSummon SummonCreature(uint id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TempSummonType.ManualDespawn, uint despwtime = 0, bool visibleBySummonerOnly = false) + public TempSummon SummonCreature(uint entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TempSummonType.ManualDespawn, uint despawnTime = 0, bool visibleBySummonerOnly = false) { if (x == 0.0f && y == 0.0f && z == 0.0f) - { GetClosePoint(out x, out y, out z, GetCombatReach()); - ang = GetOrientation(); - } - Position pos = new Position(); - pos.Relocate(x, y, z, ang); - return SummonCreature(id, pos, spwtype, despwtime, 0, visibleBySummonerOnly); + + if (o == 0.0f) + o = GetOrientation(); + + return SummonCreature(entry, new Position(x, y, z, o), despawnType, despawnTime, 0, visibleBySummonerOnly); } - public TempSummon SummonCreature(uint entry, Position pos, TempSummonType spwtype = TempSummonType.ManualDespawn, uint duration = 0, uint vehId = 0, bool visibleBySummonerOnly = false) + public TempSummon SummonCreature(uint entry, Position pos, TempSummonType despawnType = TempSummonType.ManualDespawn, uint despawnTime = 0, uint vehId = 0, bool visibleBySummonerOnly = false) { Map map = GetMap(); if (map != null) { - TempSummon summon = map.SummonCreature(entry, pos, null, duration, ToUnit(), 0, vehId, visibleBySummonerOnly); + TempSummon summon = map.SummonCreature(entry, pos, null, despawnTime, ToUnit(), 0, vehId, visibleBySummonerOnly); if (summon != null) { - summon.SetTempSummonType(spwtype); + summon.SetTempSummonType(despawnType); return summon; } } diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index c5137a6bc..7a2102f50 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -1112,7 +1112,7 @@ namespace Game.Entities damage /= (uint)victim.GetHealthMultiplierForTarget(this); - if (victim.GetTypeId() != TypeId.Player && !victim.IsControlledByPlayer() || victim.IsVehicle()) + if (victim.GetTypeId() != TypeId.Player && (!victim.IsControlledByPlayer() || victim.IsVehicle())) { if (!victim.ToCreature().HasLootRecipient()) victim.ToCreature().SetLootRecipient(this); diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index bab561b2f..7ef92597b 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -3543,14 +3543,14 @@ namespace Game.Spells owner.ToPlayer().SendPacket(petCastFailed); } - public static void SendCastResult(Player caster, SpellInfo spellInfo, Networking.Packets.SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError = SpellCustomErrors.None, uint? param1 = null, uint? param2 = null) + public static void SendCastResult(Player caster, SpellInfo spellInfo, SpellCastVisual spellVisual, ObjectGuid castCount, SpellCastResult result, SpellCustomErrors customError = SpellCustomErrors.None, uint? param1 = null, uint? param2 = null) { if (result == SpellCastResult.SpellCastOk) return; CastFailed packet = new CastFailed(); packet.Visual = spellVisual; - FillSpellCastFailedArgs(packet, cast_count, spellInfo, result, customError, param1, param2, caster); + FillSpellCastFailedArgs(packet, castCount, spellInfo, result, customError, param1, param2, caster); caster.SendPacket(packet); } diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 5aaccbf21..a78043db5 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -1954,9 +1954,11 @@ namespace Game.Entities uint oldMSTime = Time.GetMSTime(); mSpellAreaMap.Clear(); // need for reload case + mSpellAreaForAreaMap.Clear(); mSpellAreaForQuestMap.Clear(); mSpellAreaForQuestEndMap.Clear(); mSpellAreaForAuraMap.Clear(); + mSpellAreaForQuestAreaMap.Clear(); // 0 1 2 3 4 5 6 7 8 9 SQLResult result = DB.World.Query("SELECT spell, area, quest_start, quest_start_status, quest_end_status, quest_end, aura_spell, racemask, gender, flags FROM spell_area");