Scripts/Spells: Implement Summon Sayaad

Port From (https://github.com/TrinityCore/TrinityCore/commit/c7ff9a9083fdb5aab1fe54b16ffd84851f99424d)
This commit is contained in:
hondacrx
2023-05-02 16:32:00 -04:00
parent 5e5e17e23c
commit be0a98f3de
4 changed files with 141 additions and 9 deletions
@@ -207,6 +207,7 @@ namespace Framework.Constants
public const int MaxActivePets = 5; public const int MaxActivePets = 5;
public const int MaxPetStables = 200; public const int MaxPetStables = 200;
public const uint CallPetSpellId = 883; public const uint CallPetSpellId = 883;
public const uint PetSummoningDisorientation = 32752;
public const float PetFollowDist = 1.0f; public const float PetFollowDist = 1.0f;
public const float PetFollowAngle = MathF.PI; public const float PetFollowAngle = MathF.PI;
public const int MaxSpellCharm = 4; public const int MaxSpellCharm = 4;
+4 -2
View File
@@ -459,9 +459,10 @@ namespace Game.Entities
public bool IsPetImp() { return GetEntry() == (uint)PetEntry.Imp; } public bool IsPetImp() { return GetEntry() == (uint)PetEntry.Imp; }
public bool IsPetFelhunter() { return GetEntry() == (uint)PetEntry.FelHunter; } public bool IsPetFelhunter() { return GetEntry() == (uint)PetEntry.FelHunter; }
public bool IsPetVoidwalker() { return GetEntry() == (uint)PetEntry.VoidWalker; } 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 IsPetDoomguard() { return GetEntry() == (uint)PetEntry.Doomguard; }
public bool IsPetFelguard() { return GetEntry() == (uint)PetEntry.Felguard; } public bool IsPetFelguard() { return GetEntry() == (uint)PetEntry.Felguard; }
public bool IsWarlockPet() { return IsPetImp() || IsPetFelhunter() || IsPetVoidwalker() || IsPetSayaad() || IsPetDoomguard() || IsPetFelguard(); }
// Death Knight pets // Death Knight pets
public bool IsPetGhoul() { return GetEntry() == (uint)PetEntry.Ghoul; } // Ghoul may be guardian or pet public bool IsPetGhoul() { return GetEntry() == (uint)PetEntry.Ghoul; } // Ghoul may be guardian or pet
@@ -598,7 +599,7 @@ namespace Game.Entities
SetPowerType(PowerType.Energy); SetPowerType(PowerType.Energy);
SetFullPower(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); SetPowerType(PowerType.Energy);
else else
SetPowerType(PowerType.Mana); SetPowerType(PowerType.Mana);
@@ -1153,6 +1154,7 @@ namespace Game.Entities
Succubus = 1863, Succubus = 1863,
Doomguard = 18540, Doomguard = 18540,
Felguard = 30146, Felguard = 30146,
Incubus = 184600,
// Death Knight pets // Death Knight pets
Ghoul = 26125, Ghoul = 26125,
+1 -1
View File
@@ -5328,7 +5328,7 @@ namespace Game.Spells
Pet pet = unitCaster.ToPlayer().GetPet(); Pet pet = unitCaster.ToPlayer().GetPet();
if (pet != null) if (pet != null)
{ {
pet.CastSpell(pet, 32752, new CastSpellExtraArgs(TriggerCastFlags.FullMask) pet.CastSpell(pet, SharedConst.PetSummoningDisorientation, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
.SetOriginalCaster(pet.GetGUID()) .SetOriginalCaster(pet.GetGUID())
.SetTriggeringSpell(this)); .SetTriggeringSpell(this));
} }
+129
View File
@@ -41,6 +41,12 @@ namespace Scripts.Spells.Warlock
public const uint UnstableAfflictionDispel = 31117; public const uint UnstableAfflictionDispel = 31117;
public const uint Shadowflame = 37378; public const uint Shadowflame = 37378;
public const uint Flameshadow = 37379; 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 GenReplenishment = 57669;
public const uint PriestShadowWordDeath = 32409; public const uint PriestShadowWordDeath = 32409;
@@ -365,6 +371,66 @@ namespace Scripts.Spells.Warlock
} }
} }
// 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) [Script] // 6358 - Seduction (Special Ability)
class spell_warl_seduction : SpellScript class spell_warl_seduction : 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_shadow", SpellIds.Flameshadow)]// 37377 - Shadowflame
[Script("spell_warl_t4_2p_bonus_fire", SpellIds.Shadowflame)]// 39437 - Shadowflame Hellfire and RoF [Script("spell_warl_t4_2p_bonus_fire", SpellIds.Shadowflame)]// 39437 - Shadowflame Hellfire and RoF
class spell_warl_t4_2p_bonus : AuraScript class spell_warl_t4_2p_bonus : AuraScript