From 04caa3e7573bb8a81fdb3b662bf018c82b6898c6 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 15 Jun 2022 18:27:32 -0400 Subject: [PATCH] Misc fixes --- Source/Game/AI/SmartScripts/SmartAI.cs | 1 + Source/Game/Achievements/CriteriaHandler.cs | 2 + Source/Scripts/Spells/Generic.cs | 15 +++ Source/Scripts/Spells/Items.cs | 27 ---- Source/Scripts/Spells/Quest.cs | 139 -------------------- 5 files changed, 18 insertions(+), 166 deletions(-) diff --git a/Source/Game/AI/SmartScripts/SmartAI.cs b/Source/Game/AI/SmartScripts/SmartAI.cs index c7bd0c406..ff5377536 100644 --- a/Source/Game/AI/SmartScripts/SmartAI.cs +++ b/Source/Game/AI/SmartScripts/SmartAI.cs @@ -909,6 +909,7 @@ namespace Game.AI _followArrivedTimer = 1000; _followArrivedEntry = 0; _followCreditType = 0; + me.GetMotionMaster().Clear(); me.StopMoving(); me.GetMotionMaster().MoveIdle(); diff --git a/Source/Game/Achievements/CriteriaHandler.cs b/Source/Game/Achievements/CriteriaHandler.cs index 38f42a387..ebde5521f 100644 --- a/Source/Game/Achievements/CriteriaHandler.cs +++ b/Source/Game/Achievements/CriteriaHandler.cs @@ -3896,6 +3896,8 @@ namespace Game.Achievements { if (_criteriasByAsset[(int)type].ContainsKey(asset)) return _criteriasByAsset[(int)type][asset]; + + return new List(); } return _criteriasByType.LookupByKey(type); diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 8ed3cfe68..d70622d4a 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -2700,6 +2700,21 @@ namespace Scripts.Spells.Generic } } + [Script] // 36553 - PetWait + class spell_gen_pet_wait : SpellScript + { + void HandleScript(uint effIndex) + { + GetCaster().GetMotionMaster().Clear(); + GetCaster().GetMotionMaster().MoveIdle(); + } + + public override void Register() + { + OnEffectHit.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect)); + } + } + [Script] class spell_gen_profession_research : SpellScript { diff --git a/Source/Scripts/Spells/Items.cs b/Source/Scripts/Spells/Items.cs index 53b1be93a..942947587 100644 --- a/Source/Scripts/Spells/Items.cs +++ b/Source/Scripts/Spells/Items.cs @@ -2962,33 +2962,6 @@ namespace Scripts.Spells.Items float lastZ = MapConst.InvalidHeight; } - [Script] - class spell_item_teach_language : SpellScript - { - public override bool Load() - { - return GetCaster().GetTypeId() == TypeId.Player; - } - - public override bool Validate(SpellInfo spell) - { - return ValidateSpellInfo(SpellIds.LearnGnomishBinary, SpellIds.LearnGoblinBinary); - } - - void HandleDummy(uint effIndex) - { - Player caster = GetCaster().ToPlayer(); - - if (RandomHelper.randChance(34)) - caster.CastSpell(caster, caster.GetTeam() == Team.Alliance ? SpellIds.LearnGnomishBinary : SpellIds.LearnGoblinBinary, true); - } - - public override void Register() - { - OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); - } - } - [Script] class spell_item_rocket_boots : SpellScript { diff --git a/Source/Scripts/Spells/Quest.cs b/Source/Scripts/Spells/Quest.cs index 601652f95..a31211923 100644 --- a/Source/Scripts/Spells/Quest.cs +++ b/Source/Scripts/Spells/Quest.cs @@ -28,25 +28,13 @@ namespace Scripts.Spells.Quest { struct SpellIds { - //BendingShinbone - public const uint BendingShinbone1 = 8854; - public const uint BendingShinbone2 = 8855; - //Thaumaturgychannel public const uint ThaumaturgyChannel = 21029; - //Quest5206 - public const uint CreateResonatingSkull = 17269; - public const uint CreateBoneDust = 17270; - //Quest11396-11399 public const uint ForceShieldArcanePurpleX3 = 43874; public const uint ScourgingCrystalController = 43878; - //Quest11587 - public const uint SummonArcanePrisonerMale = 45446; // Summon Arcane Prisoner - Male - public const uint SummonArcanePrisonerFemale = 45448; // Summon Arcane Prisoner - Female - //Quest11730 public const uint SummonScavengebot004a8 = 46063; public const uint SummonSentrybot57k = 46068; @@ -79,10 +67,6 @@ namespace Scripts.Spells.Quest public const uint AllianceBattleStandardState = 4339; public const uint JumpRocketBlast = 4340; - //Redsnapperverytasty - public const uint FishedUpRedSnapper = 29867; - public const uint FishedUpMurloc = 29869; - //BreakfastOfChampions public const uint SummonDeepJormungar = 66510; public const uint StormforgedMoleMachine = 66492; @@ -102,10 +86,6 @@ namespace Scripts.Spells.Quest public const uint ChooseLoc = 40056; public const uint AggroCheck = 40112; - //RecoverTheCargo - public const uint SummonLockbox = 42288; - public const uint SummonBurrower = 42289; - //Spellzuldrakrat public const uint SummonGorgedLurkingBasilisk = 50928; @@ -374,26 +354,6 @@ namespace Scripts.Spells.Quest bool _shouldAttack; uint _despawnTime; } - - [Script] // 8856 - Bending Shinbone - class spell_q1846_bending_shinbone : SpellScript - { - void HandleScriptEffect(uint effIndex) - { - Item target = GetHitItem(); - Unit caster = GetCaster(); - if (!target && !caster.IsPlayer()) - return; - - uint spellId = RandomHelper.randChance(20) ? SpellIds.BendingShinbone1 : SpellIds.BendingShinbone2; - caster.CastSpell(caster, spellId, new CastSpellExtraArgs(GetSpell())); - } - - public override void Register() - { - OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect)); - } - } [Script] // 9712 - Thaumaturgy Channel class spell_q2203_thaumaturgy_channel : AuraScript @@ -417,33 +377,6 @@ namespace Scripts.Spells.Quest } } - // http://www.wowhead.com/quest=5206 Marauders of Darrowshire - [Script] // 17271 - Test Fetid Skull - class spell_q5206_test_fetid_skull : SpellScript - { - public override bool Load() - { - return GetCaster().IsTypeId(TypeId.Player); - } - - public override bool Validate(SpellInfo spellEntry) - { - return ValidateSpellInfo(SpellIds.CreateResonatingSkull, SpellIds.CreateBoneDust); - } - - void HandleDummy(uint effIndex) - { - Unit caster = GetCaster(); - uint spellId = RandomHelper.randChance(50) ? SpellIds.CreateResonatingSkull : SpellIds.CreateBoneDust; - caster.CastSpell(caster, spellId, true); - } - - public override void Register() - { - OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); - } - } - // http://www.wowhead.com/quest=6124 Curing the Sick (A) // http://www.wowhead.com/quest=6129 Curing the Sick (H) [Script] // 19512 Apply Salve @@ -559,30 +492,6 @@ namespace Scripts.Spells.Quest } } - // http://www.wowhead.com/quest=11587 Prison Break - [Script] // 45449 Arcane Prisoner Rescue - class spell_q11587_arcane_prisoner_rescue : SpellScript - { - public override bool Validate(SpellInfo spellEntry) - { - return ValidateSpellInfo(SpellIds.SummonArcanePrisonerMale, SpellIds.SummonArcanePrisonerFemale); - } - - void HandleDummy(uint effIndex) - { - Unit caster = GetCaster(); - uint spellId = SpellIds.SummonArcanePrisonerMale; - if ((RandomHelper.Rand32() % 2) != 0) - spellId = SpellIds.SummonArcanePrisonerFemale; - caster.CastSpell(caster, spellId, true); - } - - public override void Register() - { - OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); - } - } - // http://www.wowhead.com/quest=11730 Master and Servant [Script] // 46023 The Ultrasonic Screwdriver class spell_q11730_ultrasonic_screwdriver : SpellScript @@ -853,30 +762,6 @@ namespace Scripts.Spells.Quest } } - [Script] // 29866 - Cast Fishing Net - class spell_q9452_cast_net : SpellScript - { - public override bool Validate(SpellInfo spell) - { - return ValidateSpellInfo(SpellIds.FishedUpRedSnapper, SpellIds.FishedUpMurloc); - } - - void HandleDummy(uint effIndex) - { - Unit caster = GetCaster(); - - if (RandomHelper.randChance(66)) - caster.CastSpell(caster, SpellIds.FishedUpRedSnapper, true); - else - caster.CastSpell(null, SpellIds.FishedUpMurloc, true); - } - - public override void Register() - { - OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); - } - } - [Script] class spell_q12279_cast_net : SpellScript { @@ -1065,30 +950,6 @@ namespace Scripts.Spells.Quest OnCheckCast.Add(new CheckCastHandler(CheckRequirement)); } } - - [Script] // 42287 - Salvage Wreckage - class spell_q11140salvage_wreckage : SpellScript - { - public override bool Validate(SpellInfo spell) - { - return ValidateSpellInfo(SpellIds.SummonLockbox, SpellIds.SummonBurrower); - } - - void HandleDummy(uint effIndex) - { - Unit caster = GetCaster(); - - if (RandomHelper.randChance(50)) - caster.CastSpell(caster, SpellIds.SummonLockbox, true); - else - caster.CastSpell(null, SpellIds.SummonBurrower, true); - } - - public override void Register() - { - OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); - } - } [Script] // 50894 - Zul'Drak Rat class spell_q12527_zuldrak_rat : SpellScript