Skip to content

Commit

Permalink
Item: Implement Val'anyr effect (#471)
Browse files Browse the repository at this point in the history
* Item: Implement Val'anyr effect

* Item: Adjust Val'anyr proc

* Item: Move Blessing proc out of UnitAuraProcHandler
  • Loading branch information
insunaa authored Oct 28, 2023
1 parent b4a86fe commit ba289e6
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 18 deletions.
2 changes: 2 additions & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,8 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(62138,'spell_teleport_inside_violet_hold'),
(63482,'spell_lightning_whirl_heroic'),
(63845,'spell_create_lance'),
(64411,'spell_blessing_of_ancient_kings'),
(64415,'spell_valanyr_equip_effect'),
(64568,'spell_blood_reserve_enchant'),
(65869,'spell_disengage'),
(65932,'spell_retaliation_dummy_creature'),
Expand Down
52 changes: 52 additions & 0 deletions src/game/AI/ScriptDevAI/scripts/world/item_scripts_wotlk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,62 @@ struct Icecrown25MeleeTrinket : public AuraScript
}
};


// 64415 Val'anyr Hammer of Ancient Kings - Equip Effect
struct ValanyrEquipEffect : public AuraScript
{
bool OnCheckProc(Aura* /*aura*/, ProcExecutionData& procData) const override
{
if (procData.healthGain == 0)
return false;
return true;
}

SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override
{
if (!IsPositiveSpell(procData.spellInfo->Id))
return SPELL_AURA_PROC_FAILED;
procData.cooldown = 45;
return SPELL_AURA_PROC_OK;
}
};

enum
{
SPELL_PROTECTION_OF_ANCIENT_KINGS = 64413,
};

// 64411 Blessing of Ancient Kings
struct BlessingOfAncientKings : public AuraScript
{
SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override
{
if (!IsPositiveSpell(procData.spellInfo->Id))
return SPELL_AURA_PROC_FAILED;

procData.triggeredSpellId = SPELL_PROTECTION_OF_ANCIENT_KINGS;
procData.basepoints[0] = procData.damage * 15 / 100;
procData.triggerTarget = procData.target;
if (procData.target->HasAura(SPELL_PROTECTION_OF_ANCIENT_KINGS))
{
Unit* target = procData.target;
Aura* triggeredAura = target->GetAura(SPELL_PROTECTION_OF_ANCIENT_KINGS, EFFECT_INDEX_0);
if (!triggeredAura)
return SPELL_AURA_PROC_OK;
triggeredAura->GetHolder()->RefreshHolder();
triggeredAura->GetModifier()->m_amount = std::min(triggeredAura->GetModifier()->m_amount + procData.basepoints[0], 20000);
return SPELL_AURA_PROC_CANT_TRIGGER;
}
return SPELL_AURA_PROC_OK;
}
};

void AddSC_item_scripts_wotlk()
{
RegisterSpellScript<SwiftHandOfJustice>("spell_swift_hand_of_justice");
RegisterSpellScript<DiscerningEyeOfTheBeast>("spell_discerning_eye_of_the_beast");
RegisterSpellScript<ProcOnlyBelow35Percent>("spell_proc_only_below_35_percent");
RegisterSpellScript<Icecrown25MeleeTrinket>("spell_icecrown_25_melee_trinket");
RegisterSpellScript<ValanyrEquipEffect>("spell_valanyr_equip_effect");
RegisterSpellScript<BlessingOfAncientKings>("spell_blessing_of_ancient_kings");
}
18 changes: 0 additions & 18 deletions src/game/Spells/UnitAuraProcHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,17 +1608,6 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(ProcExecutionData& data)
pVictim->RemoveSpellsCausingAura(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
return SPELL_AURA_PROC_OK;
}
// Blessing of Ancient Kings
case 64411:
{
// for DOT procs
if (!IsPositiveSpell(spellInfo->Id))
return SPELL_AURA_PROC_FAILED;

triggered_spell_id = 64413;
basepoints[0] = damage * 15 / 100;
break;
}
}
break;
}
Expand Down Expand Up @@ -3237,13 +3226,6 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(ProcExecutionData& data
caster->InterruptNonMeleeSpells(false);
return SPELL_AURA_PROC_OK;
}
case 64415: // // Val'anyr Hammer of Ancient Kings - Equip Effect
{
// for DOT procs
if (!IsPositiveSpell(spellInfo->Id))
return SPELL_AURA_PROC_FAILED;
break;
}
case 64440: // Blade Warding
{
trigger_spell_id = 64442;
Expand Down

0 comments on commit ba289e6

Please sign in to comment.