fix(Scripts/DB): Quest OOX 09 - 17 - 2FE (#7792)

This commit is contained in:
IntelligentQuantum
2021-09-13 18:36:49 +04:30
committed by GitHub
parent 9dca6381f7
commit bb343b482e
4 changed files with 267 additions and 317 deletions

View File

@@ -7,12 +7,11 @@
/* ScriptData
SDName: Hinterlands
SD%Complete: 100
SDComment: Quest support: 863, 2742
SDComment: Quest support: 2742
SDCategory: The Hinterlands
EndScriptData */
/* ContentData
npc_oox09hl
npc_rinji
EndContentData */
@@ -21,109 +20,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
#include "ScriptMgr.h"
/*######
## npc_oox09hl
######*/
enum OOX
{
SAY_OOX_START = 0,
SAY_OOX_AGGRO = 1,
SAY_OOX_AMBUSH = 2,
SAY_OOX_AMBUSH_REPLY = 3,
SAY_OOX_END = 4,
QUEST_RESQUE_OOX_09 = 836,
NPC_MARAUDING_OWL = 7808,
NPC_VILE_AMBUSHER = 7809,
FACTION_ESCORTEE_A = 774,
FACTION_ESCORTEE_H = 775
};
class npc_oox09hl : public CreatureScript
{
public:
npc_oox09hl() : CreatureScript("npc_oox09hl") { }
struct npc_oox09hlAI : public npc_escortAI
{
npc_oox09hlAI(Creature* creature) : npc_escortAI(creature) { }
void Reset() override { }
void EnterCombat(Unit* who) override
{
if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER)
return;
Talk(SAY_OOX_AGGRO);
}
void JustSummoned(Creature* summoned) override
{
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
}
void sQuestAccept(Player* player, Quest const* quest) override
{
if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
{
me->SetStandState(UNIT_STAND_STATE_STAND);
me->setFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
Talk(SAY_OOX_START, player);
npc_escortAI::Start(false, false, player->GetGUID(), quest);
}
}
void WaypointReached(uint32 waypointId) override
{
switch (waypointId)
{
case 26:
Talk(SAY_OOX_AMBUSH);
break;
case 43:
Talk(SAY_OOX_AMBUSH);
break;
case 64:
Talk(SAY_OOX_END);
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_RESQUE_OOX_09, me);
break;
}
}
void WaypointStart(uint32 pointId) override
{
switch (pointId)
{
case 27:
for (uint8 i = 0; i < 3; ++i)
{
const Position src = {147.927444f, -3851.513428f, 130.893f, 0};
Position dst;
me->GetRandomPoint(src, 7.0f, dst);
DoSummon(NPC_MARAUDING_OWL, dst, 25000, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
}
break;
case 44:
for (uint8 i = 0; i < 3; ++i)
{
const Position src = {-141.151581f, -4291.213867f, 120.130f, 0};
Position dst;
me->GetRandomPoint(src, 7.0f, dst);
me->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
}
break;
}
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_oox09hlAI(creature);
}
};
/*######
## npc_rinji
######*/
@@ -319,6 +215,5 @@ public:
void AddSC_hinterlands()
{
new npc_oox09hl();
new npc_rinji();
}