refactor(Scripts/Event): convert pilgrims_bounty into new system (#9608)
This commit is contained in:
@@ -102,14 +102,9 @@ enum tableEvent
|
||||
// NPCs
|
||||
/////////////////////////////
|
||||
|
||||
class npc_pilgrims_bounty_chair : public CreatureScript
|
||||
struct npc_pilgrims_bounty_chair : public VehicleAI
|
||||
{
|
||||
public:
|
||||
npc_pilgrims_bounty_chair() : CreatureScript("npc_pilgrims_bounty_chair") { }
|
||||
|
||||
struct npc_pilgrims_bounty_chairAI : public VehicleAI
|
||||
{
|
||||
npc_pilgrims_bounty_chairAI(Creature* creature) : VehicleAI(creature)
|
||||
npc_pilgrims_bounty_chair(Creature* creature) : VehicleAI(creature)
|
||||
{
|
||||
plateGUID.Clear();
|
||||
timerSpawnPlate = 1;
|
||||
@@ -280,24 +275,11 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_pilgrims_bounty_chairAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_pilgrims_bounty_plate : public CreatureScript
|
||||
struct npc_pilgrims_bounty_plate : public NullCreatureAI
|
||||
{
|
||||
public:
|
||||
npc_pilgrims_bounty_plate() : CreatureScript("npc_pilgrims_bounty_plate") { }
|
||||
|
||||
struct npc_pilgrims_bounty_plateAI : public NullCreatureAI
|
||||
{
|
||||
npc_pilgrims_bounty_plateAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
}
|
||||
npc_pilgrims_bounty_plate(Creature* creature) : NullCreatureAI(creature) { }
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo) override
|
||||
{
|
||||
@@ -314,25 +296,15 @@ public:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_pilgrims_bounty_plateAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
// Spells
|
||||
/////////////////////////////
|
||||
class spell_pilgrims_bounty_pass_generic : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pilgrims_bounty_pass_generic() : SpellScriptLoader("spell_pilgrims_bounty_pass_generic") {}
|
||||
|
||||
class spell_pilgrims_bounty_pass_generic_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pilgrims_bounty_pass_generic_SpellScript);
|
||||
class spell_pilgrims_bounty_pass_generic : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pilgrims_bounty_pass_generic);
|
||||
|
||||
uint32 GetVisualThrow(uint32 passSpell, bool isPlayer)
|
||||
{
|
||||
@@ -456,24 +428,13 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_pass_generic_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_pilgrims_bounty_pass_generic_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_pass_generic::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pilgrims_bounty_feast_on_generic : public SpellScriptLoader
|
||||
class spell_pilgrims_bounty_feast_on_generic : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_pilgrims_bounty_feast_on_generic() : SpellScriptLoader("spell_pilgrims_bounty_feast_on_generic") {}
|
||||
|
||||
class spell_pilgrims_bounty_feast_on_generic_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pilgrims_bounty_feast_on_generic_SpellScript);
|
||||
PrepareSpellScript(spell_pilgrims_bounty_feast_on_generic);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
@@ -546,13 +507,7 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_feast_on_generic_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_pilgrims_bounty_feast_on_generic_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_feast_on_generic::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -562,18 +517,14 @@ enum tTracker
|
||||
SPELL_ACHI_TURKINATOR_CREDIT = 62021,
|
||||
};
|
||||
|
||||
class spell_pilgrims_bounty_turkey_tracker : public SpellScriptLoader
|
||||
class spell_pilgrims_bounty_turkey_tracker : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_pilgrims_bounty_turkey_tracker() : SpellScriptLoader("spell_pilgrims_bounty_turkey_tracker") {}
|
||||
|
||||
class spell_pilgrims_bounty_turkey_tracker_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pilgrims_bounty_turkey_tracker_SpellScript);
|
||||
PrepareSpellScript(spell_pilgrims_bounty_turkey_tracker);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
if (AuraEffect* aurEff = target->GetAuraEffectDummy(SPELL_TURKEY_TRACKER))
|
||||
{
|
||||
uint32 stackAmount = aurEff->GetBase()->GetStackAmount();
|
||||
@@ -596,27 +547,17 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_turkey_tracker_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_pilgrims_bounty_turkey_tracker_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_turkey_tracker::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pilgrims_bounty_serve_generic : public SpellScriptLoader
|
||||
class spell_pilgrims_bounty_serve_generic : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_pilgrims_bounty_serve_generic() : SpellScriptLoader("spell_pilgrims_bounty_serve_generic") { }
|
||||
|
||||
class spell_pilgrims_bounty_serve_generic_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pilgrims_bounty_serve_generic_AuraScript);
|
||||
PrepareAuraScript(spell_pilgrims_bounty_serve_generic);
|
||||
|
||||
void OnAuraRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
@@ -627,24 +568,13 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_pilgrims_bounty_serve_generic_AuraScript::OnAuraRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pilgrims_bounty_serve_generic_AuraScript();
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_pilgrims_bounty_serve_generic::OnAuraRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pilgrims_bounty_food : public SpellScriptLoader
|
||||
class spell_pilgrims_bounty_food_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_pilgrims_bounty_food() : SpellScriptLoader("spell_pilgrims_bounty_food") { }
|
||||
|
||||
class spell_pilgrims_bounty_food_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pilgrims_bounty_food_AuraScript);
|
||||
PrepareAuraScript(spell_pilgrims_bounty_food_aura);
|
||||
|
||||
void RecalculateHook(AuraEffect const* /*aurEffect*/, int32& amount, bool& canBeRecalculated)
|
||||
{
|
||||
@@ -661,20 +591,15 @@ public:
|
||||
void Register() override
|
||||
{
|
||||
if (m_scriptSpellId == 66041)
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pilgrims_bounty_food_AuraScript::RecalculateHook, EFFECT_0, SPELL_AURA_MOD_POWER_REGEN);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pilgrims_bounty_food_aura::RecalculateHook, EFFECT_0, SPELL_AURA_MOD_POWER_REGEN);
|
||||
else if (m_scriptSpellId != 66477)
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pilgrims_bounty_food_AuraScript::RecalculateHook, EFFECT_0, SPELL_AURA_MOD_REGEN);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pilgrims_bounty_food_aura::RecalculateHook, EFFECT_0, SPELL_AURA_MOD_REGEN);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pilgrims_bounty_food_AuraScript();
|
||||
}
|
||||
|
||||
class spell_pilgrims_bounty_food_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pilgrims_bounty_food_SpellScript);
|
||||
class spell_pilgrims_bounty_food : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pilgrims_bounty_food);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
@@ -689,13 +614,7 @@ public:
|
||||
void Register() override
|
||||
{
|
||||
if (m_scriptSpellId == 66477)
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_food_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_pilgrims_bounty_food_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_food::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -741,15 +660,15 @@ public:
|
||||
void AddSC_event_pilgrims_end_scripts()
|
||||
{
|
||||
// Spells
|
||||
new spell_pilgrims_bounty_pass_generic();
|
||||
new spell_pilgrims_bounty_feast_on_generic();
|
||||
new spell_pilgrims_bounty_turkey_tracker();
|
||||
new spell_pilgrims_bounty_serve_generic();
|
||||
new spell_pilgrims_bounty_food();
|
||||
RegisterSpellScript(spell_pilgrims_bounty_pass_generic);
|
||||
RegisterSpellScript(spell_pilgrims_bounty_feast_on_generic);
|
||||
RegisterSpellScript(spell_pilgrims_bounty_turkey_tracker);
|
||||
RegisterSpellScript(spell_pilgrims_bounty_serve_generic);
|
||||
RegisterSpellAndAuraScriptPair(spell_pilgrims_bounty_food, spell_pilgrims_bounty_food_aura);
|
||||
|
||||
// Npcs
|
||||
new npc_pilgrims_bounty_chair();
|
||||
new npc_pilgrims_bounty_plate();
|
||||
RegisterCreatureAI(npc_pilgrims_bounty_chair);
|
||||
RegisterCreatureAI(npc_pilgrims_bounty_plate);
|
||||
|
||||
// Achievements
|
||||
new achievement_pb_pilgrims_peril();
|
||||
|
||||
Reference in New Issue
Block a user