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

+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();
}