Core/Spells: partially implement Dancing Rune Weapon and handle Blood DK t12 4p bonus

This commit is contained in:
Ovahlord
2022-01-05 23:43:43 +01:00
parent e84bb6e6ba
commit 2161908280
3 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_dk_dancing_rune_weapon';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(49028, 'spell_dk_dancing_rune_weapon');
UPDATE `creature_template` SET `ScriptName`= 'npc_pet_dk_rune_weapon', `flags_extra`= 0 WHERE `entry`= 27893;
DELETE FROM `spell_proc` WHERE `SpellId`= 49028;
INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellTypeMask`, `SpellPhaseMask`) VALUES
(49028, 15, 1, 2);

View File

@@ -293,10 +293,35 @@ private:
bool _readyToAttack;
};
enum DancingRuneWeapon
{
SPELL_COPY_WEAPON_1 = 63416,
SPELL_DANCING_RUNE_WEAPON_VISUAL = 53160,
SPELL_COPY_WEAPON_2 = 63418
};
struct npc_pet_dk_rune_weapon : public AggressorAI
{
npc_pet_dk_rune_weapon(Creature* creature) : AggressorAI(creature) { }
void IsSummonedBy(Unit* summoner) override
{
if (!summoner)
return;
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
for (uint32 spellId : { SPELL_COPY_WEAPON_1, SPELL_COPY_WEAPON_2 })
DoCast(summoner, spellId, true);
DoCastSelf(SPELL_DANCING_RUNE_WEAPON_VISUAL);
}
};
void AddSC_deathknight_pet_scripts()
{
new npc_pet_dk_ebon_gargoyle();
new npc_pet_dk_guardian();
RegisterCreatureAI(npc_pet_dk_army_of_the_dead_ghoul);
RegisterSpellScript(spell_pet_ghoul_dummy_ability);
RegisterCreatureAI(npc_pet_dk_rune_weapon);
}

View File

@@ -47,6 +47,7 @@ enum DeathKnightSpells
SPELL_DK_BLOOD_TAP = 45529,
SPELL_DK_BUTCHERY = 50163,
SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999,
SPELL_DK_DANCING_RUNE_WEAPON_PARRY_BONUS = 81256,
SPELL_DK_DARK_TRANSFORMATION = 63560,
SPELL_DK_DARK_TRANSFORMATION_DUMMY = 93426,
SPELL_DK_DEATH_AND_DECAY_DAMAGE = 52212,
@@ -61,6 +62,7 @@ enum DeathKnightSpells
SPELL_DK_DEATH_STRIKE_HEAL = 45470,
SPELL_DK_DEATH_STRIKE_ENABLER = 89832,
SPELL_DK_EBON_PLAGUE = 65142,
SPELL_DK_FLAMING_RUNE_WEAPON = 101162,
SPELL_DK_FLAMING_TORRENT = 99000,
SPELL_DK_FROST_FEVER = 55095,
SPELL_DK_FROST_PRESENCE = 48266,
@@ -76,6 +78,7 @@ enum DeathKnightSpells
SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962,
SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736,
SPELL_DK_ITEM_T11_DPS_4P_BONUS = 90459,
SPELL_DK_ITEM_T12_BLOOD_4P_BONUS = 98966,
SPELL_DK_MASTER_OF_GHOULS = 52143,
SPELL_DK_OBLITERATE = 49020,
SPELL_DK_OBLITERATE_OFFHAND = 66198,
@@ -271,6 +274,11 @@ class spell_dk_death_and_decay : public AuraScript
// 47541 - Death Coil
class spell_dk_death_coil : public SpellScript
{
bool Load() override
{
return GetCaster()->IsPlayer();
}
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo(
@@ -1719,6 +1727,60 @@ class spell_dk_smoldering_rune : public AuraScript
}
};
// 49028 - Dancing Rune Weapon
class spell_dk_dancing_rune_weapon : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_DK_ITEM_T12_BLOOD_4P_BONUS,
SPELL_DK_FLAMING_RUNE_WEAPON,
SPELL_DK_DANCING_RUNE_WEAPON_PARRY_BONUS
});
}
void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->CastSpell(nullptr, SPELL_DK_DANCING_RUNE_WEAPON_PARRY_BONUS, aurEff);
}
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (AuraEffect const* t12Bonus = target->GetAuraEffect(SPELL_DK_ITEM_T12_BLOOD_4P_BONUS, EFFECT_0))
target->CastSpell(nullptr, SPELL_DK_FLAMING_RUNE_WEAPON, CastSpellExtraArgs(aurEff).AddSpellBP0(t12Bonus->GetAmount()));
target->RemoveAurasDueToSpell(SPELL_DK_DANCING_RUNE_WEAPON_PARRY_BONUS);
}
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetProcTarget() && eventInfo.GetProcSpell() && eventInfo.GetProcSpell()->GetCaster() == GetTarget();
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
std::list<Creature*> runeWeapon;
GetTarget()->GetAllMinionsByEntry(runeWeapon, GetSpellInfo()->Effects[EFFECT_0].MiscValue);
if (runeWeapon.empty())
return;
for (Creature* weapon : runeWeapon)
weapon->CastSpell(eventInfo.GetProcTarget(), eventInfo.GetSpellInfo()->Id, true);
}
void Register() override
{
AfterEffectApply.Register(&spell_dk_dancing_rune_weapon::HandleApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove.Register(&spell_dk_dancing_rune_weapon::HandleEffectRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
DoCheckProc.Register(&spell_dk_dancing_rune_weapon::CheckProc);
OnEffectProc.Register(&spell_dk_dancing_rune_weapon::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};
void AddSC_deathknight_spell_scripts()
{
RegisterSpellScript(spell_dk_anti_magic_shell);
@@ -1729,6 +1791,7 @@ void AddSC_deathknight_spell_scripts()
RegisterSpellScript(spell_dk_blood_rites);
RegisterSpellScript(spell_dk_butchery);
RegisterSpellScript(spell_dk_crimson_scourge);
RegisterSpellScript(spell_dk_dancing_rune_weapon);
RegisterSpellScript(spell_dk_dark_transformation);
RegisterSpellScript(spell_dk_dark_transformation_aura);
RegisterSpellScript(spell_dk_death_and_decay);