fix(Scripts/DB): Improve Demon Portals and convert to SAI (#6140)

This commit is contained in:
Raelorasz
2021-06-05 00:13:19 +02:00
committed by GitHub
parent c568bdcc42
commit c485bab6ee
2 changed files with 70 additions and 29 deletions

View File

@@ -13,7 +13,6 @@ EndScriptData */
/* ContentData
npc_aged_dying_ancient_kodo
go_demon_portal
EndContentData */
#include "Player.h"
@@ -495,33 +494,6 @@ public:
}
};
/*######
## go_demon_portal
######*/
enum DemonPortal
{
NPC_DEMON_GUARDIAN = 11937,
QUEST_PORTAL_OF_THE_LEGION = 5581
};
class go_demon_portal : public GameObjectScript
{
public:
go_demon_portal() : GameObjectScript("go_demon_portal") { }
bool OnGossipHello(Player* player, GameObject* go) override
{
if (player->GetQuestStatus(QUEST_PORTAL_OF_THE_LEGION) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_GUARDIAN, 5.0f, true))
{
if (Creature* guardian = player->SummonCreature(NPC_DEMON_GUARDIAN, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
guardian->AI()->AttackStart(player);
}
return true;
}
};
void AddSC_desolace()
{
// Ours
@@ -529,5 +501,4 @@ void AddSC_desolace()
// Theirs
new npc_aged_dying_ancient_kodo();
new go_demon_portal();
}