Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources

This commit is contained in:
ariel- committed 2018-03-28 04:41:59 -03:00
1 parent 7fff6c424f
commit 5ff847159c
1243 files changed
+29780 -36517

No files matched your search

+211 -203
View File
@@ -21,15 +21,16 @@
* Scriptnames in this file should be prefixed with "spell_#holidayname_".
*/
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
#include "CreatureAIImpl.h"
#include "GridNotifiersImpl.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "Vehicle.h"
#include "World.h"
// 45102 Romantic Picnic
enum SpellsPicnic
@@ -135,10 +136,7 @@ class spell_hallow_end_candy : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
for (uint32 spellId : spells)
if (!sSpellMgr->GetSpellInfo(spellId))
return false;
return true;
return ValidateSpellInfo(spells);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
@@ -181,10 +179,11 @@ class spell_hallow_end_candy_pirate : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE)
|| !sSpellMgr->GetSpellInfo(SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE))
return false;
return true;
return ValidateSpellInfo(
{
SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE,
SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE
});
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -238,11 +237,19 @@ class spell_hallow_end_trick : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
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;
return ValidateSpellInfo(
{
SPELL_PIRATE_COSTUME_MALE,
SPELL_PIRATE_COSTUME_FEMALE,
SPELL_NINJA_COSTUME_MALE,
SPELL_NINJA_COSTUME_FEMALE,
SPELL_LEPER_GNOME_COSTUME_MALE,
SPELL_LEPER_GNOME_COSTUME_FEMALE,
SPELL_SKELETON_COSTUME,
SPELL_GHOST_COSTUME_MALE,
SPELL_GHOST_COSTUME_FEMALE,
SPELL_TRICK_BUFF
});
}
void HandleScript(SpellEffIndex /*effIndex*/)
@@ -311,9 +318,7 @@ class spell_hallow_end_trick_or_treat : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_TRICK) || !sSpellMgr->GetSpellInfo(SPELL_TREAT) || !sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED))
return false;
return true;
return ValidateSpellInfo({ SPELL_TRICK, SPELL_TREAT, SPELL_TRICKED_OR_TREATED });
}
void HandleScript(SpellEffIndex /*effIndex*/)
@@ -349,13 +354,12 @@ class spell_hallow_end_tricky_treat : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_TRICKY_TREAT_SPEED))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_TRICKY_TREAT_TRIGGER))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_UPSET_TUMMY))
return false;
return true;
return ValidateSpellInfo(
{
SPELL_TRICKY_TREAT_SPEED,
SPELL_TRICKY_TREAT_TRIGGER,
SPELL_UPSET_TUMMY
});
}
void HandleScript(SpellEffIndex /*effIndex*/)
@@ -402,16 +406,17 @@ public:
bool Validate(SpellInfo const* /*spellEntry*/) override
{
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_GHOST_COSTUME_MALE) ||
!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE))
return false;
return true;
return ValidateSpellInfo(
{
SPELL_PIRATE_COSTUME_MALE,
SPELL_PIRATE_COSTUME_FEMALE,
SPELL_NINJA_COSTUME_MALE,
SPELL_NINJA_COSTUME_FEMALE,
SPELL_LEPER_GNOME_COSTUME_MALE,
SPELL_LEPER_GNOME_COSTUME_FEMALE,
SPELL_GHOST_COSTUME_MALE,
SPELL_GHOST_COSTUME_FEMALE
});
}
void HandleScriptEffect()
@@ -472,7 +477,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
private:
uint32 const _triggeredSpellId;
public:
spell_pilgrims_bounty_buff_food(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
spell_pilgrims_bounty_buff_food(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
class spell_pilgrims_bounty_buff_food_AuraScript : public AuraScript
{
@@ -565,7 +570,7 @@ class spell_pilgrims_bounty_feast_on : public SpellScriptLoader
if (Player* player = target->ToPlayer())
{
player->CastSpell(player, SPELL_ON_PLATE_EAT_VISUAL, true);
caster->CastSpell(player, _spellId, true, NULL, NULL, player->GetGUID());
caster->CastSpell(player, _spellId, true, nullptr, nullptr, player->GetGUID());
}
if (Aura* aura = caster->GetAura(GetEffectValue()))
@@ -609,9 +614,7 @@ class spell_pilgrims_bounty_turkey_tracker : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_KILL_COUNTER_VISUAL) || !sSpellMgr->GetSpellInfo(SPELL_KILL_COUNTER_VISUAL_MAX))
return false;
return true;
return ValidateSpellInfo({ SPELL_KILL_COUNTER_VISUAL, SPELL_KILL_COUNTER_VISUAL_MAX });
}
void HandleScript(SpellEffIndex /*effIndex*/)
@@ -673,59 +676,58 @@ class spell_pilgrims_bounty_well_fed : public SpellScriptLoader
uint32 _triggeredSpellId;
public:
spell_pilgrims_bounty_well_fed(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
spell_pilgrims_bounty_well_fed(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
class spell_pilgrims_bounty_well_fed_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pilgrims_bounty_well_fed_SpellScript);
private:
uint32 _triggeredSpellId;
public:
spell_pilgrims_bounty_well_fed_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
public:
spell_pilgrims_bounty_well_fed_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
private:
PrepareSpellScript(spell_pilgrims_bounty_well_fed_SpellScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
return false;
return true;
}
uint32 _triggeredSpellId;
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
Player* target = GetHitPlayer();
if (!target)
return;
if (Aura const* aura = target->GetAura(GetSpellInfo()->Id))
bool Validate(SpellInfo const* /*spell*/) override
{
if (aura->GetStackAmount() == 5)
target->CastSpell(target, _triggeredSpellId, true);
return ValidateSpellInfo({ _triggeredSpellId });
}
Aura const* turkey = target->GetAura(SPELL_TURKEY_HELPINS);
Aura const* cranberies = target->GetAura(SPELL_CRANBERRY_HELPINS);
Aura const* stuffing = target->GetAura(SPELL_STUFFING_HELPINS);
Aura const* sweetPotatoes = target->GetAura(SPELL_SWEET_POTATO_HELPINS);
Aura const* pie = target->GetAura(SPELL_PIE_HELPINS);
if ((turkey && turkey->GetStackAmount() == 5) && (cranberies && cranberies->GetStackAmount() == 5) && (stuffing && stuffing->GetStackAmount() == 5)
&& (sweetPotatoes && sweetPotatoes->GetStackAmount() == 5) && (pie && pie->GetStackAmount() == 5))
void HandleScript(SpellEffIndex effIndex)
{
target->CastSpell(target, SPELL_THE_SPIRIT_OF_SHARING, true);
target->RemoveAurasDueToSpell(SPELL_TURKEY_HELPINS);
target->RemoveAurasDueToSpell(SPELL_CRANBERRY_HELPINS);
target->RemoveAurasDueToSpell(SPELL_STUFFING_HELPINS);
target->RemoveAurasDueToSpell(SPELL_SWEET_POTATO_HELPINS);
target->RemoveAurasDueToSpell(SPELL_PIE_HELPINS);
}
}
PreventHitDefaultEffect(effIndex);
Player* target = GetHitPlayer();
if (!target)
return;
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_well_fed_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
if (Aura const* aura = target->GetAura(GetSpellInfo()->Id))
{
if (aura->GetStackAmount() == 5)
target->CastSpell(target, _triggeredSpellId, true);
}
Aura const* turkey = target->GetAura(SPELL_TURKEY_HELPINS);
Aura const* cranberies = target->GetAura(SPELL_CRANBERRY_HELPINS);
Aura const* stuffing = target->GetAura(SPELL_STUFFING_HELPINS);
Aura const* sweetPotatoes = target->GetAura(SPELL_SWEET_POTATO_HELPINS);
Aura const* pie = target->GetAura(SPELL_PIE_HELPINS);
if ((turkey && turkey->GetStackAmount() == 5) && (cranberies && cranberies->GetStackAmount() == 5) && (stuffing && stuffing->GetStackAmount() == 5)
&& (sweetPotatoes && sweetPotatoes->GetStackAmount() == 5) && (pie && pie->GetStackAmount() == 5))
{
target->CastSpell(target, SPELL_THE_SPIRIT_OF_SHARING, true);
target->RemoveAurasDueToSpell(SPELL_TURKEY_HELPINS);
target->RemoveAurasDueToSpell(SPELL_CRANBERRY_HELPINS);
target->RemoveAurasDueToSpell(SPELL_STUFFING_HELPINS);
target->RemoveAurasDueToSpell(SPELL_SWEET_POTATO_HELPINS);
target->RemoveAurasDueToSpell(SPELL_PIE_HELPINS);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_well_fed_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
@@ -780,107 +782,113 @@ class spell_pilgrims_bounty_on_plate : public SpellScriptLoader
uint32 _triggeredSpellId4;
public:
spell_pilgrims_bounty_on_plate(const char* name, uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScriptLoader(name),
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4) { }
spell_pilgrims_bounty_on_plate(char const* name, uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScriptLoader(name),
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4)
{
}
class spell_pilgrims_bounty_on_plate_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pilgrims_bounty_on_plate_SpellScript);
private:
uint32 _triggeredSpellId1;
uint32 _triggeredSpellId2;
uint32 _triggeredSpellId3;
uint32 _triggeredSpellId4;
public:
spell_pilgrims_bounty_on_plate_SpellScript(uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScript(),
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4) { }
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(_triggeredSpellId1)
|| !sSpellMgr->GetSpellInfo(_triggeredSpellId2)
|| !sSpellMgr->GetSpellInfo(_triggeredSpellId3)
|| !sSpellMgr->GetSpellInfo(_triggeredSpellId4))
return false;
return true;
}
Vehicle* GetTable(Unit* target)
{
if (target->GetTypeId() == TYPEID_PLAYER)
public:
spell_pilgrims_bounty_on_plate_SpellScript(uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScript(),
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4)
{
if (Unit* vehBase = target->GetVehicleBase())
if (Vehicle* table = vehBase->GetVehicle())
if (table->GetCreatureEntry() == NPC_BOUNTIFUL_TABLE)
return table;
}
else if (Vehicle* veh = target->GetVehicle())
if (veh->GetCreatureEntry() == NPC_BOUNTIFUL_TABLE)
return veh;
return nullptr;
}
private:
uint32 _triggeredSpellId1;
uint32 _triggeredSpellId2;
uint32 _triggeredSpellId3;
uint32 _triggeredSpellId4;
Unit* GetPlateInSeat(Vehicle* table, uint8 seat)
{
if (Unit* holderUnit = table->GetPassenger(SEAT_PLATE_HOLDER))
if (Vehicle* holder = holderUnit->GetVehicleKit())
if (Unit* plate = holder->GetPassenger(seat))
return plate;
PrepareSpellScript(spell_pilgrims_bounty_on_plate_SpellScript);
return nullptr;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();
if (!target || caster == target)
return;
Vehicle* table = GetTable(caster);
if (!table || table != GetTable(target))
return;
if (Vehicle* casterChair = caster->GetVehicleKit())
if (Unit* casterPlr = casterChair->GetPassenger(SEAT_PLAYER))
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo(
{
if (casterPlr == target)
return;
_triggeredSpellId1,
_triggeredSpellId2,
_triggeredSpellId3,
_triggeredSpellId4
});
}
casterPlr->CastSpell(casterPlr, _triggeredSpellId2, true); //Credit for Sharing is Caring(always)
Vehicle* GetTable(Unit* target)
{
if (target->GetTypeId() == TYPEID_PLAYER)
{
if (Unit* vehBase = target->GetVehicleBase())
if (Vehicle* table = vehBase->GetVehicle())
if (table->GetCreatureEntry() == NPC_BOUNTIFUL_TABLE)
return table;
}
else if (Vehicle* veh = target->GetVehicle())
if (veh->GetCreatureEntry() == NPC_BOUNTIFUL_TABLE)
return veh;
uint8 seat = target->GetTransSeat();
if (target->GetTypeId() == TYPEID_PLAYER && target->GetVehicleBase())
seat = target->GetVehicleBase()->GetTransSeat();
return nullptr;
}
if (Unit* plate = GetPlateInSeat(table, seat))
Unit* GetPlateInSeat(Vehicle* table, uint8 seat)
{
if (Unit* holderUnit = table->GetPassenger(SEAT_PLATE_HOLDER))
if (Vehicle* holder = holderUnit->GetVehicleKit())
if (Unit* plate = holder->GetPassenger(seat))
return plate;
return nullptr;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();
if (!target || caster == target)
return;
Vehicle* table = GetTable(caster);
if (!table || table != GetTable(target))
return;
if (Vehicle* casterChair = caster->GetVehicleKit())
if (Unit* casterPlr = casterChair->GetPassenger(SEAT_PLAYER))
{
if (target->GetTypeId() == TYPEID_PLAYER) //Food Fight case
if (casterPlr == target)
return;
casterPlr->CastSpell(casterPlr, _triggeredSpellId2, true); //Credit for Sharing is Caring(always)
uint8 seat = target->GetTransSeat();
if (target->GetTypeId() == TYPEID_PLAYER && target->GetVehicleBase())
seat = target->GetVehicleBase()->GetTransSeat();
if (Unit* plate = GetPlateInSeat(table, seat))
{
casterPlr->CastSpell(target, _triggeredSpellId1, true);
caster->CastSpell(target->GetVehicleBase(), _triggeredSpellId4, true); //CanEat-chair(always)
}
else
{
casterPlr->CastSpell(plate, _triggeredSpellId3, true); //Food Visual on plate
caster->CastSpell(target, _triggeredSpellId4, true); //CanEat-chair(always)
if (target->GetTypeId() == TYPEID_PLAYER) //Food Fight case
{
casterPlr->CastSpell(target, _triggeredSpellId1, true);
caster->CastSpell(target->GetVehicleBase(), _triggeredSpellId4, true); //CanEat-chair(always)
}
else
{
casterPlr->CastSpell(plate, _triggeredSpellId3, true); //Food Visual on plate
caster->CastSpell(target, _triggeredSpellId4, true); //CanEat-chair(always)
}
}
}
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_on_plate_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_on_plate_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_pilgrims_bounty_on_plate_SpellScript(_triggeredSpellId1, _triggeredSpellId2, _triggeredSpellId3, _triggeredSpellId4);
}
SpellScript* GetSpellScript() const override
{
return new spell_pilgrims_bounty_on_plate_SpellScript(_triggeredSpellId1, _triggeredSpellId2, _triggeredSpellId3, _triggeredSpellId4);
}
};
/* 61804 - A Serving of Cranberries
@@ -898,7 +906,7 @@ class spell_pilgrims_bounty_a_serving_of : public SpellScriptLoader
private:
uint32 _triggeredSpellId;
public:
spell_pilgrims_bounty_a_serving_of(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
spell_pilgrims_bounty_a_serving_of(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
class spell_pilgrims_bounty_a_serving_of_AuraScript : public AuraScript
{
@@ -912,9 +920,7 @@ class spell_pilgrims_bounty_a_serving_of : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
return false;
return true;
return ValidateSpellInfo({ _triggeredSpellId });
}
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
@@ -976,11 +982,12 @@ class spell_winter_veil_mistletoe : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_MISTLETOE) ||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_HOLLY) ||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_SNOWFLAKES))
return false;
return true;
return ValidateSpellInfo(
{
SPELL_CREATE_MISTLETOE,
SPELL_CREATE_HOLLY,
SPELL_CREATE_SNOWFLAKES
});
}
void HandleScript(SpellEffIndex /*effIndex*/)
@@ -1013,6 +1020,14 @@ enum PX238WinterWondervolt
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4 = 26274
};
uint32 const WonderboltTransformSpells[] =
{
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1,
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2,
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3,
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4
};
class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader
{
public:
@@ -1024,33 +1039,20 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1) ||
!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2) ||
!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3) ||
!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4))
return false;
return true;
return ValidateSpellInfo(WonderboltTransformSpells);
}
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
uint32 const spells[4] =
{
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1,
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2,
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3,
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4
};
if (Unit* target = GetHitUnit())
{
for (uint8 i = 0; i < 4; ++i)
if (target->HasAura(spells[i]))
for (uint32 spell : WonderboltTransformSpells)
if (target->HasAura(spell))
return;
target->CastSpell(target, spells[urand(0, 3)], true);
target->CastSpell(target, Trinity::Containers::SelectRandomContainerElement(WonderboltTransformSpells), true);
}
}
@@ -1321,7 +1323,7 @@ class spell_brewfest_relay_race_intro_force_player_to_throw : public SpellScript
PreventHitDefaultEffect(effIndex);
// All this spells trigger a spell that requires reagents; if the
// triggered spell is cast as "triggered", reagents are not consumed
GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
GetHitUnit()->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[effIndex].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
}
void Register() override
@@ -1507,9 +1509,13 @@ class spell_midsummer_braziers_hit : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_TORCH_TOSSING_TRAINING) || !sSpellMgr->GetSpellInfo(SPELL_TORCH_TOSSING_PRACTICE))
return false;
return true;
return ValidateSpellInfo(
{
SPELL_TORCH_TOSSING_TRAINING,
SPELL_TORCH_TOSSING_PRACTICE,
SPELL_TORCH_TOSSING_TRAINING_SUCCESS_ALLIANCE,
SPELL_TORCH_TOSSING_TRAINING_SUCCESS_HORDE
});
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -1560,11 +1566,13 @@ class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_HAS_FULL_MIDSUMMER_SET)
|| !sSpellMgr->GetSpellInfo(SPELL_RIBBON_DANCE)
|| !sSpellMgr->GetSpellInfo(SPELL_BURNING_HOT_POLE_DANCE))
return false;
return true;
return ValidateSpellInfo(
{
SPELL_RIBBON_DANCE_COSMETIC,
SPELL_BURNING_HOT_POLE_DANCE,
SPELL_HAS_FULL_MIDSUMMER_SET,
SPELL_RIBBON_DANCE
});
}
void PeriodicTick(AuraEffect const* /*aurEff*/)