DB/Quest: Convert "HELP!" & "Corki's Gone Missing Again!" & "Cho'war the Pillager" to SAI

Closes #24649

(cherry picked from commit fd66e291b5)
This commit is contained in:
Killyana
2020-05-23 02:44:18 +02:00
committed by Shauren
parent b7b5122b88
commit 8571a22017
2 changed files with 43 additions and 140 deletions

View File

@@ -216,144 +216,6 @@ public:
};
/*######
## go_corkis_prison and npc_corki
######*/
enum CorkiData
{
// first quest
QUEST_HELP = 9923,
NPC_CORKI = 18445,
NPC_CORKI_CREDIT_1 = 18369,
GO_CORKIS_PRISON = 182349,
CORKI_SAY_THANKS = 0,
// 2nd quest
QUEST_CORKIS_GONE_MISSING_AGAIN = 9924,
NPC_CORKI_2 = 20812,
GO_CORKIS_PRISON_2 = 182350,
CORKI_SAY_PROMISE = 0,
// 3rd quest
QUEST_CHOWAR_THE_PILLAGER = 9955,
NPC_CORKI_3 = 18369,
NPC_CORKI_CREDIT_3 = 18444,
GO_CORKIS_PRISON_3 = 182521,
CORKI_SAY_LAST = 0
};
class go_corkis_prison : public GameObjectScript
{
public:
go_corkis_prison() : GameObjectScript("go_corkis_prison") { }
struct go_corkis_prisonAI : public GameObjectAI
{
go_corkis_prisonAI(GameObject* go) : GameObjectAI(go) { }
bool GossipHello(Player* player) override
{
me->SetGoState(GO_STATE_READY);
if (me->GetEntry() == GO_CORKIS_PRISON)
{
if (Creature* corki = me->FindNearestCreature(NPC_CORKI, 25, true))
{
corki->GetMotionMaster()->MovePoint(1, me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ());
if (player)
player->KilledMonsterCredit(NPC_CORKI_CREDIT_1);
}
}
if (me->GetEntry() == GO_CORKIS_PRISON_2)
{
if (Creature* corki = me->FindNearestCreature(NPC_CORKI_2, 25, true))
{
corki->GetMotionMaster()->MovePoint(1, me->GetPositionX() - 5, me->GetPositionY(), me->GetPositionZ());
if (player)
player->KilledMonsterCredit(NPC_CORKI_2);
}
}
if (me->GetEntry() == GO_CORKIS_PRISON_3)
{
if (Creature* corki = me->FindNearestCreature(NPC_CORKI_3, 25, true))
{
corki->GetMotionMaster()->MovePoint(1, me->GetPositionX() + 4, me->GetPositionY(), me->GetPositionZ());
if (player)
player->KilledMonsterCredit(NPC_CORKI_CREDIT_3);
}
}
return true;
}
};
GameObjectAI* GetAI(GameObject* go) const override
{
return new go_corkis_prisonAI(go);
}
};
class npc_corki : public CreatureScript
{
public:
npc_corki() : CreatureScript("npc_corki") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_corkiAI(creature);
}
struct npc_corkiAI : public ScriptedAI
{
npc_corkiAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
Say_Timer = 5000;
ReleasedFromCage = false;
}
uint32 Say_Timer;
bool ReleasedFromCage;
void Reset() override
{
Initialize();
}
void UpdateAI(uint32 diff) override
{
if (ReleasedFromCage)
{
if (Say_Timer <= diff)
{
me->DespawnOrUnsummon();
ReleasedFromCage = false;
}
else
Say_Timer -= diff;
}
}
void MovementInform(uint32 type, uint32 id) override
{
if (type == POINT_MOTION_TYPE && id == 1)
{
Say_Timer = 5000;
ReleasedFromCage = true;
if (me->GetEntry() == NPC_CORKI)
Talk(CORKI_SAY_THANKS);
if (me->GetEntry() == NPC_CORKI_2)
Talk(CORKI_SAY_PROMISE);
if (me->GetEntry() == NPC_CORKI_3)
Talk(CORKI_SAY_LAST);
}
};
};
};
/*#####
## npc_kurenai_captive
#####*/
@@ -836,8 +698,6 @@ public:
void AddSC_nagrand()
{
new npc_maghar_captive();
new npc_corki();
new go_corkis_prison();
new npc_kurenai_captive();
new npc_nagrand_banner();
new condition_nagrand_banner();