1.29 Décryptage d'une cellule sur Dofus Retro/1.2

Inscrit
5 Novembre 2016
Messages
56
Reactions
2
#1
Bonjour,

je poste ce message car j'ai du mal à comprendre comment décrypter correctement une cellule d'une map sur Dofus 1.29/retro.
j'ai lu et appliqué les différentes solutions proposées sur ce forum, sources de maxoubot, salesprendes ... mais j'ai l'impression qu'ils de décryptent pas les maps de la bonne manières.

par exemple, aucune source (sur ce forum/github) n'arrive à décrypter correctement la map (10216), c'est la banque de brakmar.
voici mon code qui permet de décrypter une cellule
la méthode uncompressCell:
public static CellGame uncompressCell(String cData, int cellID, int mapWith, boolean isOutdoor) {
    int curseur = cData.length() - 1;
    int[] cell_informations = new int[cData.length()];
    while (curseur >= 0) {
        cell_informations[curseur] = ZKARRAY.indexOf(cData.charAt(curseur));
        curseur--;
    }

    int slope = (cell_informations[4] & 60) >> 2;
    int layer_object2 = ((cell_informations[0] & 2) << 12) + ((cell_informations[7] & 1) << 12) + (cell_informations[8] << 6) + cell_informations[9];
    int layer_object1 = ((cell_informations[0] & 4) << 11) + ((cell_informations[4] & 1) << 12) + (cell_informations[5] << 6) + cell_informations[6];
    int mouvement_outdoor = ((cell_informations[2] & 56) >> 3);
    int mouvement_indoor = (cell_informations[2] & 56 >> 3);

    int _loc5 = cellID / ((mapWith * 2) - 1);
    int _loc6 = cellID - (_loc5 * ((mapWith * 2) - 1));
    int _loc7 = _loc6 % mapWith;

    int y = _loc5 - _loc7;
    int x = (cellID - ((mapWith - 1) * y)) / mapWith;

    boolean is_interactive = false;
    boolean is_gate = false;
    boolean is_walkable = true;
    boolean is_recoltable = false;

    if (!isOutdoor) {
        // la condition de slope > 2 à vérifier  || slope > 2
        is_walkable = (mouvement_indoor != 0 ) && (mouvement_outdoor != 4 || mouvement_outdoor == 6);

    } else {
        if (mouvement_outdoor == 0) {
            is_walkable = Boolean.FALSE;

        } else if (mouvement_outdoor == 6 || mouvement_outdoor == 4 && !is_gate) {
            is_walkable = Boolean.TRUE;
        } else {
            is_walkable = Boolean.FALSE;
        }
    }
    is_interactive = ((cell_informations[7] & 2) >> 1) != 0;
    is_recoltable = readResourceRecoltable(layer_object2 + "", Boolean.FALSE);
    is_gate = Arrays.stream(texture_teleport_layer).anyMatch(s -> s == layer_object2) || Arrays.stream(texture_teleport_layer).anyMatch(s -> s == layer_object1);
    String readResourceDescription = readResourceDescription(layer_object2 + "", "");
    CellGame cellGame = CellGame.builder()
        .cData(cData)
        .id(cellID)
        //
        .isGate(is_gate)
        .isWalkable(is_walkable)
        .isRecoltable(is_recoltable)
        .isInteractive(is_interactive)
        .description(readResourceDescription)
        .resource_state(null)
        //
        .layer_object1(layer_object1)
        .layer_object2(layer_object2)
        //
        .x(x)
        .y(y)
        //
        .build();

    cellGame.buildCode();
    return cellGame;
}

auriez vous une solution/remarques ?
 
Haut Bas