Created
August 13, 2016 22:26
-
-
Save dagochen/bf003c3175db0f4739d08d3f5290ac2f to your computer and use it in GitHub Desktop.
Gameobject XYZ to Area and Zone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ObjectMgr::WriteGameObjectTextFile() | |
{ | |
bool stop = false; | |
if (stop) | |
return; | |
std::ofstream myfile; | |
myfile.open("gameobjects.txt"); | |
for (uint32 i = 1; i < mGameObjectDataMap.size(); i++) | |
{ | |
if (mGameObjectDataMap.find(i) == mGameObjectDataMap.end()) | |
continue; | |
GameObjectData& go = mGameObjectDataMap.at(i); | |
const GameObjectInfo* info = GetGameObjectInfo(go.id); | |
if (info->type != GAMEOBJECT_TYPE_CHEST) | |
continue; | |
uint32 zone_id = sTerrainMgr.GetZoneId(go.mapid, go.posX, go.posY, go.posZ); | |
uint32 area_id = sTerrainMgr.GetAreaId(go.mapid, go.posX, go.posY, go.posZ); | |
AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zone_id); | |
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(area_id); | |
myfile << "Gameobject GUID: " << i << "; ID: " << go.id << " Name: " << info->name << " ; XPos: " << go.posX << " ; YPos: " << go.posY << " ; ZPos: " << go.posZ << " ; Zone: " << zone_id << "; " << zoneEntry->area_name[3] << " ; Area: " << area_id << "; " << areaEntry->area_name[3] << "\n"; | |
} | |
myfile.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment