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:
treeston
2015-12-20 13:28:16 +01:00
parent 60e3127714
commit 2da458c56d
134 changed files with 985 additions and 533 deletions

View File

@@ -93,6 +93,7 @@ public:
{ "moveflags", rbac::RBAC_PERM_COMMAND_DEBUG_MOVEFLAGS, false, &HandleDebugMoveflagsCommand, "" },
{ "transport", rbac::RBAC_PERM_COMMAND_DEBUG_TRANSPORT, false, &HandleDebugTransportCommand, "" },
{ "loadcells", rbac::RBAC_PERM_COMMAND_DEBUG_LOADCELLS, false, &HandleDebugLoadCellsCommand, "" },
{ "boundary", rbac::RBAC_PERM_COMMAND_DEBUG_BOUNDARY, false, &HandleDebugBoundaryCommand, "" }
};
static std::vector<ChatCommand> commandTable =
{
@@ -1414,6 +1415,33 @@ public:
handler->PSendSysMessage("Cells loaded (mapId: %u) After load - Next GameObject %u, Creature %u", map->GetId(), map->GetMaxLowGuid<HighGuid::GameObject>(), map->GetMaxLowGuid<HighGuid::Unit>());
return true;
}
static bool HandleDebugBoundaryCommand(ChatHandler* handler, char const* args)
{
Player* player = handler->GetSession()->GetPlayer();
if (!player)
return false;
Creature* target = handler->getSelectedCreature();
if (!target || !target->IsAIEnabled || !target->AI())
{
return false;
}
char* fill_str = args ? strtok((char*)args, " ") : nullptr;
char* duration_str = args ? strtok(nullptr, " ") : nullptr;
int duration = duration_str ? atoi(duration_str) : -1;
if (duration <= 0 || duration >= 30 * MINUTE) // arbitary upper limit
duration = 3 * MINUTE;
bool doFill = fill_str ? (stricmp(fill_str, "FILL") == 0) : false;
int32 errMsg = target->AI()->VisualizeBoundary(duration, player, doFill);
if (errMsg > 0)
handler->PSendSysMessage(errMsg);
return true;
}
};
void AddSC_debug_commandscript()