Merge branch 'master' into 4.3.4

Conflicts:
	src/server/game/Battlegrounds/Battleground.cpp
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Battlegrounds/BattlegroundMgr.h
	src/server/game/Battlegrounds/BattlegroundQueue.cpp
	src/server/game/DataStores/DBCfmt.h
	src/server/game/Guilds/Guild.cpp
	src/server/game/Handlers/BattleGroundHandler.cpp
	src/server/game/Handlers/BattlefieldHandler.cpp
	src/server/game/Handlers/GuildHandler.cpp
	src/server/game/Movement/Spline/MoveSplineInit.cpp
	src/server/game/Movement/Spline/MovementPacketBuilder.cpp
	src/server/game/Movement/Spline/MovementUtil.cpp
	src/server/game/Server/WorldSession.cpp
	src/server/game/Spells/Auras/SpellAuras.cpp
	src/server/game/Spells/Spell.cpp
	src/server/game/Spells/SpellEffects.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
	src/server/scripts/EasternKingdoms/boss_kruul.cpp
	src/server/scripts/Kalimdor/zone_feralas.cpp
	src/server/scripts/Spells/spell_druid.cpp
	src/server/scripts/Spells/spell_mage.cpp
	src/server/scripts/Spells/spell_paladin.cpp
	src/server/scripts/Spells/spell_rogue.cpp
	src/server/scripts/Spells/spell_shaman.cpp
	src/server/scripts/Spells/spell_warlock.cpp
	src/server/scripts/Spells/spell_warrior.cpp
	src/server/shared/Packets/ByteBuffer.h
This commit is contained in:
Spp committed 2013-01-14 11:04:03 +01:00
commit d75222feca
486 files changed
+3261 -2604

No files matched your search

+1 -1
View File
@@ -172,7 +172,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
return true;
}
bool Validate(SpellInfo const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT))
return false;
+42 -33
View File
@@ -29,18 +29,19 @@
enum DruidSpells
{
DRUID_INCREASED_MOONFIRE_DURATION = 38414,
DRUID_NATURES_SPLENDOR = 57865,
DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
DRUID_LIFEBLOOM_ENERGIZE = 64372,
DRUID_SURVIVAL_INSTINCTS = 50322,
DRUID_SAVAGE_ROAR = 62071,
SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950,
SPELL_KING_OF_THE_JUNGLE = 48492,
SPELL_TIGER_S_FURY_ENERGIZE = 51178,
SPELL_ENRAGE_MOD_DAMAGE = 51185,
SPELL_DRUID_ENRAGE_MOD_DAMAGE = 51185,
SPELL_DRUID_INCREASED_MOONFIRE_DURATION = 38414,
SPELL_DRUID_KING_OF_THE_JUNGLE = 48492,
SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372,
SPELL_DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
SPELL_DRUID_NATURES_SPLENDOR = 57865,
SPELL_DRUID_SURVIVAL_INSTINCTS = 50322,
SPELL_DRUID_SAVAGE_ROAR = 62071,
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178,
SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950,
};
// -5229 - Enrage
class spell_dru_enrage : public SpellScriptLoader
{
public:
@@ -52,8 +53,8 @@ class spell_dru_enrage : public SpellScriptLoader
void OnHit()
{
if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_0))
GetHitUnit()->CastCustomSpell(SPELL_ENRAGE_MOD_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_0))
GetHitUnit()->CastCustomSpell(SPELL_DRUID_ENRAGE_MOD_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
}
void Register()
@@ -68,7 +69,7 @@ class spell_dru_enrage : public SpellScriptLoader
}
};
// 54846 Glyph of Starfire
// 54846 - Glyph of Starfire
class spell_dru_glyph_of_starfire : public SpellScriptLoader
{
public:
@@ -78,9 +79,9 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
{
PrepareSpellScript(spell_dru_glyph_of_starfire_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR))
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(SPELL_DRUID_NATURES_SPLENDOR))
return false;
return true;
}
@@ -95,9 +96,9 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
uint32 countMin = aura->GetMaxDuration();
uint32 countMax = aura->GetSpellInfo()->GetMaxDuration() + 9000;
if (caster->HasAura(DRUID_INCREASED_MOONFIRE_DURATION))
if (caster->HasAura(SPELL_DRUID_INCREASED_MOONFIRE_DURATION))
countMax += 3000;
if (caster->HasAura(DRUID_NATURES_SPLENDOR))
if (caster->HasAura(SPELL_DRUID_NATURES_SPLENDOR))
countMax += 3000;
if (countMin < countMax)
@@ -120,6 +121,7 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
}
};
// -5570 - Insect Swarm
class spell_dru_insect_swarm : public SpellScriptLoader
{
public:
@@ -282,9 +284,9 @@ class spell_dru_lifebloom : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_FINAL_HEAL))
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_FINAL_HEAL))
return false;
if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_ENERGIZE))
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_ENERGIZE))
return false;
return true;
}
@@ -303,15 +305,15 @@ class spell_dru_lifebloom : public SpellScriptLoader
healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack);
healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack);
GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
// restore mana
int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
return;
}
GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
}
void HandleDispel(DispelInfo* dispelInfo)
@@ -326,15 +328,15 @@ class spell_dru_lifebloom : public SpellScriptLoader
{
healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
// restore mana
int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
return;
}
target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
}
}
}
@@ -396,6 +398,7 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader
}
};
// -16972 - Predatory Strikes
class spell_dru_predatory_strikes : public SpellScriptLoader
{
public:
@@ -511,6 +514,7 @@ class spell_dru_savage_defense : public SpellScriptLoader
}
};
// 52610 - Savage Roar
class spell_dru_savage_roar : public SpellScriptLoader
{
public:
@@ -541,7 +545,7 @@ class spell_dru_savage_roar : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(DRUID_SAVAGE_ROAR))
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SAVAGE_ROAR))
return false;
return true;
}
@@ -549,12 +553,12 @@ class spell_dru_savage_roar : public SpellScriptLoader
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->CastSpell(target, DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
target->CastSpell(target, SPELL_DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
}
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(DRUID_SAVAGE_ROAR);
GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_SAVAGE_ROAR);
}
void Register()
@@ -575,6 +579,7 @@ class spell_dru_savage_roar : public SpellScriptLoader
}
};
// -50294 - Starfall (AOE)
class spell_dru_starfall_aoe : public SpellScriptLoader
{
public:
@@ -601,6 +606,7 @@ class spell_dru_starfall_aoe : public SpellScriptLoader
}
};
// -50286 - Starfall (Dummy)
class spell_dru_starfall_dummy : public SpellScriptLoader
{
public:
@@ -646,6 +652,7 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
}
};
// 61336 - Survival Instincts
class spell_dru_survival_instincts : public SpellScriptLoader
{
public:
@@ -676,7 +683,7 @@ class spell_dru_survival_instincts : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(DRUID_SURVIVAL_INSTINCTS))
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SURVIVAL_INSTINCTS))
return false;
return true;
}
@@ -685,12 +692,12 @@ class spell_dru_survival_instincts : public SpellScriptLoader
{
Unit* target = GetTarget();
int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount());
target->CastCustomSpell(target, DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
target->CastCustomSpell(target, SPELL_DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
}
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(DRUID_SURVIVAL_INSTINCTS);
GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_SURVIVAL_INSTINCTS);
}
void Register()
@@ -745,6 +752,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
}
};
// -5217 - Tiger's Fury
class spell_dru_tiger_s_fury : public SpellScriptLoader
{
public:
@@ -756,8 +764,8 @@ class spell_dru_tiger_s_fury : public SpellScriptLoader
void OnHit()
{
if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_1))
GetHitUnit()->CastCustomSpell(SPELL_TIGER_S_FURY_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_1))
GetHitUnit()->CastCustomSpell(SPELL_DRUID_TIGER_S_FURY_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
}
void Register()
@@ -772,6 +780,7 @@ class spell_dru_tiger_s_fury : public SpellScriptLoader
}
};
// 70691 - Item T10 Restoration 4P Bonus
class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
{
public:
+1 -1
View File
@@ -1539,7 +1539,7 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader
void HandleDummy(SpellEffIndex /* effIndex */)
{
Unit* caster = GetCaster();
caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE , true);
caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE, true);
}
void Register()
+5 -3
View File
@@ -17,6 +17,7 @@
/*
* Spells used in holidays/game events that do not fit any other category.
* Ordered alphabetically using scriptname.
* Scriptnames in this file should be prefixed with "spell_#holidayname_".
*/
@@ -133,6 +134,7 @@ class spell_hallow_end_trick : public SpellScriptLoader
class spell_hallow_end_trick_SpellScript : public SpellScript
{
PrepareSpellScript(spell_hallow_end_trick_SpellScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE)
@@ -170,7 +172,7 @@ class spell_hallow_end_trick : public SpellScriptLoader
break;
}
caster->CastSpell(target, spellId, true, NULL);
caster->CastSpell(target, spellId, true);
}
}
@@ -218,8 +220,8 @@ class spell_hallow_end_trick_or_treat : public SpellScriptLoader
Unit* caster = GetCaster();
if (Player* target = GetHitPlayer())
{
caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL);
caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL);
caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true);
caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true);
}
}
@@ -286,7 +286,6 @@ class spell_hun_last_stand_pet : public SpellScriptLoader
void Register()
{
// add dummy effect spell handler to pet's Last Stand
OnEffectHitTarget += SpellEffectFn(spell_hun_last_stand_pet_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -452,7 +451,6 @@ class spell_hun_pet_carrion_feeder : public SpellScriptLoader
void Register()
{
// add dummy effect spell handler to pet's Last Stand
OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear);
}
@@ -501,7 +499,6 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader
void Register()
{
// add dummy effect spell handler to pet's Last Stand
OnEffectHitTarget += SpellEffectFn(spell_hun_pet_heart_of_the_phoenix_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -551,7 +548,6 @@ class spell_hun_readiness : public SpellScriptLoader
void Register()
{
// add dummy effect spell handler to Readiness
OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
+3 -3
View File
@@ -1350,7 +1350,7 @@ class spell_item_poultryizer : public SpellScriptLoader
void HandleDummy(SpellEffIndex /* effIndex */)
{
if (GetCastItem() && GetHitUnit())
GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE , true, GetCastItem());
GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE, true, GetCastItem());
}
void Register()
@@ -1710,7 +1710,7 @@ class spell_item_teach_language : public SpellScriptLoader
Player* caster = GetCaster()->ToPlayer();
if (roll_chance_i(34))
caster->CastSpell(caster,caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true);
caster->CastSpell(caster, caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true);
}
void Register()
@@ -2004,7 +2004,7 @@ public:
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (GetHitUnit())
GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL);
GetCaster()->CastSpell(GetCaster(), SPELL_FORCE_CAST_SUMMON_GNOME_SOUL);
}
void Register()
+5 -7
View File
@@ -71,7 +71,7 @@ class spell_mage_blast_wave : public SpellScriptLoader
{
PrepareSpellScript(spell_mage_blast_wave_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FLAMESTRIKE))
return false;
@@ -131,7 +131,6 @@ class spell_mage_cold_snap : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
// immediately finishes the cooldown on Frost spells
const SpellCooldowns& cm = caster->GetSpellCooldownMap();
@@ -152,7 +151,6 @@ class spell_mage_cold_snap : public SpellScriptLoader
void Register()
{
// add dummy effect spell handler to Cold Snap
OnEffectHit += SpellEffectFn(spell_mage_cold_snap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -553,7 +551,7 @@ class spell_mage_ice_barrier : public SpellScriptLoader
{
PrepareAuraScript(spell_mage_ice_barrier_AuraScript);
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
return;
@@ -587,7 +585,7 @@ class spell_mage_mana_shield : public SpellScriptLoader
{
PrepareAuraScript(spell_mage_mana_shield_AuraScript);
void HandleAbsorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
{
if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
{
@@ -596,7 +594,7 @@ class spell_mage_mana_shield : public SpellScriptLoader
}
}
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK, true);
@@ -626,7 +624,7 @@ class spell_mage_mage_ward : public SpellScriptLoader
{
PrepareAuraScript(spell_mage_mage_ward_AuraScript);
void HandleAbsorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
{
if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
{
+440 -425
View File
@@ -29,28 +29,28 @@
enum PaladinSpells
{
PALADIN_SPELL_DIVINE_PLEA = 54428,
PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF = 67480,
SPELL_PALADIN_DIVINE_PLEA = 54428,
SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF = 67480,
PALADIN_SPELL_HOLY_SHOCK_R1 = 20473,
PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE = 25912,
PALADIN_SPELL_HOLY_SHOCK_R1_HEALING = 25914,
SPELL_PALADIN_HOLY_SHOCK_R1 = 20473,
SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE = 25912,
SPELL_PALADIN_HOLY_SHOCK_R1_HEALING = 25914,
SPELL_BLESSING_OF_LOWER_CITY_DRUID = 37878,
SPELL_BLESSING_OF_LOWER_CITY_PALADIN = 37879,
SPELL_BLESSING_OF_LOWER_CITY_PRIEST = 37880,
SPELL_BLESSING_OF_LOWER_CITY_SHAMAN = 37881,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID = 37878,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN = 37879,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST = 37880,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN = 37881,
SPELL_DIVINE_STORM = 53385,
SPELL_DIVINE_STORM_DUMMY = 54171,
SPELL_DIVINE_STORM_HEAL = 54172,
SPELL_PALADIN_DIVINE_STORM = 53385,
SPELL_PALADIN_DIVINE_STORM_DUMMY = 54171,
SPELL_PALADIN_DIVINE_STORM_HEAL = 54172,
SPELL_FORBEARANCE = 25771,
SPELL_AVENGING_WRATH_MARKER = 61987,
SPELL_IMMUNE_SHIELD_MARKER = 61988,
SPELL_PALADIN_FORBEARANCE = 25771,
SPELL_PALADIN_AVENGING_WRATH_MARKER = 61987,
SPELL_PALADIN_IMMUNE_SHIELD_MARKER = 61988,
SPELL_HAND_OF_SACRIFICE = 6940,
SPELL_DIVINE_SACRIFICE = 64205,
SPELL_PALADIN_HAND_OF_SACRIFICE = 6940,
SPELL_PALADIN_DIVINE_SACRIFICE = 64205,
};
// 31850 - Ardent Defender
@@ -129,6 +129,7 @@ enum PaladinSpells
}
};*/
// 37877 - Blessing of Faith
class spell_pal_blessing_of_faith : public SpellScriptLoader
{
public:
@@ -138,9 +139,9 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader
{
PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN))
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN))
return false;
return true;
}
@@ -152,11 +153,20 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader
uint32 spell_id = 0;
switch (unitTarget->getClass())
{
case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break;
case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break;
case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break;
case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break;
default: return; // ignore for non-healing classes
case CLASS_DRUID:
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID;
break;
case CLASS_PALADIN:
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN;
break;
case CLASS_PRIEST:
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST;
break;
case CLASS_SHAMAN:
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN;
break;
default:
return; // ignore for non-healing classes
}
Unit* caster = GetCaster();
caster->CastSpell(caster, spell_id, true);
@@ -165,7 +175,6 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader
void Register()
{
// add dummy effect spell handler to Blessing of Faith
OnEffectHitTarget += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -187,9 +196,9 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader
{
PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript);
bool Validate(SpellInfo const* /*entry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF))
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF))
return false;
return true;
}
@@ -198,13 +207,13 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader
{
Unit* target = GetTarget();
if (Unit* caster = GetCaster())
caster->CastSpell(target, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true);
caster->CastSpell(target, SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF, true);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID());
target->RemoveAura(SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID());
}
void Register()
@@ -220,399 +229,7 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader
}
};
// 63521 Guarded by The Light
class spell_pal_guarded_by_the_light : public SpellScriptLoader
{
public:
spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { }
class spell_pal_guarded_by_the_light_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_DIVINE_PLEA))
return false;
return true;
}
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
// Divine Plea
if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA))
aura->RefreshDuration();
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_guarded_by_the_light_SpellScript();
}
};
class spell_pal_holy_shock : public SpellScriptLoader
{
public:
spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { }
class spell_pal_holy_shock_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_holy_shock_SpellScript);
bool Validate(SpellInfo const* spell)
{
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1))
return false;
// can't use other spell than holy shock due to spell_ranks dependency
if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
return false;
uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
{
uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
if (caster->IsFriendlyTo(unitTarget))
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0);
else
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
}
}
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (Unit* target = GetExplTargetUnit())
{
if (!caster->IsFriendlyTo(target))
{
if (!caster->IsValidAttackTarget(target))
return SPELL_FAILED_BAD_TARGETS;
if (!caster->isInFront(target))
return SPELL_FAILED_UNIT_NOT_INFRONT;
}
}
else
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
void Register()
{
// add dummy effect spell handler to Holy Shock
OnCheckCast += SpellCheckCastFn(spell_pal_holy_shock_SpellScript::CheckCast);
OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_holy_shock_SpellScript();
}
};
class spell_pal_judgement_of_command : public SpellScriptLoader
{
public:
spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { }
class spell_pal_judgement_of_command_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_judgement_of_command_SpellScript)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* unitTarget = GetHitUnit())
if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
}
void Register()
{
// add dummy effect spell handler to Judgement of Command
OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_judgement_of_command_SpellScript();
}
};
class spell_pal_divine_storm : public SpellScriptLoader
{
public:
spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { }
class spell_pal_divine_storm_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_divine_storm_SpellScript);
uint32 healPct;
bool Validate(SpellInfo const* /* spell */)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_DUMMY))
return false;
return true;
}
bool Load()
{
healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
return true;
}
void TriggerHeal()
{
Unit* caster = GetCaster();
caster->CastCustomSpell(SPELL_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, caster, true);
}
void Register()
{
AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_divine_storm_SpellScript();
}
};
class spell_pal_divine_storm_dummy : public SpellScriptLoader
{
public:
spell_pal_divine_storm_dummy() : SpellScriptLoader("spell_pal_divine_storm_dummy") { }
class spell_pal_divine_storm_dummy_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript);
bool Validate(SpellInfo const* /* spell */)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_HEAL))
return false;
return true;
}
void CountTargets(std::list<WorldObject*>& targetList)
{
_targetCount = targetList.size();
}
void HandleDummy(SpellEffIndex /* effIndex */)
{
if (!_targetCount || ! GetHitUnit())
return;
int32 heal = GetEffectValue() / _targetCount;
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_DIVINE_STORM_HEAL, &heal, NULL, NULL, true);
}
private:
uint32 _targetCount;
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_divine_storm_dummy_SpellScript();
}
};
class spell_pal_lay_on_hands : public SpellScriptLoader
{
public:
spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { }
class spell_pal_lay_on_hands_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_lay_on_hands_SpellScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_FORBEARANCE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_AVENGING_WRATH_MARKER))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_IMMUNE_SHIELD_MARKER))
return false;
return true;
}
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (Unit* target = GetExplTargetUnit())
if (caster == target)
if (target->HasAura(SPELL_FORBEARANCE) || target->HasAura(SPELL_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_IMMUNE_SHIELD_MARKER))
return SPELL_FAILED_TARGET_AURASTATE;
return SPELL_CAST_OK;
}
void HandleScript()
{
Unit* caster = GetCaster();
if (caster == GetHitUnit())
{
caster->CastSpell(caster, SPELL_FORBEARANCE, true);
caster->CastSpell(caster, SPELL_AVENGING_WRATH_MARKER, true);
caster->CastSpell(caster, SPELL_IMMUNE_SHIELD_MARKER, true);
}
}
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast);
AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_lay_on_hands_SpellScript();
}
};
class spell_pal_righteous_defense : public SpellScriptLoader
{
public:
spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { }
class spell_pal_righteous_defense_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_righteous_defense_SpellScript);
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (caster->GetTypeId() != TYPEID_PLAYER)
return SPELL_FAILED_DONT_REPORT;
if (Unit* target = GetExplTargetUnit())
{
if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
return SPELL_FAILED_BAD_TARGETS;
}
else
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_righteous_defense_SpellScript();
}
};
class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader
{
public:
spell_pal_exorcism_and_holy_wrath_damage() : SpellScriptLoader("spell_pal_exorcism_and_holy_wrath_damage") { }
class spell_pal_exorcism_and_holy_wrath_damage_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_exorcism_and_holy_wrath_damage_AuraScript);
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
{
if (!spellMod)
{
spellMod = new SpellModifier(aurEff->GetBase());
spellMod->op = SPELLMOD_DAMAGE;
spellMod->type = SPELLMOD_FLAT;
spellMod->spellId = GetId();
spellMod->mask[1] = 0x200002;
}
spellMod->value = aurEff->GetAmount();
}
void Register()
{
DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_pal_exorcism_and_holy_wrath_damage_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const
{
return new spell_pal_exorcism_and_holy_wrath_damage_AuraScript();
}
};
class spell_pal_hand_of_sacrifice : public SpellScriptLoader
{
public:
spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { }
class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript);
int32 remainingAmount;
bool Load()
{
if (Unit* caster = GetCaster())
{
remainingAmount = caster->GetMaxHealth();
return true;
}
return false;
}
void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount)
{
remainingAmount -= splitAmount;
if (remainingAmount <= 0)
{
GetTarget()->RemoveAura(SPELL_HAND_OF_SACRIFICE);
}
}
void Register()
{
OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0);
}
};
AuraScript* GetAuraScript() const
{
return new spell_pal_hand_of_sacrifice_AuraScript();
}
};
// 64205 - Divine Sacrifice
class spell_pal_divine_sacrifice : public SpellScriptLoader
{
public:
@@ -653,7 +270,7 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader
// break when absorbed everything it could, or if the casters hp drops below 20%
if (Unit* caster = GetCaster())
if (remainingAmount <= 0 || (caster->GetHealthPct() < minHpPct))
caster->RemoveAura(SPELL_DIVINE_SACRIFICE);
caster->RemoveAura(SPELL_PALADIN_DIVINE_SACRIFICE);
}
void Register()
@@ -668,6 +285,406 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader
}
};
// 53385 - Divine Storm
class spell_pal_divine_storm : public SpellScriptLoader
{
public:
spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { }
class spell_pal_divine_storm_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_divine_storm_SpellScript);
uint32 healPct;
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_DUMMY))
return false;
return true;
}
bool Load()
{
healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
return true;
}
void TriggerHeal()
{
Unit* caster = GetCaster();
caster->CastCustomSpell(SPELL_PALADIN_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, caster, true);
}
void Register()
{
AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_divine_storm_SpellScript();
}
};
// 54171 - Divine Storm (Dummy)
class spell_pal_divine_storm_dummy : public SpellScriptLoader
{
public:
spell_pal_divine_storm_dummy() : SpellScriptLoader("spell_pal_divine_storm_dummy") { }
class spell_pal_divine_storm_dummy_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_HEAL))
return false;
return true;
}
void CountTargets(std::list<WorldObject*>& targetList)
{
_targetCount = targetList.size();
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (!_targetCount || ! GetHitUnit())
return;
int32 heal = GetEffectValue() / _targetCount;
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_PALADIN_DIVINE_STORM_HEAL, &heal, NULL, NULL, true);
}
private:
uint32 _targetCount;
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_divine_storm_dummy_SpellScript();
}
};
// 33695 - Exorcism and Holy Wrath Damage
class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader
{
public:
spell_pal_exorcism_and_holy_wrath_damage() : SpellScriptLoader("spell_pal_exorcism_and_holy_wrath_damage") { }
class spell_pal_exorcism_and_holy_wrath_damage_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_exorcism_and_holy_wrath_damage_AuraScript);
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
{
if (!spellMod)
{
spellMod = new SpellModifier(aurEff->GetBase());
spellMod->op = SPELLMOD_DAMAGE;
spellMod->type = SPELLMOD_FLAT;
spellMod->spellId = GetId();
spellMod->mask[1] = 0x200002;
}
spellMod->value = aurEff->GetAmount();
}
void Register()
{
DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_pal_exorcism_and_holy_wrath_damage_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const
{
return new spell_pal_exorcism_and_holy_wrath_damage_AuraScript();
}
};
// 63521 - Guarded by The Light
class spell_pal_guarded_by_the_light : public SpellScriptLoader
{
public:
spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { }
class spell_pal_guarded_by_the_light_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_PLEA))
return false;
return true;
}
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
// Divine Plea
if (Aura* aura = GetCaster()->GetAura(SPELL_PALADIN_DIVINE_PLEA))
aura->RefreshDuration();
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_guarded_by_the_light_SpellScript();
}
};
// 6940 - Hand of Sacrifice
class spell_pal_hand_of_sacrifice : public SpellScriptLoader
{
public:
spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { }
class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript);
int32 remainingAmount;
bool Load()
{
if (Unit* caster = GetCaster())
{
remainingAmount = caster->GetMaxHealth();
return true;
}
return false;
}
void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount)
{
remainingAmount -= splitAmount;
if (remainingAmount <= 0)
{
GetTarget()->RemoveAura(SPELL_PALADIN_HAND_OF_SACRIFICE);
}
}
void Register()
{
OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0);
}
};
AuraScript* GetAuraScript() const
{
return new spell_pal_hand_of_sacrifice_AuraScript();
}
};
// -20473 - Holy Shock
class spell_pal_holy_shock : public SpellScriptLoader
{
public:
spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { }
class spell_pal_holy_shock_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_holy_shock_SpellScript);
bool Validate(SpellInfo const* spell)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1))
return false;
// can't use other spell than holy shock due to spell_ranks dependency
if (sSpellMgr->GetFirstSpellInChain(SPELL_PALADIN_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
return false;
uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
if (!sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank, true))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
{
uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
if (caster->IsFriendlyTo(unitTarget))
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true, 0);
else
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
}
}
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (Unit* target = GetExplTargetUnit())
{
if (!caster->IsFriendlyTo(target))
{
if (!caster->IsValidAttackTarget(target))
return SPELL_FAILED_BAD_TARGETS;
if (!caster->isInFront(target))
return SPELL_FAILED_UNIT_NOT_INFRONT;
}
}
else
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_pal_holy_shock_SpellScript::CheckCast);
OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_holy_shock_SpellScript();
}
};
// 20425 - Judgement of Command
class spell_pal_judgement_of_command : public SpellScriptLoader
{
public:
spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { }
class spell_pal_judgement_of_command_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_judgement_of_command_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* unitTarget = GetHitUnit())
if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_judgement_of_command_SpellScript();
}
};
// -633 - Lay on Hands
class spell_pal_lay_on_hands : public SpellScriptLoader
{
public:
spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { }
class spell_pal_lay_on_hands_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_lay_on_hands_SpellScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_FORBEARANCE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_AVENGING_WRATH_MARKER))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_IMMUNE_SHIELD_MARKER))
return false;
return true;
}
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (Unit* target = GetExplTargetUnit())
if (caster == target)
if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || target->HasAura(SPELL_PALADIN_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER))
return SPELL_FAILED_TARGET_AURASTATE;
return SPELL_CAST_OK;
}
void HandleScript()
{
Unit* caster = GetCaster();
if (caster == GetHitUnit())
{
caster->CastSpell(caster, SPELL_PALADIN_FORBEARANCE, true);
caster->CastSpell(caster, SPELL_PALADIN_AVENGING_WRATH_MARKER, true);
caster->CastSpell(caster, SPELL_PALADIN_IMMUNE_SHIELD_MARKER, true);
}
}
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast);
AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_lay_on_hands_SpellScript();
}
};
// 31789 - Righteous Defense
class spell_pal_righteous_defense : public SpellScriptLoader
{
public:
spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { }
class spell_pal_righteous_defense_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_righteous_defense_SpellScript);
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (caster->GetTypeId() != TYPEID_PLAYER)
return SPELL_FAILED_DONT_REPORT;
if (Unit* target = GetExplTargetUnit())
{
if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
return SPELL_FAILED_BAD_TARGETS;
}
else
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast);
}
};
SpellScript* GetSpellScript() const
{
return new spell_pal_righteous_defense_SpellScript();
}
};
class spell_pal_sacred_shield : public SpellScriptLoader
{
public:
@@ -712,8 +729,6 @@ void AddSC_paladin_spell_scripts()
new spell_pal_hand_of_sacrifice();
new spell_pal_holy_shock();
new spell_pal_judgement_of_command();
new spell_pal_divine_storm();
new spell_pal_divine_storm_dummy();
new spell_pal_lay_on_hands();
new spell_pal_righteous_defense();
new spell_pal_sacred_shield();
+1 -1
View File
@@ -1433,7 +1433,7 @@ public:
if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL)
amount = -90;
// Night of the dead
else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD))
else if (Aura* aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD))
amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
}
}
+45
View File
@@ -25,6 +25,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellAuras.h"
#include "Vehicle.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
@@ -1517,6 +1518,49 @@ class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScriptLoad
}
};
enum SpellZuldrakRat
{
SPELL_SUMMON_GORGED_LURKING_BASILISK = 50928
};
class spell_q12527_zuldrak_rat : public SpellScriptLoader
{
public:
spell_q12527_zuldrak_rat() : SpellScriptLoader("spell_q12527_zuldrak_rat") { }
class spell_q12527_zuldrak_rat_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q12527_zuldrak_rat_SpellScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_GORGED_LURKING_BASILISK))
return false;
return true;
}
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount)
{
GetHitUnit()->CastSpell((Unit*) NULL, SPELL_SUMMON_GORGED_LURKING_BASILISK, true);
if (Creature* basilisk = GetHitUnit()->ToCreature())
basilisk->DespawnOrUnsummon();
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_q12527_zuldrak_rat_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_q12527_zuldrak_rat_SpellScript();
}
};
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -1554,4 +1598,5 @@ void AddSC_quest_spell_scripts()
new spell_q11010_q11102_q11023_choose_loc();
new spell_q11010_q11102_q11023_q11008_check_fly_mount();
new spell_q12372_azure_on_death_force_whisper();
new spell_q12527_zuldrak_rat();
}
+361 -363
View File
@@ -30,285 +30,27 @@
enum ShamanSpells
{
SHAMAN_SPELL_FLAME_SHOCK = 8050,
SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
SHAMAN_SPELL_SATED = 57724,
SHAMAN_SPELL_EXHAUSTION = 57723,
HUNTER_SPELL_INSANITY = 95809,
MAGE_SPELL_TEMPORAL_DISPLACEMENT = 80354,
SHAMAN_SPELL_EARTH_GRASP = 51483,
EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695,
// For Earthen Power
SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474,
SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566,
SHAMAN_BIND_SIGHT = 6277,
ICON_ID_SHAMAN_LAVA_FLOW = 3087,
SHAMAN_LAVA_FLOWS_R1 = 51480,
SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 65264,
SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC = 52752,
ICON_ID_SOOTHING_RAIN = 2011,
SPELL_HEALING_STREAM_TOTEM_HEAL = 52042,
SPELL_HUNTER_INSANITY = 95809,
SPELL_MAGE_TEMPORAL_DISPLACEMENT = 80354,
SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC = 52752,
SPELL_SHAMAN_BIND_SIGHT = 6277,
SPELL_SHAMAN_EXHAUSTION = 57723,
SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1 = 8349,
SPELL_SHAMAN_FLAME_SHOCK = 8050,
SPELL_SHAMAN_LAVA_FLOWS_R1 = 51480,
SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 65264,
SPELL_SHAMAN_SATED = 57724,
SPELL_SHAMAN_STORM_EARTH_AND_FIRE = 51483,
SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB = 64695,
SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM = 6474,
SPELL_SHAMAN_TOTEM_EARTHEN_POWER = 59566,
SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL = 52042
};
// 1535 Fire Nova
/// Updated 4.3.4
class spell_sha_fire_nova : public SpellScriptLoader
enum ShamanSpellIcons
{
public:
spell_sha_fire_nova() : SpellScriptLoader("spell_sha_fire_nova") { }
class spell_sha_fire_nova_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_fire_nova_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
{
if (target->HasAura(SHAMAN_SPELL_FLAME_SHOCK))
{
caster->CastSpell(target, SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, true);
target->RemoveAurasDueToSpell(SHAMAN_SPELL_FLAME_SHOCK);
}
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_fire_nova_SpellScript();
}
};
// 16191 Mana Tide
/// Updated 4.3.4
class spell_sha_mana_tide : public SpellScriptLoader
{
public:
spell_sha_mana_tide() : SpellScriptLoader("spell_sha_mana_tide") { }
class spell_sha_mana_tide_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_mana_tide_AuraScript);
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
{
///@TODO: Exclude the "short term" buffs from the stat value
if (Unit* caster = GetCaster())
if (Unit* owner = caster->GetOwner())
amount = CalculatePct(owner->GetStat(STAT_SPIRIT), aurEff->GetAmount());
}
void Register()
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_mana_tide_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
}
};
AuraScript* GetAuraScript() const
{
return new spell_sha_mana_tide_AuraScript();
}
};
// 6474 - Earthbind Totem - Fix Talent:Earthen Power, Earth's Grasp
/// Updated 4.3.4
class spell_sha_earthbind_totem : public SpellScriptLoader
{
public:
spell_sha_earthbind_totem() : SpellScriptLoader("spell_sha_earthbind_totem") { }
class spell_sha_earthbind_totem_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_earthbind_totem_AuraScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM) || !sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER))
return false;
return true;
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if (!GetCaster())
return;
if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself())
if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
if (roll_chance_i(aur->GetBaseAmount()))
GetTarget()->CastSpell((Unit*)NULL, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true);
}
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (!GetCaster())
return;
Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself();
if (!owner)
return;
// Earth's Grasp
if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_EARTH_GRASP, EFFECT_1))
{
if (roll_chance_i(aurEff->GetAmount()))
GetCaster()->CastSpell(GetCaster(), EARTHBIND_TOTEM_SPELL_EARTHGRAB, false);
}
}
void Register()
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
OnEffectApply += AuraEffectApplyFn(spell_sha_earthbind_totem_AuraScript::Apply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_sha_earthbind_totem_AuraScript();
}
};
class EarthenPowerTargetSelector
{
public:
EarthenPowerTargetSelector() { }
bool operator() (WorldObject* target)
{
if (!target->ToUnit())
return true;
if (!target->ToUnit()->HasAuraWithMechanic(1 << MECHANIC_SNARE))
return true;
return false;
}
};
class spell_sha_earthen_power : public SpellScriptLoader
{
public:
spell_sha_earthen_power() : SpellScriptLoader("spell_sha_earthen_power") { }
class spell_sha_earthen_power_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_earthen_power_SpellScript);
void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(EarthenPowerTargetSelector());
}
void Register()
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_earthen_power_SpellScript();
}
};
/// Updated 4.3.4
class spell_sha_bloodlust : public SpellScriptLoader
{
public:
spell_sha_bloodlust() : SpellScriptLoader("spell_sha_bloodlust") { }
class spell_sha_bloodlust_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_bloodlust_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_SATED))
return false;
return true;
}
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED));
targets.remove_if(Trinity::UnitAuraCheck(true, HUNTER_SPELL_INSANITY));
targets.remove_if(Trinity::UnitAuraCheck(true, MAGE_SPELL_TEMPORAL_DISPLACEMENT));
}
void ApplyDebuff()
{
if (Unit* target = GetHitUnit())
target->CastSpell(target, SHAMAN_SPELL_SATED, true);
}
void Register()
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_bloodlust_SpellScript();
}
};
/// Updated 4.3.4
class spell_sha_heroism : public SpellScriptLoader
{
public:
spell_sha_heroism() : SpellScriptLoader("spell_sha_heroism") { }
class spell_sha_heroism_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_heroism_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_EXHAUSTION))
return false;
return true;
}
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION));
targets.remove_if(Trinity::UnitAuraCheck(true, HUNTER_SPELL_INSANITY));
targets.remove_if(Trinity::UnitAuraCheck(true, MAGE_SPELL_TEMPORAL_DISPLACEMENT));
}
void ApplyDebuff()
{
if (Unit* target = GetHitUnit())
target->CastSpell(target, SHAMAN_SPELL_EXHAUSTION, true);
}
void Register()
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_heroism_SpellScript();
}
SHAMAN_ICON_ID_SOOTHING_RAIN = 2011,
SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW = 3087
};
/// Updated 4.3.4
@@ -321,18 +63,18 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
{
PrepareSpellScript(spell_sha_ancestral_awakening_proc_SpellScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC))
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC))
return false;
return true;
}
void HandleDummy(SpellEffIndex /* effIndex */)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
if (GetCaster() && GetHitUnit())
GetCaster()->CastCustomSpell(GetHitUnit(), SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true);
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true);
}
void Register()
@@ -348,95 +90,47 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
};
/// Updated 4.3.4
class spell_sha_healing_stream_totem : public SpellScriptLoader
class spell_sha_bloodlust : public SpellScriptLoader
{
public:
spell_sha_healing_stream_totem() : SpellScriptLoader("spell_sha_healing_stream_totem") { }
spell_sha_bloodlust() : SpellScriptLoader("spell_sha_bloodlust") { }
class spell_sha_healing_stream_totem_SpellScript : public SpellScript
class spell_sha_bloodlust_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_healing_stream_totem_SpellScript);
PrepareSpellScript(spell_sha_bloodlust_SpellScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
return sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL);
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_SATED))
return false;
return true;
}
void HandleDummy(SpellEffIndex /* effIndex */)
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SHAMAN_SATED));
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_HUNTER_INSANITY));
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_MAGE_TEMPORAL_DISPLACEMENT));
}
void ApplyDebuff()
{
int32 damage = GetEffectValue();
SpellInfo const* triggeringSpell = GetTriggeringSpell();
if (Unit* target = GetHitUnit())
if (Unit* caster = GetCaster())
{
if (Unit* owner = caster->GetOwner())
{
if (triggeringSpell)
damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL));
// Soothing Rains
if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_SOOTHING_RAIN, EFFECT_0))
AddPct(damage, dummy->GetAmount());
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
}
caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
}
target->CastSpell(target, SPELL_SHAMAN_SATED, true);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_sha_healing_stream_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_healing_stream_totem_SpellScript();
}
};
/// Updated 4.3.4
class spell_sha_lava_lash : public SpellScriptLoader
{
public:
spell_sha_lava_lash() : SpellScriptLoader("spell_sha_lava_lash") { }
class spell_sha_lava_lash_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_lava_lash_SpellScript)
bool Load()
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void HandleDummy(SpellEffIndex /* effIndex */)
{
if (Player* caster = GetCaster()->ToPlayer())
{
int32 damage = GetEffectValue();
int32 hitDamage = GetHitDamage();
if (caster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
{
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
AddPct(hitDamage, damage);
SetHitDamage(hitDamage);
}
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_sha_lava_lash_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_lava_lash_SpellScript();
return new spell_sha_bloodlust_SpellScript();
}
};
@@ -497,6 +191,141 @@ class spell_sha_chain_heal : public SpellScriptLoader
}
};
// 6474 - Earthbind Totem - Fix Talent:Earthen Power, Earth's Grasp
/// Updated 4.3.4
class spell_sha_earthbind_totem : public SpellScriptLoader
{
public:
spell_sha_earthbind_totem() : SpellScriptLoader("spell_sha_earthbind_totem") { }
class spell_sha_earthbind_totem_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_earthbind_totem_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_EARTHEN_POWER))
return false;
return true;
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if (!GetCaster())
return;
if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself())
if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
if (roll_chance_i(aur->GetBaseAmount()))
GetTarget()->CastSpell((Unit*)NULL, SPELL_SHAMAN_TOTEM_EARTHEN_POWER, true);
}
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (!GetCaster())
return;
Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself();
if (!owner)
return;
// Earth's Grasp
if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SPELL_SHAMAN_STORM_EARTH_AND_FIRE, EFFECT_1))
{
if (roll_chance_i(aurEff->GetAmount()))
GetCaster()->CastSpell(GetCaster(), SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB, false);
}
}
void Register()
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
OnEffectApply += AuraEffectApplyFn(spell_sha_earthbind_totem_AuraScript::Apply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_sha_earthbind_totem_AuraScript();
}
};
class EarthenPowerTargetSelector
{
public:
EarthenPowerTargetSelector() { }
bool operator() (WorldObject* target)
{
if (!target->ToUnit())
return true;
if (!target->ToUnit()->HasAuraWithMechanic(1 << MECHANIC_SNARE))
return true;
return false;
}
};
class spell_sha_earthen_power : public SpellScriptLoader
{
public:
spell_sha_earthen_power() : SpellScriptLoader("spell_sha_earthen_power") { }
class spell_sha_earthen_power_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_earthen_power_SpellScript);
void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(EarthenPowerTargetSelector());
}
void Register()
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_earthen_power_SpellScript();
}
};
// 1535 Fire Nova
/// Updated 4.3.4
class spell_sha_fire_nova : public SpellScriptLoader
{
public:
spell_sha_fire_nova() : SpellScriptLoader("spell_sha_fire_nova") { }
class spell_sha_fire_nova_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_fire_nova_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
{
if (target->HasAura(SPELL_SHAMAN_FLAME_SHOCK))
{
caster->CastSpell(target, SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, true);
target->RemoveAurasDueToSpell(SPELL_SHAMAN_FLAME_SHOCK);
}
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_fire_nova_SpellScript();
}
};
/// Updated 4.3.4
class spell_sha_flame_shock : public SpellScriptLoader
{
@@ -509,9 +338,9 @@ class spell_sha_flame_shock : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_R1))
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_R1))
return false;
if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_TRIGGERED_R1))
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1))
return false;
return true;
}
@@ -521,13 +350,13 @@ class spell_sha_flame_shock : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
// Lava Flows
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0))
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0))
{
if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
if (sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
return;
int32 basepoints = aurEff->GetAmount();
caster->CastCustomSpell(caster, SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, NULL, NULL, true);
caster->CastCustomSpell(caster, SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, NULL, NULL, true);
}
}
}
@@ -544,17 +373,186 @@ class spell_sha_flame_shock : public SpellScriptLoader
}
};
/// Updated 4.3.4
class spell_sha_healing_stream_totem : public SpellScriptLoader
{
public:
spell_sha_healing_stream_totem() : SpellScriptLoader("spell_sha_healing_stream_totem") { }
class spell_sha_healing_stream_totem_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_healing_stream_totem_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
return sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL);
}
void HandleDummy(SpellEffIndex /* effIndex */)
{
int32 damage = GetEffectValue();
SpellInfo const* triggeringSpell = GetTriggeringSpell();
if (Unit* target = GetHitUnit())
if (Unit* caster = GetCaster())
{
if (Unit* owner = caster->GetOwner())
{
if (triggeringSpell)
damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL));
// Soothing Rains
if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_SOOTHING_RAIN, EFFECT_0))
AddPct(damage, dummy->GetAmount());
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
}
caster->CastCustomSpell(target, SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_sha_healing_stream_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_healing_stream_totem_SpellScript();
}
};
/// Updated 4.3.4
class spell_sha_heroism : public SpellScriptLoader
{
public:
spell_sha_heroism() : SpellScriptLoader("spell_sha_heroism") { }
class spell_sha_heroism_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_heroism_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EXHAUSTION))
return false;
return true;
}
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SHAMAN_EXHAUSTION));
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_HUNTER_INSANITY));
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_MAGE_TEMPORAL_DISPLACEMENT));
}
void ApplyDebuff()
{
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_SHAMAN_EXHAUSTION, true);
}
void Register()
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_heroism_SpellScript();
}
};
/// Updated 4.3.4
class spell_sha_lava_lash : public SpellScriptLoader
{
public:
spell_sha_lava_lash() : SpellScriptLoader("spell_sha_lava_lash") { }
class spell_sha_lava_lash_SpellScript : public SpellScript
{
PrepareSpellScript(spell_sha_lava_lash_SpellScript)
bool Load()
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Player* caster = GetCaster()->ToPlayer())
{
int32 damage = GetEffectValue();
int32 hitDamage = GetHitDamage();
if (caster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
{
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
AddPct(hitDamage, damage);
SetHitDamage(hitDamage);
}
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_sha_lava_lash_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_sha_lava_lash_SpellScript();
}
};
// 16191 Mana Tide
/// Updated 4.3.4
class spell_sha_mana_tide_totem : public SpellScriptLoader
{
public:
spell_sha_mana_tide_totem() : SpellScriptLoader("spell_sha_mana_tide_totem") { }
class spell_sha_mana_tide_totem_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_mana_tide_totem_AuraScript);
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
{
///@TODO: Exclude the "short term" buffs from the stat value
if (Unit* caster = GetCaster())
if (Unit* owner = caster->GetOwner())
amount = CalculatePct(owner->GetStat(STAT_SPIRIT), aurEff->GetAmount());
}
void Register()
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_mana_tide_totem_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
}
};
AuraScript* GetAuraScript() const
{
return new spell_sha_mana_tide_totem_AuraScript();
}
};
void AddSC_shaman_spell_scripts()
{
new spell_sha_fire_nova();
new spell_sha_mana_tide();
new spell_sha_ancestral_awakening_proc();
new spell_sha_bloodlust();
new spell_sha_chain_heal();
new spell_sha_earthbind_totem();
new spell_sha_earthen_power();
new spell_sha_bloodlust();
new spell_sha_heroism();
new spell_sha_ancestral_awakening_proc();
new spell_sha_healing_stream_totem();
new spell_sha_lava_lash();
new spell_sha_chain_heal();
new spell_sha_fire_nova();
new spell_sha_flame_shock();
new spell_sha_healing_stream_totem();
new spell_sha_heroism();
new spell_sha_lava_lash();
new spell_sha_mana_tide_totem();
}
+446 -438
View File
@@ -28,145 +28,86 @@
enum WarlockSpells
{
WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435,
WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443,
WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508,
WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509,
WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444,
WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692,
WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693,
WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018,
WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020,
WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
WARLOCK_HAUNT = 48181,
WARLOCK_HAUNT_HEAL = 48210,
WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
WARLOCK_BANE_OF_DOOM_EFFECT = 18662,
WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703,
WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704,
WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955,
WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
WARLOCK_SOULSHATTER = 32835,
WARLOCK_LIFE_TAP_ENERGIZE = 31818,
WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553,
WARLOCK_IMPROVED_LIFE_TAP_ICON_ID = 208,
WARLOCK_MANA_FEED_ICON_ID = 1982,
SPELL_WARLOCK_BANE_OF_DOOM_EFFECT = 18662,
SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018,
SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020,
SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435,
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443,
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508,
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509,
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444,
SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692,
SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693,
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703,
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704,
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955,
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
SPELL_WARLOCK_HAUNT = 48181,
SPELL_WARLOCK_HAUNT_HEAL = 48210,
SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818,
SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553,
SPELL_WARLOCK_SOULSHATTER = 32835,
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117
};
enum WarlockSpellIcons
{
WARLOCK_ICON_ID_IMPROVED_LIFE_TAP = 208,
WARLOCK_ICON_ID_MANA_FEED = 1982
};
/// Updated 4.3.4
class spell_warl_banish : public SpellScriptLoader
{
public:
spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { }
class spell_warl_banish_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_banish_SpellScript);
bool Load()
{
_removed = false;
return true;
}
void HandleBanish()
{
/// Casting Banish on a banished target will cancel the effect
/// Check if the target already has Banish, if so, do nothing.
if (Unit* target = GetHitUnit())
{
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0))
{
// No need to remove old aura since its removed due to not stack by current Banish aura
PreventHitDefaultEffect(EFFECT_0);
PreventHitDefaultEffect(EFFECT_1);
PreventHitDefaultEffect(EFFECT_2);
_removed = true;
}
}
}
void RemoveAura()
{
if (_removed)
PreventHitAura();
}
void Register()
{
BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish);
AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura);
}
bool _removed;
};
SpellScript* GetSpellScript() const
{
return new spell_warl_banish_SpellScript();
}
};
// 47193 Demonic Empowerment
/// Updated 4.3.4
class spell_warl_demonic_empowerment : public SpellScriptLoader
{
public:
spell_warl_demonic_empowerment() : SpellScriptLoader("spell_warl_demonic_empowerment") { }
spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { }
class spell_warl_demonic_empowerment_SpellScript : public SpellScript
class spell_warl_banish_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript);
PrepareSpellScript(spell_warl_banish_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
bool Load()
{
if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_IMP))
return false;
_removed = false;
return true;
}
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
void HandleBanish()
{
if (Creature* targetCreature = GetHitCreature())
/// Casting Banish on a banished target will cancel the effect
/// Check if the target already has Banish, if so, do nothing.
if (Unit* target = GetHitUnit())
{
if (targetCreature->isPet())
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0))
{
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry());
switch (ci->family)
{
case CREATURE_FAMILY_SUCCUBUS:
targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
break;
case CREATURE_FAMILY_VOIDWALKER:
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
break;
}
case CREATURE_FAMILY_FELGUARD:
targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
break;
case CREATURE_FAMILY_FELHUNTER:
targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
break;
case CREATURE_FAMILY_IMP:
targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
break;
}
// No need to remove old aura since its removed due to not stack by current Banish aura
PreventHitDefaultEffect(EFFECT_0);
PreventHitDefaultEffect(EFFECT_1);
PreventHitDefaultEffect(EFFECT_2);
_removed = true;
}
}
}
void RemoveAura()
{
if (_removed)
PreventHitAura();
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warl_demonic_empowerment_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish);
AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura);
}
bool _removed;
};
SpellScript* GetSpellScript() const
{
return new spell_warl_demonic_empowerment_SpellScript();
return new spell_warl_banish_SpellScript();
}
};
@@ -182,9 +123,9 @@ class spell_warl_create_healthstone : public SpellScriptLoader
static uint32 const iTypes[8][3];
bool Validate(SpellInfo const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R2))
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2))
return false;
return true;
}
@@ -212,8 +153,12 @@ class spell_warl_create_healthstone : public SpellScriptLoader
{
switch (aurEff->GetId())
{
case WARLOCK_IMPROVED_HEALTHSTONE_R1: rank = 1; break;
case WARLOCK_IMPROVED_HEALTHSTONE_R2: rank = 2; break;
case SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1:
rank = 1;
break;
case SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2:
rank = 2;
break;
default:
sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unknown rank of Improved Healthstone id: %d", aurEff->GetId());
break;
@@ -249,6 +194,205 @@ uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellS
{36892, 36893, 36894} // Fel Healthstone
};
// 603 Bane of Doom
/// Updated 4.3.4
class spell_warl_bane_of_doom : public SpellScriptLoader
{
public:
spell_warl_bane_of_doom() : SpellScriptLoader("spell_warl_bane_of_doom") { }
class spell_warl_curse_of_doom_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_curse_of_doom_AuraScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_BANE_OF_DOOM_EFFECT))
return false;
return true;
}
bool Load()
{
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (!GetCaster())
return;
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired())
return;
if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
GetCaster()->CastSpell(GetTarget(), SPELL_WARLOCK_BANE_OF_DOOM_EFFECT, true, NULL, aurEff);
}
void Register()
{
AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_curse_of_doom_AuraScript();
}
};
// 48018 Demonic Circle: Summon
/// Updated 4.3.4
class spell_warl_demonic_circle_summon : public SpellScriptLoader
{
public:
spell_warl_demonic_circle_summon() : SpellScriptLoader("spell_warl_demonic_circle_summon") { }
class spell_warl_demonic_circle_summon_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_demonic_circle_summon_AuraScript);
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
{
// If effect is removed by expire remove the summoned demonic circle too.
if (!(mode & AURA_EFFECT_HANDLE_REAPPLY))
GetTarget()->RemoveGameObject(GetId(), true);
GetTarget()->RemoveAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST);
}
void HandleDummyTick(AuraEffect const* /*aurEff*/)
{
if (GameObject* circle = GetTarget()->GetGameObject(GetId()))
{
// Here we check if player is in demonic circle teleport range, if so add
// WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
// If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT);
if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true)))
{
if (!GetTarget()->HasAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST))
GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST, true);
}
else
GetTarget()->RemoveAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST);
}
}
void Register()
{
OnEffectRemove += AuraEffectApplyFn(spell_warl_demonic_circle_summon_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_demonic_circle_summon_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_demonic_circle_summon_AuraScript();
}
};
// 48020 Demonic Circle: Teleport
/// Updated 4.3.4
class spell_warl_demonic_circle_teleport : public SpellScriptLoader
{
public:
spell_warl_demonic_circle_teleport() : SpellScriptLoader("spell_warl_demonic_circle_teleport") { }
class spell_warl_demonic_circle_teleport_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_demonic_circle_teleport_AuraScript);
void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetTarget()->ToPlayer())
{
if (GameObject* circle = player->GetGameObject(SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON))
{
player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation());
player->RemoveMovementImpairingAuras();
}
}
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_warl_demonic_circle_teleport_AuraScript::HandleTeleport, EFFECT_0, SPELL_AURA_MECHANIC_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_demonic_circle_teleport_AuraScript();
}
};
// 47193 Demonic Empowerment
/// Updated 4.3.4
class spell_warl_demonic_empowerment : public SpellScriptLoader
{
public:
spell_warl_demonic_empowerment() : SpellScriptLoader("spell_warl_demonic_empowerment") { }
class spell_warl_demonic_empowerment_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP))
return false;
return true;
}
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
if (Creature* targetCreature = GetHitCreature())
{
if (targetCreature->isPet())
{
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry());
switch (ci->family)
{
case CREATURE_FAMILY_SUCCUBUS:
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
break;
case CREATURE_FAMILY_VOIDWALKER:
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
break;
}
case CREATURE_FAMILY_FELGUARD:
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
break;
case CREATURE_FAMILY_FELHUNTER:
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
break;
case CREATURE_FAMILY_IMP:
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
break;
}
}
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warl_demonic_empowerment_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warl_demonic_empowerment_SpellScript();
}
};
// 47422 Everlasting Affliction
/// Updated 4.3.4
class spell_warl_everlasting_affliction : public SpellScriptLoader
@@ -280,6 +424,181 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader
}
};
// 48181 Haunt
/// Updated 4.3.4
class spell_warl_haunt : public SpellScriptLoader
{
public:
spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { }
class spell_warl_haunt_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_haunt_SpellScript);
void HandleOnHit()
{
if (Aura* aura = GetHitAura())
if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
aurEff->SetAmount(CalculatePct(aurEff->GetAmount(), GetHitDamage()));
}
void Register()
{
OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit);
}
};
class spell_warl_haunt_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_haunt_AuraScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_HAUNT_HEAL))
return false;
return true;
}
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
{
int32 amount = aurEff->GetAmount();
GetTarget()->CastCustomSpell(caster, SPELL_WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
}
}
void Register()
{
OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warl_haunt_SpellScript();
}
AuraScript* GetAuraScript() const
{
return new spell_warl_haunt_AuraScript();
}
};
// 755 Health Funnel
/// Updated 4.3.4
class spell_warl_health_funnel : public SpellScriptLoader
{
public:
spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { }
class spell_warl_health_funnel_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_health_funnel_AuraScript);
void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
Unit* target = GetTarget();
if (caster->HasAura(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2))
target->CastSpell(target, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true);
else if (caster->HasAura(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1))
target->CastSpell(target, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true);
}
void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->RemoveAurasDueToSpell(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1);
target->RemoveAurasDueToSpell(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2);
}
void Register()
{
OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_health_funnel_AuraScript();
}
};
// 1454 Life Tap
/// Updated 4.3.4
class spell_warl_life_tap : public SpellScriptLoader
{
public:
spell_warl_life_tap() : SpellScriptLoader("spell_warl_life_tap") { }
class spell_warl_life_tap_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_life_tap_SpellScript);
bool Load()
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
if (Unit* target = GetHitUnit())
{
int32 damage = caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue());
int32 mana = CalculatePct(damage, GetSpellInfo()->Effects[EFFECT_1].CalcValue());
// Shouldn't Appear in Combat Log
target->ModifyHealth(-damage);
// Improved Life Tap mod
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_IMPROVED_LIFE_TAP, 0))
AddPct(mana, aurEff->GetAmount());
caster->CastCustomSpell(target, SPELL_WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
// Mana Feed
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_MANA_FEED, 0))
{
int32 manaFeedVal = aurEff->GetAmount();
ApplyPct(manaFeedVal, mana);
caster->CastCustomSpell(caster, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
}
}
}
SpellCastResult CheckCast()
{
if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue())))
return SPELL_CAST_OK;
return SPELL_FAILED_FIZZLE;
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warl_life_tap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnCheckCast += SpellCheckCastFn(spell_warl_life_tap_SpellScript::CheckCast);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warl_life_tap_SpellScript();
}
};
// 27285 Seed of Corruption
/// Updated 4.3.4
class spell_warl_seed_of_corruption : public SpellScriptLoader
@@ -322,7 +641,7 @@ class spell_warl_soulshatter : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(WARLOCK_SOULSHATTER))
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOULSHATTER))
return false;
return true;
}
@@ -332,7 +651,7 @@ class spell_warl_soulshatter : public SpellScriptLoader
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f)
caster->CastSpell(target, WARLOCK_SOULSHATTER, true);
caster->CastSpell(target, SPELL_WARLOCK_SOULSHATTER, true);
}
void Register()
@@ -347,225 +666,6 @@ class spell_warl_soulshatter : public SpellScriptLoader
}
};
// 1454 Life Tap
/// Updated 4.3.4
class spell_warl_life_tap : public SpellScriptLoader
{
public:
spell_warl_life_tap() : SpellScriptLoader("spell_warl_life_tap") { }
class spell_warl_life_tap_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_life_tap_SpellScript);
bool Load()
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE_2))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
if (Unit* target = GetHitUnit())
{
int32 damage = caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue());
int32 mana = CalculatePct(damage, GetSpellInfo()->Effects[EFFECT_1].CalcValue());
// Shouldn't Appear in Combat Log
target->ModifyHealth(-damage);
// Improved Life Tap mod
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_IMPROVED_LIFE_TAP_ICON_ID, 0))
AddPct(mana, aurEff->GetAmount());
caster->CastCustomSpell(target, WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
// Mana Feed
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_MANA_FEED_ICON_ID, 0))
{
int32 manaFeedVal = aurEff->GetAmount();
ApplyPct(manaFeedVal, mana);
caster->CastCustomSpell(caster, WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
}
}
}
SpellCastResult CheckCast()
{
if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue())))
return SPELL_CAST_OK;
return SPELL_FAILED_FIZZLE;
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warl_life_tap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnCheckCast += SpellCheckCastFn(spell_warl_life_tap_SpellScript::CheckCast);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warl_life_tap_SpellScript();
}
};
// 48018 Demonic Circle: Summon
/// Updated 4.3.4
class spell_warl_demonic_circle_summon : public SpellScriptLoader
{
public:
spell_warl_demonic_circle_summon() : SpellScriptLoader("spell_warl_demonic_circle_summon") { }
class spell_warl_demonic_circle_summon_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_demonic_circle_summon_AuraScript);
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
{
// If effect is removed by expire remove the summoned demonic circle too.
if (!(mode & AURA_EFFECT_HANDLE_REAPPLY))
GetTarget()->RemoveGameObject(GetId(), true);
GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST);
}
void HandleDummyTick(AuraEffect const* /*aurEff*/)
{
if (GameObject* circle = GetTarget()->GetGameObject(GetId()))
{
// Here we check if player is in demonic circle teleport range, if so add
// WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
// If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_CIRCLE_TELEPORT);
if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true)))
{
if (!GetTarget()->HasAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST))
GetTarget()->CastSpell(GetTarget(), WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST, true);
}
else
GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST);
}
}
void Register()
{
OnEffectRemove += AuraEffectApplyFn(spell_warl_demonic_circle_summon_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_demonic_circle_summon_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_demonic_circle_summon_AuraScript();
}
};
// 48020 Demonic Circle: Teleport
/// Updated 4.3.4
class spell_warl_demonic_circle_teleport : public SpellScriptLoader
{
public:
spell_warl_demonic_circle_teleport() : SpellScriptLoader("spell_warl_demonic_circle_teleport") { }
class spell_warl_demonic_circle_teleport_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_demonic_circle_teleport_AuraScript);
void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetTarget()->ToPlayer())
{
if (GameObject* circle = player->GetGameObject(WARLOCK_DEMONIC_CIRCLE_SUMMON))
{
player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation());
player->RemoveMovementImpairingAuras();
}
}
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_warl_demonic_circle_teleport_AuraScript::HandleTeleport, EFFECT_0, SPELL_AURA_MECHANIC_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_demonic_circle_teleport_AuraScript();
}
};
// 48181 Haunt
/// Updated 4.3.4
class spell_warl_haunt : public SpellScriptLoader
{
public:
spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { }
class spell_warl_haunt_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_haunt_SpellScript);
void HandleOnHit()
{
if (Aura* aura = GetHitAura())
if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
aurEff->SetAmount(CalculatePct(aurEff->GetAmount(), GetHitDamage()));
}
void Register()
{
OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit);
}
};
class spell_warl_haunt_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_haunt_AuraScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(WARLOCK_HAUNT_HEAL))
return false;
return true;
}
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
{
int32 amount = aurEff->GetAmount();
GetTarget()->CastCustomSpell(caster, WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
}
}
void Register()
{
OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warl_haunt_SpellScript();
}
AuraScript* GetAuraScript() const
{
return new spell_warl_haunt_AuraScript();
}
};
/// Updated 4.3.4
class spell_warl_unstable_affliction : public SpellScriptLoader
{
@@ -578,7 +678,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(WARLOCK_UNSTABLE_AFFLICTION_DISPEL))
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL))
return false;
return true;
}
@@ -590,7 +690,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
{
int32 damage = aurEff->GetAmount() * 9;
// backfire damage and silence
caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
caster->CastCustomSpell(dispelInfo->GetDispeller(), SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
}
}
@@ -606,111 +706,19 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
}
};
// 603 Bane of Doom
/// Updated 4.3.4
class spell_warl_bane_of_doom : public SpellScriptLoader
{
public:
spell_warl_bane_of_doom() : SpellScriptLoader("spell_warl_bane_of_doom") { }
class spell_warl_curse_of_doom_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_curse_of_doom_AuraScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(WARLOCK_BANE_OF_DOOM_EFFECT))
return false;
return true;
}
bool Load()
{
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (!GetCaster())
return;
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired())
return;
if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
GetCaster()->CastSpell(GetTarget(), WARLOCK_BANE_OF_DOOM_EFFECT, true, NULL, aurEff);
}
void Register()
{
AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_curse_of_doom_AuraScript();
}
};
// 755 Health Funnel
/// Updated 4.3.4
class spell_warl_health_funnel : public SpellScriptLoader
{
public:
spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { }
class spell_warl_health_funnel_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_health_funnel_AuraScript);
void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
Unit* target = GetTarget();
if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2))
target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true);
else if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1))
target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true);
}
void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1);
target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2);
}
void Register()
{
OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_health_funnel_AuraScript();
}
};
void AddSC_warlock_spell_scripts()
{
new spell_warl_bane_of_doom();
new spell_warl_banish();
new spell_warl_demonic_empowerment();
new spell_warl_create_healthstone();
new spell_warl_everlasting_affliction();
new spell_warl_seed_of_corruption();
new spell_warl_soulshatter();
new spell_warl_life_tap();
new spell_warl_demonic_circle_summon();
new spell_warl_demonic_circle_teleport();
new spell_warl_demonic_empowerment();
new spell_warl_everlasting_affliction();
new spell_warl_haunt();
new spell_warl_unstable_affliction();
new spell_warl_bane_of_doom();
new spell_warl_health_funnel();
new spell_warl_life_tap();
new spell_warl_seed_of_corruption();
new spell_warl_soulshatter();
new spell_warl_unstable_affliction();
}
+207 -201
View File
@@ -28,111 +28,91 @@
enum WarriorSpells
{
SPELL_LAST_STAND_TRIGGERED = 12976,
SPELL_DEEP_WOUNDS_RANK_1 = 12162,
SPELL_DEEP_WOUNDS_RANK_2 = 12850,
SPELL_DEEP_WOUNDS_RANK_3 = 12868,
SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721,
SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
SPELL_CHARGE = 34846,
SPELL_SLAM = 50782,
ICON_ID_SUDDEN_DEATH = 1989,
SPELL_BLOODTHIRST_DAMAGE = 23881,
SPELL_BLOODTHIRST = 23885,
SPELL_WARRIOR_BLOODTHIRST = 23885,
SPELL_WARRIOR_BLOODTHIRST_DAMAGE = 23881,
SPELL_WARRIOR_CHARGE = 34846,
SPELL_WARRIOR_DEEP_WOUNDS_RANK_1 = 12162,
SPELL_WARRIOR_DEEP_WOUNDS_RANK_2 = 12850,
SPELL_WARRIOR_DEEP_WOUNDS_RANK_3 = 12868,
SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC = 12721,
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976,
SPELL_WARRIOR_SLAM = 50782
};
enum WarriorSpellIcons
{
WARRIOR_ICON_ID_SUDDEN_DEATH = 1989,
};
/// Updated 4.3.4
class spell_warr_last_stand : public SpellScriptLoader
class spell_warr_bloodthirst : public SpellScriptLoader
{
public:
spell_warr_last_stand() : SpellScriptLoader("spell_warr_last_stand") { }
spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { }
class spell_warr_last_stand_SpellScript : public SpellScript
class spell_warr_bloodthirst_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_last_stand_SpellScript);
PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
void HandleDamage(SpellEffIndex /*effIndex*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_LAST_STAND_TRIGGERED))
return false;
return true;
}
int32 damage = GetEffectValue();
ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
if (Unit* target = GetHitUnit())
{
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue()));
caster->CastCustomSpell(caster, SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
}
}
void Register()
{
// add dummy effect spell handler to Last Stand
OnEffectHit += SpellEffectFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_last_stand_SpellScript();
}
};
/// Updated 4.3.4
class spell_warr_deep_wounds : public SpellScriptLoader
{
public:
spell_warr_deep_wounds() : SpellScriptLoader("spell_warr_deep_wounds") { }
class spell_warr_deep_wounds_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_deep_wounds_SpellScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_3))
return false;
return true;
SetHitDamage(damage);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
{
// apply percent damage mods
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
ApplyPct(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
// Add remaining ticks to damage done
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
damage = damage / ticks;
caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
}
GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_deep_wounds_SpellScript();
return new spell_warr_bloodthirst_SpellScript();
}
};
/// Updated 4.3.4
class spell_warr_bloodthirst_heal : public SpellScriptLoader
{
public:
spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { }
class spell_warr_bloodthirst_heal_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_BLOODTHIRST_DAMAGE))
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_bloodthirst_heal_SpellScript();
}
};
@@ -146,21 +126,22 @@ class spell_warr_charge : public SpellScriptLoader
{
PrepareSpellScript(spell_warr_charge_SpellScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_CHARGE))
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_CHARGE))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 chargeBasePoints0 = GetEffectValue();
Unit* caster = GetCaster();
caster->CastCustomSpell(caster, SPELL_CHARGE, &chargeBasePoints0, NULL, NULL, true);
caster->CastCustomSpell(caster, SPELL_WARRIOR_CHARGE, &chargeBasePoints0, NULL, NULL, true);
//Juggernaut crit bonus
if (caster->HasAura(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT))
caster->CastSpell(caster, SPELL_JUGGERNAUT_CRIT_BONUS_BUFF, true);
// Juggernaut crit bonus
if (caster->HasAura(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT))
caster->CastSpell(caster, SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF, true);
}
void Register()
@@ -175,89 +156,6 @@ class spell_warr_charge : public SpellScriptLoader
}
};
/// Updated 4.3.4
class spell_warr_slam : public SpellScriptLoader
{
public:
spell_warr_slam() : SpellScriptLoader("spell_warr_slam") { }
class spell_warr_slam_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_slam_SpellScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_SLAM))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 bp0 = GetEffectValue();
if (GetHitUnit())
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SLAM, &bp0, NULL, NULL, true, 0);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_slam_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_slam_SpellScript();
}
};
/// Updated 4.3.4
class spell_warr_execute : public SpellScriptLoader
{
public:
spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { }
class spell_warr_execute_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_execute_SpellScript);
void HandleEffect(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (GetHitUnit())
{
SpellInfo const* spellInfo = GetSpellInfo();
int32 rageUsed = std::min<int32>(200 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed);
// Sudden Death rage save
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0))
{
int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_0].CalcValue() * 10;
newRage = std::max(newRage, ragesave);
}
caster->SetPower(POWER_RAGE, uint32(newRage));
/// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}"
int32 baseDamage = int32(10 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.437f * GetEffectValue() / 100.0f);
/// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage"
int32 moreDamage = int32(rageUsed * (caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f * GetEffectValue() / 100.0f - 1) / 200);
SetHitDamage(baseDamage + moreDamage);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_execute_SpellScript();
}
};
/// Updated 4.3.4
class spell_warr_concussion_blow : public SpellScriptLoader
{
@@ -286,83 +184,191 @@ class spell_warr_concussion_blow : public SpellScriptLoader
};
/// Updated 4.3.4
class spell_warr_bloodthirst : public SpellScriptLoader
class spell_warr_deep_wounds : public SpellScriptLoader
{
public:
spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { }
spell_warr_deep_wounds() : SpellScriptLoader("spell_warr_deep_wounds") { }
class spell_warr_bloodthirst_SpellScript : public SpellScript
class spell_warr_deep_wounds_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
PrepareSpellScript(spell_warr_deep_wounds_SpellScript);
void HandleDamage(SpellEffIndex /*effIndex*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
int32 damage = GetEffectValue();
ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
if (Unit* target = GetHitUnit())
{
damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
}
SetHitDamage(damage);
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_3))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
{
// apply percent damage mods
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
ApplyPct(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC);
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
// Add remaining ticks to damage done
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
damage /= ticks;
caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_warr_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_bloodthirst_SpellScript();
return new spell_warr_deep_wounds_SpellScript();
}
};
/// Updated 4.3.4
class spell_warr_bloodthirst_heal : public SpellScriptLoader
class spell_warr_execute : public SpellScriptLoader
{
public:
spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { }
spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { }
class spell_warr_bloodthirst_heal_SpellScript : public SpellScript
class spell_warr_execute_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
PrepareSpellScript(spell_warr_execute_SpellScript);
void HandleHeal(SpellEffIndex /*effIndex*/)
void HandleEffect(SpellEffIndex /*effIndex*/)
{
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE))
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100);
Unit* caster = GetCaster();
if (GetHitUnit())
{
SpellInfo const* spellInfo = GetSpellInfo();
int32 rageUsed = std::min<int32>(200 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed);
// Sudden Death rage save
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, WARRIOR_ICON_ID_SUDDEN_DEATH, EFFECT_0))
{
int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_0].CalcValue() * 10;
newRage = std::max(newRage, ragesave);
}
caster->SetPower(POWER_RAGE, uint32(newRage));
/// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}"
int32 baseDamage = int32(10 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.437f * GetEffectValue() / 100.0f);
/// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage"
int32 moreDamage = int32(rageUsed * (caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f * GetEffectValue() / 100.0f - 1) / 200);
SetHitDamage(baseDamage + moreDamage);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_bloodthirst_heal_SpellScript();
return new spell_warr_execute_SpellScript();
}
};
/// Updated 4.3.4
class spell_warr_last_stand : public SpellScriptLoader
{
public:
spell_warr_last_stand() : SpellScriptLoader("spell_warr_last_stand") { }
class spell_warr_last_stand_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_last_stand_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_LAST_STAND_TRIGGERED))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
{
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue()));
caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
}
}
void Register()
{
// add dummy effect spell handler to Last Stand
OnEffectHit += SpellEffectFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_last_stand_SpellScript();
}
};
/// Updated 4.3.4
class spell_warr_slam : public SpellScriptLoader
{
public:
spell_warr_slam() : SpellScriptLoader("spell_warr_slam") { }
class spell_warr_slam_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_slam_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SLAM))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 bp0 = GetEffectValue();
if (GetHitUnit())
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_SLAM, &bp0, NULL, NULL, true, 0);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_slam_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_slam_SpellScript();
}
};
void AddSC_warrior_spell_scripts()
{
new spell_warr_last_stand();
new spell_warr_deep_wounds();
new spell_warr_charge();
new spell_warr_slam();
new spell_warr_execute();
new spell_warr_concussion_blow();
new spell_warr_bloodthirst();
new spell_warr_bloodthirst_heal();
new spell_warr_charge();
new spell_warr_concussion_blow();
new spell_warr_deep_wounds();
new spell_warr_execute();
new spell_warr_last_stand();
new spell_warr_slam();
}