mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 04:02:53 -04:00
2639 lines
100 KiB
C++
2639 lines
100 KiB
C++
/*
|
|
* Copyright (C) 2008-2012 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 "ScriptMgr.h"
|
|
#include "SpellScript.h"
|
|
#include "SpellAuraEffects.h"
|
|
#include "SkillDiscovery.h"
|
|
#include "Cell.h"
|
|
#include "CellImpl.h"
|
|
#include "GridNotifiers.h"
|
|
#include "GridNotifiersImpl.h"
|
|
#include "InstanceScript.h"
|
|
#include "Group.h"
|
|
#include "LFGMgr.h"
|
|
|
|
class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_absorb0_hitlimit1() : SpellScriptLoader("spell_gen_absorb0_hitlimit1") { }
|
|
|
|
class spell_gen_absorb0_hitlimit1_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_absorb0_hitlimit1_AuraScript);
|
|
|
|
uint32 limit;
|
|
|
|
bool Load()
|
|
{
|
|
// Max absorb stored in 1 dummy effect
|
|
limit = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
|
return true;
|
|
}
|
|
|
|
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
|
|
{
|
|
absorbAmount = std::min(limit, absorbAmount);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectAbsorb += AuraEffectAbsorbFn(spell_gen_absorb0_hitlimit1_AuraScript::Absorb, EFFECT_0);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_absorb0_hitlimit1_AuraScript();
|
|
}
|
|
};
|
|
|
|
// 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
|
|
{
|
|
PrepareAuraScript(spell_gen_aura_of_anger_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();
|
|
}
|
|
};
|
|
|
|
class spell_gen_av_drekthar_presence : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_av_drekthar_presence() : SpellScriptLoader("spell_gen_av_drekthar_presence") { }
|
|
|
|
class spell_gen_av_drekthar_presence_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_av_drekthar_presence_AuraScript);
|
|
|
|
bool CheckAreaTarget(Unit* target)
|
|
{
|
|
switch (target->GetEntry())
|
|
{
|
|
// alliance
|
|
case 14762: // Dun Baldar North Marshal
|
|
case 14763: // Dun Baldar South Marshal
|
|
case 14764: // Icewing Marshal
|
|
case 14765: // Stonehearth Marshal
|
|
case 11948: // Vandar Stormspike
|
|
// horde
|
|
case 14772: // East Frostwolf Warmaster
|
|
case 14776: // Tower Point Warmaster
|
|
case 14773: // Iceblood Warmaster
|
|
case 14777: // West Frostwolf Warmaster
|
|
case 11946: // Drek'thar
|
|
return true;
|
|
default:
|
|
return false;
|
|
break;
|
|
}
|
|
}
|
|
void Register()
|
|
{
|
|
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_gen_av_drekthar_presence_AuraScript::CheckAreaTarget);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_av_drekthar_presence_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
|
|
{
|
|
PrepareAuraScript(spell_gen_burn_brutallus_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();
|
|
}
|
|
};
|
|
|
|
enum eCannibalizeSpells
|
|
{
|
|
SPELL_CANNIBALIZE_TRIGGERED = 20578,
|
|
};
|
|
|
|
class spell_gen_cannibalize : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_cannibalize() : SpellScriptLoader("spell_gen_cannibalize") { }
|
|
|
|
class spell_gen_cannibalize_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_cannibalize_SpellScript);
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_CANNIBALIZE_TRIGGERED))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
SpellCastResult CheckIfCorpseNear()
|
|
{
|
|
Unit* caster = GetCaster();
|
|
float max_range = GetSpellInfo()->GetMaxRange(false);
|
|
WorldObject* result = NULL;
|
|
// search for nearby enemy corpse in range
|
|
Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY);
|
|
Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check);
|
|
caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher);
|
|
if (!result)
|
|
return SPELL_FAILED_NO_EDIBLE_CORPSES;
|
|
return SPELL_CAST_OK;
|
|
}
|
|
|
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
|
{
|
|
Unit* caster = GetCaster();
|
|
caster->CastSpell(caster, SPELL_CANNIBALIZE_TRIGGERED, false);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHit += SpellEffectFn(spell_gen_cannibalize_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
OnCheckCast += SpellCheckCastFn(spell_gen_cannibalize_SpellScript::CheckIfCorpseNear);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_cannibalize_SpellScript();
|
|
}
|
|
};
|
|
|
|
// 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
|
|
{
|
|
PrepareAuraScript(spell_gen_parachute_AuraScript);
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
|
{
|
|
if (Player* target = GetTarget()->ToPlayer())
|
|
if (target->IsFalling())
|
|
{
|
|
target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
|
|
target->CastSpell(target, 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
|
|
{
|
|
NPC_DOOMGUARD = 11859,
|
|
NPC_INFERNAL = 89,
|
|
NPC_IMP = 416,
|
|
};
|
|
|
|
class spell_gen_pet_summoned : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_pet_summoned() : SpellScriptLoader("spell_gen_pet_summoned") { }
|
|
|
|
class spell_gen_pet_summoned_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_pet_summoned_SpellScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
Player* player = GetCaster()->ToPlayer();
|
|
if (player->GetLastPetNumber())
|
|
{
|
|
PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
|
if (Pet* newPet = new Pet(player, newPetType))
|
|
{
|
|
if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
|
|
{
|
|
// revive the pet if it is dead
|
|
if (newPet->getDeathState() == DEAD)
|
|
newPet->setDeathState(ALIVE);
|
|
|
|
newPet->SetFullHealth();
|
|
newPet->SetPower(newPet->getPowerType(), newPet->GetMaxPower(newPet->getPowerType()));
|
|
|
|
switch (newPet->GetEntry())
|
|
{
|
|
case NPC_DOOMGUARD:
|
|
case NPC_INFERNAL:
|
|
newPet->SetEntry(NPC_IMP);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
delete newPet;
|
|
}
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_pet_summoned_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_pet_summoned_SpellScript();
|
|
}
|
|
};
|
|
|
|
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
|
|
{
|
|
PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript);
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
if (Unit* target = GetHitUnit())
|
|
{
|
|
target->RemoveAurasByType(SPELL_AURA_FLY);
|
|
target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += 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();
|
|
}
|
|
};
|
|
|
|
// 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
|
|
{
|
|
PrepareAuraScript(spell_gen_leeching_swarm_AuraScript);
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_DMG) || !sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_HEAL))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
|
{
|
|
Unit* caster = GetCaster();
|
|
if (Unit* target = GetTarget())
|
|
{
|
|
int32 lifeLeeched = target->CountPctFromCurHealth(aurEff->GetAmount());
|
|
if (lifeLeeched < 250)
|
|
lifeLeeched = 250;
|
|
// Damage
|
|
caster->CastCustomSpell(target, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false);
|
|
// Heal
|
|
caster->CastCustomSpell(caster, 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();
|
|
}
|
|
};
|
|
|
|
enum EluneCandle
|
|
{
|
|
NPC_OMEN = 15467,
|
|
|
|
SPELL_ELUNE_CANDLE_OMEN_HEAD = 26622,
|
|
SPELL_ELUNE_CANDLE_OMEN_CHEST = 26624,
|
|
SPELL_ELUNE_CANDLE_OMEN_HAND_R = 26625,
|
|
SPELL_ELUNE_CANDLE_OMEN_HAND_L = 26649,
|
|
SPELL_ELUNE_CANDLE_NORMAL = 26636,
|
|
};
|
|
|
|
class spell_gen_elune_candle : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_elune_candle() : SpellScriptLoader("spell_gen_elune_candle") {}
|
|
|
|
class spell_gen_elune_candle_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_elune_candle_SpellScript);
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD))
|
|
return false;
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST))
|
|
return false;
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R))
|
|
return false;
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L))
|
|
return false;
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
uint32 spellId = 0;
|
|
|
|
if (GetHitUnit()->GetEntry() == NPC_OMEN)
|
|
{
|
|
switch (urand(0, 3))
|
|
{
|
|
case 0: spellId = SPELL_ELUNE_CANDLE_OMEN_HEAD; break;
|
|
case 1: spellId = SPELL_ELUNE_CANDLE_OMEN_CHEST; break;
|
|
case 2: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_R; break;
|
|
case 3: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_L; break;
|
|
}
|
|
}
|
|
else
|
|
spellId = SPELL_ELUNE_CANDLE_NORMAL;
|
|
|
|
GetCaster()->CastSpell(GetHitUnit(), spellId, true, NULL);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_elune_candle_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_elune_candle_SpellScript();
|
|
}
|
|
};
|
|
|
|
// 24750 Trick
|
|
enum eTrickSpells
|
|
{
|
|
SPELL_PIRATE_COSTUME_MALE = 24708,
|
|
SPELL_PIRATE_COSTUME_FEMALE = 24709,
|
|
SPELL_NINJA_COSTUME_MALE = 24710,
|
|
SPELL_NINJA_COSTUME_FEMALE = 24711,
|
|
SPELL_LEPER_GNOME_COSTUME_MALE = 24712,
|
|
SPELL_LEPER_GNOME_COSTUME_FEMALE = 24713,
|
|
SPELL_SKELETON_COSTUME = 24723,
|
|
SPELL_GHOST_COSTUME_MALE = 24735,
|
|
SPELL_GHOST_COSTUME_FEMALE = 24736,
|
|
SPELL_TRICK_BUFF = 24753,
|
|
};
|
|
|
|
class spell_gen_trick : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_trick() : SpellScriptLoader("spell_gen_trick") {}
|
|
|
|
class spell_gen_trick_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_trick_SpellScript);
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE)
|
|
|| !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE)
|
|
|| !sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
Unit* caster = GetCaster();
|
|
if (Player* target = GetHitPlayer())
|
|
{
|
|
uint8 gender = target->getGender();
|
|
uint32 spellId = SPELL_TRICK_BUFF;
|
|
switch (urand(0, 5))
|
|
{
|
|
case 1:
|
|
spellId = gender ? SPELL_LEPER_GNOME_COSTUME_FEMALE : SPELL_LEPER_GNOME_COSTUME_MALE;
|
|
break;
|
|
case 2:
|
|
spellId = gender ? SPELL_PIRATE_COSTUME_FEMALE : SPELL_PIRATE_COSTUME_MALE;
|
|
break;
|
|
case 3:
|
|
spellId = gender ? SPELL_GHOST_COSTUME_FEMALE : SPELL_GHOST_COSTUME_MALE;
|
|
break;
|
|
case 4:
|
|
spellId = gender ? SPELL_NINJA_COSTUME_FEMALE : SPELL_NINJA_COSTUME_MALE;
|
|
break;
|
|
case 5:
|
|
spellId = SPELL_SKELETON_COSTUME;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
caster->CastSpell(target, spellId, true, NULL);
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_trick_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_trick_SpellScript();
|
|
}
|
|
};
|
|
|
|
// 24751 Trick or Treat
|
|
enum eTrickOrTreatSpells
|
|
{
|
|
SPELL_TRICK = 24714,
|
|
SPELL_TREAT = 24715,
|
|
SPELL_TRICKED_OR_TREATED = 24755
|
|
};
|
|
|
|
class spell_gen_trick_or_treat : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_trick_or_treat() : SpellScriptLoader("spell_gen_trick_or_treat") {}
|
|
|
|
class spell_gen_trick_or_treat_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_trick_or_treat_SpellScript);
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_TRICK) || !sSpellMgr->GetSpellInfo(SPELL_TREAT) || !sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_trick_or_treat_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_trick_or_treat_SpellScript();
|
|
}
|
|
};
|
|
|
|
class spell_creature_permanent_feign_death : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_creature_permanent_feign_death() : SpellScriptLoader("spell_creature_permanent_feign_death") { }
|
|
|
|
class spell_creature_permanent_feign_death_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_creature_permanent_feign_death_AuraScript);
|
|
|
|
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
Unit* target = GetTarget();
|
|
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
|
target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
|
|
|
if (target->GetTypeId() == TYPEID_UNIT)
|
|
target->ToCreature()->SetReactState(REACT_PASSIVE);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectApply += AuraEffectApplyFn(spell_creature_permanent_feign_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_creature_permanent_feign_death_AuraScript();
|
|
}
|
|
};
|
|
|
|
enum PvPTrinketTriggeredSpells
|
|
{
|
|
SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER = 72752,
|
|
SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF = 72757,
|
|
};
|
|
|
|
class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_pvp_trinket_wotf_shared_cd() : SpellScriptLoader("spell_pvp_trinket_wotf_shared_cd") {}
|
|
|
|
class spell_pvp_trinket_wotf_shared_cd_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
Player* caster = GetCaster()->ToPlayer();
|
|
SpellInfo const* spellInfo = GetSpellInfo();
|
|
caster->AddSpellCooldown(spellInfo->Id, 0, time(NULL) + sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)->GetRecoveryTime() / IN_MILLISECONDS);
|
|
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4);
|
|
data << uint64(caster->GetGUID());
|
|
data << uint8(0);
|
|
data << uint32(spellInfo->Id);
|
|
data << uint32(0);
|
|
caster->GetSession()->SendPacket(&data);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHit += SpellEffectFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_pvp_trinket_wotf_shared_cd_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum AnimalBloodPoolSpell
|
|
{
|
|
SPELL_ANIMAL_BLOOD = 46221,
|
|
SPELL_SPAWN_BLOOD_POOL = 63471,
|
|
};
|
|
|
|
class spell_gen_animal_blood : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_animal_blood() : SpellScriptLoader("spell_gen_animal_blood") { }
|
|
|
|
class spell_gen_animal_blood_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_animal_blood_AuraScript);
|
|
|
|
bool Validate(SpellInfo const* /*spell*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_SPAWN_BLOOD_POOL))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
// Remove all auras with spell id 46221, except the one currently being applied
|
|
while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura()))
|
|
GetUnitOwner()->RemoveOwnedAura(aur);
|
|
}
|
|
|
|
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
if (Unit* owner = GetUnitOwner())
|
|
if (owner->IsInWater())
|
|
owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
AfterEffectApply += AuraEffectRemoveFn(spell_gen_animal_blood_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
|
AfterEffectRemove += AuraEffectRemoveFn(spell_gen_animal_blood_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_animal_blood_AuraScript();
|
|
}
|
|
};
|
|
|
|
enum DivineStormSpell
|
|
{
|
|
SPELL_DIVINE_STORM = 53385,
|
|
};
|
|
|
|
// 70769 Divine Storm!
|
|
class spell_gen_divine_storm_cd_reset : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_divine_storm_cd_reset() : SpellScriptLoader("spell_gen_divine_storm_cd_reset") {}
|
|
|
|
class spell_gen_divine_storm_cd_reset_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
Player* caster = GetCaster()->ToPlayer();
|
|
if (caster->HasSpellCooldown(SPELL_DIVINE_STORM))
|
|
caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_divine_storm_cd_reset_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_divine_storm_cd_reset_SpellScript();
|
|
}
|
|
};
|
|
|
|
class spell_gen_gunship_portal : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { }
|
|
|
|
class spell_gen_gunship_portal_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_gunship_portal_SpellScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
Player* caster = GetCaster()->ToPlayer();
|
|
if (Battleground* bg = caster->GetBattleground())
|
|
if (bg->GetTypeID(true) == BATTLEGROUND_IC)
|
|
bg->DoAction(1, caster->GetGUID());
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_gunship_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_gunship_portal_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum parachuteIC
|
|
{
|
|
SPELL_PARACHUTE_IC = 66657,
|
|
};
|
|
|
|
class spell_gen_parachute_ic : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_parachute_ic() : SpellScriptLoader("spell_gen_parachute_ic") { }
|
|
|
|
class spell_gen_parachute_ic_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_parachute_ic_AuraScript)
|
|
|
|
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
|
|
{
|
|
if (Player* target = GetTarget()->ToPlayer())
|
|
if (target->m_movementInfo.fallTime > 2000)
|
|
target->CastSpell(target, SPELL_PARACHUTE_IC, true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_ic_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_parachute_ic_AuraScript();
|
|
}
|
|
};
|
|
|
|
class spell_gen_dungeon_credit : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_dungeon_credit() : SpellScriptLoader("spell_gen_dungeon_credit") { }
|
|
|
|
class spell_gen_dungeon_credit_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_dungeon_credit_SpellScript);
|
|
|
|
bool Load()
|
|
{
|
|
_handled = false;
|
|
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
|
}
|
|
|
|
void CreditEncounter()
|
|
{
|
|
// This hook is executed for every target, make sure we only credit instance once
|
|
if (_handled)
|
|
return;
|
|
|
|
_handled = true;
|
|
Unit* caster = GetCaster();
|
|
if (InstanceScript* instance = caster->GetInstanceScript())
|
|
instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, caster);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
AfterHit += SpellHitFn(spell_gen_dungeon_credit_SpellScript::CreditEncounter);
|
|
}
|
|
|
|
bool _handled;
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_dungeon_credit_SpellScript();
|
|
}
|
|
};
|
|
|
|
class spell_gen_profession_research : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_profession_research() : SpellScriptLoader("spell_gen_profession_research") {}
|
|
|
|
class spell_gen_profession_research_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_profession_research_SpellScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
SpellCastResult CheckRequirement()
|
|
{
|
|
if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer()))
|
|
{
|
|
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER);
|
|
return SPELL_FAILED_CUSTOM_ERROR;
|
|
}
|
|
|
|
return SPELL_CAST_OK;
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnCheckCast += SpellCheckCastFn(spell_gen_profession_research_SpellScript::CheckRequirement);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_profession_research_SpellScript();
|
|
}
|
|
};
|
|
|
|
class spell_generic_clone : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_generic_clone() : SpellScriptLoader("spell_generic_clone") { }
|
|
|
|
class spell_generic_clone_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_generic_clone_SpellScript);
|
|
|
|
void HandleScriptEffect(SpellEffIndex effIndex)
|
|
{
|
|
PreventHitDefaultEffect(effIndex);
|
|
uint32 spellId = uint32(GetSpellInfo()->Effects[effIndex].CalcValue());
|
|
GetHitUnit()->CastSpell(GetCaster(), spellId, true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_generic_clone_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
OnEffectHitTarget += SpellEffectFn(spell_generic_clone_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_generic_clone_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum CloneWeaponSpells
|
|
{
|
|
SPELL_COPY_WEAPON = 41055,
|
|
SPELL_COPY_WEAPON_2 = 63416,
|
|
SPELL_COPY_WEAPON_3 = 69891,
|
|
|
|
SPELL_COPY_OFFHAND = 45206,
|
|
SPELL_COPY_OFFHAND_2 = 69892,
|
|
|
|
SPELL_COPY_RANGED = 57593
|
|
};
|
|
|
|
class spell_generic_clone_weapon : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_generic_clone_weapon() : SpellScriptLoader("spell_generic_clone_weapon") { }
|
|
|
|
class spell_generic_clone_weapon_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_generic_clone_weapon_SpellScript);
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3) || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND)
|
|
|| !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleScriptEffect(SpellEffIndex effIndex)
|
|
{
|
|
PreventHitDefaultEffect(effIndex);
|
|
Unit* caster = GetCaster();
|
|
if (Unit* target = GetHitUnit())
|
|
{
|
|
|
|
uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue());
|
|
target->CastSpell(caster, spellId, true);
|
|
|
|
if (target->GetTypeId() == TYPEID_PLAYER)
|
|
return;
|
|
|
|
switch (GetSpellInfo()->Id)
|
|
{
|
|
case SPELL_COPY_WEAPON:
|
|
case SPELL_COPY_WEAPON_2:
|
|
case SPELL_COPY_WEAPON_3:
|
|
{
|
|
if (Player* player = caster->ToPlayer())
|
|
{
|
|
if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
|
|
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
|
|
}
|
|
else
|
|
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
|
|
break;
|
|
}
|
|
case SPELL_COPY_OFFHAND:
|
|
case SPELL_COPY_OFFHAND_2:
|
|
{
|
|
if (Player* player = caster->ToPlayer())
|
|
{
|
|
if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
|
|
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
|
|
}
|
|
else
|
|
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
|
|
break;
|
|
}
|
|
case SPELL_COPY_RANGED:
|
|
{
|
|
if (Player* player = caster->ToPlayer())
|
|
{
|
|
if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
|
|
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
|
|
}
|
|
else
|
|
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_generic_clone_weapon_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_generic_clone_weapon_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum SeaforiumSpells
|
|
{
|
|
SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT = 60937,
|
|
};
|
|
|
|
class spell_gen_seaforium_blast : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_seaforium_blast() : SpellScriptLoader("spell_gen_seaforium_blast") {}
|
|
|
|
class spell_gen_seaforium_blast_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_seaforium_blast_SpellScript);
|
|
|
|
bool Validate(SpellInfo const* /*spell*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
bool Load()
|
|
{
|
|
// OriginalCaster is always available in Spell::prepare
|
|
return GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
void AchievementCredit(SpellEffIndex /*effIndex*/)
|
|
{
|
|
// but in effect handling OriginalCaster can become NULL
|
|
if (Unit* originalCaster = GetOriginalCaster())
|
|
if (GameObject* go = GetHitGObj())
|
|
if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
|
|
originalCaster->CastSpell(originalCaster, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_seaforium_blast_SpellScript::AchievementCredit, EFFECT_1, SPELL_EFFECT_GAMEOBJECT_DAMAGE);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_seaforium_blast_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum FriendOrFowl
|
|
{
|
|
SPELL_TURKEY_VENGEANCE = 25285,
|
|
};
|
|
|
|
class spell_gen_turkey_marker : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_turkey_marker() : SpellScriptLoader("spell_gen_turkey_marker") { }
|
|
|
|
class spell_gen_turkey_marker_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_turkey_marker_AuraScript);
|
|
|
|
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
// store stack apply times, so we can pop them while they expire
|
|
_applyTimes.push_back(getMSTime());
|
|
Unit* target = GetTarget();
|
|
|
|
// on stack 15 cast the achievement crediting spell
|
|
if (GetStackAmount() >= 15)
|
|
target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID());
|
|
}
|
|
|
|
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
|
{
|
|
if (_applyTimes.empty())
|
|
return;
|
|
|
|
// pop stack if it expired for us
|
|
if (_applyTimes.front() + GetMaxDuration() < getMSTime())
|
|
ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
AfterEffectApply += AuraEffectApplyFn(spell_gen_turkey_marker_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
|
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_turkey_marker_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
|
}
|
|
|
|
std::list<uint32> _applyTimes;
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_turkey_marker_AuraScript();
|
|
}
|
|
};
|
|
|
|
class spell_gen_lifeblood : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_lifeblood() : SpellScriptLoader("spell_gen_lifeblood") { }
|
|
|
|
class spell_gen_lifeblood_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_lifeblood_AuraScript);
|
|
|
|
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
|
|
{
|
|
if (Unit* owner = GetUnitOwner())
|
|
amount += int32(CalculatePctF(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks()));
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_lifeblood_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_lifeblood_AuraScript();
|
|
}
|
|
};
|
|
|
|
enum MagicRoosterSpells
|
|
{
|
|
SPELL_MAGIC_ROOSTER_NORMAL = 66122,
|
|
SPELL_MAGIC_ROOSTER_DRAENEI_MALE = 66123,
|
|
SPELL_MAGIC_ROOSTER_TAUREN_MALE = 66124,
|
|
};
|
|
|
|
class spell_gen_magic_rooster : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_magic_rooster() : SpellScriptLoader("spell_gen_magic_rooster") { }
|
|
|
|
class spell_gen_magic_rooster_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_magic_rooster_SpellScript);
|
|
|
|
void HandleScript(SpellEffIndex effIndex)
|
|
{
|
|
PreventHitDefaultEffect(effIndex);
|
|
if (Player* target = GetHitPlayer())
|
|
{
|
|
// prevent client crashes from stacking mounts
|
|
target->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
|
|
|
uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL;
|
|
switch (target->getRace())
|
|
{
|
|
case RACE_DRAENEI:
|
|
if (target->getGender() == GENDER_MALE)
|
|
spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE;
|
|
break;
|
|
case RACE_TAUREN:
|
|
if (target->getGender() == GENDER_MALE)
|
|
spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
target->CastSpell(target, spellId, true);
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_magic_rooster_SpellScript::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_magic_rooster_SpellScript();
|
|
}
|
|
};
|
|
|
|
class spell_gen_allow_cast_from_item_only : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { }
|
|
|
|
class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript);
|
|
|
|
SpellCastResult CheckRequirement()
|
|
{
|
|
if (!GetCastItem())
|
|
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
|
|
return SPELL_CAST_OK;
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_allow_cast_from_item_only_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum Launch
|
|
{
|
|
SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251
|
|
};
|
|
|
|
class spell_gen_launch : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_launch() : SpellScriptLoader("spell_gen_launch") {}
|
|
|
|
class spell_gen_launch_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_launch_SpellScript);
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
if (Player* player = GetHitPlayer())
|
|
player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage
|
|
}
|
|
|
|
void Launch()
|
|
{
|
|
WorldLocation const* const position = GetTargetDest();
|
|
|
|
if (Player* player = GetHitPlayer())
|
|
{
|
|
player->ExitVehicle();
|
|
|
|
// A better research is needed
|
|
// There is no spell for this, the following calculation was based on void Spell::CalculateJumpSpeeds
|
|
|
|
float speedZ = 10.0f;
|
|
float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY());
|
|
float speedXY = dist;
|
|
|
|
player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ);
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_launch_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST);
|
|
AfterHit += SpellHitFn(spell_gen_launch_SpellScript::Launch);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_launch_SpellScript();
|
|
}
|
|
};
|
|
|
|
class spell_gen_vehicle_scaling : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_vehicle_scaling() : SpellScriptLoader("spell_gen_vehicle_scaling") { }
|
|
|
|
class spell_gen_vehicle_scaling_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_vehicle_scaling_AuraScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
|
{
|
|
Unit* caster = GetCaster();
|
|
float factor;
|
|
uint16 baseItemLevel;
|
|
|
|
// TODO: Reserach coeffs for different vehicles
|
|
switch (GetId())
|
|
{
|
|
case 66668:
|
|
factor = 1.0f;
|
|
baseItemLevel = 205;
|
|
break;
|
|
default:
|
|
factor = 1.0f;
|
|
baseItemLevel = 170;
|
|
break;
|
|
}
|
|
|
|
float avgILvl = caster->ToPlayer()->GetAverageItemLevel();
|
|
if (avgILvl < baseItemLevel)
|
|
return; // TODO: Research possibility of scaling down
|
|
|
|
amount = uint16((avgILvl - baseItemLevel) * factor);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT);
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
|
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_vehicle_scaling_AuraScript::CalculateAmount, EFFECT_2, SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_vehicle_scaling_AuraScript();
|
|
}
|
|
};
|
|
|
|
|
|
class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_oracle_wolvar_reputation() : SpellScriptLoader("spell_gen_oracle_wolvar_reputation") { }
|
|
|
|
class spell_gen_oracle_wolvar_reputation_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_oracle_wolvar_reputation_SpellScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
void HandleDummy(SpellEffIndex effIndex)
|
|
{
|
|
Player* player = GetCaster()->ToPlayer();
|
|
uint32 factionId = GetSpellInfo()->Effects[effIndex].CalcValue();
|
|
int32 repChange = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
|
|
|
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
|
|
|
|
if (!factionEntry)
|
|
return;
|
|
|
|
// Set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated)
|
|
// Not when player already has equal or higher rep with this faction
|
|
if (player->GetReputationMgr().GetBaseReputation(factionEntry) < repChange)
|
|
player->GetReputationMgr().SetReputation(factionEntry, repChange);
|
|
|
|
// EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHit += SpellEffectFn(spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_oracle_wolvar_reputation_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum DamageReductionAura
|
|
{
|
|
SPELL_BLESSING_OF_SANCTUARY = 20911,
|
|
SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899,
|
|
SPELL_RENEWED_HOPE = 63944,
|
|
SPELL_VIGILANCE = 50720,
|
|
SPELL_DAMAGE_REDUCTION_AURA = 68066,
|
|
};
|
|
|
|
class spell_gen_damage_reduction_aura : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { }
|
|
|
|
class spell_gen_damage_reduction_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_damage_reduction_AuraScript);
|
|
|
|
bool Validate(SpellInfo const* /*SpellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
Unit* target = GetTarget();
|
|
target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true);
|
|
}
|
|
|
|
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
Unit* target = GetTarget();
|
|
if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) ||
|
|
target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) ||
|
|
target->HasAura(SPELL_RENEWED_HOPE) ||
|
|
target->HasAura(SPELL_VIGILANCE)))
|
|
target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
|
OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
|
}
|
|
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_damage_reduction_AuraScript();
|
|
}
|
|
};
|
|
|
|
class spell_gen_luck_of_the_draw : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_luck_of_the_draw() : SpellScriptLoader("spell_gen_luck_of_the_draw") { }
|
|
|
|
class spell_gen_luck_of_the_draw_AuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_luck_of_the_draw_AuraScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
// cheap hax to make it have update calls
|
|
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
|
|
{
|
|
isPeriodic = true;
|
|
amplitude = 5 * IN_MILLISECONDS;
|
|
}
|
|
|
|
void Update(AuraEffect* /*effect*/)
|
|
{
|
|
if (Player* owner = GetUnitOwner()->ToPlayer())
|
|
{
|
|
const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(owner->GetGUID());
|
|
LfgDungeonSet::const_iterator itr = dungeons.begin();
|
|
|
|
if (itr == dungeons.end())
|
|
{
|
|
Remove(AURA_REMOVE_BY_DEFAULT);
|
|
return;
|
|
}
|
|
|
|
|
|
LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*itr);
|
|
if (Group* group = owner->GetGroup())
|
|
if (Map const* map = owner->GetMap())
|
|
if (group->isLFGGroup())
|
|
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
|
|
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
|
|
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty())
|
|
if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM)
|
|
return; // in correct dungeon
|
|
|
|
Remove(AURA_REMOVE_BY_DEFAULT);
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_gen_luck_of_the_draw_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
|
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_luck_of_the_draw_AuraScript::Update, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_luck_of_the_draw_AuraScript();
|
|
}
|
|
};
|
|
|
|
enum DummyTrigger
|
|
{
|
|
SPELL_PERSISTANT_SHIELD_TRIGGERED = 26470,
|
|
SPELL_PERSISTANT_SHIELD = 26467,
|
|
};
|
|
|
|
class spell_gen_dummy_trigger : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_dummy_trigger() : SpellScriptLoader("spell_gen_dummy_trigger") { }
|
|
|
|
class spell_gen_dummy_trigger_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_dummy_trigger_SpellScript);
|
|
|
|
bool Validate(SpellInfo const* /*SpellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleDummy(SpellEffIndex /* effIndex */)
|
|
{
|
|
int32 damage = GetEffectValue();
|
|
Unit* caster = GetCaster();
|
|
if (Unit* target = GetHitUnit())
|
|
if (SpellInfo const* triggeredByAuraSpell = GetTriggeringSpell())
|
|
if (triggeredByAuraSpell->Id == SPELL_PERSISTANT_SHIELD_TRIGGERED)
|
|
caster->CastCustomSpell(target, SPELL_PERSISTANT_SHIELD_TRIGGERED, &damage, NULL, NULL, true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_dummy_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_dummy_trigger_SpellScript();
|
|
}
|
|
|
|
};
|
|
|
|
class spell_gen_spirit_healer_res : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_spirit_healer_res(): SpellScriptLoader("spell_gen_spirit_healer_res") { }
|
|
|
|
class spell_gen_spirit_healer_res_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_spirit_healer_res_SpellScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetOriginalCaster() && GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
void HandleDummy(SpellEffIndex /* effIndex */)
|
|
{
|
|
Player* originalCaster = GetOriginalCaster()->ToPlayer();
|
|
if (Unit* target = GetHitUnit())
|
|
{
|
|
WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8);
|
|
data << uint64(target->GetGUID());
|
|
originalCaster->GetSession()->SendPacket(&data);
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_spirit_healer_res_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_spirit_healer_res_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum TransporterBackfires
|
|
{
|
|
SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH = 23444,
|
|
SPELL_TRANSPORTER_EVIL_TWIN = 23445,
|
|
SPELL_TRANSPORTER_MALFUNCTION_MISS = 36902,
|
|
};
|
|
|
|
class spell_gen_gadgetzan_transporter_backfire : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_gadgetzan_transporter_backfire() : SpellScriptLoader("spell_gen_gadgetzan_transporter_backfire") { }
|
|
|
|
class spell_gen_gadgetzan_transporter_backfire_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_gadgetzan_transporter_backfire_SpellScript)
|
|
|
|
bool Validate(SpellInfo const* /*SpellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH) || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_EVIL_TWIN)
|
|
|| !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_MISS))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleDummy(SpellEffIndex /* effIndex */)
|
|
{
|
|
Unit* caster = GetCaster();
|
|
int32 r = irand(0, 119);
|
|
if (r < 20) // Transporter Malfunction - 1/6 polymorph
|
|
caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH, true);
|
|
else if (r < 100) // Evil Twin - 4/6 evil twin
|
|
caster->CastSpell(caster, SPELL_TRANSPORTER_EVIL_TWIN, true);
|
|
else // Transporter Malfunction - 1/6 miss the target
|
|
caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_MISS, true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_gadgetzan_transporter_backfire_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_gadgetzan_transporter_backfire_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum GnomishTransporter
|
|
{
|
|
SPELL_TRANSPORTER_SUCCESS = 23441,
|
|
SPELL_TRANSPORTER_FAILURE = 23446,
|
|
};
|
|
|
|
class spell_gen_gnomish_transporter : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_gnomish_transporter() : SpellScriptLoader("spell_gen_gnomish_transporter") { }
|
|
|
|
class spell_gen_gnomish_transporter_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_gnomish_transporter_SpellScript)
|
|
|
|
bool Validate(SpellInfo const* /*SpellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_FAILURE))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleDummy(SpellEffIndex /* effIndex */)
|
|
{
|
|
Unit* caster = GetCaster();
|
|
caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE , true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_gnomish_transporter_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_gnomish_transporter_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum DalaranDisguiseSpells
|
|
{
|
|
SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672,
|
|
SPELL_SUNREAVER_DISGUISE_FEMALE = 70973,
|
|
SPELL_SUNREAVER_DISGUISE_MALE = 70974,
|
|
|
|
SPELL_SILVER_COVENANT_DISGUISE_TRIGGER = 69673,
|
|
SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971,
|
|
SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972,
|
|
};
|
|
|
|
class spell_gen_dalaran_disguise : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) {}
|
|
|
|
class spell_gen_dalaran_disguise_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript);
|
|
bool Validate(SpellInfo const* spellEntry)
|
|
{
|
|
switch (spellEntry->Id)
|
|
{
|
|
case SPELL_SUNREAVER_DISGUISE_TRIGGER:
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE))
|
|
return false;
|
|
break;
|
|
case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE))
|
|
return false;
|
|
break;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
if (Player* player = GetHitPlayer())
|
|
{
|
|
uint8 gender = player->getGender();
|
|
|
|
uint32 spellId = GetSpellInfo()->Id;
|
|
|
|
switch (spellId)
|
|
{
|
|
case SPELL_SUNREAVER_DISGUISE_TRIGGER:
|
|
spellId = gender ? SPELL_SUNREAVER_DISGUISE_FEMALE : SPELL_SUNREAVER_DISGUISE_MALE;
|
|
break;
|
|
case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
|
|
spellId = gender ? SPELL_SILVER_COVENANT_DISGUISE_FEMALE : SPELL_SILVER_COVENANT_DISGUISE_MALE;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
GetCaster()->CastSpell(player, spellId, true);
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_dalaran_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_dalaran_disguise_SpellScript();
|
|
}
|
|
};
|
|
|
|
/* DOCUMENTATION: Break-Shield spells
|
|
Break-Shield spells can be classified in three groups:
|
|
|
|
- Spells on vehicle bar used by players:
|
|
+ EFFECT_0: SCRIPT_EFFECT
|
|
+ EFFECT_1: NONE
|
|
+ EFFECT_2: NONE
|
|
- Spells casted by players triggered by script:
|
|
+ EFFECT_0: SCHOOL_DAMAGE
|
|
+ EFFECT_1: SCRIPT_EFFECT
|
|
+ EFFECT_2: FORCE_CAST
|
|
- Spells casted by NPCs on players:
|
|
+ EFFECT_0: SCHOOL_DAMAGE
|
|
+ EFFECT_1: SCRIPT_EFFECT
|
|
+ EFFECT_2: NONE
|
|
|
|
In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1.
|
|
- When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case
|
|
and we'll trigger "Spells casted by players triggered by script"
|
|
- When handling EFFECT_1 we're in the "Spells casted by players triggered by script"
|
|
or "Spells casted by NPCs on players" so we'll search for the first defend layer and drop it.
|
|
*/
|
|
|
|
enum BreakShieldSpells
|
|
{
|
|
SPELL_BREAK_SHIELD_DAMAGE_2K = 62626,
|
|
SPELL_BREAK_SHIELD_DAMAGE_10K = 64590,
|
|
|
|
SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS = 62575, // Also on ToC5 mounts
|
|
SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE = 64595,
|
|
SPELL_BREAK_SHIELD_TRIGGER_UNK = 66480,
|
|
};
|
|
|
|
class spell_gen_break_shield: public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_break_shield(const char* name) : SpellScriptLoader(name) {}
|
|
|
|
class spell_gen_break_shield_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_break_shield_SpellScript)
|
|
|
|
void HandleScriptEffect(SpellEffIndex effIndex)
|
|
{
|
|
Unit* target = GetHitUnit();
|
|
|
|
switch (effIndex)
|
|
{
|
|
case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
|
|
{
|
|
uint32 spellId;
|
|
|
|
switch (GetSpellInfo()->Id)
|
|
{
|
|
case SPELL_BREAK_SHIELD_TRIGGER_UNK:
|
|
case SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE:
|
|
spellId = SPELL_BREAK_SHIELD_DAMAGE_10K;
|
|
break;
|
|
case SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS:
|
|
spellId = SPELL_BREAK_SHIELD_DAMAGE_2K;
|
|
break;
|
|
default:
|
|
return;
|
|
}
|
|
|
|
if (Unit* rider = GetCaster()->GetCharmer())
|
|
rider->CastSpell(target, spellId, false);
|
|
else
|
|
GetCaster()->CastSpell(target, spellId, false);
|
|
break;
|
|
}
|
|
case EFFECT_1: // On damaging spells, for removing a defend layer
|
|
{
|
|
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
|
|
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
|
{
|
|
Aura* aura = itr->second->GetBase();
|
|
SpellInfo const* auraInfo = aura->GetSpellInfo();
|
|
if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
|
|
{
|
|
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
|
// Remove dummys from rider (Necessary for updating visual shields)
|
|
if (Unit* rider = target->GetCharmer())
|
|
if (Aura* defend = rider->GetAura(aura->GetId()))
|
|
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_break_shield_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_break_shield_SpellScript();
|
|
}
|
|
};
|
|
|
|
/* DOCUMENTATION: Charge spells
|
|
Charge spells can be classified in four groups:
|
|
|
|
- Spells on vehicle bar used by players:
|
|
+ EFFECT_0: SCRIPT_EFFECT
|
|
+ EFFECT_1: TRIGGER_SPELL
|
|
+ EFFECT_2: NONE
|
|
- Spells casted by player's mounts triggered by script:
|
|
+ EFFECT_0: CHARGE
|
|
+ EFFECT_1: TRIGGER_SPELL
|
|
+ EFFECT_2: APPLY_AURA
|
|
- Spells casted by players on the target triggered by script:
|
|
+ EFFECT_0: SCHOOL_DAMAGE
|
|
+ EFFECT_1: SCRIPT_EFFECT
|
|
+ EFFECT_2: NONE
|
|
- Spells casted by NPCs on players:
|
|
+ EFFECT_0: SCHOOL_DAMAGE
|
|
+ EFFECT_1: CHARGE
|
|
+ EFFECT_2: SCRIPT_EFFECT
|
|
|
|
In the following script we handle the SCRIPT_EFFECT and CHARGE
|
|
- When handling SCRIPT_EFFECT:
|
|
+ EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast
|
|
the charge effect on the current target ("Spells casted by player's mounts triggered by script").
|
|
+ EFFECT_1 and EFFECT_2: Triggered when "Spells casted by player's mounts triggered by script" hits target,
|
|
corresponding to "Spells casted by players on the target triggered by script" and "Spells casted by
|
|
NPCs on players" and we check Defend layers and drop a charge of the first found.
|
|
- When handling CHARGE:
|
|
+ Only launched for "Spells casted by player's mounts triggered by script", makes the player cast the
|
|
damaging spell on target with a small chance of failing it.
|
|
*/
|
|
|
|
enum ChargeSpells
|
|
{
|
|
SPELL_CHARGE_DAMAGE_8K5 = 62874,
|
|
SPELL_CHARGE_DAMAGE_20K = 68498,
|
|
SPELL_CHARGE_DAMAGE_45K = 64591,
|
|
|
|
SPELL_CHARGE_CHARGING_EFFECT_8K5 = 63661,
|
|
SPELL_CHARGE_CHARGING_EFFECT_20K_1 = 68284,
|
|
SPELL_CHARGE_CHARGING_EFFECT_20K_2 = 68501,
|
|
SPELL_CHARGE_CHARGING_EFFECT_45K_1 = 62563,
|
|
SPELL_CHARGE_CHARGING_EFFECT_45K_2 = 66481,
|
|
|
|
SPELL_CHARGE_TRIGGER_FACTION_MOUNTS = 62960,
|
|
SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION = 68282,
|
|
|
|
SPELL_CHARGE_MISS_EFFECT = 62977,
|
|
};
|
|
|
|
class spell_gen_mounted_charge: public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_mounted_charge() : SpellScriptLoader("spell_gen_mounted_charge") { }
|
|
|
|
class spell_gen_mounted_charge_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_mounted_charge_SpellScript)
|
|
|
|
void HandleScriptEffect(SpellEffIndex effIndex)
|
|
{
|
|
Unit* target = GetHitUnit();
|
|
|
|
switch (effIndex)
|
|
{
|
|
case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
|
|
{
|
|
uint32 spellId;
|
|
|
|
switch (GetSpellInfo()->Id)
|
|
{
|
|
case SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION:
|
|
spellId = SPELL_CHARGE_CHARGING_EFFECT_20K_1;
|
|
break;
|
|
case SPELL_CHARGE_TRIGGER_FACTION_MOUNTS:
|
|
spellId = SPELL_CHARGE_CHARGING_EFFECT_8K5;
|
|
break;
|
|
default:
|
|
return;
|
|
}
|
|
|
|
// If target isn't a training dummy there's a chance of failing the charge
|
|
if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE) && roll_chance_f(12.5f))
|
|
spellId = SPELL_CHARGE_MISS_EFFECT;
|
|
|
|
if (Unit* vehicle = GetCaster()->GetVehicleBase())
|
|
vehicle->CastSpell(target, spellId, false);
|
|
else
|
|
GetCaster()->CastSpell(target, spellId, false);
|
|
break;
|
|
}
|
|
case EFFECT_1: // On damaging spells, for removing a defend layer
|
|
case EFFECT_2:
|
|
{
|
|
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
|
|
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
|
{
|
|
Aura* aura = itr->second->GetBase();
|
|
SpellInfo const* auraInfo = aura->GetSpellInfo();
|
|
if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
|
|
{
|
|
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
|
// Remove dummys from rider (Necessary for updating visual shields)
|
|
if (Unit* rider = target->GetCharmer())
|
|
if (Aura* defend = rider->GetAura(aura->GetId()))
|
|
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
void HandleChargeEffect(SpellEffIndex /*effIndex*/)
|
|
{
|
|
uint32 spellId;
|
|
|
|
switch (GetSpellInfo()->Id)
|
|
{
|
|
case SPELL_CHARGE_CHARGING_EFFECT_8K5:
|
|
spellId = SPELL_CHARGE_DAMAGE_8K5;
|
|
break;
|
|
case SPELL_CHARGE_CHARGING_EFFECT_20K_1:
|
|
case SPELL_CHARGE_CHARGING_EFFECT_20K_2:
|
|
spellId = SPELL_CHARGE_DAMAGE_20K;
|
|
break;
|
|
case SPELL_CHARGE_CHARGING_EFFECT_45K_1:
|
|
case SPELL_CHARGE_CHARGING_EFFECT_45K_2:
|
|
spellId = SPELL_CHARGE_DAMAGE_45K;
|
|
break;
|
|
default:
|
|
return;
|
|
}
|
|
|
|
if (Unit* rider = GetCaster()->GetCharmer())
|
|
rider->CastSpell(GetHitUnit(), spellId, false);
|
|
else
|
|
GetCaster()->CastSpell(GetHitUnit(), spellId, false);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId);
|
|
|
|
if (spell->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT))
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
|
|
if (spell->Effects[EFFECT_0].Effect == SPELL_EFFECT_CHARGE)
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleChargeEffect, EFFECT_0, SPELL_EFFECT_CHARGE);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_mounted_charge_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum DefendVisuals
|
|
{
|
|
SPELL_VISUAL_SHIELD_1 = 63130,
|
|
SPELL_VISUAL_SHIELD_2 = 63131,
|
|
SPELL_VISUAL_SHIELD_3 = 63132,
|
|
};
|
|
|
|
class spell_gen_defend : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_defend() : SpellScriptLoader("spell_gen_defend") { }
|
|
|
|
class spell_gen_defendAuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_defendAuraScript);
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1))
|
|
return false;
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2))
|
|
return false;
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
if (GetCaster())
|
|
{
|
|
Unit* target = GetTarget();
|
|
|
|
for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
|
|
target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
|
|
|
|
target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, NULL, aurEff);
|
|
}
|
|
else
|
|
GetTarget()->RemoveAurasDueToSpell(GetId());
|
|
}
|
|
|
|
void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
|
|
GetTarget()->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
|
|
}
|
|
|
|
void RemoveDummyFromDriver(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
if (Unit* caster = GetCaster())
|
|
if (TempSummon* vehicle = caster->ToTempSummon())
|
|
if (Unit* rider = vehicle->GetSummoner())
|
|
rider->RemoveAurasDueToSpell(GetId());
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId);
|
|
|
|
// Defend spells casted by NPCs (add visuals)
|
|
if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
|
|
{
|
|
AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
|
OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
|
}
|
|
|
|
// Remove Defend spell from player when he dismounts
|
|
if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
|
|
OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
// Defend spells casted by players (add/remove visuals)
|
|
if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY)
|
|
{
|
|
AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
|
OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
|
}
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_defendAuraScript();
|
|
}
|
|
};
|
|
|
|
enum MountedDuelSpells
|
|
{
|
|
SPELL_ON_TOURNAMENT_MOUNT = 63034,
|
|
SPELL_MOUNTED_DUEL = 62875,
|
|
};
|
|
|
|
class spell_gen_tournament_duel : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_tournament_duel() : SpellScriptLoader("spell_gen_tournament_duel") { }
|
|
|
|
class spell_gen_tournament_duel_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_tournament_duel_SpellScript);
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_ON_TOURNAMENT_MOUNT))
|
|
return false;
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTED_DUEL))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
|
{
|
|
if (Unit* rider = GetCaster()->GetCharmer())
|
|
{
|
|
if (Player* plrTarget = GetHitPlayer())
|
|
{
|
|
if (plrTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && plrTarget->GetVehicleBase())
|
|
rider->CastSpell(plrTarget, SPELL_MOUNTED_DUEL, true);
|
|
}
|
|
else if (Unit* unitTarget = GetHitUnit())
|
|
{
|
|
if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT))
|
|
rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_tournament_duel_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_tournament_duel_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum TournamentMountsSpells
|
|
{
|
|
SPELL_LANCE_EQUIPPED = 62853,
|
|
};
|
|
|
|
class spell_gen_summon_tournament_mount : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_summon_tournament_mount() : SpellScriptLoader("spell_gen_summon_tournament_mount") { }
|
|
|
|
class spell_gen_summon_tournament_mount_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_summon_tournament_mount_SpellScript);
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_LANCE_EQUIPPED))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
SpellCastResult CheckIfLanceEquiped()
|
|
{
|
|
if (GetCaster()->IsInDisallowedMountForm())
|
|
GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
|
|
|
if (!GetCaster()->HasAura(SPELL_LANCE_EQUIPPED))
|
|
{
|
|
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED);
|
|
return SPELL_FAILED_CUSTOM_ERROR;
|
|
}
|
|
|
|
return SPELL_CAST_OK;
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnCheckCast += SpellCheckCastFn(spell_gen_summon_tournament_mount_SpellScript::CheckIfLanceEquiped);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_summon_tournament_mount_SpellScript();
|
|
}
|
|
};
|
|
|
|
enum TournamentPennantSpells
|
|
{
|
|
SPELL_PENNANT_STORMWIND_ASPIRANT = 62595,
|
|
SPELL_PENNANT_STORMWIND_VALIANT = 62596,
|
|
SPELL_PENNANT_STORMWIND_CHAMPION = 62594,
|
|
SPELL_PENNANT_GNOMEREGAN_ASPIRANT = 63394,
|
|
SPELL_PENNANT_GNOMEREGAN_VALIANT = 63395,
|
|
SPELL_PENNANT_GNOMEREGAN_CHAMPION = 63396,
|
|
SPELL_PENNANT_SEN_JIN_ASPIRANT = 63397,
|
|
SPELL_PENNANT_SEN_JIN_VALIANT = 63398,
|
|
SPELL_PENNANT_SEN_JIN_CHAMPION = 63399,
|
|
SPELL_PENNANT_SILVERMOON_ASPIRANT = 63401,
|
|
SPELL_PENNANT_SILVERMOON_VALIANT = 63402,
|
|
SPELL_PENNANT_SILVERMOON_CHAMPION = 63403,
|
|
SPELL_PENNANT_DARNASSUS_ASPIRANT = 63404,
|
|
SPELL_PENNANT_DARNASSUS_VALIANT = 63405,
|
|
SPELL_PENNANT_DARNASSUS_CHAMPION = 63406,
|
|
SPELL_PENNANT_EXODAR_ASPIRANT = 63421,
|
|
SPELL_PENNANT_EXODAR_VALIANT = 63422,
|
|
SPELL_PENNANT_EXODAR_CHAMPION = 63423,
|
|
SPELL_PENNANT_IRONFORGE_ASPIRANT = 63425,
|
|
SPELL_PENNANT_IRONFORGE_VALIANT = 63426,
|
|
SPELL_PENNANT_IRONFORGE_CHAMPION = 63427,
|
|
SPELL_PENNANT_UNDERCITY_ASPIRANT = 63428,
|
|
SPELL_PENNANT_UNDERCITY_VALIANT = 63429,
|
|
SPELL_PENNANT_UNDERCITY_CHAMPION = 63430,
|
|
SPELL_PENNANT_ORGRIMMAR_ASPIRANT = 63431,
|
|
SPELL_PENNANT_ORGRIMMAR_VALIANT = 63432,
|
|
SPELL_PENNANT_ORGRIMMAR_CHAMPION = 63433,
|
|
SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT = 63434,
|
|
SPELL_PENNANT_THUNDER_BLUFF_VALIANT = 63435,
|
|
SPELL_PENNANT_THUNDER_BLUFF_CHAMPION = 63436,
|
|
SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT = 63606,
|
|
SPELL_PENNANT_ARGENT_CRUSADE_VALIANT = 63500,
|
|
SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION = 63501,
|
|
SPELL_PENNANT_EBON_BLADE_ASPIRANT = 63607,
|
|
SPELL_PENNANT_EBON_BLADE_VALIANT = 63608,
|
|
SPELL_PENNANT_EBON_BLADE_CHAMPION = 63609,
|
|
};
|
|
|
|
enum TournamentMounts
|
|
{
|
|
NPC_STORMWIND_STEED = 33217,
|
|
NPC_IRONFORGE_RAM = 33316,
|
|
NPC_GNOMEREGAN_MECHANOSTRIDER = 33317,
|
|
NPC_EXODAR_ELEKK = 33318,
|
|
NPC_DARNASSIAN_NIGHTSABER = 33319,
|
|
NPC_ORGRIMMAR_WOLF = 33320,
|
|
NPC_DARK_SPEAR_RAPTOR = 33321,
|
|
NPC_THUNDER_BLUFF_KODO = 33322,
|
|
NPC_SILVERMOON_HAWKSTRIDER = 33323,
|
|
NPC_FORSAKEN_WARHORSE = 33324,
|
|
NPC_ARGENT_WARHORSE = 33782,
|
|
NPC_ARGENT_STEED_ASPIRANT = 33845,
|
|
NPC_ARGENT_HAWKSTRIDER_ASPIRANT = 33844,
|
|
};
|
|
|
|
enum TournamentQuestsAchievements
|
|
{
|
|
ACHIEVEMENT_CHAMPION_STORMWIND = 2781,
|
|
ACHIEVEMENT_CHAMPION_DARNASSUS = 2777,
|
|
ACHIEVEMENT_CHAMPION_IRONFORGE = 2780,
|
|
ACHIEVEMENT_CHAMPION_GNOMEREGAN = 2779,
|
|
ACHIEVEMENT_CHAMPION_THE_EXODAR = 2778,
|
|
ACHIEVEMENT_CHAMPION_ORGRIMMAR = 2783,
|
|
ACHIEVEMENT_CHAMPION_SEN_JIN = 2784,
|
|
ACHIEVEMENT_CHAMPION_THUNDER_BLUFF = 2786,
|
|
ACHIEVEMENT_CHAMPION_UNDERCITY = 2787,
|
|
ACHIEVEMENT_CHAMPION_SILVERMOON = 2785,
|
|
ACHIEVEMENT_ARGENT_VALOR = 2758,
|
|
ACHIEVEMENT_CHAMPION_ALLIANCE = 2782,
|
|
ACHIEVEMENT_CHAMPION_HORDE = 2788,
|
|
|
|
QUEST_VALIANT_OF_STORMWIND = 13593,
|
|
QUEST_A_VALIANT_OF_STORMWIND = 13684,
|
|
QUEST_VALIANT_OF_DARNASSUS = 13706,
|
|
QUEST_A_VALIANT_OF_DARNASSUS = 13689,
|
|
QUEST_VALIANT_OF_IRONFORGE = 13703,
|
|
QUEST_A_VALIANT_OF_IRONFORGE = 13685,
|
|
QUEST_VALIANT_OF_GNOMEREGAN = 13704,
|
|
QUEST_A_VALIANT_OF_GNOMEREGAN = 13688,
|
|
QUEST_VALIANT_OF_THE_EXODAR = 13705,
|
|
QUEST_A_VALIANT_OF_THE_EXODAR = 13690,
|
|
QUEST_VALIANT_OF_ORGRIMMAR = 13707,
|
|
QUEST_A_VALIANT_OF_ORGRIMMAR = 13691,
|
|
QUEST_VALIANT_OF_SEN_JIN = 13708,
|
|
QUEST_A_VALIANT_OF_SEN_JIN = 13693,
|
|
QUEST_VALIANT_OF_THUNDER_BLUFF = 13709,
|
|
QUEST_A_VALIANT_OF_THUNDER_BLUFF = 13694,
|
|
QUEST_VALIANT_OF_UNDERCITY = 13710,
|
|
QUEST_A_VALIANT_OF_UNDERCITY = 13695,
|
|
QUEST_VALIANT_OF_SILVERMOON = 13711,
|
|
QUEST_A_VALIANT_OF_SILVERMOON = 13696,
|
|
};
|
|
|
|
class spell_gen_on_tournament_mount : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_on_tournament_mount() : SpellScriptLoader("spell_gen_on_tournament_mount") { }
|
|
|
|
class spell_gen_on_tournament_mountAuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_on_tournament_mountAuraScript);
|
|
|
|
uint32 _pennantSpellId;
|
|
|
|
bool Load()
|
|
{
|
|
_pennantSpellId = 0;
|
|
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
if (Unit* caster = GetCaster())
|
|
{
|
|
if (Unit* vehicle = caster->GetVehicleBase())
|
|
{
|
|
_pennantSpellId = GetPennatSpellId(caster->ToPlayer(), vehicle);
|
|
caster->CastSpell(caster, _pennantSpellId, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
void HandleRemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
if (Unit* caster = GetCaster())
|
|
caster->RemoveAurasDueToSpell(_pennantSpellId);
|
|
}
|
|
|
|
uint32 GetPennatSpellId(Player* player, Unit* mount)
|
|
{
|
|
switch (mount->GetEntry())
|
|
{
|
|
case NPC_ARGENT_STEED_ASPIRANT:
|
|
case NPC_STORMWIND_STEED:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_STORMWIND))
|
|
return SPELL_PENNANT_STORMWIND_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_STORMWIND) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_STORMWIND))
|
|
return SPELL_PENNANT_STORMWIND_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_STORMWIND_ASPIRANT;
|
|
}
|
|
case NPC_GNOMEREGAN_MECHANOSTRIDER:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_GNOMEREGAN))
|
|
return SPELL_PENNANT_GNOMEREGAN_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_GNOMEREGAN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_GNOMEREGAN))
|
|
return SPELL_PENNANT_GNOMEREGAN_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_GNOMEREGAN_ASPIRANT;
|
|
}
|
|
case NPC_DARK_SPEAR_RAPTOR:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SEN_JIN))
|
|
return SPELL_PENNANT_SEN_JIN_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SEN_JIN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SEN_JIN))
|
|
return SPELL_PENNANT_SEN_JIN_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_SEN_JIN_ASPIRANT;
|
|
}
|
|
case NPC_ARGENT_HAWKSTRIDER_ASPIRANT:
|
|
case NPC_SILVERMOON_HAWKSTRIDER:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SILVERMOON))
|
|
return SPELL_PENNANT_SILVERMOON_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SILVERMOON) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SILVERMOON))
|
|
return SPELL_PENNANT_SILVERMOON_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_SILVERMOON_ASPIRANT;
|
|
}
|
|
case NPC_DARNASSIAN_NIGHTSABER:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_DARNASSUS))
|
|
return SPELL_PENNANT_DARNASSUS_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_DARNASSUS) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_DARNASSUS))
|
|
return SPELL_PENNANT_DARNASSUS_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_DARNASSUS_ASPIRANT;
|
|
}
|
|
case NPC_EXODAR_ELEKK:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THE_EXODAR))
|
|
return SPELL_PENNANT_EXODAR_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THE_EXODAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THE_EXODAR))
|
|
return SPELL_PENNANT_EXODAR_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_EXODAR_ASPIRANT;
|
|
}
|
|
case NPC_IRONFORGE_RAM:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_IRONFORGE))
|
|
return SPELL_PENNANT_IRONFORGE_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_IRONFORGE) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_IRONFORGE))
|
|
return SPELL_PENNANT_IRONFORGE_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_IRONFORGE_ASPIRANT;
|
|
}
|
|
case NPC_FORSAKEN_WARHORSE:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_UNDERCITY))
|
|
return SPELL_PENNANT_UNDERCITY_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_UNDERCITY) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_UNDERCITY))
|
|
return SPELL_PENNANT_UNDERCITY_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_UNDERCITY_ASPIRANT;
|
|
}
|
|
case NPC_ORGRIMMAR_WOLF:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ORGRIMMAR))
|
|
return SPELL_PENNANT_ORGRIMMAR_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_ORGRIMMAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_ORGRIMMAR))
|
|
return SPELL_PENNANT_ORGRIMMAR_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_ORGRIMMAR_ASPIRANT;
|
|
}
|
|
case NPC_THUNDER_BLUFF_KODO:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THUNDER_BLUFF))
|
|
return SPELL_PENNANT_THUNDER_BLUFF_CHAMPION;
|
|
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THUNDER_BLUFF) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THUNDER_BLUFF))
|
|
return SPELL_PENNANT_THUNDER_BLUFF_VALIANT;
|
|
else
|
|
return SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT;
|
|
}
|
|
case NPC_ARGENT_WARHORSE:
|
|
{
|
|
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ALLIANCE) || player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_HORDE))
|
|
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION;
|
|
else if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_ARGENT_VALOR))
|
|
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT;
|
|
else
|
|
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT;
|
|
}
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
AfterEffectApply += AuraEffectApplyFn(spell_gen_on_tournament_mountAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
|
OnEffectRemove += AuraEffectRemoveFn(spell_gen_on_tournament_mountAuraScript::HandleRemoveEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_on_tournament_mountAuraScript();
|
|
}
|
|
};
|
|
|
|
class spell_gen_tournament_pennant : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_tournament_pennant() : SpellScriptLoader("spell_gen_tournament_pennant") { }
|
|
|
|
class spell_gen_tournament_pennantAuraScript : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_gen_tournament_pennantAuraScript);
|
|
|
|
bool Load()
|
|
{
|
|
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
}
|
|
|
|
void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
{
|
|
if (Unit* caster = GetCaster())
|
|
if (!caster->GetVehicleBase())
|
|
caster->RemoveAurasDueToSpell(GetId());
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectApply += AuraEffectApplyFn(spell_gen_tournament_pennantAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
|
}
|
|
};
|
|
|
|
AuraScript* GetAuraScript() const
|
|
{
|
|
return new spell_gen_tournament_pennantAuraScript();
|
|
}
|
|
};
|
|
|
|
enum ChaosBlast
|
|
{
|
|
SPELL_CHAOS_BLAST = 37675,
|
|
};
|
|
|
|
class spell_gen_chaos_blast : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_chaos_blast() : SpellScriptLoader("spell_gen_chaos_blast") { }
|
|
|
|
class spell_gen_chaos_blast_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_chaos_blast_SpellScript)
|
|
|
|
bool Validate(SpellInfo const* /*SpellEntry*/)
|
|
{
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_CHAOS_BLAST))
|
|
return false;
|
|
return true;
|
|
}
|
|
void HandleDummy(SpellEffIndex /* effIndex */)
|
|
{
|
|
int32 basepoints0 = 100;
|
|
Unit* caster = GetCaster();
|
|
if (Unit* target = GetHitUnit())
|
|
caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, NULL, NULL, true);
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_chaos_blast_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_chaos_blast_SpellScript();
|
|
}
|
|
|
|
};
|
|
|
|
class spell_gen_ds_flush_knockback : public SpellScriptLoader
|
|
{
|
|
public:
|
|
spell_gen_ds_flush_knockback() : SpellScriptLoader("spell_gen_ds_flush_knockback") {}
|
|
|
|
class spell_gen_ds_flush_knockback_SpellScript : public SpellScript
|
|
{
|
|
PrepareSpellScript(spell_gen_ds_flush_knockback_SpellScript);
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
{
|
|
// Here the target is the water spout and determines the position where the player is knocked from
|
|
if (Unit* target = GetHitUnit())
|
|
{
|
|
if (Player* player = GetCaster()->ToPlayer())
|
|
{
|
|
float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target));
|
|
float verticalSpeed = 8.0f;
|
|
// This method relies on the Dalaran Sewer map disposition and Water Spout position
|
|
// What we do is knock the player from a position exactly behind him and at the end of the pipe
|
|
player->KnockbackFrom(target->GetPositionX(), player->GetPositionY(), horizontalSpeed, verticalSpeed);
|
|
}
|
|
}
|
|
}
|
|
|
|
void Register()
|
|
{
|
|
OnEffectHitTarget += SpellEffectFn(spell_gen_ds_flush_knockback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
}
|
|
};
|
|
|
|
SpellScript* GetSpellScript() const
|
|
{
|
|
return new spell_gen_ds_flush_knockback_SpellScript();
|
|
}
|
|
};
|
|
|
|
void AddSC_generic_spell_scripts()
|
|
{
|
|
new spell_gen_absorb0_hitlimit1();
|
|
new spell_gen_aura_of_anger();
|
|
new spell_gen_av_drekthar_presence();
|
|
new spell_gen_burn_brutallus();
|
|
new spell_gen_cannibalize();
|
|
new spell_gen_leeching_swarm();
|
|
new spell_gen_parachute();
|
|
new spell_gen_pet_summoned();
|
|
new spell_gen_remove_flight_auras();
|
|
new spell_gen_trick();
|
|
new spell_gen_trick_or_treat();
|
|
new spell_creature_permanent_feign_death();
|
|
new spell_pvp_trinket_wotf_shared_cd();
|
|
new spell_gen_animal_blood();
|
|
new spell_gen_divine_storm_cd_reset();
|
|
new spell_gen_parachute_ic();
|
|
new spell_gen_gunship_portal();
|
|
new spell_gen_dungeon_credit();
|
|
new spell_gen_profession_research();
|
|
new spell_generic_clone();
|
|
new spell_generic_clone_weapon();
|
|
new spell_gen_seaforium_blast();
|
|
new spell_gen_turkey_marker();
|
|
new spell_gen_lifeblood();
|
|
new spell_gen_magic_rooster();
|
|
new spell_gen_allow_cast_from_item_only();
|
|
new spell_gen_launch();
|
|
new spell_gen_vehicle_scaling();
|
|
new spell_gen_oracle_wolvar_reputation();
|
|
new spell_gen_damage_reduction_aura();
|
|
new spell_gen_luck_of_the_draw();
|
|
new spell_gen_dummy_trigger();
|
|
new spell_gen_spirit_healer_res();
|
|
new spell_gen_gadgetzan_transporter_backfire();
|
|
new spell_gen_gnomish_transporter();
|
|
new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise");
|
|
new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise");
|
|
new spell_gen_elune_candle();
|
|
new spell_gen_break_shield("spell_gen_break_shield");
|
|
new spell_gen_break_shield("spell_gen_tournament_counterattack");
|
|
new spell_gen_mounted_charge();
|
|
new spell_gen_defend();
|
|
new spell_gen_tournament_duel();
|
|
new spell_gen_summon_tournament_mount();
|
|
new spell_gen_on_tournament_mount();
|
|
new spell_gen_tournament_pennant();
|
|
new spell_gen_chaos_blast();
|
|
new spell_gen_ds_flush_knockback();
|
|
}
|