Spell Scripts:

* add new file spell_item.cpp for spells used by items (but not by quests)
* move some dummy effects of generic spells to scripts
* implement spell for quest 12937 Relief for the Fallen. Closes issue #3070

--HG--
branch : trunk
This commit is contained in:
azazel
2010-08-29 22:40:23 +06:00
parent 9648cf7f39
commit d952c90754
7 changed files with 632 additions and 184 deletions
+31 -32
View File
@@ -24,7 +24,6 @@
#include "ScriptPCH.h"
enum NPCEntries
{
NPC_DOOMGUARD = 11859,
@@ -32,34 +31,6 @@ enum NPCEntries
NPC_IMP = 416,
};
class spell_gen_remove_flight_auras : public SpellScriptLoader
{
public:
spell_gen_remove_flight_auras() : SpellScriptLoader("spell_gen_remove_flight_auras") {}
class spell_gen_remove_flight_auras_SpellScript : public SpellScript
{
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit *target = GetHitUnit();
if (!target)
return;
target->RemoveAurasByType(SPELL_AURA_FLY);
target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
}
void Register()
{
OnEffect += SpellEffectFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_remove_flight_auras_SpellScript;
}
};
class spell_gen_pet_summoned : public SpellScriptLoader
{
public:
@@ -112,12 +83,40 @@ public:
SpellScript* GetSpellScript() const
{
return new spell_gen_pet_summonedSpellScript;
return new spell_gen_pet_summonedSpellScript();
}
};
class spell_gen_remove_flight_auras : public SpellScriptLoader
{
public:
spell_gen_remove_flight_auras() : SpellScriptLoader("spell_gen_remove_flight_auras") {}
class spell_gen_remove_flight_auras_SpellScript : public SpellScript
{
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit *target = GetHitUnit();
if (!target)
return;
target->RemoveAurasByType(SPELL_AURA_FLY);
target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
}
void Register()
{
OnEffect += SpellEffectFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_remove_flight_auras_SpellScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_remove_flight_auras;
new spell_gen_pet_summoned;
new spell_gen_pet_summoned();
new spell_gen_remove_flight_auras();
}