Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==========================================
- * Prepares 'unit walking' packet
- *------------------------------------------*/
- void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, struct unit_data* ud, enum send_target target) {
- struct map_session_data* sd;
- struct status_change* sc = status->get_sc(bl);
- struct view_data* vd = status->get_viewdata(bl);
- struct packet_unit_walking p;
- int g_id = status->get_guild_id(bl);
- nullpo_retv(bl);
- nullpo_retv(ud);
- sd = BL_CAST(BL_PC, bl);
- p.PacketType = unit_walkingType;
- #if PACKETVER >= 20091103
- p.PacketLength = sizeof(p);
- #endif
- #if PACKETVER >= 20071106
- p.objecttype = clif_bl_type(bl);
- #endif
- #if PACKETVER >= 20131223
- p.AID = bl->id;
- p.GID = (tsd) ? tsd->status.char_id : 0; // CCODE
- #else
- p.GID = bl->id;
- #endif
- p.speed = status->get_speed(bl);
- p.bodyState = (sc) ? sc->opt1 : 0;
- p.healthState = (sc) ? sc->opt2 : 0;
- p.effectState = (sc != NULL) ? sc->option : ((bl->type == BL_NPC) ? BL_UCCAST(BL_NPC, bl)->option : 0);
- p.job = vd->class_;
- p.head = vd->hair_style;
- p.weapon = vd->weapon;
- p.accessory = vd->head_bottom;
- p.moveStartTime = (unsigned int)timer->gettick();
- #if PACKETVER < 7
- p.shield = vd->shield;
- #endif
- p.accessory2 = vd->head_top;
- p.accessory3 = vd->head_mid;
- p.headpalette = vd->hair_color;
- p.bodypalette = vd->cloth_color;
- p.headDir = (sd)? sd->head_dir : 0;
- #if PACKETVER >= 20101124
- p.robe = vd->robe;
- #endif
- p.GUID = g_id;
- p.GEmblemVer = status->get_emblem_id(bl);
- p.honor = (sd) ? sd->status.manner : 0;
- p.virtue = (sc) ? sc->opt3 : 0;
- p.isPKModeON = (sd && sd->status.karma) ? 1 : 0;
- p.sex = vd->sex;
- WBUFPOS2(&p.MoveData[0],0,bl->x,bl->y,ud->to_x,ud->to_y,8,8);
- p.xSize = p.ySize = (sd) ? 5 : 0;
- p.clevel = clif_setlevel(bl);
- #if PACKETVER >= 20080102
- p.font = (sd) ? sd->status.font : 0;
- #endif
- #if PACKETVER >= 20120221
- if (battle_config.show_monster_hp_bar && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl)) {
- const struct mob_data *md = BL_UCCAST(BL_MOB, bl);
- p.maxHP = status_get_max_hp(bl);
- p.HP = status_get_hp(bl);
- p.isBoss = (md->spawn != NULL && md->spawn->state.boss) ? 1 : 0;
- } else {
- p.maxHP = -1;
- p.HP = -1;
- p.isBoss = 0;
- }
- #endif
- #if PACKETVER >= 20150513
- p.body = vd->body_style;
- #endif
- clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target);
- if( disguised(bl) ) {
- #if PACKETVER >= 20091103
- p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
- p.GID = -bl->id;
- #else
- p.GID = -bl->id;
- #endif
- clif->send(&p,sizeof(p),bl,SELF);
- }
- }
- #if PACKETVER < 4
- unit_walkingType = 0x7b,
- #elif PACKETVER < 7
- unit_walkingType = 0x1da,
- #elif PACKETVER < 20080102
- unit_walkingType = 0x22c,
- #elif PACKETVER < 20091103
- unit_walkingType = 0x2ec,
- #elif PACKETVER < 20101124
- unit_walkingType = 0x7f7,
- #elif PACKETVER < 20120221
- unit_walkingType = 0x856,
- #elif PACKETVER < 20131223
- unit_walkingType = 0x914,
- #elif PACKETVER < 20150513
- unit_walkingType = 0x9db,
- #else
- unit_walkingType = 0x9fd,
Advertisement
Add Comment
Please, Sign In to add comment