refactor(Scripts/Events): convert brewfest to new system (#9612)

This commit is contained in:
Kitzunu
2021-12-13 11:04:56 +01:00
committed by GitHub
parent 92d7c276c1
commit 4226976b3e
+113 -434
View File
@@ -54,14 +54,9 @@ enum kegThrowers
KEG_KILL_CREDIT = 24337, KEG_KILL_CREDIT = 24337,
}; };
class npc_brewfest_keg_thrower : public CreatureScript struct npc_brewfest_keg_thrower : public ScriptedAI
{ {
public: npc_brewfest_keg_thrower(Creature* creature) : ScriptedAI(creature)
npc_brewfest_keg_thrower() : CreatureScript("npc_brewfest_keg_thrower") { }
struct npc_brewfest_keg_throwerAI : public ScriptedAI
{
npc_brewfest_keg_throwerAI(Creature* creature) : ScriptedAI(creature)
{ {
} }
@@ -81,24 +76,11 @@ public:
return false; return false;
} }
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_brewfest_keg_throwerAI(creature);
}
}; };
class npc_brewfest_keg_reciver : public CreatureScript struct npc_brewfest_keg_reciver : public ScriptedAI
{ {
public: npc_brewfest_keg_reciver(Creature* creature) : ScriptedAI(creature) { }
npc_brewfest_keg_reciver() : CreatureScript("npc_brewfest_keg_reciver") { }
struct npc_brewfest_keg_reciverAI : public ScriptedAI
{
npc_brewfest_keg_reciverAI(Creature* creature) : ScriptedAI(creature)
{
}
void MoveInLineOfSight(Unit* who) override void MoveInLineOfSight(Unit* who) override
{ {
@@ -128,14 +110,8 @@ public:
} }
} }
} }
};
CreatureAI* GetAI(Creature* creature) const override bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction)
{
return new npc_brewfest_keg_reciverAI(creature);
}
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) override
{ {
switch (uiAction) switch (uiAction)
{ {
@@ -149,7 +125,7 @@ public:
return true; return true;
} }
bool OnGossipHello(Player* player, Creature* creature) override bool OnGossipHello(Player* player, Creature* creature)
{ {
if (creature->IsQuestGiver()) if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID()); player->PrepareQuestMenu(creature->GetGUID());
@@ -170,16 +146,9 @@ enum barkTrigger
QUEST_BARK_FOR_THUNDERBREW = 11294, QUEST_BARK_FOR_THUNDERBREW = 11294,
}; };
class npc_brewfest_bark_trigger : public CreatureScript struct npc_brewfest_bark_trigger : public ScriptedAI
{ {
public: npc_brewfest_bark_trigger(Creature* creature) : ScriptedAI(creature) { }
npc_brewfest_bark_trigger() : CreatureScript("npc_brewfest_bark_trigger") { }
struct npc_brewfest_bark_triggerAI : public ScriptedAI
{
npc_brewfest_bark_triggerAI(Creature* creature) : ScriptedAI(creature)
{
}
void MoveInLineOfSight(Unit* who) override void MoveInLineOfSight(Unit* who) override
{ {
@@ -281,12 +250,6 @@ public:
return str; return str;
} }
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_brewfest_bark_triggerAI(creature);
}
}; };
enum darkIronAttack enum darkIronAttack
@@ -337,16 +300,9 @@ enum darkIronAttack
SPELL_MUG_BOUNCE_BACK = 42522, SPELL_MUG_BOUNCE_BACK = 42522,
}; };
class npc_dark_iron_attack_generator : public CreatureScript struct npc_dark_iron_attack_generator : public ScriptedAI
{ {
public: npc_dark_iron_attack_generator(Creature* creature) : ScriptedAI(creature), summons(me) { }
npc_dark_iron_attack_generator() : CreatureScript("npc_dark_iron_attack_generator") { }
struct npc_dark_iron_attack_generatorAI : public ScriptedAI
{
npc_dark_iron_attack_generatorAI(Creature* creature) : ScriptedAI(creature), summons(me)
{
}
EventMap events; EventMap events;
SummonList summons; SummonList summons;
@@ -604,24 +560,11 @@ public:
return me->FindNearestCreature(entry, 100.0f); return me->FindNearestCreature(entry, 100.0f);
} }
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_dark_iron_attack_generatorAI(creature);
}
}; };
class npc_dark_iron_attack_mole_machine : public CreatureScript struct npc_dark_iron_attack_mole_machine : public ScriptedAI
{ {
public: npc_dark_iron_attack_mole_machine(Creature* creature) : ScriptedAI(creature) { }
npc_dark_iron_attack_mole_machine() : CreatureScript("npc_dark_iron_attack_mole_machine") { }
struct npc_dark_iron_attack_mole_machineAI : public ScriptedAI
{
npc_dark_iron_attack_mole_machineAI(Creature* creature) : ScriptedAI(creature)
{
}
void EnterCombat(Unit*) override {} void EnterCombat(Unit*) override {}
void MoveInLineOfSight(Unit*) override {} void MoveInLineOfSight(Unit*) override {}
@@ -667,22 +610,11 @@ public:
} }
} }
} }
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_dark_iron_attack_mole_machineAI(creature);
}
}; };
class npc_dark_iron_guzzler : public CreatureScript struct npc_dark_iron_guzzler : public ScriptedAI
{ {
public: npc_dark_iron_guzzler(Creature* creature) : ScriptedAI(creature)
npc_dark_iron_guzzler() : CreatureScript("npc_dark_iron_guzzler") { }
struct npc_dark_iron_guzzlerAI : public ScriptedAI
{
npc_dark_iron_guzzlerAI(Creature* creature) : ScriptedAI(creature)
{ {
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
attacking = false; attacking = false;
@@ -835,24 +767,11 @@ public:
} }
} }
} }
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_dark_iron_guzzlerAI(creature);
}
}; };
class npc_brewfest_super_brew_trigger : public CreatureScript struct npc_brewfest_super_brew_trigger : public ScriptedAI
{ {
public: npc_brewfest_super_brew_trigger(Creature* creature) : ScriptedAI(creature) { }
npc_brewfest_super_brew_trigger() : CreatureScript("npc_brewfest_super_brew_trigger") { }
struct npc_brewfest_super_brew_triggerAI : public ScriptedAI
{
npc_brewfest_super_brew_triggerAI(Creature* creature) : ScriptedAI(creature)
{
}
uint32 timer; uint32 timer;
void EnterCombat(Unit*) override {} void EnterCombat(Unit*) override {}
@@ -886,12 +805,6 @@ public:
} }
} }
} }
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_brewfest_super_brew_triggerAI(creature);
}
}; };
/////////////////////////////////////// ///////////////////////////////////////
@@ -913,14 +826,9 @@ enum ramRacing
RACING_RAM_MODEL = 22630, RACING_RAM_MODEL = 22630,
}; };
class spell_brewfest_main_ram_buff : public SpellScriptLoader class spell_brewfest_main_ram_buff : public AuraScript
{ {
public: PrepareAuraScript(spell_brewfest_main_ram_buff)
spell_brewfest_main_ram_buff() : SpellScriptLoader("spell_brewfest_main_ram_buff") { }
class spell_brewfest_main_ram_buff_AuraScript : public AuraScript
{
PrepareAuraScript(spell_brewfest_main_ram_buff_AuraScript)
uint8 privateLevel; uint8 privateLevel;
uint32 questTick; uint32 questTick;
@@ -1048,25 +956,14 @@ public:
void Register() override void Register() override
{ {
OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_main_ram_buff_AuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_main_ram_buff::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_main_ram_buff_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_main_ram_buff::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_brewfest_main_ram_buff_AuraScript();
} }
}; };
class spell_brewfest_ram_fatigue : public SpellScriptLoader class spell_brewfest_ram_fatigue : public AuraScript
{ {
public: PrepareAuraScript(spell_brewfest_ram_fatigue)
spell_brewfest_ram_fatigue() : SpellScriptLoader("spell_brewfest_ram_fatigue") { }
class spell_brewfest_ram_fatigue_AuraScript : public AuraScript
{
PrepareAuraScript(spell_brewfest_ram_fatigue_AuraScript)
void HandleEffectPeriodic(AuraEffect const* aurEff) void HandleEffectPeriodic(AuraEffect const* aurEff)
{ {
@@ -1108,26 +1005,15 @@ public:
void Register() override void Register() override
{ {
if (m_scriptSpellId != 43332) if (m_scriptSpellId != 43332)
OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_ram_fatigue_AuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_ram_fatigue::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
else else
OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_ram_fatigue_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_ram_fatigue::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_brewfest_ram_fatigue_AuraScript();
} }
}; };
class spell_brewfest_apple_trap : public SpellScriptLoader class spell_brewfest_apple_trap : public SpellScript
{ {
public: PrepareSpellScript(spell_brewfest_apple_trap);
spell_brewfest_apple_trap() : SpellScriptLoader("spell_brewfest_apple_trap") { }
class spell_brewfest_apple_trap_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_apple_trap_SpellScript);
void HandleDummyEffect(SpellEffIndex /*effIndex*/) void HandleDummyEffect(SpellEffIndex /*effIndex*/)
{ {
@@ -1138,24 +1024,13 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_brewfest_apple_trap_SpellScript::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY); OnEffectHitTarget += SpellEffectFn(spell_brewfest_apple_trap::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_brewfest_apple_trap_SpellScript();
};
}; };
class spell_q11117_catch_the_wild_wolpertinger : public SpellScriptLoader class spell_q11117_catch_the_wild_wolpertinger : public SpellScript
{ {
public: PrepareSpellScript(spell_q11117_catch_the_wild_wolpertinger);
spell_q11117_catch_the_wild_wolpertinger() : SpellScriptLoader("spell_q11117_catch_the_wild_wolpertinger") { }
class spell_q11117_catch_the_wild_wolpertinger_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q11117_catch_the_wild_wolpertinger_SpellScript);
SpellCastResult CheckTarget() SpellCastResult CheckTarget()
{ {
@@ -1180,15 +1055,9 @@ public:
void Register() override void Register() override
{ {
OnCheckCast += SpellCheckCastFn(spell_q11117_catch_the_wild_wolpertinger_SpellScript::CheckTarget); OnCheckCast += SpellCheckCastFn(spell_q11117_catch_the_wild_wolpertinger::CheckTarget);
OnEffectHitTarget += SpellEffectFn(spell_q11117_catch_the_wild_wolpertinger_SpellScript::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY); OnEffectHitTarget += SpellEffectFn(spell_q11117_catch_the_wild_wolpertinger::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_q11117_catch_the_wild_wolpertinger_SpellScript();
};
}; };
enum fillKeg enum fillKeg
@@ -1198,14 +1067,9 @@ enum fillKeg
YELLOW_EMPTY_KEG = 32912, YELLOW_EMPTY_KEG = 32912,
}; };
class spell_brewfest_fill_keg : public SpellScriptLoader class spell_brewfest_fill_keg : public SpellScript
{ {
public: PrepareSpellScript(spell_brewfest_fill_keg);
spell_brewfest_fill_keg() : SpellScriptLoader("spell_brewfest_fill_keg") { }
class spell_brewfest_fill_keg_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_fill_keg_SpellScript);
void HandleAfterHit() void HandleAfterHit()
{ {
@@ -1241,24 +1105,13 @@ public:
void Register() override void Register() override
{ {
AfterHit += SpellHitFn(spell_brewfest_fill_keg_SpellScript::HandleAfterHit); AfterHit += SpellHitFn(spell_brewfest_fill_keg::HandleAfterHit);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_brewfest_fill_keg_SpellScript();
};
}; };
class spell_brewfest_unfill_keg : public SpellScriptLoader class spell_brewfest_unfill_keg : public SpellScript
{ {
public: PrepareSpellScript(spell_brewfest_unfill_keg);
spell_brewfest_unfill_keg() : SpellScriptLoader("spell_brewfest_unfill_keg") { }
class spell_brewfest_unfill_keg_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_unfill_keg_SpellScript);
uint32 GetEmptyEntry(uint32 baseEntry) uint32 GetEmptyEntry(uint32 baseEntry)
{ {
@@ -1308,24 +1161,13 @@ public:
void Register() override void Register() override
{ {
AfterHit += SpellHitFn(spell_brewfest_unfill_keg_SpellScript::HandleAfterHit); AfterHit += SpellHitFn(spell_brewfest_unfill_keg::HandleAfterHit);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_brewfest_unfill_keg_SpellScript();
};
}; };
class spell_brewfest_toss_mug : public SpellScriptLoader class spell_brewfest_toss_mug : public SpellScript
{ {
public: PrepareSpellScript(spell_brewfest_toss_mug);
spell_brewfest_toss_mug() : SpellScriptLoader("spell_brewfest_toss_mug") { }
class spell_brewfest_toss_mug_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_toss_mug_SpellScript);
SpellCastResult CheckCast() SpellCastResult CheckCast()
{ {
@@ -1434,27 +1276,16 @@ public:
void Register() override void Register() override
{ {
OnCheckCast += SpellCheckCastFn(spell_brewfest_toss_mug_SpellScript::CheckCast); OnCheckCast += SpellCheckCastFn(spell_brewfest_toss_mug::CheckCast);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_brewfest_toss_mug_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_brewfest_toss_mug::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
BeforeHit += BeforeSpellHitFn(spell_brewfest_toss_mug_SpellScript::HandleBeforeHit); BeforeHit += BeforeSpellHitFn(spell_brewfest_toss_mug::HandleBeforeHit);
OnEffectHitTarget += SpellEffectFn(spell_brewfest_toss_mug_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); OnEffectHitTarget += SpellEffectFn(spell_brewfest_toss_mug::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_brewfest_toss_mug_SpellScript();
};
}; };
class spell_brewfest_add_mug : public SpellScriptLoader class spell_brewfest_add_mug : public SpellScript
{ {
public: PrepareSpellScript(spell_brewfest_add_mug);
spell_brewfest_add_mug() : SpellScriptLoader("spell_brewfest_add_mug") { }
class spell_brewfest_add_mug_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_add_mug_SpellScript);
void HandleDummyEffect(SpellEffIndex /*effIndex*/) void HandleDummyEffect(SpellEffIndex /*effIndex*/)
{ {
@@ -1464,32 +1295,18 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_brewfest_add_mug_SpellScript::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY); OnEffectHitTarget += SpellEffectFn(spell_brewfest_add_mug::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_brewfest_add_mug_SpellScript();
};
}; };
//
enum brewBubble enum brewBubble
{ {
SPELL_BUBBLE_BUILD_UP = 49828, SPELL_BUBBLE_BUILD_UP = 49828,
}; };
class npc_brew_bubble : public CreatureScript struct npc_brew_bubble : public NullCreatureAI
{ {
public: npc_brew_bubble(Creature* creature) : NullCreatureAI(creature) { }
npc_brew_bubble() : CreatureScript("npc_brew_bubble") { }
struct npc_brew_bubbleAI : public NullCreatureAI
{
npc_brew_bubbleAI(Creature* creature) : NullCreatureAI(creature)
{
}
uint32 timer; uint32 timer;
@@ -1541,12 +1358,6 @@ public:
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
} }
} }
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_brew_bubbleAI(creature);
}
}; };
enum BrewfestRevelerEnum enum BrewfestRevelerEnum
@@ -1563,14 +1374,9 @@ enum BrewfestRevelerEnum
SPELL_BREWFEST_REVELER_TRANSFORM_UNDEAD = 43917 SPELL_BREWFEST_REVELER_TRANSFORM_UNDEAD = 43917
}; };
class spell_brewfest_reveler_transform : public SpellScriptLoader class spell_brewfest_reveler_transform : public AuraScript
{ {
public: PrepareAuraScript(spell_brewfest_reveler_transform);
spell_brewfest_reveler_transform() : SpellScriptLoader("spell_brewfest_reveler_transform") {}
class spell_brewfest_reveler_transform_AuraScript : public AuraScript
{
PrepareAuraScript(spell_brewfest_reveler_transform_AuraScript);
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{ {
@@ -1597,24 +1403,13 @@ public:
void Register() override void Register() override
{ {
AfterEffectApply += AuraEffectApplyFn(spell_brewfest_reveler_transform_AuraScript::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); AfterEffectApply += AuraEffectApplyFn(spell_brewfest_reveler_transform::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_brewfest_reveler_transform_AuraScript();
} }
}; };
class spell_brewfest_relay_race_force_cast : public SpellScriptLoader class spell_brewfest_relay_race_force_cast : public SpellScript
{ {
public: PrepareSpellScript(spell_brewfest_relay_race_force_cast);
spell_brewfest_relay_race_force_cast() : SpellScriptLoader("spell_brewfest_relay_race_force_cast") {}
class spell_brewfest_relay_race_force_cast_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_relay_race_force_cast_SpellScript);
SpellCastResult CheckItem() SpellCastResult CheckItem()
{ {
@@ -1637,13 +1432,7 @@ public:
void Register() override void Register() override
{ {
OnCheckCast += SpellCheckCastFn(spell_brewfest_relay_race_force_cast_SpellScript::CheckItem); OnCheckCast += SpellCheckCastFn(spell_brewfest_relay_race_force_cast::CheckItem);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_brewfest_relay_race_force_cast_SpellScript();
} }
}; };
@@ -1732,14 +1521,9 @@ Position const AntagonistPos[3] =
{ 896.2667f, -130.483f, -49.66249f, 2.600541f } { 896.2667f, -130.483f, -49.66249f, 2.600541f }
}; };
class npc_coren_direbrew : public CreatureScript struct npc_coren_direbrew : public ScriptedAI
{ {
public: npc_coren_direbrew(Creature* creature) : ScriptedAI(creature), _summons(me) {}
npc_coren_direbrew() : CreatureScript("npc_coren_direbrew") {}
struct npc_coren_direbrewAI : public ScriptedAI
{
npc_coren_direbrewAI(Creature* creature) : ScriptedAI(creature), _summons(me) {}
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
{ {
@@ -1942,25 +1726,14 @@ public:
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
private: private:
EventMap _events; EventMap _events;
SummonList _summons; SummonList _summons;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_coren_direbrewAI(creature);
}
}; };
class npc_coren_direbrew_sisters : public CreatureScript struct npc_coren_direbrew_sisters : public ScriptedAI
{ {
public: npc_coren_direbrew_sisters(Creature* creature) : ScriptedAI(creature) { }
npc_coren_direbrew_sisters() : CreatureScript("npc_coren_direbrew_sisters") {}
struct npc_coren_direbrew_sistersAI : public ScriptedAI
{
npc_coren_direbrew_sistersAI(Creature* creature) : ScriptedAI(creature) {}
void SetGUID(ObjectGuid guid, int32 id) override void SetGUID(ObjectGuid guid, int32 id) override
{ {
@@ -2016,25 +1789,14 @@ public:
}); });
} }
private: private:
ObjectGuid _targetGUID; ObjectGuid _targetGUID;
TaskScheduler _scheduler; TaskScheduler _scheduler;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_coren_direbrew_sistersAI(creature);
}
}; };
class npc_direbrew_minion : public CreatureScript struct npc_direbrew_minion : public ScriptedAI
{ {
public: npc_direbrew_minion(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) {}
npc_direbrew_minion() : CreatureScript("npc_direbrew_minion") {}
struct npc_direbrew_minionAI : public ScriptedAI
{
npc_direbrew_minionAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) {}
void Reset() override void Reset() override
{ {
@@ -2050,24 +1812,13 @@ public:
} }
} }
private: private:
InstanceScript* _instance; InstanceScript* _instance;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_direbrew_minionAI(creature);
}
}; };
class npc_direbrew_antagonist : public CreatureScript struct npc_direbrew_antagonist : public ScriptedAI
{ {
public: npc_direbrew_antagonist(Creature* creature) : ScriptedAI(creature) {}
npc_direbrew_antagonist() : CreatureScript("npc_direbrew_antagonist") {}
struct npc_direbrew_antagonistAI : public ScriptedAI
{
npc_direbrew_antagonistAI(Creature* creature) : ScriptedAI(creature) {}
void DoAction(int32 action) override void DoAction(int32 action) override
{ {
@@ -2094,12 +1845,6 @@ public:
Talk(SAY_ANTAGONIST_COMBAT, who); Talk(SAY_ANTAGONIST_COMBAT, who);
ScriptedAI::EnterCombat(who); ScriptedAI::EnterCombat(who);
} }
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_direbrew_antagonistAI(creature);
}
}; };
class go_direbrew_mole_machine : public GameObjectScript class go_direbrew_mole_machine : public GameObjectScript
@@ -2146,14 +1891,9 @@ public:
}; };
// 47691 - Summon Mole Machine Target Picker // 47691 - Summon Mole Machine Target Picker
class spell_direbrew_summon_mole_machine_target_picker : public SpellScriptLoader class spell_direbrew_summon_mole_machine_target_picker : public SpellScript
{ {
public: PrepareSpellScript(spell_direbrew_summon_mole_machine_target_picker);
spell_direbrew_summon_mole_machine_target_picker() : SpellScriptLoader("spell_direbrew_summon_mole_machine_target_picker") {}
class spell_direbrew_summon_mole_machine_target_picker_SpellScript : public SpellScript
{
PrepareSpellScript(spell_direbrew_summon_mole_machine_target_picker_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -2167,25 +1907,14 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_direbrew_summon_mole_machine_target_picker_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); OnEffectHitTarget += SpellEffectFn(spell_direbrew_summon_mole_machine_target_picker::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_direbrew_summon_mole_machine_target_picker_SpellScript();
};
}; };
// 47370 - Send Mug Target Picker // 47370 - Send Mug Target Picker
class spell_send_mug_target_picker : public SpellScriptLoader class spell_send_mug_target_picker: public SpellScript
{ {
public: PrepareSpellScript(spell_send_mug_target_picker);
spell_send_mug_target_picker() : SpellScriptLoader("spell_send_mug_target_picker") {}
class spell_send_mug_target_picker_SpellScript : public SpellScript
{
PrepareSpellScript(spell_send_mug_target_picker_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets) void FilterTargets(std::list<WorldObject*>& targets)
{ {
@@ -2225,26 +1954,15 @@ public:
void Register() override void Register() override
{ {
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_send_mug_target_picker_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_send_mug_target_picker::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_send_mug_target_picker_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); OnEffectHitTarget += SpellEffectFn(spell_send_mug_target_picker::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_send_mug_target_picker_SpellScript();
};
}; };
// 47344 - Request Second Mug // 47344 - Request Second Mug
class spell_request_second_mug : public SpellScriptLoader class spell_request_second_mug : public SpellScript
{ {
public: PrepareSpellScript(spell_request_second_mug);
spell_request_second_mug() : SpellScriptLoader("spell_request_second_mug") {}
class spell_request_second_mug_SpellScript : public SpellScript
{
PrepareSpellScript(spell_request_second_mug_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -2258,25 +1976,14 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_request_second_mug_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); OnEffectHitTarget += SpellEffectFn(spell_request_second_mug::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
} }
};
SpellScript* GetSpellScript() const override
{
return new spell_request_second_mug_SpellScript();
};
}; };
// 47369 - Send Mug Control Aura // 47369 - Send Mug Control Aura
class spell_send_mug_control_aura : public SpellScriptLoader class spell_send_mug_control_aura : public AuraScript
{ {
public: PrepareAuraScript(spell_send_mug_control_aura);
spell_send_mug_control_aura() : SpellScriptLoader("spell_send_mug_control_aura") {}
class spell_send_mug_control_aura_AuraScript : public AuraScript
{
PrepareAuraScript(spell_send_mug_control_aura_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -2290,25 +1997,14 @@ public:
void Register() override void Register() override
{ {
OnEffectPeriodic += AuraEffectPeriodicFn(spell_send_mug_control_aura_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); OnEffectPeriodic += AuraEffectPeriodicFn(spell_send_mug_control_aura::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
} }
};
AuraScript* GetAuraScript() const override
{
return new spell_send_mug_control_aura_AuraScript();
};
}; };
// 50278 - Barreled Control Aura // 50278 - Barreled Control Aura
class spell_barreled_control_aura : public SpellScriptLoader class spell_barreled_control_aura : public AuraScript
{
public:
spell_barreled_control_aura() : SpellScriptLoader("spell_barreled_control_aura") {}
class spell_barreled_control_aura_AuraScript : public AuraScript
{ {
PrepareAuraScript(spell_barreled_control_aura_AuraScript); PrepareAuraScript(spell_barreled_control_aura);
void PeriodicTick(AuraEffect const* /*aurEff*/) void PeriodicTick(AuraEffect const* /*aurEff*/)
{ {
@@ -2318,25 +2014,14 @@ public:
void Register() override void Register() override
{ {
OnEffectPeriodic += AuraEffectPeriodicFn(spell_barreled_control_aura_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); OnEffectPeriodic += AuraEffectPeriodicFn(spell_barreled_control_aura::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
} }
}; };
AuraScript* GetAuraScript() const override
{
return new spell_barreled_control_aura_AuraScript();
};
};
// 47407 - Direbrew's Disarm (precast) // 47407 - Direbrew's Disarm (precast)
class spell_direbrew_disarm : public SpellScriptLoader class spell_direbrew_disarm : public AuraScript
{ {
public: PrepareAuraScript(spell_direbrew_disarm);
spell_direbrew_disarm() : SpellScriptLoader("spell_direbrew_disarm") {}
class spell_direbrew_disarm_AuraScript : public AuraScript
{
PrepareAuraScript(spell_direbrew_disarm_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -2360,55 +2045,49 @@ public:
void Register() override void Register() override
{ {
OnEffectPeriodic += AuraEffectPeriodicFn(spell_direbrew_disarm_AuraScript::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); OnEffectPeriodic += AuraEffectPeriodicFn(spell_direbrew_disarm::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
OnEffectApply += AuraEffectRemoveFn(spell_direbrew_disarm_AuraScript::OnApply, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); OnEffectApply += AuraEffectRemoveFn(spell_direbrew_disarm::OnApply, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
} }
};
AuraScript* GetAuraScript() const override
{
return new spell_direbrew_disarm_AuraScript();
};
}; };
void AddSC_event_brewfest_scripts() void AddSC_event_brewfest_scripts()
{ {
// Npcs // Npcs
new npc_brewfest_keg_thrower(); RegisterCreatureAI(npc_brewfest_keg_thrower);
new npc_brewfest_keg_reciver(); RegisterCreatureAI(npc_brewfest_keg_reciver);
new npc_brewfest_bark_trigger(); RegisterCreatureAI(npc_brewfest_bark_trigger);
new npc_dark_iron_attack_generator(); RegisterCreatureAI(npc_dark_iron_attack_generator);
new npc_dark_iron_attack_mole_machine(); RegisterCreatureAI(npc_dark_iron_attack_mole_machine);
new npc_dark_iron_guzzler(); RegisterCreatureAI(npc_dark_iron_guzzler);
new npc_brewfest_super_brew_trigger(); RegisterCreatureAI(npc_brewfest_super_brew_trigger);
// Spells // Spells
// ram // ram
new spell_brewfest_main_ram_buff(); RegisterSpellScript(spell_brewfest_main_ram_buff);
new spell_brewfest_ram_fatigue(); RegisterSpellScript(spell_brewfest_ram_fatigue);
new spell_brewfest_apple_trap(); RegisterSpellScript(spell_brewfest_apple_trap);
// other // other
new spell_q11117_catch_the_wild_wolpertinger(); RegisterSpellScript(spell_q11117_catch_the_wild_wolpertinger);
new spell_brewfest_fill_keg(); RegisterSpellScript(spell_brewfest_fill_keg);
new spell_brewfest_unfill_keg(); RegisterSpellScript(spell_brewfest_unfill_keg);
new spell_brewfest_toss_mug(); RegisterSpellScript(spell_brewfest_toss_mug);
new spell_brewfest_add_mug(); RegisterSpellScript(spell_brewfest_add_mug);
new spell_brewfest_reveler_transform(); RegisterSpellScript(spell_brewfest_reveler_transform);
new spell_brewfest_relay_race_force_cast(); RegisterSpellScript(spell_brewfest_relay_race_force_cast);
// beer effect // beer effect
new npc_brew_bubble(); RegisterCreatureAI(npc_brew_bubble);
// Coren Direbrew // Coren Direbrew
new npc_coren_direbrew(); RegisterCreatureAI(npc_coren_direbrew);
new npc_coren_direbrew_sisters(); RegisterCreatureAI(npc_coren_direbrew_sisters);
new npc_direbrew_minion(); RegisterCreatureAI(npc_direbrew_minion);
new npc_direbrew_antagonist(); RegisterCreatureAI(npc_direbrew_antagonist);
new go_direbrew_mole_machine(); new go_direbrew_mole_machine();
new spell_direbrew_summon_mole_machine_target_picker(); RegisterSpellScript(spell_direbrew_summon_mole_machine_target_picker);
new spell_send_mug_target_picker(); RegisterSpellScript(spell_send_mug_target_picker);
new spell_request_second_mug(); RegisterSpellScript(spell_request_second_mug);
new spell_send_mug_control_aura(); RegisterSpellScript(spell_send_mug_control_aura);
new spell_barreled_control_aura(); RegisterSpellScript(spell_barreled_control_aura);
new spell_direbrew_disarm(); RegisterSpellScript(spell_direbrew_disarm);
} }