Files
TCPlayerbotCore/src/server/scripts/Spells/spell_generic.cpp
T

59 lines
2.0 KiB
C++
Raw Normal View History

/*
* Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Scripts for spells with SPELLFAMILY_GENERIC which cannot be included in AI script file
* of creature using it or can't be bound to any player class.
* Ordered alphabetically using scriptname.
* Scriptnames of files in this file should be prefixed with "spell_gen_"
*/
#include "ScriptPCH.h"
2010-08-06 20:09:23 +02:00
class spell_gen_remove_flight_auras : public SpellHandlerScript
{
public:
spell_gen_remove_flight_auras() : SpellHandlerScript("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()
{
EffectHandlers += EffectHandlerFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_remove_flight_auras_SpellScript;
}
};
2010-08-06 20:09:23 +02:00
void AddSC_generic_spell_scripts()
{
2010-08-06 20:09:23 +02:00
new spell_gen_remove_flight_auras;
}