增加 wmoinfo 命令 查询WMO信息
This commit is contained in:
parent
150ff2b29d
commit
f432e7752c
@ -252,6 +252,7 @@ public:
|
||||
{ "_heal", HandleHealCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "_level", HandleLevelCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "_enchantlua", HandleEnchantLuaCommand, SEC_CONSOLE, Console::Yes },
|
||||
{ "wmoinfo", HandleWMOInfoCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "_go", HandleGoCommand, SEC_CONSOLE, Console::No } // 命令功能: 传送玩家到指定坐标,支持设置地图ID、难度和挑战等级
|
||||
};
|
||||
return commandTable;
|
||||
@ -2780,6 +2781,54 @@ public:
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWMOInfoCommand(ChatHandler* handler)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
Map* map = player->GetMap();
|
||||
if (!map)
|
||||
return false;
|
||||
|
||||
float x = player->GetPositionX();
|
||||
float y = player->GetPositionY();
|
||||
float z = player->GetPositionZ();
|
||||
uint32 phaseMask = player->GetPhaseMask();
|
||||
|
||||
// 获取WMO区域信息
|
||||
uint32 mogpFlags;
|
||||
int32 adtId, rootId, groupId;
|
||||
float vmapZ = z;
|
||||
bool hasVmapArea = map->GetAreaInfo(phaseMask, x, y, vmapZ, mogpFlags, adtId, rootId, groupId);
|
||||
|
||||
if (hasVmapArea)
|
||||
{
|
||||
handler->PSendSysMessage("WMO Area Information:");
|
||||
handler->PSendSysMessage("Root ID (WMOID): {}", rootId);
|
||||
handler->PSendSysMessage("ADT ID (NameSetID): {}", adtId);
|
||||
handler->PSendSysMessage("Group ID (WMOGroupID): {}", groupId);
|
||||
handler->PSendSysMessage("MOGP Flags: {}", mogpFlags);
|
||||
|
||||
// 尝试查找对应的WMOAreaTable条目
|
||||
if (WMOAreaTableEntry const* wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId))
|
||||
{
|
||||
handler->PSendSysMessage("Found WMOAreaTable Entry ID: {}", wmoEntry->Id);
|
||||
handler->PSendSysMessage("Linked Area ID: {}", wmoEntry->areaId);
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage("No WMOAreaTable entry found for this triplet!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage("You are not in a WMO area.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_custom_commandscript()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user