summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c188
1 files changed, 113 insertions, 75 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 424d94205..6897c357a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -276,7 +276,7 @@ unsigned char clif_bl_type(struct block_list *bl)
vd = status->get_viewdata(bl);
nullpo_retr(CLUT_NPC, vd);
- if (clif->isdisguised(bl) && !pc->db_checkid(vd->class_))
+ if (clif->isdisguised(bl) && !pc->db_checkid(vd->class))
return CLUT_NPC;
return CLUT_PC;
case BL_ITEM:
@@ -288,15 +288,15 @@ unsigned char clif_bl_type(struct block_list *bl)
case BL_MOB:
vd = status->get_viewdata(bl);
nullpo_retr(CLUT_NPC, vd);
- return pc->db_checkid(vd->class_) ? CLUT_PC : CLUT_MOB;
+ return pc->db_checkid(vd->class) ? CLUT_PC : CLUT_MOB;
case BL_NPC:
vd = status->get_viewdata(bl);
nullpo_retr(CLUT_NPC, vd);
- return pc->db_checkid(vd->class_) ? CLUT_PC : CLUT_EVENT;
+ return pc->db_checkid(vd->class) ? CLUT_PC : CLUT_EVENT;
case BL_PET:
vd = status->get_viewdata(bl);
nullpo_retr(CLUT_NPC, vd);
- return pc->db_checkid(vd->class_) ? CLUT_PC : CLUT_PET;
+ return pc->db_checkid(vd->class) ? CLUT_PC : CLUT_PET;
case BL_HOM:
return CLUT_HOMNUCLUS;
case BL_MER:
@@ -451,8 +451,8 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
break;
case AREA_CHAT_WOC:
nullpo_retr(true, bl);
- map->foreachinarea(clif->send_sub, bl->m, bl->x-(AREA_SIZE-5), bl->y-(AREA_SIZE-5),
- bl->x+(AREA_SIZE-5), bl->y+(AREA_SIZE-5), BL_PC, buf, len, bl, AREA_WOC);
+ map->foreachinarea(clif->send_sub, bl->m, bl->x-CHAT_AREA_SIZE, bl->y-CHAT_AREA_SIZE,
+ bl->x+CHAT_AREA_SIZE, bl->y+CHAT_AREA_SIZE, BL_PC, buf, len, bl, AREA_WOC);
break;
case CHAT:
@@ -961,14 +961,15 @@ void clif_set_unit_idle2(struct block_list* bl, struct map_session_data *tsd, en
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.job = vd->class;
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
p.shield = vd->shield;
p.accessory2 = vd->head_top;
p.accessory3 = vd->head_mid;
- if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
+ // The hell, why flags work like this?
p.shield = status->get_emblem_id(bl);
p.accessory2 = GetWord(g_id, 1);
p.accessory3 = GetWord(g_id, 0);
@@ -1005,7 +1006,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
nullpo_retv(bl);
#if PACKETVER < 20091103
- if( !pc->db_checkid(vd->class_) ) {
+ if (!pc->db_checkid(vd->class)) {
clif->set_unit_idle2(bl,tsd,target);
return;
}
@@ -1028,7 +1029,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
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.job = vd->class;
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
@@ -1037,7 +1038,8 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
#endif
p.accessory2 = vd->head_top;
p.accessory3 = vd->head_mid;
- if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
+ // The hell, why flags work like this?
p.accessory = status->get_emblem_id(bl);
p.accessory2 = GetWord(g_id, 1);
p.accessory3 = GetWord(g_id, 0);
@@ -1075,15 +1077,21 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
-
clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target);
if (clif->isdisguised(bl)) {
#if PACKETVER >= 20091103
- p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1115,11 +1123,12 @@ void clif_spawn_unit2(struct block_list* bl, enum send_target target) {
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
- p.job = vd->class_;
+ p.job = vd->class;
p.shield = vd->shield;
p.accessory2 = vd->head_top;
p.accessory3 = vd->head_mid;
- if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
+ // The hell, why flags work like this?
p.shield = status->get_emblem_id(bl);
p.accessory2 = GetWord(g_id, 1);
p.accessory3 = GetWord(g_id, 0);
@@ -1147,7 +1156,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
nullpo_retv(bl);
#if PACKETVER < 20091103
- if( !pc->db_checkid(vd->class_) ) {
+ if (!pc->db_checkid(vd->class)) {
clif->spawn_unit2(bl,target);
return;
}
@@ -1170,7 +1179,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
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.job = vd->class;
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
@@ -1179,7 +1188,8 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
#endif
p.accessory2 = vd->head_top;
p.accessory3 = vd->head_mid;
- if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
+ // The hell, why flags work like this?
p.accessory = status->get_emblem_id(bl);
p.accessory2 = GetWord(g_id, 1);
p.accessory3 = GetWord(g_id, 0);
@@ -1216,15 +1226,22 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
if (clif->isdisguised(bl)) {
nullpo_retv(sd);
- if( sd->status.class_ != sd->disguise )
+ if (sd->status.class != sd->disguise)
clif->send(&p,sizeof(p),bl,target);
#if PACKETVER >= 20091103
- p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1258,7 +1275,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
#endif
#if PACKETVER >= 20131223
p.AID = bl->id;
- p.GID = (tsd) ? tsd->status.char_id : 0; // CCODE
+ p.GID = (sd) ? sd->status.char_id : 0; // CCODE
#else
p.GID = bl->id;
#endif
@@ -1266,7 +1283,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
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.job = vd->class;
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
@@ -1308,6 +1325,9 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
@@ -1315,8 +1335,12 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
if (clif->isdisguised(bl)) {
#if PACKETVER >= 20091103
- p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1328,7 +1352,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
/// 01b0 <id>.L <type>.B <value>.L
/// type:
/// unused
-void clif_class_change(struct block_list *bl, int class_, int type)
+void clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd)
{
nullpo_retv(bl);
@@ -1339,7 +1363,11 @@ void clif_class_change(struct block_list *bl, int class_, int type)
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=type;
WBUFL(buf,7)=class_;
- clif->send(buf,packet_len(0x1b0),bl,AREA);
+
+ if (sd == NULL)
+ clif->send(buf, packet_len(0x1b0), bl, AREA);
+ else
+ clif->send(buf, packet_len(0x1b0), &sd->bl, SELF);
}
}
@@ -1360,7 +1388,7 @@ void clif_spiritball_single(int fd, struct map_session_data *sd) {
*------------------------------------------*/
void clif_charm_single(int fd, struct map_session_data *sd)
{
-#if PACKETVER >= 20120410
+#if PACKETVER >= 20110809
nullpo_retv(sd);
WFIFOHEAD(fd, packet_len(0x08cf));
WFIFOW(fd,0) = 0x08cf;
@@ -1427,7 +1455,7 @@ bool clif_spawn(struct block_list *bl)
if( !vd )
return false;
- if (vd->class_ == INVISIBLE_CLASS)
+ if (vd->class == INVISIBLE_CLASS)
return true; // Doesn't need to be spawned, so everything is alright
if (bl->type == BL_NPC) {
@@ -1774,7 +1802,7 @@ void clif_move(struct unit_data *ud)
bl = ud->bl;
nullpo_retv(bl);
vd = status->get_viewdata(bl);
- if (!vd || vd->class_ == INVISIBLE_CLASS)
+ if (vd == NULL || vd->class == INVISIBLE_CLASS)
return; //This performance check is needed to keep GM-hidden objects from being notified to bots.
if (bl->type == BL_NPC) {
@@ -4231,7 +4259,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
nullpo_retv(bl);
vd = status->get_viewdata(bl);
- if (!vd || vd->class_ == INVISIBLE_CLASS)
+ if (vd == NULL || vd->class == INVISIBLE_CLASS)
return;
if (bl->type == BL_NPC) {
@@ -4691,7 +4719,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
nullpo_ret(bl);
switch(bl->type){
case BL_PC:
- if (sd->vd.class_ != INVISIBLE_CLASS)
+ if (sd->vd.class != INVISIBLE_CLASS)
clif->clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
if (sd->chat_id != 0) {
struct chat_data *cd = map->id2cd(sd->chat_id);
@@ -4714,7 +4742,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
clif->clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
break;
default:
- if ((vd=status->get_viewdata(bl)) && vd->class_ != INVISIBLE_CLASS)
+ if ((vd=status->get_viewdata(bl)) && vd->class != INVISIBLE_CLASS)
clif->clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
break;
}
@@ -4723,7 +4751,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
nullpo_ret(tbl);
if (tbl->type == BL_SKILL) //Trap knocked out of sight
clif->clearchar_skillunit(BL_UCAST(BL_SKILL, tbl), sd->fd);
- else if ((vd = status->get_viewdata(tbl)) && vd->class_ != INVISIBLE_CLASS
+ else if ((vd = status->get_viewdata(tbl)) != NULL && vd->class != INVISIBLE_CLASS
&& !(tbl->type == BL_NPC && (BL_UCAST(BL_NPC, tbl)->option&OPTION_INVISIBLE)))
clif->clearunit_single(tbl->id,CLR_OUTSIGHT,sd->fd);
}
@@ -4799,7 +4827,7 @@ void clif_skillinfoblock(struct map_session_data *sd)
}
safestrncpy(WFIFOP(fd,len+12), skill->get_name(id), NAME_LENGTH);
if(sd->status.skill[i].flag == SKILL_FLAG_PERMANENT)
- WFIFOB(fd,len+36) = (sd->status.skill[i].lv < skill->tree_get_max(id, sd->status.class_))? 1:0;
+ WFIFOB(fd,len+36) = (sd->status.skill[i].lv < skill->tree_get_max(id, sd->status.class))? 1:0;
else
WFIFOB(fd,len+36) = 0;
len += 37;
@@ -4850,7 +4878,7 @@ void clif_addskill(struct map_session_data *sd, int id)
}
safestrncpy(WFIFOP(fd,14), skill->get_name(id), NAME_LENGTH);
if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT)
- WFIFOB(fd,38) = (skill_lv < skill->tree_get_max(id, sd->status.class_))? 1:0;
+ WFIFOB(fd,38) = (skill_lv < skill->tree_get_max(id, sd->status.class))? 1:0;
else
WFIFOB(fd,38) = 0;
WFIFOSET(fd,packet_len(0x111));
@@ -4895,7 +4923,7 @@ void clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill_lv, in
WFIFOW(fd, 6) = skill->get_sp(skill_id, skill_lv);
WFIFOW(fd, 8) = (flag)?skill->get_range2(&sd->bl, skill_id, skill_lv) : skill->get_range(skill_id, skill_lv);
if( flag )
- WFIFOB(fd,10) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class_)) ? 1 : 0;
+ WFIFOB(fd,10) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class)) ? 1 : 0;
else
WFIFOB(fd,10) = 1;
@@ -4928,7 +4956,7 @@ void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf)
WFIFOW(fd,12) = 0;
}
if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT)
- WFIFOB(fd,14) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class_))? 1:0;
+ WFIFOB(fd,14) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class))? 1:0;
else
WFIFOB(fd,14) = 0;
WFIFOSET(fd,packet_len(0x7e1));
@@ -6418,12 +6446,12 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven
}
WFIFOSET(fd,WFIFOW(fd,2));
-#if PACKETVER >= 20141022
+#if PACKETVER >= 20140625
/** should go elsewhere perhaps? it has to be bundled with this however. **/
- WFIFOHEAD(fd, 3);
+ WFIFOHEAD(fd, packet_len(0xa28));
WFIFOW(fd, 0) = 0xa28;
WFIFOB(fd, 2) = 0;/** 1 is failure. our current responses to failure are working so not yet implemented **/
- WFIFOSET(fd, 3);
+ WFIFOSET(fd, packet_len(0xa28));
#endif
}
@@ -7482,7 +7510,7 @@ void clif_guild_memberlist(struct map_session_data *sd)
WFIFOW(fd,c*104+12)=m->hair;
WFIFOW(fd,c*104+14)=m->hair_color;
WFIFOW(fd,c*104+16)=m->gender;
- WFIFOW(fd,c*104+18)=m->class_;
+ WFIFOW(fd,c*104+18)=m->class;
WFIFOW(fd,c*104+20)=m->lv;
WFIFOL(fd,c*104+22)=(int)cap_value(m->exp,0,INT32_MAX);
WFIFOL(fd,c*104+26)=m->online;
@@ -8913,7 +8941,7 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
safestrncpy(viewequip_list.characterName, tsd->status.name, NAME_LENGTH);
- viewequip_list.job = tsd->status.class_;
+ viewequip_list.job = tsd->status.class;
viewequip_list.head = tsd->vd.hair_style;
viewequip_list.accessory = tsd->vd.head_bottom;
viewequip_list.accessory2 = tsd->vd.head_mid;
@@ -9628,7 +9656,7 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) {
struct questinfo *qi = &map->list[sd->bl.m].qi_data[i];
if( quest->check(sd, qi->quest_id, HAVEQUEST) == -1 ) {// Check if quest is not started
if( qi->hasJob ) { // Check if quest is job-specific, check is user is said job class.
- if( sd->class_ == qi->job )
+ if (sd->status.class == qi->job)
clif->quest_show_event(sd, &qi->nd->bl, qi->icon, qi->color);
} else {
clif->quest_show_event(sd, &qi->nd->bl, qi->icon, qi->color);
@@ -9870,7 +9898,7 @@ int clif_undisguise_timer(int tid, int64 tick, int id, intptr_t data) {
struct map_session_data * sd;
if( (sd = map->id2sd(id)) ) {
sd->fontcolor_tid = INVALID_TIMER;
- if( sd->fontcolor && sd->disguise == sd->status.class_ )
+ if (sd->fontcolor && sd->disguise == sd->status.class)
pc->disguise(sd,-1);
}
return 0;
@@ -9921,12 +9949,12 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd)
if (sd->disguise == -1) {
sd->fontcolor_tid = timer->add(timer->gettick()+5000, clif->undisguise_timer, sd->bl.id, 0);
- pc->disguise(sd,sd->status.class_);
+ pc->disguise(sd,sd->status.class);
if (pc_isdead(sd))
clif->clearunit_single(-sd->bl.id, CLR_DEAD, sd->fd);
if (unit->is_walking(&sd->bl))
clif->move(&sd->ud);
- } else if (sd->disguise == sd->status.class_ && sd->fontcolor_tid != INVALID_TIMER) {
+ } else if (sd->disguise == sd->status.class && sd->fontcolor_tid != INVALID_TIMER) {
const struct TimerData *td;
if ((td = timer->get(sd->fontcolor_tid)) != NULL)
timer->settick(sd->fontcolor_tid, td->tick+5000);
@@ -12568,7 +12596,7 @@ void clif_PartyBookingVolunteerInfo(int index, struct map_session_data *sd)
nullpo_retv(sd);
WBUFW(buf, 0) = 0x8f2;
WBUFL(buf, 2) = sd->status.account_id;
- WBUFL(buf, 6) = sd->status.class_;
+ WBUFL(buf, 6) = sd->status.class;
WBUFW(buf, 10) = sd->status.base_level;
memcpy(WBUFP(buf, 12), sd->status.name, NAME_LENGTH);
@@ -13824,7 +13852,7 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd)
{
if (sd->state.doridori) return;
- switch (sd->class_&MAPID_UPPERMASK) {
+ switch (sd->job & MAPID_UPPERMASK) {
case MAPID_SOUL_LINKER:
case MAPID_STAR_GLADIATOR:
case MAPID_TAEKWON:
@@ -13852,7 +13880,7 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
/* game client is currently broken on this (not sure the packetver range) */
/* it sends the request when the criteria doesn't match (and of course we let it fail) */
/* so restoring the old parse_globalmes method. */
- if( ( sd->class_&MAPID_UPPERMASK ) == MAPID_SUPER_NOVICE ) {
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) {
unsigned int next = pc->nextbaseexp(sd);
if( next == 0 ) next = pc->thisbaseexp(sd);
if( next ) {
@@ -14220,28 +14248,22 @@ void clif_ranklist(struct map_session_data *sd, enum fame_list_type type)
{
#if PACKETVER >= 20120502
int fd;
- int mypoint = 0;
- int upperMask;
+ int len = packet_len(0x97d);
nullpo_retv(sd);
fd = sd->fd;
- upperMask = sd->class_&MAPID_UPPERMASK;
- WFIFOHEAD(fd, 288);
+ WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x97d;
WFIFOW(fd, 2) = type;
clif_ranklist_sub(WFIFOP(fd,4), type);
- if( (upperMask == MAPID_BLACKSMITH && type == RANKTYPE_BLACKSMITH)
- || (upperMask == MAPID_ALCHEMIST && type == RANKTYPE_ALCHEMIST)
- || (upperMask == MAPID_TAEKWON && type == RANKTYPE_TAEKWON)
- ) {
- mypoint = sd->status.fame;
+ if (pc->famelist_type(sd->job) == type) {
+ WFIFOL(fd, 284) = sd->status.fame; //mypoint
} else {
- mypoint = 0;
+ WFIFOL(fd, 284) = 0; //mypoint
}
- WFIFOL(fd, 284) = mypoint; //mypoint
- WFIFOSET(fd, 288);
+ WFIFOSET(fd, len);
#endif
}
@@ -14262,8 +14284,9 @@ void clif_parse_ranklist(int fd, struct map_session_data *sd) {
}
// 097e <RankingType>.W <point>.L <TotalPoint>.L (ZC_UPDATE_RANKING_POINT)
-void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type type, int points) {
-#if PACKETVER < 20130710
+void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type type, int points)
+{
+#if PACKETVER < 20120502
switch( type ) {
case RANKTYPE_BLACKSMITH: clif->fame_blacksmith(sd,points); break;
case RANKTYPE_ALCHEMIST: clif->fame_alchemist(sd,points); break;
@@ -14272,15 +14295,16 @@ void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type t
#else
int fd;
+ int len = packet_len(0x97e);
nullpo_retv(sd);
fd = sd->fd;
- WFIFOHEAD(fd, 12);
+ WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x97e;
WFIFOW(fd, 2) = type;
WFIFOL(fd, 4) = points;
WFIFOL(fd, 8) = sd->status.fame;
- WFIFOSET(fd, 12);
+ WFIFOSET(fd, len);
#endif
}
@@ -16248,7 +16272,7 @@ void clif_bg_xy(struct map_session_data *sd)
WBUFW(buf,0)=0x2df;
WBUFL(buf,2)=sd->status.account_id;
memcpy(WBUFP(buf,6), sd->status.name, NAME_LENGTH);
- WBUFW(buf,30)=sd->status.class_;
+ WBUFW(buf,30)=sd->status.class;
WBUFW(buf,32)=sd->bl.x;
WBUFW(buf,34)=sd->bl.y;
@@ -17494,7 +17518,7 @@ void clif_parse_SkillSelectMenu(int fd, struct map_session_data *sd) {
*------------------------------------------*/
void clif_charm(struct map_session_data *sd)
{
-#if PACKETVER >= 20120410
+#if PACKETVER >= 20110809
unsigned char buf[10];
nullpo_retv(sd);
@@ -17620,7 +17644,7 @@ void clif_favorite_item(struct map_session_data* sd, unsigned short index) {
}
void clif_snap( struct block_list *bl, short x, short y ) {
-#if PACKETVER >= 20111005
+#if PACKETVER >= 20110809
unsigned char buf[10];
nullpo_retv(bl);
@@ -17675,7 +17699,9 @@ void clif_parse_CashShopClose(int fd, struct map_session_data *sd) {
}
void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) {
+void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd)
+{
+#if PACKETVER >= 20110614
int i, j = 0;
for( i = 0; i < CASHSHOP_TAB_MAX; i++ ) {
@@ -17695,6 +17721,7 @@ void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) {
WFIFOSET(fd, 8 + ( clif->cs.item_count[i] * 6 ));
}
+#endif
}
void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -17788,7 +17815,9 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/* [Ind/Hercules] */
-void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) {
+void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd)
+{
+#if PACKETVER >= 20110222
short tab = RFIFOW(fd, 2);
int j;
@@ -17807,9 +17836,12 @@ void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) {
}
WFIFOSET(fd, 10 + ( clif->cs.item_count[tab] * 6 ));
+#endif
}
+
/* [Ind/Hercules] */
-void clif_maptypeproperty2(struct block_list *bl,enum send_target t) {
+void clif_maptypeproperty2(struct block_list *bl,enum send_target t)
+{
#if PACKETVER >= 20121010
struct packet_maptypeproperty2 p;
struct map_session_data *sd = NULL;
@@ -17862,6 +17894,7 @@ void clif_partytickack(struct map_session_data* sd, bool flag) {
void clif_ShowScript(struct block_list *bl, const char *message)
{
+#if PACKETVER >= 20110111
char buf[256];
int len;
nullpo_retv(bl);
@@ -17881,6 +17914,7 @@ void clif_ShowScript(struct block_list *bl, const char *message)
WBUFL(buf,4) = bl->id;
safestrncpy(WBUFP(buf,8),message,len);
clif->send(buf,WBUFW(buf,2),bl,AREA);
+#endif
}
void clif_status_change_end(struct block_list *bl, int tid, enum send_target target, int type) {
@@ -18037,14 +18071,17 @@ void clif_bgqueue_battlebegins(struct map_session_data *sd, unsigned char arena_
clif->send(&p,sizeof(p), &sd->bl, target);
}
-void clif_scriptclear(struct map_session_data *sd, int npcid) {
+void clif_scriptclear(struct map_session_data *sd, int npcid)
+{
+#if PACKETVER >= 20110928
struct packet_script_clear p;
nullpo_retv(sd);
p.PacketType = script_clearType;
p.NpcID = npcid;
- clif->send(&p,sizeof(p), &sd->bl, SELF);
+ clif->send(&p, sizeof(p), &sd->bl, SELF);
+#endif
}
/* Made Possible Thanks to Yommy! */
@@ -18953,13 +18990,14 @@ void clif_selectcart(struct map_session_data *sd)
/// Starts navigation to the given target on client side
void clif_navigate_to(struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id)
{
-#if PACKETVER >= 20111010
+// probably this packet with other fields present in older packet versions
+#if PACKETVER >= 20120307
int fd;
nullpo_retv(sd);
nullpo_retv(mapname);
fd = sd->fd;
- WFIFOHEAD(fd, 27);
+ WFIFOHEAD(fd, packet_len(0x8e2));
WFIFOW(fd, 0) = 0x8e2;
// How detailed will our navigation be?
@@ -18987,7 +19025,7 @@ void clif_navigate_to(struct map_session_data *sd, const char* mapname, uint16 x
WFIFOW(fd, 23) = y;
// Target monster ID
WFIFOW(fd, 25) = mob_id;
- WFIFOSET(fd, 27);
+ WFIFOSET(fd, packet_len(0x8e2));
#endif
}