viewing paste Unknown #22388 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/// Presents a list of pet eggs that can be hatched (ZC_PETEGG_LIST).
/// 01a6 <packet len>.W { <index>.W }*
void clif_sendegg(struct map_session_data *sd) {
        int i, n, fd;
 
        nullpo_retv(sd);
 
        fd = sd->fd;
        if (battle_config.pet_no_gvg && map_flag_gvg2(sd->bl.m)) { //Disable pet hatching in GvG grounds during Guild Wars [Skotlex]
                clif->message(fd, msg_sd(sd, 866)); // "Pets are not allowed in Guild Wars."
                return;
        }
 
        WFIFOHEAD(fd, MAX_INVENTORY * 2 + 4);
        WFIFOW(fd,0) = 0x1a6;
        for (i = n = 0; i < MAX_INVENTORY; i++) {
                if (sd->status.inventory[i].nameid <= 0 || sd->inventory_data[i] == NULL || sd->inventory_data[i]->type!=IT_PETEGG || sd->status.inventory[i].amount <= 0)
                        continue;
                WFIFOW(fd, n * 2 + 4) = i + 2;
                n++;
        }
 
        if (!n) return;
 
        WFIFOW(fd, 2) = 4 + n * 2;
        WFIFOSET(fd, WFIFOW(fd, 2));
 
        sd->menuskill_id = SA_TAMINGMONSTER;
        sd->menuskill_val = -1;
}
Viewed 537 times, submitted by unknown.