[Release] Reading map_XXXX.xzi

01/26/2017 16:15 Plastic#1
This is the file structure for reading the map .xzi files. With this information you should be able to change what areas gates will lead to for each map.

Code:
typedef struct
{
    float x;
    float z;
} XAREA_POINTSTRUCT;

typedef struct
{
    unsigned char areaCategory; // 5 = event area : 6 = map warp : 7 = pvp area
    int num;
    char areaTitle[ 21 ];
    unsigned char shapeType;
    
    if ( shapeType )
    {
        XAREA_POINTSTRUCT centerPoint;
        float radius;
    }
    else
    {
        XAREA_POINTSTRUCT point[ 4 ];
    }

    int specialFunction;
    
    if ( areaCategory == 6 ) // map warp
    {
        int targetZone;
        int targetWarpZone;
    }

    if ( areaCategory == 2 ) // mob spawn
    {
        int monsterTypeCount;

        typedef struct
        {
            int monsterSpawnType;
            int monsterSpawnCount;
        } MONSTERSPAWNINFO;

        MONSTERSPAWNINFO monsterInfo[ monsterTypeCount ];

        int monsterSpawnPointCount;
        char cUnk[ 12 * monsterSpawnPointCount ]; // client fseeks past XAREA_POINTSTRUCT + radius for each spawn point
    }

    if ( areaCategory == 7 ) // pvp area
    {
        unsigned char pvpZoneType;
        int indexPVPSafeZone1;
        int indexPVPSafeZone2;
        int indexPVPSafeZone3;
        int indexPVPSafeZone4;
        int indexPVPCompleteZone;
    }

    if ( specialFunction == 6 )
    {
        int multiTargetZone1;
        int multiTargetWarpZone1;
        int multiWarpZonePassage1;

        char areaTitleWarp1[ 21 ];

        int multiTargetZone2;
        int multiTargetWarpZone2;
        int multiWarpZonePassage2;

        char areaTitleWarp2[ 21 ];

        int multiTargetZone3;
        int multiTargetWarpZone3;
        int multiWarpZonePassage3;

        char areaTitleWarp3[ 21 ];
    }
} XZI_AREA;

typedef struct
{
    int areaCount;
    XZI_AREA xziArea[ areaCount ];
} XZI_FILE;
Area categories afaik are:
Code:
enum AREACATEGORY { SAFE = 0, PLAYERSPAWN, MOBSPAWN, NPCAREA, QUESTAREA, EVENTAREA, MAPWARP, PVPAREA, CASTLE, LOGOUT, NOTUSESPEEDSKILL, PUBLICPVPAREA };
Template for 010 editor attached below.