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,
};
class npc_brewfest_keg_thrower : public CreatureScript
struct npc_brewfest_keg_thrower : public ScriptedAI
{
public:
npc_brewfest_keg_thrower() : CreatureScript("npc_brewfest_keg_thrower") { }
struct npc_brewfest_keg_throwerAI : public ScriptedAI
{
npc_brewfest_keg_throwerAI(Creature* creature) : ScriptedAI(creature)
npc_brewfest_keg_thrower(Creature* creature) : ScriptedAI(creature)
{
}
@@ -81,24 +76,11 @@ public:
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() : CreatureScript("npc_brewfest_keg_reciver") { }
struct npc_brewfest_keg_reciverAI : public ScriptedAI
{
npc_brewfest_keg_reciverAI(Creature* creature) : ScriptedAI(creature)
{
}
npc_brewfest_keg_reciver(Creature* creature) : ScriptedAI(creature) { }
void MoveInLineOfSight(Unit* who) override
{
@@ -128,14 +110,8 @@ public:
}
}
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_brewfest_keg_reciverAI(creature);
}
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) override
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction)
{
switch (uiAction)
{
@@ -149,7 +125,7 @@ public:
return true;
}
bool OnGossipHello(Player* player, Creature* creature) override
bool OnGossipHello(Player* player, Creature* creature)
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
@@ -170,16 +146,9 @@ enum barkTrigger
QUEST_BARK_FOR_THUNDERBREW = 11294,
};
class npc_brewfest_bark_trigger : public CreatureScript
struct npc_brewfest_bark_trigger : public ScriptedAI
{
public:
npc_brewfest_bark_trigger() : CreatureScript("npc_brewfest_bark_trigger") { }
struct npc_brewfest_bark_triggerAI : public ScriptedAI
{
npc_brewfest_bark_triggerAI(Creature* creature) : ScriptedAI(creature)
{
}
npc_brewfest_bark_trigger(Creature* creature) : ScriptedAI(creature) { }
void MoveInLineOfSight(Unit* who) override
{
@@ -281,12 +250,6 @@ public:
return str;
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_brewfest_bark_triggerAI(creature);
}
};
enum darkIronAttack
@@ -337,16 +300,9 @@ enum darkIronAttack
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() : 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)
{
}
npc_dark_iron_attack_generator(Creature* creature) : ScriptedAI(creature), summons(me) { }
EventMap events;
SummonList summons;
@@ -604,24 +560,11 @@ public:
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() : 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)
{
}
npc_dark_iron_attack_mole_machine(Creature* creature) : ScriptedAI(creature) { }
void EnterCombat(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() : CreatureScript("npc_dark_iron_guzzler") { }
struct npc_dark_iron_guzzlerAI : public ScriptedAI
{
npc_dark_iron_guzzlerAI(Creature* creature) : ScriptedAI(creature)
npc_dark_iron_guzzler(Creature* creature) : ScriptedAI(creature)
{
me->SetReactState(REACT_PASSIVE);
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() : CreatureScript("npc_brewfest_super_brew_trigger") { }
struct npc_brewfest_super_brew_triggerAI : public ScriptedAI
{
npc_brewfest_super_brew_triggerAI(Creature* creature) : ScriptedAI(creature)
{
}
npc_brewfest_super_brew_trigger(Creature* creature) : ScriptedAI(creature) { }
uint32 timer;
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,
};
class spell_brewfest_main_ram_buff : public SpellScriptLoader
class spell_brewfest_main_ram_buff : public AuraScript
{
public:
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)
PrepareAuraScript(spell_brewfest_main_ram_buff)
uint8 privateLevel;
uint32 questTick;
@@ -1048,25 +956,14 @@ public:
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_main_ram_buff_AuraScript::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);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_brewfest_main_ram_buff_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_main_ram_buff::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_main_ram_buff::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_brewfest_ram_fatigue : public SpellScriptLoader
class spell_brewfest_ram_fatigue : public AuraScript
{
public:
spell_brewfest_ram_fatigue() : SpellScriptLoader("spell_brewfest_ram_fatigue") { }
class spell_brewfest_ram_fatigue_AuraScript : public AuraScript
{
PrepareAuraScript(spell_brewfest_ram_fatigue_AuraScript)
PrepareAuraScript(spell_brewfest_ram_fatigue)
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
@@ -1108,26 +1005,15 @@ public:
void Register() override
{
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
OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_ram_fatigue_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_brewfest_ram_fatigue_AuraScript();
OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_ram_fatigue::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_brewfest_apple_trap : public SpellScriptLoader
class spell_brewfest_apple_trap : public SpellScript
{
public:
spell_brewfest_apple_trap() : SpellScriptLoader("spell_brewfest_apple_trap") { }
class spell_brewfest_apple_trap_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_apple_trap_SpellScript);
PrepareSpellScript(spell_brewfest_apple_trap);
void HandleDummyEffect(SpellEffIndex /*effIndex*/)
{
@@ -1138,24 +1024,13 @@ public:
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:
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);
PrepareSpellScript(spell_q11117_catch_the_wild_wolpertinger);
SpellCastResult CheckTarget()
{
@@ -1180,15 +1055,9 @@ public:
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_q11117_catch_the_wild_wolpertinger_SpellScript::CheckTarget);
OnEffectHitTarget += SpellEffectFn(spell_q11117_catch_the_wild_wolpertinger_SpellScript::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
OnCheckCast += SpellCheckCastFn(spell_q11117_catch_the_wild_wolpertinger::CheckTarget);
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
@@ -1198,14 +1067,9 @@ enum fillKeg
YELLOW_EMPTY_KEG = 32912,
};
class spell_brewfest_fill_keg : public SpellScriptLoader
class spell_brewfest_fill_keg : public SpellScript
{
public:
spell_brewfest_fill_keg() : SpellScriptLoader("spell_brewfest_fill_keg") { }
class spell_brewfest_fill_keg_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_fill_keg_SpellScript);
PrepareSpellScript(spell_brewfest_fill_keg);
void HandleAfterHit()
{
@@ -1241,24 +1105,13 @@ public:
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:
spell_brewfest_unfill_keg() : SpellScriptLoader("spell_brewfest_unfill_keg") { }
class spell_brewfest_unfill_keg_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_unfill_keg_SpellScript);
PrepareSpellScript(spell_brewfest_unfill_keg);
uint32 GetEmptyEntry(uint32 baseEntry)
{
@@ -1308,24 +1161,13 @@ public:
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:
spell_brewfest_toss_mug() : SpellScriptLoader("spell_brewfest_toss_mug") { }
class spell_brewfest_toss_mug_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_toss_mug_SpellScript);
PrepareSpellScript(spell_brewfest_toss_mug);
SpellCastResult CheckCast()
{
@@ -1434,27 +1276,16 @@ public:
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_brewfest_toss_mug_SpellScript::CheckCast);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_brewfest_toss_mug_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
BeforeHit += BeforeSpellHitFn(spell_brewfest_toss_mug_SpellScript::HandleBeforeHit);
OnEffectHitTarget += SpellEffectFn(spell_brewfest_toss_mug_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
OnCheckCast += SpellCheckCastFn(spell_brewfest_toss_mug::CheckCast);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_brewfest_toss_mug::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
BeforeHit += BeforeSpellHitFn(spell_brewfest_toss_mug::HandleBeforeHit);
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:
spell_brewfest_add_mug() : SpellScriptLoader("spell_brewfest_add_mug") { }
class spell_brewfest_add_mug_SpellScript : public SpellScript
{
PrepareSpellScript(spell_brewfest_add_mug_SpellScript);
PrepareSpellScript(spell_brewfest_add_mug);
void HandleDummyEffect(SpellEffIndex /*effIndex*/)
{
@@ -1464,32 +1295,18 @@ public:
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
{
SPELL_BUBBLE_BUILD_UP = 49828,
};
class npc_brew_bubble : public CreatureScript
struct npc_brew_bubble : public NullCreatureAI
{
public:
npc_brew_bubble() : CreatureScript("npc_brew_bubble") { }
struct npc_brew_bubbleAI : public NullCreatureAI
{
npc_brew_bubbleAI(Creature* creature) : NullCreatureAI(creature)
{
}
npc_brew_bubble(Creature* creature) : NullCreatureAI(creature) { }
uint32 timer;
@@ -1541,12 +1358,6 @@ public:
me->DespawnOrUnsummon();
}
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_brew_bubbleAI(creature);
}
};
enum BrewfestRevelerEnum
@@ -1563,14 +1374,9 @@ enum BrewfestRevelerEnum
SPELL_BREWFEST_REVELER_TRANSFORM_UNDEAD = 43917
};
class spell_brewfest_reveler_transform : public SpellScriptLoader
class spell_brewfest_reveler_transform : public AuraScript
{
public:
spell_brewfest_reveler_transform() : SpellScriptLoader("spell_brewfest_reveler_transform") {}
class spell_brewfest_reveler_transform_AuraScript : public AuraScript
{
PrepareAuraScript(spell_brewfest_reveler_transform_AuraScript);
PrepareAuraScript(spell_brewfest_reveler_transform);
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
@@ -1597,24 +1403,13 @@ public:
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_brewfest_reveler_transform_AuraScript::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_brewfest_reveler_transform_AuraScript();
AfterEffectApply += AuraEffectApplyFn(spell_brewfest_reveler_transform::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_brewfest_relay_race_force_cast : public SpellScriptLoader
class spell_brewfest_relay_race_force_cast : public SpellScript
{
public:
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);
PrepareSpellScript(spell_brewfest_relay_race_force_cast);
SpellCastResult CheckItem()
{
@@ -1637,13 +1432,7 @@ public:
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_brewfest_relay_race_force_cast_SpellScript::CheckItem);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_brewfest_relay_race_force_cast_SpellScript();
OnCheckCast += SpellCheckCastFn(spell_brewfest_relay_race_force_cast::CheckItem);
}
};
@@ -1732,14 +1521,9 @@ Position const AntagonistPos[3] =
{ 896.2667f, -130.483f, -49.66249f, 2.600541f }
};
class npc_coren_direbrew : public CreatureScript
struct npc_coren_direbrew : public ScriptedAI
{
public:
npc_coren_direbrew() : CreatureScript("npc_coren_direbrew") {}
struct npc_coren_direbrewAI : public ScriptedAI
{
npc_coren_direbrewAI(Creature* creature) : ScriptedAI(creature), _summons(me) {}
npc_coren_direbrew(Creature* creature) : ScriptedAI(creature), _summons(me) {}
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
{
@@ -1942,25 +1726,14 @@ public:
DoMeleeAttackIfReady();
}
private:
private:
EventMap _events;
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() : CreatureScript("npc_coren_direbrew_sisters") {}
struct npc_coren_direbrew_sistersAI : public ScriptedAI
{
npc_coren_direbrew_sistersAI(Creature* creature) : ScriptedAI(creature) {}
npc_coren_direbrew_sisters(Creature* creature) : ScriptedAI(creature) { }
void SetGUID(ObjectGuid guid, int32 id) override
{
@@ -2016,25 +1789,14 @@ public:
});
}
private:
private:
ObjectGuid _targetGUID;
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() : CreatureScript("npc_direbrew_minion") {}
struct npc_direbrew_minionAI : public ScriptedAI
{
npc_direbrew_minionAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) {}
npc_direbrew_minion(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) {}
void Reset() override
{
@@ -2050,24 +1812,13 @@ public:
}
}
private:
private:
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() : CreatureScript("npc_direbrew_antagonist") {}
struct npc_direbrew_antagonistAI : public ScriptedAI
{
npc_direbrew_antagonistAI(Creature* creature) : ScriptedAI(creature) {}
npc_direbrew_antagonist(Creature* creature) : ScriptedAI(creature) {}
void DoAction(int32 action) override
{
@@ -2094,12 +1845,6 @@ public:
Talk(SAY_ANTAGONIST_COMBAT, who);
ScriptedAI::EnterCombat(who);
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_direbrew_antagonistAI(creature);
}
};
class go_direbrew_mole_machine : public GameObjectScript
@@ -2146,14 +1891,9 @@ public:
};
// 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:
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);
PrepareSpellScript(spell_direbrew_summon_mole_machine_target_picker);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -2167,25 +1907,14 @@ public:
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
class spell_send_mug_target_picker : public SpellScriptLoader
class spell_send_mug_target_picker: public SpellScript
{
public:
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);
PrepareSpellScript(spell_send_mug_target_picker);
void FilterTargets(std::list<WorldObject*>& targets)
{
@@ -2225,26 +1954,15 @@ public:
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_send_mug_target_picker_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_send_mug_target_picker_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_send_mug_target_picker::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
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
class spell_request_second_mug : public SpellScriptLoader
class spell_request_second_mug : public SpellScript
{
public:
spell_request_second_mug() : SpellScriptLoader("spell_request_second_mug") {}
class spell_request_second_mug_SpellScript : public SpellScript
{
PrepareSpellScript(spell_request_second_mug_SpellScript);
PrepareSpellScript(spell_request_second_mug);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -2258,25 +1976,14 @@ public:
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
class spell_send_mug_control_aura : public SpellScriptLoader
class spell_send_mug_control_aura : public AuraScript
{
public:
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);
PrepareAuraScript(spell_send_mug_control_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -2290,25 +1997,14 @@ public:
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
class spell_barreled_control_aura : public SpellScriptLoader
{
public:
spell_barreled_control_aura() : SpellScriptLoader("spell_barreled_control_aura") {}
class spell_barreled_control_aura_AuraScript : public AuraScript
class spell_barreled_control_aura : public AuraScript
{
PrepareAuraScript(spell_barreled_control_aura_AuraScript);
PrepareAuraScript(spell_barreled_control_aura);
void PeriodicTick(AuraEffect const* /*aurEff*/)
{
@@ -2318,25 +2014,14 @@ public:
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)
class spell_direbrew_disarm : public SpellScriptLoader
class spell_direbrew_disarm : public AuraScript
{
public:
spell_direbrew_disarm() : SpellScriptLoader("spell_direbrew_disarm") {}
class spell_direbrew_disarm_AuraScript : public AuraScript
{
PrepareAuraScript(spell_direbrew_disarm_AuraScript);
PrepareAuraScript(spell_direbrew_disarm);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -2360,55 +2045,49 @@ public:
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_direbrew_disarm_AuraScript::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
OnEffectApply += AuraEffectRemoveFn(spell_direbrew_disarm_AuraScript::OnApply, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_direbrew_disarm::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
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()
{
// Npcs
new npc_brewfest_keg_thrower();
new npc_brewfest_keg_reciver();
new npc_brewfest_bark_trigger();
new npc_dark_iron_attack_generator();
new npc_dark_iron_attack_mole_machine();
new npc_dark_iron_guzzler();
new npc_brewfest_super_brew_trigger();
RegisterCreatureAI(npc_brewfest_keg_thrower);
RegisterCreatureAI(npc_brewfest_keg_reciver);
RegisterCreatureAI(npc_brewfest_bark_trigger);
RegisterCreatureAI(npc_dark_iron_attack_generator);
RegisterCreatureAI(npc_dark_iron_attack_mole_machine);
RegisterCreatureAI(npc_dark_iron_guzzler);
RegisterCreatureAI(npc_brewfest_super_brew_trigger);
// Spells
// ram
new spell_brewfest_main_ram_buff();
new spell_brewfest_ram_fatigue();
new spell_brewfest_apple_trap();
RegisterSpellScript(spell_brewfest_main_ram_buff);
RegisterSpellScript(spell_brewfest_ram_fatigue);
RegisterSpellScript(spell_brewfest_apple_trap);
// other
new spell_q11117_catch_the_wild_wolpertinger();
new spell_brewfest_fill_keg();
new spell_brewfest_unfill_keg();
new spell_brewfest_toss_mug();
new spell_brewfest_add_mug();
new spell_brewfest_reveler_transform();
new spell_brewfest_relay_race_force_cast();
RegisterSpellScript(spell_q11117_catch_the_wild_wolpertinger);
RegisterSpellScript(spell_brewfest_fill_keg);
RegisterSpellScript(spell_brewfest_unfill_keg);
RegisterSpellScript(spell_brewfest_toss_mug);
RegisterSpellScript(spell_brewfest_add_mug);
RegisterSpellScript(spell_brewfest_reveler_transform);
RegisterSpellScript(spell_brewfest_relay_race_force_cast);
// beer effect
new npc_brew_bubble();
RegisterCreatureAI(npc_brew_bubble);
// Coren Direbrew
new npc_coren_direbrew();
new npc_coren_direbrew_sisters();
new npc_direbrew_minion();
new npc_direbrew_antagonist();
RegisterCreatureAI(npc_coren_direbrew);
RegisterCreatureAI(npc_coren_direbrew_sisters);
RegisterCreatureAI(npc_direbrew_minion);
RegisterCreatureAI(npc_direbrew_antagonist);
new go_direbrew_mole_machine();
new spell_direbrew_summon_mole_machine_target_picker();
new spell_send_mug_target_picker();
new spell_request_second_mug();
new spell_send_mug_control_aura();
new spell_barreled_control_aura();
new spell_direbrew_disarm();
RegisterSpellScript(spell_direbrew_summon_mole_machine_target_picker);
RegisterSpellScript(spell_send_mug_target_picker);
RegisterSpellScript(spell_request_second_mug);
RegisterSpellScript(spell_send_mug_control_aura);
RegisterSpellScript(spell_barreled_control_aura);
RegisterSpellScript(spell_direbrew_disarm);
}