DB/Quest: Convert & update support for WP Scourge cauldrons quests to SAI

Closes #24730

(cherry picked from commit d70eb96c85)
This commit is contained in:
offl
2020-06-14 18:12:17 +02:00
committed by Shauren
parent c088588701
commit 5f94d0f4c8
2 changed files with 123 additions and 82 deletions

View File

@@ -23,7 +23,6 @@ SDCategory: Western Plaguelands
EndScriptData */
/* ContentData
npc_the_scourge_cauldron
npc_andorhal_tower
EndContentData */
@@ -33,86 +32,6 @@ EndContentData */
#include "Player.h"
#include "WorldSession.h"
/*######
## npc_the_scourge_cauldron
######*/
class npc_the_scourge_cauldron : public CreatureScript
{
public:
npc_the_scourge_cauldron() : CreatureScript("npc_the_scourge_cauldron") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_the_scourge_cauldronAI(creature);
}
struct npc_the_scourge_cauldronAI : public ScriptedAI
{
npc_the_scourge_cauldronAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() override { }
void JustEngagedWith(Unit* /*who*/) override { }
void DoDie()
{
//summoner dies here
me->KillSelf();
//override any database `spawntimesecs` to prevent duplicated summons
uint32 rTime = me->GetRespawnDelay();
if (rTime < 600)
me->SetRespawnDelay(600);
}
void MoveInLineOfSight(Unit* who) override
{
if (!who)
return;
Player* player = who->ToPlayer();
if (!player)
return;
switch (me->GetAreaId())
{
case 199: //felstone
if (player->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE ||
player->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE)
{
me->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
case 200: //dalson
if (player->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE ||
player->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE)
{
me->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
case 201: //gahrron
if (player->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE ||
player->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE)
{
me->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
case 202: //writhing
if (player->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE ||
player->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE)
{
me->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
}
}
};
};
/*######
## npcs_andorhal_tower
######*/
@@ -153,6 +72,5 @@ public:
void AddSC_western_plaguelands()
{
new npc_the_scourge_cauldron();
new npc_andorhal_tower();
}