mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/Items): HP-gated proc for low-HP tank trinkets (#25478)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: ariel- <ariel-@users.noreply.github.com> Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id` IN (45057, 52420, 71634, 71640, 75475, 75481) OR `ScriptName` IN ('spell_item_commendation_of_kaelthas', 'spell_item_corpse_tongue_coin', 'spell_item_corpse_tongue_coin_heroic', 'spell_item_petrified_twilight_scale', 'spell_item_petrified_twilight_scale_heroic', 'spell_item_soul_harvesters_charm');
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||||
|
(45057, 'spell_item_proc_below_pct_damaged'),
|
||||||
|
(52420, 'spell_item_proc_below_pct_damaged'),
|
||||||
|
(71634, 'spell_item_proc_below_pct_damaged'),
|
||||||
|
(71640, 'spell_item_proc_below_pct_damaged'),
|
||||||
|
(75475, 'spell_item_proc_below_pct_damaged'),
|
||||||
|
(75481, 'spell_item_proc_below_pct_damaged');
|
||||||
@@ -214,27 +214,11 @@ enum UnstablePower
|
|||||||
SPELL_UNSTABLE_POWER_AURA = 24659
|
SPELL_UNSTABLE_POWER_AURA = 24659
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CommendationOfKaelthas
|
|
||||||
{
|
|
||||||
SPELL_COMMENDATION_OF_KAELTHAS = 45480
|
|
||||||
};
|
|
||||||
|
|
||||||
enum CorpseTongueCoin
|
|
||||||
{
|
|
||||||
SPELL_CORPSE_TONGUE_COIN = 71633,
|
|
||||||
SPELL_CORPSE_TONGUE_COIN_HERO = 71634
|
|
||||||
};
|
|
||||||
|
|
||||||
enum CrystalSpireOfKarabor
|
enum CrystalSpireOfKarabor
|
||||||
{
|
{
|
||||||
SPELL_CRYSTAL_SPIRE_OF_KARABOR_MANA = 35476
|
SPELL_CRYSTAL_SPIRE_OF_KARABOR_MANA = 35476
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SoulHarvestersCharm
|
|
||||||
{
|
|
||||||
SPELL_SOUL_HARVESTERS_CHARM = 60513
|
|
||||||
};
|
|
||||||
|
|
||||||
enum SunwellExaltedNeck
|
enum SunwellExaltedNeck
|
||||||
{
|
{
|
||||||
SPELL_LIGHTS_WRATH = 45479,
|
SPELL_LIGHTS_WRATH = 45479,
|
||||||
@@ -260,12 +244,6 @@ enum TotemOfFlowingWater
|
|||||||
SPELL_TOTEM_OF_FLOWING_WATER_MANA = 28857
|
SPELL_TOTEM_OF_FLOWING_WATER_MANA = 28857
|
||||||
};
|
};
|
||||||
|
|
||||||
enum PetrifiedTwilightScale
|
|
||||||
{
|
|
||||||
SPELL_PETRIFIED_TWILIGHT_SCALE_HC = 75480,
|
|
||||||
SPELL_PETRIFIED_TWILIGHT_SCALE = 75477
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ShardOfTheScale
|
enum ShardOfTheScale
|
||||||
{
|
{
|
||||||
SPELL_PURIFIED_CAUTERIZING_HEAL = 69733,
|
SPELL_PURIFIED_CAUTERIZING_HEAL = 69733,
|
||||||
@@ -5706,67 +5684,30 @@ class spell_item_unstable_power : public AuraScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 45478 - Commendation of Kael'thas
|
// 45057 - Evasive Maneuvers (Commendation of Kael'thas)
|
||||||
class spell_item_commendation_of_kaelthas : public AuraScript
|
// 52420 - Deflection (Soul Harvester's Charm)
|
||||||
|
// 71634 - Item - Icecrown 25 Normal Tank Trinket 1 (Corpse Tongue Coin)
|
||||||
|
// 71640 - Item - Icecrown 25 Heroic Tank Trinket 1 (Corpse Tongue Coin (Heroic))
|
||||||
|
// 75475 - Item - Chamber of Aspects 25 Tank Trinket (Petrified Twilight Scale)
|
||||||
|
// 75481 - Item - Chamber of Aspects 25 Heroic Tank Trinket (Petrified Twilight Scale (Heroic))
|
||||||
|
// Trinkets that proc only when a melee hit drops you below EFFECT_0 % HP.
|
||||||
|
class spell_item_proc_below_pct_damaged : public AuraScript
|
||||||
{
|
{
|
||||||
PrepareAuraScript(spell_item_commendation_of_kaelthas);
|
PrepareAuraScript(spell_item_proc_below_pct_damaged);
|
||||||
|
|
||||||
bool CheckProc(ProcEventInfo& eventInfo)
|
bool CheckProc(ProcEventInfo& eventInfo)
|
||||||
{
|
{
|
||||||
if (HealInfo* healInfo = eventInfo.GetHealInfo())
|
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||||
if (Unit* target = healInfo->GetTarget())
|
if (!damageInfo || !damageInfo->GetDamage())
|
||||||
if (target->GetHealth() + healInfo->GetEffectiveHeal() >= target->GetMaxHealth())
|
return false;
|
||||||
return true;
|
|
||||||
return false;
|
int32 pct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
|
||||||
|
return eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
DoCheckProc += AuraCheckProcFn(spell_item_commendation_of_kaelthas::CheckProc);
|
DoCheckProc += AuraCheckProcFn(spell_item_proc_below_pct_damaged::CheckProc);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 71632 - Corpse Tongue Coin
|
|
||||||
class spell_item_corpse_tongue_coin : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_item_corpse_tongue_coin);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo({ SPELL_CORPSE_TONGUE_COIN });
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleProc(ProcEventInfo& eventInfo)
|
|
||||||
{
|
|
||||||
PreventDefaultAction();
|
|
||||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_CORPSE_TONGUE_COIN, true, nullptr, GetEffect(EFFECT_0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnProc += AuraProcFn(spell_item_corpse_tongue_coin::HandleProc);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 71639 - Corpse Tongue Coin (Heroic)
|
|
||||||
class spell_item_corpse_tongue_coin_heroic : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_item_corpse_tongue_coin_heroic);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo({ SPELL_CORPSE_TONGUE_COIN_HERO });
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleProc(ProcEventInfo& eventInfo)
|
|
||||||
{
|
|
||||||
PreventDefaultAction();
|
|
||||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_CORPSE_TONGUE_COIN_HERO, true, nullptr, GetEffect(EFFECT_0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnProc += AuraProcFn(spell_item_corpse_tongue_coin_heroic::HandleProc);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5788,28 +5729,6 @@ class spell_item_crystal_spire_of_karabor : public AuraScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 60512 - Soul Harvester's Charm
|
|
||||||
class spell_item_soul_harvesters_charm : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_item_soul_harvesters_charm);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo({ SPELL_SOUL_HARVESTERS_CHARM });
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleProc(ProcEventInfo& eventInfo)
|
|
||||||
{
|
|
||||||
PreventDefaultAction();
|
|
||||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_SOUL_HARVESTERS_CHARM, true, nullptr, GetEffect(EFFECT_0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnProc += AuraProcFn(spell_item_soul_harvesters_charm::HandleProc);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 45481 - Sunwell Exalted Caster Neck
|
// 45481 - Sunwell Exalted Caster Neck
|
||||||
class spell_item_sunwell_exalted_caster_neck : public AuraScript
|
class spell_item_sunwell_exalted_caster_neck : public AuraScript
|
||||||
{
|
{
|
||||||
@@ -6025,50 +5944,6 @@ class spell_item_totem_of_flowing_water : public AuraScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 75466 - Petrified Twilight Scale
|
|
||||||
class spell_item_petrified_twilight_scale : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_item_petrified_twilight_scale);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo({ SPELL_PETRIFIED_TWILIGHT_SCALE });
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleProc(ProcEventInfo& eventInfo)
|
|
||||||
{
|
|
||||||
PreventDefaultAction();
|
|
||||||
eventInfo.GetActionTarget()->CastSpell((Unit*)nullptr, SPELL_PETRIFIED_TWILIGHT_SCALE, true, nullptr, GetEffect(EFFECT_0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnProc += AuraProcFn(spell_item_petrified_twilight_scale::HandleProc);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 75473 - Petrified Twilight Scale (Heroic)
|
|
||||||
class spell_item_petrified_twilight_scale_heroic : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_item_petrified_twilight_scale_heroic);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo({ SPELL_PETRIFIED_TWILIGHT_SCALE_HC });
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleProc(ProcEventInfo& eventInfo)
|
|
||||||
{
|
|
||||||
PreventDefaultAction();
|
|
||||||
eventInfo.GetActionTarget()->CastSpell((Unit*)nullptr, SPELL_PETRIFIED_TWILIGHT_SCALE_HC, true, nullptr, GetEffect(EFFECT_0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnProc += AuraProcFn(spell_item_petrified_twilight_scale_heroic::HandleProc);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 69739 - Purified Shard of the Scale
|
// 69739 - Purified Shard of the Scale
|
||||||
class spell_item_purified_shard_of_the_scale : public AuraScript
|
class spell_item_purified_shard_of_the_scale : public AuraScript
|
||||||
{
|
{
|
||||||
@@ -6355,11 +6230,8 @@ void AddSC_item_spell_scripts()
|
|||||||
RegisterSpellScript(spell_item_pet_healing);
|
RegisterSpellScript(spell_item_pet_healing);
|
||||||
RegisterSpellScript(spell_item_restless_strength);
|
RegisterSpellScript(spell_item_restless_strength);
|
||||||
RegisterSpellScript(spell_item_unstable_power);
|
RegisterSpellScript(spell_item_unstable_power);
|
||||||
RegisterSpellScript(spell_item_commendation_of_kaelthas);
|
RegisterSpellScript(spell_item_proc_below_pct_damaged);
|
||||||
RegisterSpellScript(spell_item_corpse_tongue_coin);
|
|
||||||
RegisterSpellScript(spell_item_corpse_tongue_coin_heroic);
|
|
||||||
RegisterSpellScript(spell_item_crystal_spire_of_karabor);
|
RegisterSpellScript(spell_item_crystal_spire_of_karabor);
|
||||||
RegisterSpellScript(spell_item_soul_harvesters_charm);
|
|
||||||
RegisterSpellScript(spell_item_sunwell_exalted_caster_neck);
|
RegisterSpellScript(spell_item_sunwell_exalted_caster_neck);
|
||||||
RegisterSpellScript(spell_item_sunwell_exalted_healer_neck);
|
RegisterSpellScript(spell_item_sunwell_exalted_healer_neck);
|
||||||
RegisterSpellScript(spell_item_sunwell_exalted_melee_neck);
|
RegisterSpellScript(spell_item_sunwell_exalted_melee_neck);
|
||||||
@@ -6368,8 +6240,6 @@ void AddSC_item_spell_scripts()
|
|||||||
RegisterSpellScript(spell_item_tiny_abomination_in_a_jar);
|
RegisterSpellScript(spell_item_tiny_abomination_in_a_jar);
|
||||||
RegisterSpellScript(spell_item_tiny_abomination_in_a_jar_hero);
|
RegisterSpellScript(spell_item_tiny_abomination_in_a_jar_hero);
|
||||||
RegisterSpellScript(spell_item_totem_of_flowing_water);
|
RegisterSpellScript(spell_item_totem_of_flowing_water);
|
||||||
RegisterSpellScript(spell_item_petrified_twilight_scale);
|
|
||||||
RegisterSpellScript(spell_item_petrified_twilight_scale_heroic);
|
|
||||||
RegisterSpellScript(spell_item_purified_shard_of_the_scale);
|
RegisterSpellScript(spell_item_purified_shard_of_the_scale);
|
||||||
RegisterSpellScript(spell_item_shiny_shard_of_the_scale);
|
RegisterSpellScript(spell_item_shiny_shard_of_the_scale);
|
||||||
RegisterSpellScript(spell_item_living_root_of_the_wildheart);
|
RegisterSpellScript(spell_item_living_root_of_the_wildheart);
|
||||||
|
|||||||
Reference in New Issue
Block a user