Skip to content

Commit

Permalink
DK: Fix or implement all DK glyphs
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Oct 5, 2023
1 parent 9724885 commit ec88df8
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 1 deletion.
14 changes: 14 additions & 0 deletions sql/base/dbc/cmangos_fixes/Spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3458,6 +3458,20 @@ UPDATE spell_template SET EffectSpellClassMask1_1=0x20200021,EffectSpellClassMas
UPDATE spell_template SET EffectSpellClassMask1_1=0x20200021,EffectSpellClassMask1_2=0x00009000,EffectSpellClassMask1_3=0x0 WHERE Id IN(55339);
UPDATE spell_template SET EffectSpellClassMask1_1=0x20200021,EffectSpellClassMask1_2=0x00009000,EffectSpellClassMask1_3=0x0 WHERE Id IN(55340);

-- DK glyphs
-- Glyph of Chains of Ice
UPDATE spell_template SET EffectSpellClassMask1_1=0x000004 WHERE Id IN(58620);
-- Glyph of Heart Strike
UPDATE spell_template SET EffectSpellClassMask1_1=0x01000000 WHERE Id IN(58616);
-- glyph of obliterate - wrong effects
UPDATE spell_template SET Effect1=0 WHERE Id=58671; -- WTF - was meant to be removed
-- glyph of scourge strike - wrong trigger spell
UPDATE spell_template SET EffectTriggerSpell1=69961 WHERE Id IN(58642);
-- glyph of rune tap - wrong mask
UPDATE spell_template SET EffectSpellClassMask1_1=0x08000000 WHERE Id IN(58620);
-- glyph of death's embrace - wrong mask
UPDATE spell_template SET EffectSpellClassMask1_1=0x00002000 WHERE Id IN(58620);

-- ============================================================
-- Missing WotLK Achievement Spells
-- ============================================================
Expand Down
11 changes: 11 additions & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,17 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(49471,'spell_glacier_rot'),
(49790,'spell_glacier_rot'),
(49791,'spell_glacier_rot'),
(48792,'spell_icebound_fortitude'),
(49020,'spell_obliterate_dk'),
(51423,'spell_obliterate_dk'),
(51424,'spell_obliterate_dk'),
(51425,'spell_obliterate_dk'),
(66198,'spell_obliterate_dk'),
(66972,'spell_obliterate_dk'),
(66973,'spell_obliterate_dk'),
(66974,'spell_obliterate_dk'),
(69961,'spell_glyph_of_scourge_strike'),
(58677,'spell_glyph_of_deaths_embrace'),
(55090,'spell_scourge_strike'),
(55265,'spell_scourge_strike'),
(55270,'spell_scourge_strike'),
Expand Down
78 changes: 78 additions & 0 deletions src/game/Spells/Scripts/Scripting/ClassScripts/DeathKnight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,80 @@ struct GlacierRot : public AuraScript
}
};

// 48792 - Icebound Fortitude
struct IceboundFortitude : public AuraScript
{
int32 OnAuraValueCalculate(AuraCalcData& data, int32 value) const override
{
if (data.effIdx == EFFECT_INDEX_2)
{
if (data.caster)
{
if (Aura* aura = data.caster->GetAura(58625, EFFECT_INDEX_0))
value = aura->GetAmount();

if (data.caster->IsPlayer())
{
Player* player = static_cast<Player*>(data.caster);
uint32 defValue = uint32(player->GetSkillValue(SKILL_DEFENSE)) + player->GetRatingBonusValue(CR_DEFENSE_SKILL);
if (defValue > 400) // patch 3.0.8 - 35% reduction for 540 def
value += int32((defValue - 400) * 0.11);
}
}
}
return value;
}
};

// 49020 - Obliterate
struct ObliterateDK : public SpellScript
{
void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override
{
// in official data, supposedly removed eff 1 is not removed, effect 0 that worked differently isnt removed, and actual functionality is stored in eff2
if (effIdx == EFFECT_INDEX_1)
if (Aura* glyphOfObliterate = spell->GetCaster()->GetAura(58671, EFFECT_INDEX_1))
spell->SetDamageDoneModifier(glyphOfObliterate->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2), EFFECT_INDEX_1);
}
};

// 69961 - Glyph of Scourge Strike
struct GlyphOfScourgeStrike : public SpellScript
{
void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override
{
SpellEntry const* spellInfo = spell->GetTriggeredByAuraSpellInfo();
Unit* target = spell->GetUnitTarget();
auto& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for (auto& aura : auras)
{
// your diseases
if (aura->GetSpellProto()->Dispel == DISPEL_DISEASE &&
aura->GetCasterGuid() == spell->GetCaster()->GetObjectGuid())
{
int32 increaseAmount = spellInfo->CalculateSimpleValue(EFFECT_INDEX_0);
int32 maxIncreaseAmount = spellInfo->CalculateSimpleValue(EFFECT_INDEX_1);
if (aura->GetScriptValue() >= maxIncreaseAmount)
return;
SpellAuraHolder* holder = aura->GetHolder();
holder->SetAuraMaxDuration(holder->GetAuraMaxDuration() + increaseAmount);
holder->SetAuraDuration(holder->GetAuraDuration() + increaseAmount);
holder->SendAuraUpdate(false);
aura->SetScriptValue(aura->GetScriptValue() + increaseAmount);
}
}
}
};

// 58677 - Glyph of Death's Embrace
struct GlyphOfDeathsEmbrace : public AuraScript
{
bool OnCheckProc(Aura* /*aura*/, ProcExecutionData& data) const override
{
return data.isHeal;
}
};

void LoadDeathKnightScripts()
{
RegisterSpellScript<ScourgeStrike>("spell_scourge_strike");
Expand Down Expand Up @@ -713,6 +787,10 @@ void LoadDeathKnightScripts()
RegisterSpellScript<TundraStalker>("spell_tundra_stalker");
RegisterSpellScript<RageOfRivendare>("spell_rage_of_rivendare");
RegisterSpellScript<GlacierRot>("spell_glacier_rot");
RegisterSpellScript<IceboundFortitude>("spell_icebound_fortitude");
RegisterSpellScript<ObliterateDK>("spell_obliterate_dk");
RegisterSpellScript<GlyphOfScourgeStrike>("spell_glyph_of_scourge_strike");
RegisterSpellScript<GlyphOfDeathsEmbrace>("spell_glyph_of_deaths_embrace");

Script* pNewScript = new Script;
pNewScript->Name = "npc_gargoyle_dk";
Expand Down
2 changes: 1 addition & 1 deletion src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct ShredDruid : public SpellScript
Unit* target = spell->GetUnitTarget();
if (Aura* rip = target->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x0, 0x00200000, spell->GetCaster()->GetObjectGuid()))
{
int32 increaseAmount = rip->GetAmount();
int32 increaseAmount = glyphOfShred->GetAmount();
int32 maxIncreaseAmount = spell->GetCaster()->CalculateSpellEffectValue(target, rip->GetSpellProto(), EFFECT_INDEX_1);
if (rip->GetScriptValue() >= maxIncreaseAmount)
return;
Expand Down

0 comments on commit ec88df8

Please sign in to comment.