Scripts/Spells: move implementation of some spells into scripts.
* 41337 Aura of Anger * 46394 Burn (Brutallus) * 53302 Sniper Training * 45472 Parachute * 66118 Leeching Swarm * 51685 Prey on the Weak * 20911 Blessing of Sanctuary * 25899 Greater Blessing of Sanctuary Scripts/Spells: remove several spells implementations from core to table (requires DB data) * 31231 Cheat Death * 51662 Hunger for Blood --HG-- branch : trunk
This commit is contained in:
1 parent
38be7aab55
commit
5eb0fd80ac
7 files changed
+346
-183
No files matched your search
@@ -23,6 +23,106 @@
|
||||
*/
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
// 41337 Aura of Anger
|
||||
class spell_gen_aura_of_anger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_aura_of_anger() : SpellScriptLoader("spell_gen_aura_of_anger") { }
|
||||
|
||||
class spell_gen_aura_of_anger_AuraScript : public AuraScript
|
||||
{
|
||||
void HandleEffectPeriodicUpdate(AuraEffect * aurEff)
|
||||
{
|
||||
if (AuraEffect * aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1))
|
||||
aurEff1->ChangeAmount(aurEff1->GetAmount() + 5);
|
||||
aurEff->SetAmount(100 * aurEff->GetTickNumber());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_aura_of_anger_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_aura_of_anger_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 46394 Brutallus Burn
|
||||
class spell_gen_burn_brutallus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_burn_brutallus() : SpellScriptLoader("spell_gen_burn_brutallus") { }
|
||||
|
||||
class spell_gen_burn_brutallus_AuraScript : public AuraScript
|
||||
{
|
||||
void HandleEffectPeriodicUpdate(AuraEffect * aurEff)
|
||||
{
|
||||
if (aurEff->GetTickNumber() % 11 == 0)
|
||||
aurEff->SetAmount(aurEff->GetAmount() * 2);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_burn_brutallus_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_burn_brutallus_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 45472 Parachute
|
||||
enum eParachuteSpells
|
||||
{
|
||||
SPELL_PARACHUTE = 45472,
|
||||
SPELL_PARACHUTE_BUFF = 44795,
|
||||
};
|
||||
|
||||
class spell_gen_parachute : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_parachute() : SpellScriptLoader("spell_gen_parachute") { }
|
||||
|
||||
class spell_gen_parachute_AuraScript : public AuraScript
|
||||
{
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_PARACHUTE))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_PARACHUTE_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * /*aurEff*/, AuraApplication const * aurApp)
|
||||
{
|
||||
if (Unit* pTarget = aurApp->GetTarget())
|
||||
if (Player* pPlayerTarget = pTarget->ToPlayer())
|
||||
if (pPlayerTarget->IsFalling())
|
||||
{
|
||||
pPlayerTarget->RemoveAurasDueToSpell(SPELL_PARACHUTE);
|
||||
pPlayerTarget->CastSpell(pPlayerTarget, SPELL_PARACHUTE_BUFF, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_parachute_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum NPCEntries
|
||||
{
|
||||
@@ -115,6 +215,56 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// 66118 Leeching Swarm
|
||||
enum eLeechingSwarmSpells
|
||||
{
|
||||
SPELL_LEECHING_SWARM_DMG = 66240,
|
||||
SPELL_LEECHING_SWARM_HEAL = 66125,
|
||||
};
|
||||
|
||||
class spell_gen_leeching_swarm : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_leeching_swarm() : SpellScriptLoader("spell_gen_leeching_swarm") { }
|
||||
|
||||
class spell_gen_leeching_swarm_AuraScript : public AuraScript
|
||||
{
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_DMG))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * aurEff, AuraApplication const * aurApp)
|
||||
{
|
||||
if (Unit* pTarget = aurApp->GetTarget())
|
||||
if (Unit* pCaster = GetCaster())
|
||||
{
|
||||
int32 lifeLeeched = pTarget->CountPctFromMaxHealth(aurEff->GetAmount());
|
||||
if (lifeLeeched < 250)
|
||||
lifeLeeched = 250;
|
||||
// Damage
|
||||
pCaster->CastCustomSpell(pTarget, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false);
|
||||
// Heal
|
||||
pCaster->CastCustomSpell(pCaster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_leeching_swarm_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_leeching_swarm_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 24750 Trick
|
||||
enum eTrickSpells
|
||||
{
|
||||
@@ -320,6 +470,10 @@ public:
|
||||
|
||||
void AddSC_generic_spell_scripts()
|
||||
{
|
||||
new spell_gen_aura_of_anger();
|
||||
new spell_gen_burn_brutallus();
|
||||
new spell_gen_leeching_swarm();
|
||||
new spell_gen_parachute();
|
||||
new spell_gen_pet_summoned();
|
||||
new spell_gen_remove_flight_auras();
|
||||
new spell_gen_trick();
|
||||
|
||||
Reference in new issue
Block a user