aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-06-27 12:58:44 +0200
committerShauren <shauren.trinity@gmail.com>2024-06-27 12:58:44 +0200
commita33864ce2d9038e491fe99eba8acc532ebd6327f (patch)
tree927d3e51d3793aa36398a5f2092f26ea45514254 /src/server/scripts
parentcb335c32740d0af87ae693e4ea3833236354d080 (diff)
Scripts/Spells: Implemented Dark Simulacrum and its related attribute SPELL_ATTR9_ALLOW_DARK_SIMULACRUM
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 31a8e5c65cf..0254f2abbdb 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -49,6 +49,8 @@ enum DeathKnightSpells
SPELL_DK_BLOOD_SHIELD_MASTERY = 77513,
SPELL_DK_BREATH_OF_SINDRAGOSA = 152279,
SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999,
+ SPELL_DK_DARK_SIMULACRUM_BUFF = 77616,
+ SPELL_DK_DARK_SIMULACRUM_SPELLPOWER_BUFF = 94984,
SPELL_DK_DEATH_AND_DECAY_DAMAGE = 52212,
SPELL_DK_DEATH_COIL_DAMAGE = 47632,
SPELL_DK_DEATH_GRIP_DUMMY = 243912,
@@ -324,6 +326,72 @@ class spell_dk_dancing_rune_weapon : public AuraScript
}
};
+// 77606 - Dark Simulacrum
+class spell_dk_dark_simulacrum : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_DK_DARK_SIMULACRUM_BUFF, SPELL_DK_DARK_SIMULACRUM_SPELLPOWER_BUFF });
+ }
+
+ bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
+ {
+ Spell const* procSpell = eventInfo.GetProcSpell();
+ if (!procSpell)
+ return false;
+
+ if (!GetTarget()->IsPlayer())
+ return procSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR9_ALLOW_DARK_SIMULACRUM);
+
+ if (!procSpell->HasPowerTypeCost(POWER_MANA))
+ return false;
+
+ // filter out spells not castable by mind controlled players (teleports, summons, item creations (healthstones))
+ if (procSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR1_NO_AUTOCAST_AI))
+ return false;
+
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
+ {
+ Unit* caster = GetCaster();
+ if (!caster)
+ return;
+
+ caster->CastSpell(caster, SPELL_DK_DARK_SIMULACRUM_BUFF, CastSpellExtraArgs()
+ .SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR)
+ .SetTriggeringSpell(eventInfo.GetProcSpell())
+ .AddSpellMod(SPELLVALUE_BASE_POINT0, eventInfo.GetSpellInfo()->Id));
+
+ caster->CastSpell(caster, SPELL_DK_DARK_SIMULACRUM_SPELLPOWER_BUFF, CastSpellExtraArgs()
+ .SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR)
+ .SetTriggeringSpell(eventInfo.GetProcSpell())
+ .AddSpellMod(SPELLVALUE_BASE_POINT0, GetTarget()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_MAGIC))
+ .AddSpellMod(SPELLVALUE_BASE_POINT1, GetTarget()->SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_MAGIC)));
+ }
+
+ void Register() override
+ {
+ DoCheckEffectProc += AuraCheckEffectProcFn(spell_dk_dark_simulacrum::CheckProc, EFFECT_0, SPELL_AURA_DUMMY);
+ OnEffectProc += AuraEffectProcFn(spell_dk_dark_simulacrum::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+};
+
+// 77616 - Dark Simulacrum
+class spell_dk_dark_simulacrum_buff : public AuraScript
+{
+ bool CheckProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
+ {
+ return uint32(aurEff->GetAmount()) == eventInfo.GetSpellInfo()->Id;
+ }
+
+ void Register() override
+ {
+ DoCheckEffectProc += AuraCheckEffectProcFn(spell_dk_dark_simulacrum_buff::CheckProc, EFFECT_0, SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_TRIGGERED);
+ }
+};
+
// 43265 - Death and Decay (Aura)
class spell_dk_death_and_decay : public AuraScript
{
@@ -951,6 +1019,8 @@ void AddSC_deathknight_spell_scripts()
RegisterSpellScript(spell_dk_blinding_sleet);
RegisterSpellScript(spell_dk_blood_boil);
RegisterSpellScript(spell_dk_dancing_rune_weapon);
+ RegisterSpellScript(spell_dk_dark_simulacrum);
+ RegisterSpellScript(spell_dk_dark_simulacrum_buff);
RegisterSpellScript(spell_dk_death_and_decay);
RegisterSpellScript(spell_dk_death_coil);
RegisterSpellScript(spell_dk_death_gate);