mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-12 21:19:08 +01:00
Scripts/Spells: Implement Summon Sayaad (#28907)
Co-authored-by: ModoX <moardox@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
@@ -63,6 +64,12 @@ enum WarlockSpells
|
||||
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
|
||||
SPELL_WARLOCK_SHADOWFLAME = 37378,
|
||||
SPELL_WARLOCK_FLAMESHADOW = 37379,
|
||||
SPELL_WARLOCK_SUMMON_SUCCUBUS = 712,
|
||||
SPELL_WARLOCK_SUMMON_INCUBUS = 365349,
|
||||
SPELL_WARLOCK_STRENGTHEN_PACT_SUCCUBUS = 366323,
|
||||
SPELL_WARLOCK_STRENGTHEN_PACT_INCUBUS = 366325,
|
||||
SPELL_WARLOCK_SUCCUBUS_PACT = 365360,
|
||||
SPELL_WARLOCK_INCUBUS_PACT = 365355
|
||||
};
|
||||
|
||||
enum MiscSpells
|
||||
@@ -408,6 +415,74 @@ class spell_warl_immolate : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 366330 - Random Sayaad
|
||||
class spell_warl_random_sayaad : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_random_sayaad);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo
|
||||
({
|
||||
SPELL_WARLOCK_SUCCUBUS_PACT,
|
||||
SPELL_WARLOCK_INCUBUS_PACT
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
caster->RemoveAurasDueToSpell(SPELL_WARLOCK_SUCCUBUS_PACT);
|
||||
caster->RemoveAurasDueToSpell(SPELL_WARLOCK_INCUBUS_PACT);
|
||||
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
if (Pet* pet = player->GetPet())
|
||||
{
|
||||
if (pet->IsPetSayaad())
|
||||
pet->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_warl_random_sayaad::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 366323 - Strengthen Pact - Succubus
|
||||
// 366325 - Strengthen Pact - Incubus
|
||||
// 366222 - Summon Sayaad
|
||||
class spell_warl_sayaad_precast_disorientation : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_sayaad_precast_disorientation);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ PET_SUMMONING_DISORIENTATION });
|
||||
}
|
||||
|
||||
// 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.
|
||||
void OnPrecast() override
|
||||
{
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
if (Pet* pet = player->GetPet())
|
||||
pet->CastSpell(pet, PET_SUMMONING_DISORIENTATION, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
|
||||
.SetOriginalCaster(pet->GetGUID())
|
||||
.SetTriggeringSpell(GetSpell()));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// 6358 - Seduction (Special Ability)
|
||||
class spell_warl_seduction : public SpellScript
|
||||
{
|
||||
@@ -745,6 +820,87 @@ class spell_warl_soulshatter : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 366323 - Strengthen Pact - Succubus
|
||||
class spell_warl_strengthen_pact_succubus : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_strengthen_pact_succubus);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo
|
||||
({
|
||||
SPELL_WARLOCK_SUCCUBUS_PACT,
|
||||
SPELL_WARLOCK_SUMMON_SUCCUBUS
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
caster->CastSpell(nullptr, SPELL_WARLOCK_SUCCUBUS_PACT, TRIGGERED_FULL_MASK);
|
||||
caster->CastSpell(nullptr, SPELL_WARLOCK_SUMMON_SUCCUBUS, TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_warl_strengthen_pact_succubus::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 366325 - Strengthen Pact - Incubus
|
||||
class spell_warl_strengthen_pact_incubus : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_strengthen_pact_incubus);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo
|
||||
({
|
||||
SPELL_WARLOCK_INCUBUS_PACT,
|
||||
SPELL_WARLOCK_SUMMON_INCUBUS
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
caster->CastSpell(nullptr, SPELL_WARLOCK_INCUBUS_PACT, TRIGGERED_FULL_MASK);
|
||||
caster->CastSpell(nullptr, SPELL_WARLOCK_SUMMON_INCUBUS, TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_warl_strengthen_pact_incubus::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 366222 - Summon Sayaad
|
||||
class spell_warl_summon_sayaad : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_summon_sayaad);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo
|
||||
({
|
||||
SPELL_WARLOCK_SUMMON_SUCCUBUS,
|
||||
SPELL_WARLOCK_SUMMON_INCUBUS
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(nullptr, roll_chance_i(50) ? SPELL_WARLOCK_SUMMON_SUCCUBUS : SPELL_WARLOCK_SUMMON_INCUBUS, TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_warl_summon_sayaad::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 37377 - Shadowflame
|
||||
// 39437 - Shadowflame Hellfire and RoF
|
||||
template <uint32 Trigger>
|
||||
@@ -850,6 +1006,8 @@ void AddSC_warlock_spell_scripts()
|
||||
RegisterSpellScript(spell_warl_health_funnel);
|
||||
RegisterSpellScript(spell_warl_healthstone_heal);
|
||||
RegisterSpellScript(spell_warl_immolate);
|
||||
RegisterSpellScript(spell_warl_random_sayaad);
|
||||
RegisterSpellScript(spell_warl_sayaad_precast_disorientation);
|
||||
RegisterSpellScript(spell_warl_seduction);
|
||||
RegisterSpellScript(spell_warl_seed_of_corruption);
|
||||
RegisterSpellScript(spell_warl_seed_of_corruption_dummy);
|
||||
@@ -860,6 +1018,9 @@ void AddSC_warlock_spell_scripts()
|
||||
RegisterSpellScript(spell_warl_soul_swap_exhale);
|
||||
RegisterSpellScript(spell_warl_soul_swap_override);
|
||||
RegisterSpellScript(spell_warl_soulshatter);
|
||||
RegisterSpellScript(spell_warl_strengthen_pact_succubus);
|
||||
RegisterSpellScript(spell_warl_strengthen_pact_incubus);
|
||||
RegisterSpellScript(spell_warl_summon_sayaad);
|
||||
RegisterSpellScriptWithArgs(spell_warl_t4_2p_bonus<SPELL_WARLOCK_FLAMESHADOW>, "spell_warl_t4_2p_bonus_shadow");
|
||||
RegisterSpellScriptWithArgs(spell_warl_t4_2p_bonus<SPELL_WARLOCK_SHADOWFLAME>, "spell_warl_t4_2p_bonus_fire");
|
||||
RegisterSpellScript(spell_warl_unstable_affliction);
|
||||
|
||||
Reference in New Issue
Block a user