summaryrefslogtreecommitdiff
path: root/src/emap/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-05 19:28:15 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-05 19:28:15 +0300
commit3c0f83c3da4c57587baba441a2eece59b1b7c1e1 (patch)
tree7ede2b7dcec3164585c1523f485da519bb18f02a /src/emap/clif.c
parentf5c9f9f42da5889d38104e8b44956a7da461393d (diff)
downloadevol-hercules-3c0f83c3da4c57587baba441a2eece59b1b7c1e1.tar.gz
evol-hercules-3c0f83c3da4c57587baba441a2eece59b1b7c1e1.tar.bz2
evol-hercules-3c0f83c3da4c57587baba441a2eece59b1b7c1e1.tar.xz
evol-hercules-3c0f83c3da4c57587baba441a2eece59b1b7c1e1.zip
Reimpliment packet 0x90f for old clients.
Diffstat (limited to 'src/emap/clif.c')
-rw-r--r--src/emap/clif.c81
1 files changed, 77 insertions, 4 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c
index 8e81d80..023d3e9 100644
--- a/src/emap/clif.c
+++ b/src/emap/clif.c
@@ -352,7 +352,7 @@ bool eclif_send(const void* buf __attribute__ ((unused)),
if (*len >= 2)
{
const int packet = RBUFW (buf, 0);
- if (packet == 0x9dd)
+ if (packet == 0x9dd || packet == 0x9dc)
{
struct map_session_data *sd = BL_CAST(BL_PC, bl);
struct SessionExt *data = session_get_bysd(sd);
@@ -364,7 +364,7 @@ bool eclif_send(const void* buf __attribute__ ((unused)),
return true;
}
}
- if (packet == 0x915)
+ if (packet == 0x915 || packet == 0x90f)
{
struct map_session_data *sd = BL_CAST(BL_PC, bl);
struct SessionExt *data = session_get_bysd(sd);
@@ -509,7 +509,7 @@ int eclif_send_actual(int *fd, void *buf, int *len)
return 0;
}
}
- if (packet == 0x9dd)
+ if (packet == 0x9dd || packet == 0x9dc)
{
struct SessionExt *data = session_get(*fd);
if (!data)
@@ -520,7 +520,7 @@ int eclif_send_actual(int *fd, void *buf, int *len)
return 0;
}
}
- if (packet == 0x915)
+ if (packet == 0x915 || packet == 0x90f)
{
struct SessionExt *data = session_get(*fd);
if (!data)
@@ -672,6 +672,74 @@ void eclif_set_unit_idle_old(struct block_list* bl,
}
+void eclif_spawn_unit_old(struct block_list* bl, 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_spawn_unit_old p;
+ int g_id = status->get_guild_id(bl);
+
+ nullpo_retv(bl);
+
+ sd = BL_CAST(BL_PC, bl);
+
+ p.PacketType = 0x90f;
+ p.PacketLength = sizeof(p);
+ p.objecttype = clif_bl_type_old(bl);
+// p.AID = bl->id;
+// p.GID = (sd) ? sd->status.char_id : 0; // CCODE
+ p.GID = bl->id;
+ p.speed = status->get_speed(bl);
+ p.bodyState = (sc) ? sc->opt1 : 0;
+ p.healthState = (sc) ? sc->opt2 : 0;
+ p.effectState = (sc) ? sc->option : bl->type == BL_NPC ? ((TBL_NPC*)bl)->option : 0;
+ p.job = vd->class_;
+ p.head = vd->hair_style;
+ p.weapon = vd->weapon;
+ p.accessory = vd->head_bottom;
+ 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?
+ p.accessory = status->get_emblem_id(bl);
+ p.accessory2 = GetWord(g_id, 1);
+ p.accessory3 = GetWord(g_id, 0);
+ }
+ p.headpalette = vd->hair_color;
+ p.bodypalette = vd->cloth_color;
+ p.headDir = (sd)? sd->head_dir : 0;
+ p.robe = vd->robe;
+ 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;
+ WBUFPOS(&p.PosDir[0],0,bl->x,bl->y,unit->getdir(bl));
+ p.xSize = p.ySize = (sd) ? 5 : 0;
+ p.clevel = clif_setlevel(bl);
+ p.font = (sd) ? sd->status.font : 0;
+ if (battle->bc->show_monster_hp_bar && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl)) {
+ p.maxHP = status_get_max_hp(bl);
+ p.HP = status_get_hp(bl);
+ p.isBoss = ( ((TBL_MOB*)bl)->spawn && ((TBL_MOB*)bl)->spawn->state.boss ) ? 1 : 0;
+ } else {
+ p.maxHP = -1;
+ p.HP = -1;
+ p.isBoss = 0;
+ }
+ if( disguised(bl) ) {
+ nullpo_retv(sd);
+ if( sd->status.class_ != sd->disguise )
+ clif->send(&p,sizeof(p),bl,target);
+ p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.GID = -bl->id;
+ clif->send(&p,sizeof(p),bl,SELF);
+ } else
+ clif->send(&p,sizeof(p),bl,target);
+
+}
+
void eclif_set_unit_idle_post(struct block_list* bl, TBL_PC *tsd,
enum send_target *target)
{
@@ -708,6 +776,11 @@ void eclif_move(struct unit_data *ud)
send_advmoving(ud, false, ud->bl, AREA_WOS);
}
+void eclif_spawn_unit_pre(struct block_list* bl, enum send_target *target)
+{
+ eclif_spawn_unit_old(bl, *target);
+}
+
bool tempChangeMap;
void eclif_parse_LoadEndAck_pre(int *fdPtr __attribute__ ((unused)),