diff --git a/Source/Framework/Constants/SharedConst.cs b/Source/Framework/Constants/SharedConst.cs index 46976bc6f..04078ac6e 100644 --- a/Source/Framework/Constants/SharedConst.cs +++ b/Source/Framework/Constants/SharedConst.cs @@ -207,6 +207,7 @@ namespace Framework.Constants public const int MaxActivePets = 5; public const int MaxPetStables = 200; public const uint CallPetSpellId = 883; + public const uint PetSummoningDisorientation = 32752; public const float PetFollowDist = 1.0f; public const float PetFollowAngle = MathF.PI; public const int MaxSpellCharm = 4; diff --git a/Source/Game/Entities/TemporarySummon.cs b/Source/Game/Entities/TemporarySummon.cs index 842fdc8cc..b8fe3521b 100644 --- a/Source/Game/Entities/TemporarySummon.cs +++ b/Source/Game/Entities/TemporarySummon.cs @@ -448,7 +448,7 @@ namespace Game.Entities { return $"{base.GetDebugInfo()}\nOwner: {(GetOwner() ? GetOwner().GetGUID() : "")}"; } - + public override Unit GetOwner() { return m_owner; } public override float GetFollowAngle() { return m_followAngle; } @@ -459,9 +459,10 @@ namespace Game.Entities public bool IsPetImp() { return GetEntry() == (uint)PetEntry.Imp; } public bool IsPetFelhunter() { return GetEntry() == (uint)PetEntry.FelHunter; } public bool IsPetVoidwalker() { return GetEntry() == (uint)PetEntry.VoidWalker; } - public bool IsPetSuccubus() { return GetEntry() == (uint)PetEntry.Succubus; } + public bool IsPetSayaad() { return GetEntry() == (uint)PetEntry.Succubus || GetEntry() == (uint)PetEntry.Incubus; } public bool IsPetDoomguard() { return GetEntry() == (uint)PetEntry.Doomguard; } public bool IsPetFelguard() { return GetEntry() == (uint)PetEntry.Felguard; } + public bool IsWarlockPet() { return IsPetImp() || IsPetFelhunter() || IsPetVoidwalker() || IsPetSayaad() || IsPetDoomguard() || IsPetFelguard(); } // Death Knight pets public bool IsPetGhoul() { return GetEntry() == (uint)PetEntry.Ghoul; } // Ghoul may be guardian or pet @@ -598,7 +599,7 @@ namespace Game.Entities SetPowerType(PowerType.Energy); SetFullPower(PowerType.Energy); } - else if (IsPetImp() || IsPetFelhunter() || IsPetVoidwalker() || IsPetSuccubus() || IsPetDoomguard() || IsPetFelguard()) // Warlock pets have energy (since 5.x) + else if (IsWarlockPet()) // Warlock pets have energy (since 5.x) SetPowerType(PowerType.Energy); else SetPowerType(PowerType.Mana); @@ -1153,6 +1154,7 @@ namespace Game.Entities Succubus = 1863, Doomguard = 18540, Felguard = 30146, + Incubus = 184600, // Death Knight pets Ghoul = 26125, diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index d976af0f0..0011d4b80 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -5328,7 +5328,7 @@ namespace Game.Spells Pet pet = unitCaster.ToPlayer().GetPet(); if (pet != null) { - pet.CastSpell(pet, 32752, new CastSpellExtraArgs(TriggerCastFlags.FullMask) + pet.CastSpell(pet, SharedConst.PetSummoningDisorientation, new CastSpellExtraArgs(TriggerCastFlags.FullMask) .SetOriginalCaster(pet.GetGUID()) .SetTriggeringSpell(this)); } diff --git a/Source/Scripts/Spells/Warlock.cs b/Source/Scripts/Spells/Warlock.cs index 725c6c758..db87dacb2 100644 --- a/Source/Scripts/Spells/Warlock.cs +++ b/Source/Scripts/Spells/Warlock.cs @@ -41,6 +41,12 @@ namespace Scripts.Spells.Warlock public const uint UnstableAfflictionDispel = 31117; public const uint Shadowflame = 37378; public const uint Flameshadow = 37379; + public const uint SummonSuccubus = 712; + public const uint SummonIncubus = 365349; + public const uint StrengthenPactSuccubus = 366323; + public const uint StrengthenPactIncubus = 366325; + public const uint SuccubusPact = 365360; + public const uint IncubusPact = 365355; public const uint GenReplenishment = 57669; public const uint PriestShadowWordDeath = 32409; @@ -94,7 +100,7 @@ namespace Scripts.Spells.Warlock OnCalcCritChance.Add(new OnCalcCritChanceHandler(CalcCritChance)); } } - + [Script] // 77220 - Mastery: Chaotic Energies class spell_warl_chaotic_energies : AuraScript { @@ -260,7 +266,7 @@ namespace Scripts.Spells.Warlock AfterEffectRemove.Add(new EffectApplyHandler(HandleRemove, 0, AuraType.PeriodicDamage, AuraEffectHandleModes.Real)); } } - + [Script] // 48181 - Haunt class spell_warl_haunt : SpellScript { @@ -364,7 +370,67 @@ namespace Scripts.Spells.Warlock OnEffectHitTarget.Add(new EffectHandler(HandleOnEffectHit, 0, SpellEffectName.SchoolDamage)); } } - + + // 366330 - Random Sayaad + class spell_warl_random_sayaad : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.SuccubusPact, SpellIds.IncubusPact); + } + + void HandleDummy(uint effIndex) + { + Unit caster = GetCaster(); + + caster.RemoveAurasDueToSpell(SpellIds.SuccubusPact); + caster.RemoveAurasDueToSpell(SpellIds.IncubusPact); + + Player player = GetCaster().ToPlayer(); + if (!player) + return; + + Pet pet = player.GetPet(); + if (pet != null) + { + if (pet.IsPetSayaad()) + pet.DespawnOrUnsummon(); + } + } + + public override void Register() + { + OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); + } + } + + // 366323 - Strengthen Pact - Succubus + // 366325 - Strengthen Pact - Incubus + // 366222 - Summon Sayaad + class spell_warl_sayaad_precast_disorientation : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SharedConst.PetSummoningDisorientation); + } + + // Note: this is a special case in which the warlock's minion pet must also cast Summon Disorientation at the beginning since this is only handled by SPELL_EFFECT_SUMMON_PET in Spell::CheckCast. + public override void OnPrecast() + { + Player player = GetCaster().ToPlayer(); + if (!player) + return; + + Pet pet = player.GetPet(); + if (pet != null) + pet.CastSpell(pet, SharedConst.PetSummoningDisorientation, new CastSpellExtraArgs(TriggerCastFlags.FullMask) + .SetOriginalCaster(pet.GetGUID()) + .SetTriggeringSpell(GetSpell())); + } + + public override void Register() { } + } + [Script] // 6358 - Seduction (Special Ability) class spell_warl_seduction : SpellScript { @@ -425,7 +491,7 @@ namespace Scripts.Spells.Warlock amount = caster.SpellBaseDamageBonusDone(GetSpellInfo().GetSchoolMask()) * GetEffectInfo(0).CalcValue(caster) / 100; } - + void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); @@ -518,7 +584,7 @@ namespace Scripts.Spells.Warlock AfterCast.Add(new CastHandler(HandleAfterCast)); } } - + [Script] // 86121 - Soul Swap class spell_warl_soul_swap : SpellScript { @@ -682,6 +748,69 @@ namespace Scripts.Spells.Warlock } } + // 366323 - Strengthen Pact - Succubus + class spell_warl_strengthen_pact_succubus : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.SuccubusPact, SpellIds.SummonSuccubus); + } + + void HandleDummy(uint effIndex) + { + Unit caster = GetCaster(); + + caster.CastSpell((WorldObject)null, SpellIds.SuccubusPact, new CastSpellExtraArgs(TriggerCastFlags.FullMask)); + caster.CastSpell((WorldObject)null, SpellIds.SummonSuccubus, new CastSpellExtraArgs(TriggerCastFlags.FullMask)); + } + + public override void Register() + { + OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); + } + } + + // 366325 - Strengthen Pact - Incubus + class spell_warl_strengthen_pact_incubus : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.IncubusPact, SpellIds.SummonIncubus); + } + + void HandleDummy(uint effIndex) + { + Unit caster = GetCaster(); + + caster.CastSpell((WorldObject)null, SpellIds.IncubusPact, new CastSpellExtraArgs(TriggerCastFlags.FullMask)); + caster.CastSpell((WorldObject)null, SpellIds.SummonIncubus, new CastSpellExtraArgs(TriggerCastFlags.FullMask)); + } + + public override void Register() + { + OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); + } + } + + // 366222 - Summon Sayaad + class spell_warl_summon_sayaad : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.SummonSuccubus, SpellIds.SummonIncubus); + } + + void HandleDummy(uint effIndex) + { + GetCaster().CastSpell((WorldObject)null, RandomHelper.randChance(50) ? SpellIds.SummonSuccubus : SpellIds.SummonIncubus, new CastSpellExtraArgs(TriggerCastFlags.FullMask)); + } + + public override void Register() + { + OnEffectHit.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy)); + } + } + [Script("spell_warl_t4_2p_bonus_shadow", SpellIds.Flameshadow)]// 37377 - Shadowflame [Script("spell_warl_t4_2p_bonus_fire", SpellIds.Shadowflame)]// 39437 - Shadowflame Hellfire and RoF class spell_warl_t4_2p_bonus : AuraScript