mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Scripts/Instances: Complete rewrite of the boundary system.
- Migrate boundary logic to Maps/AreaBoundary instead of having it sit in InstanceScript (to possibly allow use for other purposes). - Implement the first five boundary types in Maps/AreaBoundary.cpp. - Add boundary checks to Creature's update logic - Add boundary data for all Northrend raids - Add boundary initialization structures and methods to InstanceScript - Modify EnterEvadeMode signature. It now passes a value from the EvadeReason enum as parameter to allow special casing depending on evade reason - Remove previous (weird) boundary code that had them linked to GO spawns
This commit is contained in:
@@ -96,6 +96,13 @@ void InstanceScript::SetHeaders(std::string const& dataHeaders)
|
||||
headers.push_back(header);
|
||||
}
|
||||
|
||||
void InstanceScript::LoadBossBoundaries(const BossBoundaryData& data)
|
||||
{
|
||||
for (BossBoundaryEntry entry : data)
|
||||
if (entry.bossId < bosses.size())
|
||||
bosses[entry.bossId].boundary.insert(entry.boundary);
|
||||
}
|
||||
|
||||
void InstanceScript::LoadMinionData(const MinionData* data)
|
||||
{
|
||||
while (data->entry)
|
||||
@@ -113,7 +120,7 @@ void InstanceScript::LoadDoorData(const DoorData* data)
|
||||
while (data->entry)
|
||||
{
|
||||
if (data->bossId < bosses.size())
|
||||
doors.insert(std::make_pair(data->entry, DoorInfo(&bosses[data->bossId], data->type, BoundaryType(data->boundary))));
|
||||
doors.insert(std::make_pair(data->entry, DoorInfo(&bosses[data->bossId], data->type)));
|
||||
|
||||
++data;
|
||||
}
|
||||
@@ -236,28 +243,6 @@ void InstanceScript::AddDoor(GameObject* door, bool add)
|
||||
if (add)
|
||||
{
|
||||
data.bossInfo->door[data.type].insert(door->GetGUID());
|
||||
switch (data.boundary)
|
||||
{
|
||||
default:
|
||||
case BOUNDARY_NONE:
|
||||
break;
|
||||
case BOUNDARY_N:
|
||||
case BOUNDARY_S:
|
||||
data.bossInfo->boundary[data.boundary] = door->GetPositionX();
|
||||
break;
|
||||
case BOUNDARY_E:
|
||||
case BOUNDARY_W:
|
||||
data.bossInfo->boundary[data.boundary] = door->GetPositionY();
|
||||
break;
|
||||
case BOUNDARY_NW:
|
||||
case BOUNDARY_SE:
|
||||
data.bossInfo->boundary[data.boundary] = door->GetPositionX() + door->GetPositionY();
|
||||
break;
|
||||
case BOUNDARY_NE:
|
||||
case BOUNDARY_SW:
|
||||
data.bossInfo->boundary[data.boundary] = door->GetPositionX() - door->GetPositionY();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
data.bossInfo->door[data.type].erase(door->GetGUID());
|
||||
|
||||
Reference in New Issue
Block a user