From c3e8791aac48d298fe902d0b387e1ef226ce9f02 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 24 May 2022 13:20:05 -0400 Subject: [PATCH] Misc fixes --- Source/Framework/Constants/SharedConst.cs | 2 +- Source/Game/AI/SmartScripts/SmartScript.cs | 4 +- Source/Game/Chat/Commands/MMapsCommands.cs | 2 +- Source/Game/Chat/Commands/MiscCommands.cs | 2 +- Source/Game/Spells/SpellManager.cs | 8 ++ Source/Scripts/Spells/Quest.cs | 17 ++--- Source/Scripts/World/GameObject.cs | 86 ---------------------- Source/Scripts/World/NpcSpecial.cs | 40 ---------- 8 files changed, 18 insertions(+), 143 deletions(-) diff --git a/Source/Framework/Constants/SharedConst.cs b/Source/Framework/Constants/SharedConst.cs index 81e0055c2..9eb685fda 100644 --- a/Source/Framework/Constants/SharedConst.cs +++ b/Source/Framework/Constants/SharedConst.cs @@ -79,7 +79,7 @@ namespace Framework.Constants /// /// Loot Const /// - public const int MaxNRLootItems = 16; + public const int MaxNRLootItems = 18; public const int MaxNRQuestItems = 32; public const int PlayerCorpseLootEntry = 1; diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 4fdc46992..badd189e8 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -1403,8 +1403,8 @@ namespace Game.AI break; // Set the timer to 1 ms so the path will be resumed on next update loop - if (((SmartAI)_me.GetAI()).CanResumePath()) - ((SmartAI)_me.GetAI()).SetWPPauseTimer(1); + if (_me.GetAI().CanResumePath()) + _me.GetAI().SetWPPauseTimer(1); break; } case SmartActions.SetOrientation: diff --git a/Source/Game/Chat/Commands/MMapsCommands.cs b/Source/Game/Chat/Commands/MMapsCommands.cs index 8b6b18d1e..9afb94f0b 100644 --- a/Source/Game/Chat/Commands/MMapsCommands.cs +++ b/Source/Game/Chat/Commands/MMapsCommands.cs @@ -105,7 +105,7 @@ namespace Game.Chat player.GetPosition(out x, out y, out z); handler.SendSysMessage("{0:D4}{1:D2}{2:D2}.mmtile", player.GetMapId(), gy, gx); - handler.SendSysMessage("gridloc [{0}, {1}]", gx, gy); + handler.SendSysMessage("tileloc [{0}, {1}]", gx, gy); // calculate navmesh tile location uint terrainMapId = PhasingHandler.GetTerrainMapId(player.GetPhaseShift(), player.GetMap(), x, y); diff --git a/Source/Game/Chat/Commands/MiscCommands.cs b/Source/Game/Chat/Commands/MiscCommands.cs index 8a7799cdc..3782c6a65 100644 --- a/Source/Game/Chat/Commands/MiscCommands.cs +++ b/Source/Game/Chat/Commands/MiscCommands.cs @@ -187,7 +187,7 @@ namespace Game.Chat return true; } - [CommandNonGroup("additemset", RBACPermissions.CommandAdditemset)] + [CommandNonGroup("additem set", RBACPermissions.CommandAdditemset)] static bool HandleAddItemSetCommand(CommandHandler handler, StringArguments args) { if (args.Empty()) diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index c1ef7cd58..03f1166d8 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -4328,6 +4328,14 @@ namespace Game.Entities spellInfo.NegativeEffects[2] = true; }); + // Headless Horseman Climax - Return Head (Hallow End) + // Headless Horseman Climax - Body Regen (confuse only - removed on death) + // Headless Horseman Climax - Head Is Dead + ApplySpellFix(new[] { 42401, 43105, 42428 }, spellInfo => + { + spellInfo.Attributes |= SpellAttr0.UnaffectedByInvulnerability; + }); + foreach (var spellInfo in mSpellInfoMap.Values) { // Fix range for trajectory triggered spell diff --git a/Source/Scripts/Spells/Quest.cs b/Source/Scripts/Spells/Quest.cs index 18a8aab17..8549cc466 100644 --- a/Source/Scripts/Spells/Quest.cs +++ b/Source/Scripts/Spells/Quest.cs @@ -46,7 +46,6 @@ namespace Scripts.Spells.Quest //Quest11587 public const uint SummonArcanePrisonerMale = 45446; // Summon Arcane Prisoner - Male public const uint SummonArcanePrisonerFemale = 45448; // Summon Arcane Prisoner - Female - public const uint ArcanePrisonerKillCredit = 45456; // Arcane Prisoner Kill Credit //Quest11730 public const uint SummonScavengebot004a8 = 46063; @@ -554,22 +553,16 @@ namespace Scripts.Spells.Quest { public override bool Validate(SpellInfo spellEntry) { - return ValidateSpellInfo(SpellIds.SummonArcanePrisonerMale, SpellIds.SummonArcanePrisonerFemale, SpellIds.ArcanePrisonerKillCredit); + return ValidateSpellInfo(SpellIds.SummonArcanePrisonerMale, SpellIds.SummonArcanePrisonerFemale); } void HandleDummy(uint effIndex) { Unit caster = GetCaster(); - - Unit unitTarget = GetHitUnit(); - if (unitTarget) - { - uint spellId = SpellIds.SummonArcanePrisonerMale; - if (Convert.ToBoolean(RandomHelper.Rand32() % 2)) - spellId = SpellIds.SummonArcanePrisonerFemale; - caster.CastSpell(caster, spellId, true); - unitTarget.CastSpell(caster, SpellIds.ArcanePrisonerKillCredit, true); - } + uint spellId = SpellIds.SummonArcanePrisonerMale; + if ((RandomHelper.Rand32() % 2) != 0) + spellId = SpellIds.SummonArcanePrisonerFemale; + caster.CastSpell(caster, spellId, true); } public override void Register() diff --git a/Source/Scripts/World/GameObject.cs b/Source/Scripts/World/GameObject.cs index 7932432e0..80df2b0d2 100644 --- a/Source/Scripts/World/GameObject.cs +++ b/Source/Scripts/World/GameObject.cs @@ -56,9 +56,6 @@ namespace Scripts.World.GameObjects public const uint RedPunchCard = 11528; public const uint PrismaticPunchCard = 11545; - //Arcaneprison - public const uint ArcanePrisonerKillCredit = 45456; - //Jotunheimcage public const uint SummonBladeKnightH = 56207; public const uint SummonBladeKnightNe = 56209; @@ -111,9 +108,6 @@ namespace Scripts.World.GameObjects //Southfury public const uint Rizzle = 23002; - //Scourgecage - public const uint ScourgePrisoner = 25610; - //Bloodfilledorb public const uint Zelemar = 17830; @@ -129,9 +123,6 @@ namespace Scripts.World.GameObjects //Amberpineouthouse public const uint OuthouseBunny = 27326; - //Hives - public const uint HiveAmbusher = 13301; - //Missingfriends public const uint CaptiveChild = 22314; @@ -173,21 +164,12 @@ namespace Scripts.World.GameObjects public const uint LearnLeaveReturn = 12790; public const uint TeleCrystalFlag = 12845; - //Arcaneprison - public const uint PrisonBreak = 11587; - - //Tabletheka - public const uint SpiderGold = 2936; - //Tadpoles public const uint OhNoesTheTadpoles = 11560; //Amberpineouthouse public const uint DoingYourDuty = 12227; - //Hives - public const uint HiveInTheTower = 9544; - //Missingfriends public const uint MissingFriends = 10852; @@ -221,9 +203,6 @@ namespace Scripts.World.GameObjects public const string GossipBashirCrystalforgeItem5 = "Purchase 5 Unstable Flask Of The Sorcerer For The Cost Of 50 Apexis Shards"; public const string GossipBashirCrystalforgeItemReturn = "Use The Bashir Crystalforge To Make Another Purchase."; - //Tabletheka - public const uint GossipTableTheka = 1653; - //Amberpineouthouse public const uint GossipOuthouseInuse = 12775; public const uint GossipOuthouseVacant = 12779; @@ -515,42 +494,6 @@ namespace Scripts.World.GameObjects } } - [Script] - class go_scourge_cage : GameObjectAI - { - public go_scourge_cage(GameObject go) : base(go) { } - - public override bool OnGossipHello(Player player) - { - me.UseDoorOrButton(); - Creature pNearestPrisoner = me.FindNearestCreature(CreatureIds.ScourgePrisoner, 5.0f, true); - if (pNearestPrisoner) - { - player.KilledMonsterCredit(CreatureIds.ScourgePrisoner, pNearestPrisoner.GetGUID()); - pNearestPrisoner.DisappearAndDie(); - } - - return true; - } - } - - [Script] - class go_arcane_prison : GameObjectAI - { - public go_arcane_prison(GameObject go) : base(go) { } - - public override bool OnGossipHello(Player player) - { - if (player.GetQuestStatus(QuestIds.PrisonBreak) == QuestStatus.Incomplete) - { - me.SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TempSummonType.TimedDespawn, TimeSpan.FromMinutes(1)); - player.CastSpell(player, SpellIds.ArcanePrisonerKillCredit, true); - return true; - } - return false; - } - } - [Script] class go_blood_filled_orb : GameObjectAI { @@ -565,21 +508,6 @@ namespace Scripts.World.GameObjects } } - [Script] - class go_table_theka : GameObjectAI - { - public go_table_theka(GameObject go) : base(go) { } - - public override bool OnGossipHello(Player player) - { - if (player.GetQuestStatus(QuestIds.SpiderGold) == QuestStatus.Incomplete) - player.AreaExploredOrEventHappens(QuestIds.SpiderGold); - - player.SendGossipMenu(GossipConst.GossipTableTheka, me.GetGUID()); - return true; - } - } - [Script] class go_soulwell : GameObjectAI { @@ -640,20 +568,6 @@ namespace Scripts.World.GameObjects } } - [Script] - class go_hive_pod : GameObjectAI - { - public go_hive_pod(GameObject go) : base(go) { } - - public override bool OnGossipHello(Player player) - { - player.SendLoot(me.GetGUID(), LootType.Corpse); - me.SummonCreature(CreatureIds.HiveAmbusher, me.GetPositionX() + 1, me.GetPositionY(), me.GetPositionZ(), me.GetAbsoluteAngle(player), TempSummonType.TimedOrDeadDespawn, TimeSpan.FromMinutes(1)); - me.SummonCreature(CreatureIds.HiveAmbusher, me.GetPositionX(), me.GetPositionY() + 1, me.GetPositionZ(), me.GetAbsoluteAngle(player), TempSummonType.TimedOrDeadDespawn, TimeSpan.FromMinutes(1)); - return true; - } - } - [Script] class go_massive_seaforium_charge : GameObjectAI { diff --git a/Source/Scripts/World/NpcSpecial.cs b/Source/Scripts/World/NpcSpecial.cs index 250e78a62..5dd30cd2e 100644 --- a/Source/Scripts/World/NpcSpecial.cs +++ b/Source/Scripts/World/NpcSpecial.cs @@ -166,9 +166,6 @@ namespace Scripts.World.NpcSpecial //Guardianspells public const uint Deathtouch = 5; - //Tonkmine - public const uint TonkMineDetonate = 25099; - //Brewfestreveler public const uint BrewfestToast = 41586; @@ -1300,43 +1297,6 @@ namespace Scripts.World.NpcSpecial } } - [Script] - class npc_tonk_mine : ScriptedAI - { - public npc_tonk_mine(Creature creature) : base(creature) - { - Initialize(); - me.SetReactState(ReactStates.Passive); - } - - void Initialize() - { - ExplosionTimer = 3000; - } - - uint ExplosionTimer; - - public override void Reset() - { - Initialize(); - } - - public override void JustEngagedWith(Unit who) { } - public override void AttackStart(Unit who) { } - public override void MoveInLineOfSight(Unit who) { } - - public override void UpdateAI(uint diff) - { - if (ExplosionTimer <= diff) - { - DoCast(me, SpellIds.TonkMineDetonate, new CastSpellExtraArgs(true)); - me.SetDeathState(DeathState.Dead); // unsummon it - } - else - ExplosionTimer -= diff; - } - } - [Script] class npc_brewfest_reveler : ScriptedAI {