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