mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 07:07:29 +01:00
DB/Quest: Rewrite 'Strengthen the Ancients' (#31131)
This commit is contained in:
@@ -350,81 +350,6 @@ struct npc_commander_eligor_dawnbringer : public ScriptedAI
|
||||
uint8 talkWing;
|
||||
};
|
||||
|
||||
/*######
|
||||
## Quest Strengthen the Ancients (12096|12092)
|
||||
######*/
|
||||
|
||||
enum StrengthenAncientsMisc
|
||||
{
|
||||
SAY_WALKER_FRIENDLY = 0,
|
||||
SAY_WALKER_ENEMY = 1,
|
||||
SAY_LOTHALOR = 0,
|
||||
|
||||
SPELL_CREATE_ITEM_BARK = 47550,
|
||||
SPELL_CONFUSED = 47044,
|
||||
|
||||
NPC_LOTHALOR = 26321
|
||||
};
|
||||
|
||||
// 47575 - Strengthen the Ancients: On Interact Dummy to Woodlands Walker
|
||||
class spell_q12096_q12092_dummy : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12096_q12092_dummy);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint32 roll = rand32() % 2;
|
||||
|
||||
Creature* tree = GetHitCreature();
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
|
||||
if (!tree || !player)
|
||||
return;
|
||||
|
||||
tree->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
|
||||
|
||||
if (roll == 1) // friendly version
|
||||
{
|
||||
tree->CastSpell(player, SPELL_CREATE_ITEM_BARK);
|
||||
tree->AI()->Talk(SAY_WALKER_FRIENDLY, player);
|
||||
tree->DespawnOrUnsummon(1s);
|
||||
}
|
||||
else // enemy version
|
||||
{
|
||||
tree->AI()->Talk(SAY_WALKER_ENEMY, player);
|
||||
tree->SetFaction(FACTION_MONSTER);
|
||||
tree->Attack(player, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12096_q12092_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 47530 - Bark of the Walkers
|
||||
class spell_q12096_q12092_bark : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12096_q12092_bark);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Creature* lothalor = GetHitCreature();
|
||||
if (!lothalor || lothalor->GetEntry() != NPC_LOTHALOR)
|
||||
return;
|
||||
|
||||
lothalor->AI()->Talk(SAY_LOTHALOR);
|
||||
lothalor->RemoveAura(SPELL_CONFUSED);
|
||||
lothalor->DespawnOrUnsummon(4s);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12096_q12092_bark::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## Quest: Defending Wyrmrest Temple ID: 12372
|
||||
######*/
|
||||
@@ -1113,8 +1038,6 @@ class spell_dragonblight_end_of_the_line_quest_completion_script : public SpellS
|
||||
void AddSC_dragonblight()
|
||||
{
|
||||
RegisterCreatureAI(npc_commander_eligor_dawnbringer);
|
||||
RegisterSpellScript(spell_q12096_q12092_dummy);
|
||||
RegisterSpellScript(spell_q12096_q12092_bark);
|
||||
RegisterCreatureAI(npc_wyrmrest_defender);
|
||||
RegisterSpellScript(spell_dragonblight_defending_wyrmrest_temple_cast_from_gossip);
|
||||
RegisterSpellScript(spell_dragonblight_defending_wyrmrest_temple_dummy);
|
||||
|
||||
Reference in New Issue
Block a user