fix(Scripts/OldHilsbradFoothills): Corrected spawn position and waypo… (#15099)

This commit is contained in:
UltraNix
2023-02-19 05:22:35 +01:00
committed by GitHub
parent 23a68b694e
commit c3a8d26109
3 changed files with 84 additions and 36 deletions

View File

@@ -57,36 +57,13 @@ public:
{
boss_lieutenant_drakeAI(Creature* creature) : ScriptedAI(creature)
{
pathPoints.clear();
WPPath* path = sSmartWaypointMgr->GetPath(me->GetEntry());
if (!path || path->empty())
return;
pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
uint32 wpCounter = 1;
WPPath::const_iterator itr;
while ((itr = path->find(wpCounter++)) != path->end())
{
WayPoint* wp = itr->second;
pathPoints.push_back(G3D::Vector3(wp->x, wp->y, wp->z));
}
}
void InitializeAI() override
{
ScriptedAI::InitializeAI();
//Talk(SAY_ENTER);
JustReachedHome();
}
void JustReachedHome() override
{
me->SetWalk(true);
Movement::MoveSplineInit init(me);
init.MovebyPath(pathPoints);
init.SetCyclic();
init.Launch();
runSecondPath = false;
pathId = me->GetEntry() * 10;
me->GetMotionMaster()->MovePath(pathId, false);
}
void Reset() override
@@ -118,8 +95,38 @@ public:
instance->SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_DRAKE_KILLED);
}
void MovementInform(uint32 type, uint32 point) override
{
if (type != WAYPOINT_MOTION_TYPE)
{
return;
}
if (pathId == me->GetEntry() * 10)
{
switch (point)
{
case 7:
Talk(SAY_ENTER);
break;
case 10:
pathId = (me->GetEntry() * 10) + 1;
runSecondPath = true;
break;
default:
break;
}
}
}
void UpdateAI(uint32 diff) override
{
if (runSecondPath)
{
runSecondPath = false;
me->GetMotionMaster()->MovePath(pathId, true);
}
if (!UpdateVictim())
return;
@@ -161,7 +168,8 @@ public:
private:
EventMap events;
Movement::PointsArray pathPoints;
uint32 pathId;
bool runSecondPath;
};
};

View File

@@ -21,11 +21,11 @@
#include "ScriptMgr.h"
#include "old_hillsbrad.h"
const Position instancePositions[INSTANCE_POSITIONS_COUNT] =
static Position const instancePositions[INSTANCE_POSITIONS_COUNT] =
{
{2188.18f, 228.90f, 53.025f, 1.77f}, // Orcs Gather Point 1
{2103.23f, 93.55f, 53.096f, 3.78f}, // Orcs Gather Point 2
{2128.43f, 71.01f, 64.42f, 1.74f} // Lieutenant Drake Summon Position
{ 2188.18f, 228.90f, 53.025f, 1.77f }, // Orcs Gather Point 1
{ 2103.23f, 93.550f, 53.096f, 3.78f }, // Orcs Gather Point 2
{ 2172.76f, 149.54f, 87.981f, 4.19f } // Lieutenant Drake Summon Position
};
const Position thrallPositions[THRALL_POSITIONS_COUNT] =
@@ -248,11 +248,8 @@ public:
case EVENT_SUMMON_LIEUTENANT:
{
instance->LoadGrid(instancePositions[2].GetPositionX(), instancePositions[2].GetPositionY());
if (Creature* drake = instance->SummonCreature(NPC_LIEUTENANT_DRAKE, instancePositions[2]))
{
drake->AI()->Talk(0);
}
[[fallthrough]]; /// @todo: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
instance->SummonCreature(NPC_LIEUTENANT_DRAKE, instancePositions[2]);
break;
}
case EVENT_THRALL_REPOSITION:
{