Skip to content

Commit 2d805e0

Browse files
committed
Unit/Spell: Refactor existing absorb and death prevention into spell scripts
1 parent c25ddd8 commit 2d805e0

File tree

17 files changed

+339
-322
lines changed

17 files changed

+339
-322
lines changed

sql/scriptdev2/spell.sql

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
238238
(38760,'spell_void_blast'),
239239
(33558,'spell_draw_shadows_trigger'),
240240
(34662,'spell_bear_command'),
241+
(36815,'spell_shock_barrier'),
242+
(39228,'spell_argussian_compass'),
243+
(41341,'spell_balance_of_power'),
244+
(41475,'spell_reflective_shield_malande'),
241245
(41624,'spell_enfeeble_removal'),
242246
(32264,'spell_shirrak_inhibit_magic'),
243247
(33332,'spell_suppression_blast'),
@@ -1004,11 +1008,17 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
10041008
(52285,'spell_will_of_the_necropolis'),
10051009
(52286,'spell_will_of_the_necropolis'),
10061010
(50452,'spell_bloodworm'),
1011+
(49145,'spell_spell_deflection'),
1012+
(49495,'spell_spell_deflection'),
1013+
(49497,'spell_spell_deflection'),
10071014
(50453,'spell_health_leech_passive'),
10081015
(55078,'spell_death_knight_disease'),
10091016
(55095,'spell_death_knight_disease'),
10101017
(65142,'spell_crypt_fever_serverside'),
10111018
(51052,'spell_anti_magic_zone'),
1019+
(48707,'spell_anti_magic_shell_absorb_self'),
1020+
(50462,'spell_anti_magic_shell_zone'),
1021+
(50461,'spell_anti_zone_absorb'),
10121022
(55090,'spell_scourge_strike'),
10131023
(55265,'spell_scourge_strike'),
10141024
(55270,'spell_scourge_strike'),
@@ -1046,6 +1056,20 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
10461056
-- Priest
10471057
INSERT INTO spell_scripts(Id, ScriptName) VALUES
10481058
(10060,'spell_power_infusion'),
1059+
(17,'spell_power_word_shield_priest'),
1060+
(592,'spell_power_word_shield_priest'),
1061+
(600,'spell_power_word_shield_priest'),
1062+
(3747,'spell_power_word_shield_priest'),
1063+
(6065,'spell_power_word_shield_priest'),
1064+
(6066,'spell_power_word_shield_priest'),
1065+
(10898,'spell_power_word_shield_priest'),
1066+
(10899,'spell_power_word_shield_priest'),
1067+
(10900,'spell_power_word_shield_priest'),
1068+
(10901,'spell_power_word_shield_priest'),
1069+
(25217,'spell_power_word_shield_priest'),
1070+
(25218,'spell_power_word_shield_priest'),
1071+
(48065,'spell_power_word_shield_priest'),
1072+
(48066,'spell_power_word_shield_priest'),
10491073
(27827,'spell_spirit_of_redemption_heal'),
10501074
(33076,'spell_prayer_of_mending'),
10511075
(33206,'spell_pain_suppression'),
@@ -1074,6 +1098,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
10741098
(48085,'spell_lightwell_renew'),
10751099
(55673,'spell_glyph_of_lightwell'),
10761100
(60123,'spell_lightwell_relay'),
1101+
(47788,'spell_guardian_spirit_priest'),
10771102
(34861,'spell_circle_of_healing'),
10781103
(34863,'spell_circle_of_healing'),
10791104
(34864,'spell_circle_of_healing'),
@@ -1286,6 +1311,20 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
12861311
(12824,'spell_polymorph'),
12871312
(12825,'spell_polymorph'),
12881313
(12826,'spell_polymorph'),
1314+
(543,'spell_frost_warding'),
1315+
(8457,'spell_frost_warding'),
1316+
(8458,'spell_frost_warding'),
1317+
(10223,'spell_frost_warding'),
1318+
(10225,'spell_frost_warding'),
1319+
(27128,'spell_frost_warding'),
1320+
(43010,'spell_frost_warding'),
1321+
(6143,'spell_frost_warding'),
1322+
(8461,'spell_frost_warding'),
1323+
(8462,'spell_frost_warding'),
1324+
(10177,'spell_frost_warding'),
1325+
(28609,'spell_frost_warding'),
1326+
(32796,'spell_frost_warding'),
1327+
(43012,'spell_frost_warding'),
12891328
(58838,'spell_inherit_masters_threat_list'),
12901329
(59638,'spell_mirror_image_frostbolt');
12911330

@@ -1324,6 +1363,10 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
13241363
(27002,'spell_shred_druid'),
13251364
(48571,'spell_shred_druid'),
13261365
(48572,'spell_shred_druid'),
1366+
(33851,'spell_primal_tenacity'),
1367+
(33852,'spell_primal_tenacity'),
1368+
(33957,'spell_primal_tenacity'),
1369+
(69366,'spell_moonkin_form_passive'),
13271370
(40121,'spell_swift_flight_form_passive');
13281371

13291372
-- Rogue
@@ -1339,6 +1382,9 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
13391382
(2070,'spell_sap'), -- check ranks before changing
13401383
(11297,'spell_sap'),
13411384
(51724,'spell_sap'),
1385+
(31228,'spell_cheat_death_rogue'),
1386+
(31229,'spell_cheat_death_rogue'),
1387+
(31230,'spell_cheat_death_rogue'),
13421388
(14082,'spell_dirty_deeds'),
13431389
(14083,'spell_dirty_deeds'),
13441390
(13983,'spell_setup_rogue'),
@@ -1350,7 +1396,9 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
13501396
(51686,'spell_prey_on_the_weak'),
13511397
(51687,'spell_prey_on_the_weak'),
13521398
(51688,'spell_prey_on_the_weak'),
1353-
(51689,'spell_prey_on_the_weak');
1399+
(51689,'spell_prey_on_the_weak'),
1400+
(31130,'spell_nerves_of_steel'),
1401+
(31131,'spell_nerves_of_steel');
13541402

13551403
-- Shaman
13561404
INSERT INTO spell_scripts(Id, ScriptName) VALUES
@@ -1396,6 +1444,9 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
13961444
(58590,'spell_stoneclaw_totem_absorb'),
13971445
(58591,'spell_stoneclaw_totem_absorb'),
13981446
(70811,'spell_item_shaman_t10_elemental_2p_bonus'),
1447+
(51474,'spell_astral_shift_shaman'),
1448+
(51478,'spell_astral_shift_shaman'),
1449+
(51479,'spell_astral_shift_shaman'),
13991450
(2825,'spell_heroism_bloodlust'),
14001451
(32182,'spell_heroism_bloodlust');
14011452

src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ UnitAI* GetAI_npc_keeper_thorim(Creature* pCreature)
16521652

16531653
struct HodirsProtectiveGaze : AuraScript
16541654
{
1655-
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& dropCharge) const override
1655+
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& dropCharge, DamageEffectType /*damageType*/) const override
16561656
{
16571657
currentAbsorb = 0;
16581658
dropCharge = false;

src/game/AI/ScriptDevAI/scripts/outland/black_temple/boss_teron_gorefiend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ bool AreaTrigger_at_teron_gorefiend(Player* player, AreaTriggerEntry const* /*at
375375

376376
struct ShadowOfDeath : public AuraScript
377377
{
378-
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/) const override
378+
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
379379
{
380380
preventedDeath = true;
381381
currentAbsorb = 0;

src/game/AI/ScriptDevAI/scripts/outland/black_temple/illidari_council.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,31 @@ struct VerasDeadlyPoisonTick : public AuraScript
714714
}
715715
};
716716

717+
// 41341 - Balance of Power
718+
struct BalanceOfPower : public AuraScript
719+
{
720+
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& dropCharge, DamageEffectType /*damageType*/) const override
721+
{
722+
// unused atm
723+
remainingDamage += currentAbsorb;
724+
currentAbsorb = 0;
725+
dropCharge = false;
726+
}
727+
};
728+
729+
// 41475 - Reflective Shield
730+
struct ReflectiveShieldMalande : public AuraScript
731+
{
732+
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
733+
{
734+
if (remainingDamage < currentAbsorb)
735+
reflectDamage = remainingDamage / 2;
736+
else
737+
reflectDamage = currentAbsorb / 2;
738+
reflectedSpellId = 33619;
739+
}
740+
};
741+
717742
void AddSC_boss_illidari_council()
718743
{
719744
Script* pNewScript = new Script;
@@ -749,4 +774,6 @@ void AddSC_boss_illidari_council()
749774
RegisterSpellScript<VerasVanish>("spell_veras_vanish");
750775
RegisterSpellScript<VerasDeadlyPoison>("spell_veras_deadly_poison");
751776
RegisterSpellScript<VerasDeadlyPoisonTick>("spell_veras_deadly_poison_tick");
777+
RegisterSpellScript<BalanceOfPower>("spell_balance_of_power");
778+
RegisterSpellScript<ReflectiveShieldMalande>("spell_reflective_shield_malande");
752779
}

src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,19 @@ struct GravityLapseKnockup : public AuraScript
19281928
}
19291929
};
19301930

1931+
// 36815 - Shock Barrier
1932+
struct ShockBarrier : public AuraScript
1933+
{
1934+
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
1935+
{
1936+
reflectedSpellId = 36822;
1937+
if (remainingDamage < currentAbsorb)
1938+
reflectDamage = remainingDamage / 100;
1939+
else
1940+
reflectDamage = currentAbsorb / 100;
1941+
}
1942+
};
1943+
19311944
void AddSC_boss_kaelthas()
19321945
{
19331946
Script* pNewScript = new Script;
@@ -1966,4 +1979,5 @@ void AddSC_boss_kaelthas()
19661979
RegisterSpellScript<NetherVaporSummonParent>("spell_nether_vapor_summon_parent");
19671980
RegisterSpellScript<RemoveWeapons>("spell_remove_weapons");
19681981
RegisterSpellScript<GravityLapseKnockup>("spell_gravity_lapse_knockup");
1982+
RegisterSpellScript<ShockBarrier>("spell_shock_barrier");
19691983
}

src/game/AI/ScriptDevAI/scripts/world/item_scripts.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,18 @@ struct OrbOfDeception : public AuraScript
352352
}
353353
};
354354

355+
// 39228 - Argussian Compass
356+
struct ArgussianCompass : public AuraScript
357+
{
358+
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
359+
{
360+
// Max absorb stored in 1 dummy effect
361+
int32 max_absorb = aura->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1);
362+
if (max_absorb < currentAbsorb)
363+
currentAbsorb = max_absorb;
364+
}
365+
};
366+
355367
void AddSC_item_scripts()
356368
{
357369
Script* pNewScript = new Script;
@@ -389,4 +401,5 @@ void AddSC_item_scripts()
389401
RegisterSpellScript<ReducedProcChancePast60>("spell_reduced_proc_chance_past60");
390402
RegisterSpellScript<BanishExile>("spell_banish_exile");
391403
RegisterSpellScript<OrbOfDeception>("spell_orb_of_deception");
404+
RegisterSpellScript<ArgussianCompass>("spell_argussian_compass");
392405
}

0 commit comments

Comments
 (0)