2010-07-24 22:41:42 +02:00
|
|
|
/*
|
2011-01-01 15:01:13 +01:00
|
|
|
* Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
|
2010-07-24 22:41:42 +02:00
|
|
|
*
|
|
|
|
|
* 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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
2010-08-08 19:45:53 +02:00
|
|
|
* Scripts for spells with SPELLFAMILY_GENERIC which cannot be included in AI script file
|
2010-07-24 22:41:42 +02:00
|
|
|
* 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-09-21 23:59:45 +06:00
|
|
|
#include "SpellAuraEffects.h"
|
|
|
|
|
|
2010-12-30 02:03:46 +01:00
|
|
|
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 = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-11 11:18:00 +01:00
|
|
|
void Absorb(AuraEffect * /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
|
2010-12-30 02:03:46 +01:00
|
|
|
{
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-09-21 23:59:45 +06:00
|
|
|
// 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
|
|
|
|
|
{
|
2010-10-08 22:33:21 +02:00
|
|
|
PrepareAuraScript(spell_gen_aura_of_anger_AuraScript)
|
2010-09-21 23:59:45 +06:00
|
|
|
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
|
|
|
|
|
{
|
2010-10-08 22:33:21 +02:00
|
|
|
PrepareAuraScript(spell_gen_burn_brutallus_AuraScript)
|
2010-09-21 23:59:45 +06:00
|
|
|
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
|
|
|
|
|
{
|
2010-10-08 22:33:21 +02:00
|
|
|
PrepareAuraScript(spell_gen_parachute_AuraScript)
|
2010-09-21 23:59:45 +06:00
|
|
|
bool Validate(SpellEntry const * /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_PARACHUTE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_PARACHUTE_BUFF))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-27 20:14:54 +01:00
|
|
|
void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
|
2010-09-21 23:59:45 +06:00
|
|
|
{
|
2010-12-27 20:14:54 +01:00
|
|
|
Unit* pTarget = GetTarget();
|
2010-12-05 21:38:52 +01:00
|
|
|
if (Player* pPlayerTarget = pTarget->ToPlayer())
|
|
|
|
|
if (pPlayerTarget->IsFalling())
|
|
|
|
|
{
|
|
|
|
|
pPlayerTarget->RemoveAurasDueToSpell(SPELL_PARACHUTE);
|
|
|
|
|
pPlayerTarget->CastSpell(pPlayerTarget, SPELL_PARACHUTE_BUFF, true);
|
|
|
|
|
}
|
2010-09-21 23:59:45 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript *GetAuraScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_gen_parachute_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
2010-07-24 22:41:42 +02:00
|
|
|
|
2010-08-22 21:07:18 -07:00
|
|
|
enum NPCEntries
|
|
|
|
|
{
|
|
|
|
|
NPC_DOOMGUARD = 11859,
|
|
|
|
|
NPC_INFERNAL = 89,
|
|
|
|
|
NPC_IMP = 416,
|
|
|
|
|
};
|
|
|
|
|
|
2010-08-24 00:10:49 +02:00
|
|
|
class spell_gen_pet_summoned : public SpellScriptLoader
|
2010-08-22 21:07:18 -07:00
|
|
|
{
|
|
|
|
|
public:
|
2010-08-24 00:10:49 +02:00
|
|
|
spell_gen_pet_summoned() : SpellScriptLoader("spell_gen_pet_summoned") { }
|
2010-08-22 21:07:18 -07:00
|
|
|
|
|
|
|
|
class spell_gen_pet_summonedSpellScript : public SpellScript
|
|
|
|
|
{
|
2010-10-08 21:33:44 +02:00
|
|
|
PrepareSpellScript(spell_gen_pet_summonedSpellScript)
|
2010-08-23 14:10:24 +02:00
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
2010-08-22 21:07:18 -07:00
|
|
|
{
|
|
|
|
|
Unit *caster = GetCaster();
|
|
|
|
|
if (caster->GetTypeId() != TYPEID_PLAYER)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Player* plr = caster->ToPlayer();
|
|
|
|
|
if (plr && plr->GetLastPetNumber())
|
2010-08-06 20:09:23 +02:00
|
|
|
{
|
2010-08-22 21:07:18 -07:00
|
|
|
PetType NewPetType = (plr->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
|
|
|
|
if (Pet* NewPet = new Pet(plr, NewPetType))
|
|
|
|
|
{
|
|
|
|
|
if (NewPet->LoadPetFromDB(plr, 0, plr->GetLastPetNumber(), true))
|
|
|
|
|
{
|
|
|
|
|
// revive the pet if it is dead
|
|
|
|
|
if (NewPet->getDeathState() == DEAD)
|
|
|
|
|
NewPet->setDeathState(ALIVE);
|
|
|
|
|
|
2010-08-26 01:20:57 +06:00
|
|
|
NewPet->SetFullHealth();
|
2010-08-22 21:07:18 -07:00
|
|
|
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;
|
|
|
|
|
}
|
2010-08-06 20:09:23 +02:00
|
|
|
}
|
2010-08-22 21:07:18 -07:00
|
|
|
}
|
2010-08-06 20:09:23 +02:00
|
|
|
|
2010-08-22 21:07:18 -07:00
|
|
|
void Register()
|
2010-08-06 20:09:23 +02:00
|
|
|
{
|
2010-08-24 00:10:49 +02:00
|
|
|
OnEffect += SpellEffectFn(spell_gen_pet_summonedSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
2010-08-06 20:09:23 +02:00
|
|
|
}
|
2010-08-22 21:07:18 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript* GetSpellScript() const
|
|
|
|
|
{
|
2010-08-29 22:40:23 +06:00
|
|
|
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
|
|
|
|
|
{
|
2010-10-08 21:33:44 +02:00
|
|
|
PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript)
|
2010-08-29 22:40:23 +06:00
|
|
|
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();
|
2010-08-22 21:07:18 -07:00
|
|
|
}
|
2010-08-07 01:02:09 +06:00
|
|
|
};
|
2010-08-06 20:09:23 +02:00
|
|
|
|
2010-09-21 23:59:45 +06:00
|
|
|
// 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
|
|
|
|
|
{
|
2010-10-08 22:33:21 +02:00
|
|
|
PrepareAuraScript(spell_gen_leeching_swarm_AuraScript)
|
2010-09-21 23:59:45 +06:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-27 20:14:54 +01:00
|
|
|
void HandleEffectPeriodic(AuraEffect const * aurEff)
|
2010-09-21 23:59:45 +06:00
|
|
|
{
|
2010-12-31 02:23:29 -02:00
|
|
|
if (Unit* pTarget = GetTarget())
|
|
|
|
|
if (Unit* pCaster = GetCaster())
|
|
|
|
|
{
|
|
|
|
|
int32 lifeLeeched = pTarget->CountPctFromCurHealth(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);
|
|
|
|
|
}
|
2010-09-21 23:59:45 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-09-18 22:50:43 +06:00
|
|
|
// 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
|
|
|
|
|
{
|
2010-10-08 21:33:44 +02:00
|
|
|
PrepareSpellScript(spell_gen_trick_SpellScript)
|
2010-09-18 22:50:43 +06:00
|
|
|
bool Validate(SpellEntry const * /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_MALE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_FEMALE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_NINJA_COSTUME_MALE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_NINJA_COSTUME_FEMALE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_LEPER_GNOME_COSTUME_MALE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_LEPER_GNOME_COSTUME_FEMALE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_SKELETON_COSTUME))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_GHOST_COSTUME_MALE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_GHOST_COSTUME_FEMALE))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_TRICK_BUFF))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
|
|
|
{
|
|
|
|
|
if (Player* pTarget = GetHitPlayer())
|
|
|
|
|
{
|
|
|
|
|
uint8 gender = pTarget->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;
|
|
|
|
|
}
|
|
|
|
|
GetCaster()->CastSpell(pTarget, spellId, true, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffect += SpellEffectFn(spell_gen_trick_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript* GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_gen_trick_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-09-17 14:24:25 +06:00
|
|
|
// 24751 Trick or Treat
|
|
|
|
|
enum eTrickOrTreatSpells
|
|
|
|
|
{
|
2010-09-18 22:50:43 +06:00
|
|
|
SPELL_TRICK = 24714,
|
|
|
|
|
SPELL_TREAT = 24715,
|
|
|
|
|
SPELL_TRICKED_OR_TREATED = 24755
|
2010-09-17 14:24:25 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
{
|
2010-10-08 21:33:44 +02:00
|
|
|
PrepareSpellScript(spell_gen_trick_or_treat_SpellScript)
|
2010-09-17 14:24:25 +06:00
|
|
|
bool Validate(SpellEntry const * /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_TRICK))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_TREAT))
|
|
|
|
|
return false;
|
2010-09-18 22:50:43 +06:00
|
|
|
if (!sSpellStore.LookupEntry(SPELL_TRICKED_OR_TREATED))
|
|
|
|
|
return false;
|
2010-09-17 14:24:25 +06:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
|
|
|
{
|
2010-09-18 22:50:43 +06:00
|
|
|
if (Player* pTarget = GetHitPlayer())
|
|
|
|
|
{
|
2010-09-17 14:24:25 +06:00
|
|
|
GetCaster()->CastSpell(pTarget, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL);
|
2010-09-18 22:50:43 +06:00
|
|
|
GetCaster()->CastSpell(pTarget, SPELL_TRICKED_OR_TREATED, true, NULL);
|
|
|
|
|
}
|
2010-09-17 14:24:25 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffect += 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();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-09-08 14:57:44 +03:00
|
|
|
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_deathAuraScript : public AuraScript
|
|
|
|
|
{
|
2010-10-08 22:33:21 +02:00
|
|
|
PrepareAuraScript(spell_creature_permanent_feign_deathAuraScript)
|
2010-12-27 20:14:54 +01:00
|
|
|
void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
2010-09-08 14:57:44 +03:00
|
|
|
{
|
2010-12-27 20:14:54 +01:00
|
|
|
Unit* pTarget = GetTarget();
|
2010-09-08 14:57:44 +03:00
|
|
|
|
|
|
|
|
pTarget->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
|
|
|
|
pTarget->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectApply += AuraEffectApplyFn(spell_creature_permanent_feign_deathAuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript *GetAuraScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_creature_permanent_feign_deathAuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-09-08 16:00:10 +03:00
|
|
|
enum PvPTrinketTriggeredSpells
|
|
|
|
|
{
|
|
|
|
|
SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER = 72752,
|
|
|
|
|
SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF = 72757,
|
|
|
|
|
};
|
2010-09-17 14:24:25 +06:00
|
|
|
|
2010-09-08 16:00:10 +03:00
|
|
|
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
|
|
|
|
|
{
|
2010-10-08 21:33:44 +02:00
|
|
|
PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript)
|
2010-09-08 16:00:10 +03:00
|
|
|
bool Validate(SpellEntry const * /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
|
|
|
{
|
|
|
|
|
Player* pCaster = GetCaster()->ToPlayer();
|
|
|
|
|
if (!pCaster)
|
|
|
|
|
return;
|
|
|
|
|
const SpellEntry* m_spellInfo = GetSpellInfo();
|
|
|
|
|
|
|
|
|
|
pCaster->AddSpellCooldown(m_spellInfo->Id, NULL, time(NULL) + GetSpellRecoveryTime(sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) / IN_MILLISECONDS);
|
|
|
|
|
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4);
|
|
|
|
|
data << uint64(pCaster->GetGUID());
|
|
|
|
|
data << uint8(0);
|
|
|
|
|
data << uint32(m_spellInfo->Id);
|
|
|
|
|
data << uint32(0);
|
|
|
|
|
pCaster->GetSession()->SendPacket(&data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffect += 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();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-11-10 11:37:41 +01:00
|
|
|
enum AnimalBloodPoolSpell
|
|
|
|
|
{
|
2010-12-19 20:03:56 +01:00
|
|
|
SPELL_ANIMAL_BLOOD = 46221,
|
2010-11-10 11:37:41 +01:00
|
|
|
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(SpellEntry const* /*spell*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_SPAWN_BLOOD_POOL))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2010-12-19 20:03:56 +01:00
|
|
|
|
2010-12-27 20:14:54 +01:00
|
|
|
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
2010-12-19 20:03:56 +01:00
|
|
|
{
|
|
|
|
|
// Remove all auras with spell id 46221, except the one currently being applied
|
2010-12-20 11:04:48 +01:00
|
|
|
while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura()))
|
2010-12-19 20:03:56 +01:00
|
|
|
GetUnitOwner()->RemoveOwnedAura(aur);
|
|
|
|
|
}
|
2010-11-10 11:37:41 +01:00
|
|
|
|
2010-12-27 20:14:54 +01:00
|
|
|
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
2010-11-10 11:37:41 +01:00
|
|
|
{
|
|
|
|
|
if (GetUnitOwner()->IsInWater())
|
|
|
|
|
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPAWN_BLOOD_POOL, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
2010-12-19 20:03:56 +01:00
|
|
|
OnEffectApply += AuraEffectRemoveFn(spell_gen_animal_blood_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
2010-11-10 11:37:41 +01:00
|
|
|
OnEffectRemove += 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();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-11-13 17:18:09 +01:00
|
|
|
class spell_gen_shroud_of_death : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_gen_shroud_of_death() : SpellScriptLoader("spell_gen_shroud_of_death") { }
|
|
|
|
|
|
|
|
|
|
class spell_gen_shroud_of_deathAuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_gen_shroud_of_deathAuraScript)
|
|
|
|
|
|
2010-12-27 20:14:54 +01:00
|
|
|
void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
2010-11-13 17:18:09 +01:00
|
|
|
{
|
2010-12-27 20:14:54 +01:00
|
|
|
Unit* target = GetTarget();
|
2010-12-05 21:38:52 +01:00
|
|
|
target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
|
|
|
|
target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
2010-11-13 17:18:09 +01:00
|
|
|
}
|
|
|
|
|
|
2010-12-27 20:14:54 +01:00
|
|
|
void HandleEffectRemove(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
2010-11-13 17:18:09 +01:00
|
|
|
{
|
2010-12-27 20:14:54 +01:00
|
|
|
Unit* target = GetTarget();
|
2010-12-05 21:38:52 +01:00
|
|
|
target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
|
|
|
|
|
target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
|
2010-11-13 17:18:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectApply += AuraEffectApplyFn(spell_gen_shroud_of_deathAuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
|
OnEffectRemove += AuraEffectRemoveFn(spell_gen_shroud_of_deathAuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript *GetAuraScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_gen_shroud_of_deathAuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-31 18:31:16 -02:00
|
|
|
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 Validate(SpellEntry const * /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellStore.LookupEntry(SPELL_DIVINE_STORM))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
|
|
|
{
|
2011-01-02 16:27:38 +01:00
|
|
|
if (Player *caster = GetCaster()->ToPlayer())
|
|
|
|
|
if (caster->HasSpellCooldown(SPELL_DIVINE_STORM))
|
|
|
|
|
caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true);
|
2010-12-31 18:31:16 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffect += 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();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2011-01-09 00:00:08 -03:00
|
|
|
class spell_gen_gunship_portal : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { }
|
|
|
|
|
|
|
|
|
|
class spell_gen_gunship_portalSpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_gen_gunship_portalSpellScript)
|
|
|
|
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
|
|
|
{
|
|
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
if (!caster->ToPlayer())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (Battleground *bg = caster->ToPlayer()->GetBattleground())
|
|
|
|
|
{
|
|
|
|
|
if (bg->GetTypeID(true) == BATTLEGROUND_IC)
|
|
|
|
|
bg->DoAction(1,caster->GetGUID());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffect += SpellEffectFn(spell_gen_gunship_portalSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript* GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_gen_gunship_portalSpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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_icAuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_gen_parachute_icAuraScript)
|
|
|
|
|
|
|
|
|
|
void HandleTriggerSpell(AuraEffect const * /*aurEff*/)
|
|
|
|
|
{
|
|
|
|
|
Unit* target = GetTarget();
|
|
|
|
|
|
|
|
|
|
if (!target->ToPlayer())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (target->ToPlayer()->m_movementInfo.fallTime > 2000)
|
|
|
|
|
target->CastSpell(target,SPELL_PARACHUTE_IC,true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_icAuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript *GetAuraScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_gen_parachute_icAuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-07-24 22:41:42 +02:00
|
|
|
void AddSC_generic_spell_scripts()
|
|
|
|
|
{
|
2010-12-30 02:03:46 +01:00
|
|
|
new spell_gen_absorb0_hitlimit1();
|
2010-09-21 23:59:45 +06:00
|
|
|
new spell_gen_aura_of_anger();
|
|
|
|
|
new spell_gen_burn_brutallus();
|
|
|
|
|
new spell_gen_leeching_swarm();
|
|
|
|
|
new spell_gen_parachute();
|
2010-08-29 22:40:23 +06:00
|
|
|
new spell_gen_pet_summoned();
|
|
|
|
|
new spell_gen_remove_flight_auras();
|
2010-09-18 22:50:43 +06:00
|
|
|
new spell_gen_trick();
|
2010-09-17 14:24:25 +06:00
|
|
|
new spell_gen_trick_or_treat();
|
2010-09-08 14:57:44 +03:00
|
|
|
new spell_creature_permanent_feign_death();
|
2010-09-08 16:00:10 +03:00
|
|
|
new spell_pvp_trinket_wotf_shared_cd();
|
2010-11-10 11:37:41 +01:00
|
|
|
new spell_gen_animal_blood();
|
2010-11-13 17:18:09 +01:00
|
|
|
new spell_gen_shroud_of_death();
|
2010-12-31 18:31:16 -02:00
|
|
|
new spell_gen_divine_storm_cd_reset();
|
2011-01-09 00:00:08 -03:00
|
|
|
new spell_gen_parachute_ic();
|
|
|
|
|
new spell_gen_gunship_portal();
|
2010-08-06 19:46:02 +02:00
|
|
|
}
|