fix(DB/Creature): Convert npc_anchorite_truuen to sai (#4324)

* fix(DB/Core): Anchorite Truuen

Anchorote Truuen is escorted in quest Tomb of the Lightbringer, but he's
too fast and doesn't aggro on anything.

* Updated using suggestions from @pklloveyou

Co-authored-by: Zoidwaffle <zoidwaffle@gmail.com>
This commit is contained in:
Peter
2021-02-02 00:13:01 +01:00
committed by GitHub
parent 58c1d0025e
commit f65cfb6f20
2 changed files with 90 additions and 136 deletions

View File

@@ -264,141 +264,6 @@ public:
};
};
/*######
## npc_anchorite_truuen
######*/
enum Truuen
{
NPC_GHOST_UTHER = 17233,
NPC_THEL_DANIS = 1854,
NPC_GHOUL = 1791, //ambush
QUEST_TOMB_LIGHTBRINGER = 9446,
SAY_WP_0 = 0, //Beware! We are attacked!
SAY_WP_1 = 1, //It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to attack us. We must proceed with caution lest we be overwhelmed!
SAY_WP_2 = 2, //This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now...
SAY_WP_3 = 0, //Be welcome, friends!
SAY_WP_4 = 0, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart.
SAY_WP_5 = 1, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire.
SAY_WP_6 = 2 //Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here.
};
class npc_anchorite_truuen : public CreatureScript
{
public:
npc_anchorite_truuen() : CreatureScript("npc_anchorite_truuen") { }
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
{
npc_escortAI* pEscortAI = CAST_AI(npc_anchorite_truuen::npc_anchorite_truuenAI, creature->AI());
if (quest->GetQuestId() == QUEST_TOMB_LIGHTBRINGER)
pEscortAI->Start(true, true, player->GetGUID());
return false;
}
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_anchorite_truuenAI(creature);
}
struct npc_anchorite_truuenAI : public npc_escortAI
{
npc_anchorite_truuenAI(Creature* creature) : npc_escortAI(creature) { }
uint32 m_uiChatTimer;
uint64 UghostGUID;
uint64 TheldanisGUID;
Creature* Ughost;
Creature* Theldanis;
void Reset() override
{
m_uiChatTimer = 7000;
}
void JustSummoned(Creature* summoned) override
{
if (summoned->GetEntry() == NPC_GHOUL)
summoned->AI()->AttackStart(me);
}
void WaypointReached(uint32 waypointId) override
{
Player* player = GetPlayerForEscort();
switch (waypointId)
{
case 8:
Talk(SAY_WP_0);
me->SummonCreature(NPC_GHOUL, me->GetPositionX() + 7.0f, me->GetPositionY() + 7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX() + 5.0f, me->GetPositionY() + 5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
break;
case 9:
Talk(SAY_WP_1);
break;
case 14:
me->SummonCreature(NPC_GHOUL, me->GetPositionX() + 7.0f, me->GetPositionY() + 7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX() + 5.0f, me->GetPositionY() + 5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX() + 10.0f, me->GetPositionY() + 10.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX() + 8.0f, me->GetPositionY() + 8.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
break;
case 15:
Talk(SAY_WP_2);
break;
case 21:
Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150);
if (Theldanis)
Theldanis->AI()->Talk(SAY_WP_3);
break;
case 23:
Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
if (Ughost)
{
Ughost->SetDisableGravity(true);
Ughost->AI()->Talk(SAY_WP_4, me);
}
m_uiChatTimer = 4000;
break;
case 24:
if (Ughost)
Ughost->AI()->Talk(SAY_WP_5, me);
m_uiChatTimer = 4000;
break;
case 25:
if (Ughost)
Ughost->AI()->Talk(SAY_WP_6, me);
m_uiChatTimer = 4000;
break;
case 26:
if (player)
player->GroupEventHappens(QUEST_TOMB_LIGHTBRINGER, me);
break;
}
}
void EnterCombat(Unit* /*who*/) override { }
void JustDied(Unit* /*killer*/) override
{
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_TOMB_LIGHTBRINGER);
}
void UpdateAI(uint32 uiDiff) override
{
npc_escortAI::UpdateAI(uiDiff);
DoMeleeAttackIfReady();
if (HasEscortState(STATE_ESCORT_ESCORTING))
m_uiChatTimer = 6000;
}
};
};
/*######
##
######*/
@@ -409,5 +274,4 @@ void AddSC_western_plaguelands()
new npc_myranda_the_hag();
new npc_the_scourge_cauldron();
new npc_andorhal_tower();
new npc_anchorite_truuen();
}