mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Spells: Implement Summon Sayaad (#28907)
Co-authored-by: ModoX <moardox@gmail.com>
This commit is contained in:
9
sql/updates/world/master/2023_04_23_00_world.sql
Normal file
9
sql/updates/world/master/2023_04_23_00_world.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warl_strengthen_pact_succubus','spell_warl_strengthen_pact_incubus','spell_warl_random_sayaad','spell_warl_summon_sayaad','spell_warl_sayaad_precast_disorientation');
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(366323,'spell_warl_strengthen_pact_succubus'),
|
||||
(366325,'spell_warl_strengthen_pact_incubus'),
|
||||
(366330,'spell_warl_random_sayaad'),
|
||||
(366222,'spell_warl_summon_sayaad'),
|
||||
(366323,'spell_warl_sayaad_precast_disorientation'),
|
||||
(366325,'spell_warl_sayaad_precast_disorientation'),
|
||||
(366222,'spell_warl_sayaad_precast_disorientation');
|
||||
@@ -29,6 +29,7 @@ enum PetEntry
|
||||
PET_SUCCUBUS = 1863,
|
||||
PET_DOOMGUARD = 18540,
|
||||
PET_FELGUARD = 30146,
|
||||
PET_INCUBUS = 184600,
|
||||
|
||||
// Death Knight pets
|
||||
PET_GHOUL = 26125,
|
||||
@@ -94,9 +95,10 @@ class TC_GAME_API Minion : public TempSummon
|
||||
bool IsPetImp() const { return GetEntry() == PET_IMP; }
|
||||
bool IsPetFelhunter() const { return GetEntry() == PET_FEL_HUNTER; }
|
||||
bool IsPetVoidwalker() const { return GetEntry() == PET_VOID_WALKER; }
|
||||
bool IsPetSuccubus() const { return GetEntry() == PET_SUCCUBUS; }
|
||||
bool IsPetSayaad() const { return GetEntry() == PET_SUCCUBUS || GetEntry() == PET_INCUBUS; }
|
||||
bool IsPetDoomguard() const { return GetEntry() == PET_DOOMGUARD; }
|
||||
bool IsPetFelguard() const { return GetEntry() == PET_FELGUARD; }
|
||||
bool IsWarlockPet() const { return IsPetImp() || IsPetFelhunter() || IsPetVoidwalker() || IsPetSayaad() || IsPetDoomguard() || IsPetFelguard(); }
|
||||
|
||||
// Death Knight pets
|
||||
bool IsPetGhoul() const { return GetEntry() == PET_GHOUL; } // Ghoul may be guardian or pet
|
||||
|
||||
@@ -931,7 +931,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetPowerType(POWER_ENERGY);
|
||||
SetFullPower(POWER_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(POWER_ENERGY);
|
||||
else
|
||||
SetPowerType(POWER_MANA);
|
||||
|
||||
@@ -111,6 +111,7 @@ enum class PetTameResult : uint8
|
||||
};
|
||||
|
||||
constexpr uint32 CALL_PET_SPELL_ID = 883;
|
||||
constexpr uint32 PET_SUMMONING_DISORIENTATION = 32752;
|
||||
|
||||
class PetStable
|
||||
{
|
||||
|
||||
@@ -6174,7 +6174,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
|
||||
{
|
||||
if (strict) //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
|
||||
if (Pet* pet = unitCaster->ToPlayer()->GetPet())
|
||||
pet->CastSpell(pet, 32752, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
|
||||
pet->CastSpell(pet, PET_SUMMONING_DISORIENTATION, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
|
||||
.SetOriginalCaster(pet->GetGUID())
|
||||
.SetTriggeringSpell(this));
|
||||
}
|
||||
|
||||
@@ -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