|
@@ -1403,7 +1403,6 @@ int clif_spawn(struct block_list *bl)
|
|
{
|
|
{
|
|
unsigned char buf[128];
|
|
unsigned char buf[128];
|
|
struct view_data *vd;
|
|
struct view_data *vd;
|
|
- struct status_change *sc = status_get_sc(bl);
|
|
|
|
int len;
|
|
int len;
|
|
|
|
|
|
vd = status_get_viewdata(bl);
|
|
vd = status_get_viewdata(bl);
|
|
@@ -1431,7 +1430,7 @@ int clif_spawn(struct block_list *bl)
|
|
case BL_PC:
|
|
case BL_PC:
|
|
{
|
|
{
|
|
TBL_PC *sd = ((TBL_PC*)bl);
|
|
TBL_PC *sd = ((TBL_PC*)bl);
|
|
- int i;
|
|
|
|
|
|
+
|
|
if (sd->spiritball > 0)
|
|
if (sd->spiritball > 0)
|
|
clif_spiritball(&sd->bl);
|
|
clif_spiritball(&sd->bl);
|
|
if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
|
|
if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
|
|
@@ -1442,14 +1441,9 @@ int clif_spawn(struct block_list *bl)
|
|
clif_sendbgemblem_area(sd);
|
|
clif_sendbgemblem_area(sd);
|
|
if (sd->spiritcharm_type != CHARM_TYPE_NONE && sd->spiritcharm > 0)
|
|
if (sd->spiritcharm_type != CHARM_TYPE_NONE && sd->spiritcharm > 0)
|
|
clif_spiritcharm(sd);
|
|
clif_spiritcharm(sd);
|
|
- for (i = 0; i < sd->sc_display_count; i++) {
|
|
|
|
- if (sc && (sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE|OPTION_CHASEWALK)))
|
|
|
|
- clif_status_change2(&sd->bl,sd->bl.id,AREA,SI_BLANK,0,0,0);
|
|
|
|
- else
|
|
|
|
- clif_status_change2(&sd->bl,sd->bl.id,AREA,StatusIconChangeTable[sd->sc_display[i]->type],sd->sc_display[i]->val1,sd->sc_display[i]->val2,sd->sc_display[i]->val3);
|
|
|
|
- }
|
|
|
|
if (sd->status.robe)
|
|
if (sd->status.robe)
|
|
clif_refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);
|
|
clif_refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);
|
|
|
|
+ clif_efst_status_change_sub(sd, bl, AREA);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case BL_MOB:
|
|
case BL_MOB:
|
|
@@ -4493,12 +4487,6 @@ static void clif_getareachar_pc(struct map_session_data* sd,struct map_session_d
|
|
clif_spiritball_single(sd->fd, dstsd);
|
|
clif_spiritball_single(sd->fd, dstsd);
|
|
if (dstsd->spiritcharm_type != CHARM_TYPE_NONE && dstsd->spiritcharm > 0)
|
|
if (dstsd->spiritcharm_type != CHARM_TYPE_NONE && dstsd->spiritcharm > 0)
|
|
clif_spiritcharm_single(sd->fd, dstsd);
|
|
clif_spiritcharm_single(sd->fd, dstsd);
|
|
- for( i = 0; i < dstsd->sc_display_count; i++ ) {
|
|
|
|
- if (dstsd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE|OPTION_CHASEWALK))
|
|
|
|
- clif_status_change2(&sd->bl, dstsd->bl.id, SELF, SI_BLANK, 0, 0, 0);
|
|
|
|
- else
|
|
|
|
- clif_status_change2(&sd->bl, dstsd->bl.id, SELF, StatusIconChangeTable[dstsd->sc_display[i]->type], dstsd->sc_display[i]->val1, dstsd->sc_display[i]->val2, dstsd->sc_display[i]->val3);
|
|
|
|
- }
|
|
|
|
if( (sd->status.party_id && dstsd->status.party_id == sd->status.party_id) || //Party-mate, or hpdisp setting.
|
|
if( (sd->status.party_id && dstsd->status.party_id == sd->status.party_id) || //Party-mate, or hpdisp setting.
|
|
(sd->bg_id && sd->bg_id == dstsd->bg_id) || //BattleGround
|
|
(sd->bg_id && sd->bg_id == dstsd->bg_id) || //BattleGround
|
|
pc_has_permission(sd, PC_PERM_VIEW_HPMETER)
|
|
pc_has_permission(sd, PC_PERM_VIEW_HPMETER)
|
|
@@ -4549,6 +4537,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
|
|
case BL_PC:
|
|
case BL_PC:
|
|
{
|
|
{
|
|
TBL_PC* tsd = (TBL_PC*)bl;
|
|
TBL_PC* tsd = (TBL_PC*)bl;
|
|
|
|
+
|
|
clif_getareachar_pc(sd, tsd);
|
|
clif_getareachar_pc(sd, tsd);
|
|
if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris]
|
|
if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris]
|
|
clif_specialeffect_single(bl,423,sd->fd);
|
|
clif_specialeffect_single(bl,423,sd->fd);
|
|
@@ -4558,25 +4547,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
|
|
clif_sendbgemblem_single(sd->fd,tsd);
|
|
clif_sendbgemblem_single(sd->fd,tsd);
|
|
if ( tsd->status.robe )
|
|
if ( tsd->status.robe )
|
|
clif_refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF);
|
|
clif_refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF);
|
|
-
|
|
|
|
- if (!&tsd->sc)
|
|
|
|
- break;
|
|
|
|
- if( tsd->sc.data[SC_CAMOUFLAGE] )
|
|
|
|
- clif_status_load(bl,SI_CAMOUFLAGE,1);
|
|
|
|
- if( tsd->sc.data[SC_ACTIVE_MONSTER_TRANSFORM] ) // Overrides SC_MONSTER_TRANSFORM
|
|
|
|
- clif_status_change(bl,SI_MONSTER_TRANSFORM,1,0,tsd->sc.data[SC_ACTIVE_MONSTER_TRANSFORM]->val1,0,0);
|
|
|
|
- else if( tsd->sc.data[SC_MONSTER_TRANSFORM] )
|
|
|
|
- clif_status_change(bl,SI_MONSTER_TRANSFORM,1,0,tsd->sc.data[SC_MONSTER_TRANSFORM]->val1,0,0);
|
|
|
|
- if( tsd->sc.data[SC_MOONSTAR] )
|
|
|
|
- clif_status_load(bl,SI_MOONSTAR,1);
|
|
|
|
- if( tsd->sc.data[SC_SUPER_STAR] )
|
|
|
|
- clif_status_load(bl,SI_SUPER_STAR,1);
|
|
|
|
- if( tsd->sc.data[SC_DECORATION_OF_MUSIC] )
|
|
|
|
- clif_status_load(bl,SI_DECORATION_OF_MUSIC,1);
|
|
|
|
- if( tsd->sc.data[SC_STRANGELIGHTS] )
|
|
|
|
- clif_status_load(bl,SI_STRANGELIGHTS,1);
|
|
|
|
- if( tsd->sc.data[SC_ALL_RIDING] )
|
|
|
|
- clif_status_load(bl,SI_ALL_RIDING,1);
|
|
|
|
|
|
+ clif_efst_status_change_sub(sd, bl, SELF);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case BL_MER: // Devotion Effects
|
|
case BL_MER: // Devotion Effects
|
|
@@ -5904,32 +5875,71 @@ void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val
|
|
clif_send(buf,packet_len(WBUFW(buf,0)),bl, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
|
|
clif_send(buf,packet_len(WBUFW(buf,0)),bl, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Send any active EFST to those around.
|
|
|
|
+ * @param sd: Player to send the packet to
|
|
|
|
+ * @param bl: Objects walking into view
|
|
|
|
+ * @param target: Client send type
|
|
|
|
+ */
|
|
|
|
+void clif_efst_status_change_sub(struct map_session_data *sd, struct block_list *bl, enum send_target target) {
|
|
|
|
+ struct map_session_data *tsd = NULL;
|
|
|
|
+ unsigned char i;
|
|
|
|
|
|
-void clif_status_change2(struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3) {
|
|
|
|
- unsigned char buf[32];
|
|
|
|
|
|
+ nullpo_retv(sd);
|
|
|
|
+ nullpo_retv(bl);
|
|
|
|
|
|
- if (type == SI_BLANK) //It shows nothing on the client
|
|
|
|
- return;
|
|
|
|
|
|
+ if (target == SELF)
|
|
|
|
+ tsd = (TBL_PC *)bl;
|
|
|
|
+ else
|
|
|
|
+ tsd = sd;
|
|
|
|
|
|
- nullpo_retv(bl);
|
|
|
|
|
|
+ for (i = 0; i < tsd->sc_display_count; i++) {
|
|
|
|
+ enum sc_type type = tsd->sc_display[i]->type;
|
|
|
|
+ struct status_change *sc = status_get_sc(bl);
|
|
|
|
+ const struct TimerData *td = (sc && sc->data[type] ? get_timer(sc->data[type]->timer) : NULL);
|
|
|
|
+ int tick = 0;
|
|
|
|
|
|
- WBUFW(buf,0) = 0x43f;
|
|
|
|
- WBUFW(buf,2) = type;
|
|
|
|
- WBUFL(buf,4) = tid;
|
|
|
|
- WBUFB(buf,8) = 1;
|
|
|
|
- WBUFL(buf,9) = 9999;
|
|
|
|
- WBUFL(buf,13) = val1;
|
|
|
|
- WBUFL(buf,17) = val2;
|
|
|
|
- WBUFL(buf,21) = val3;
|
|
|
|
- clif_send(buf,packet_len(0x43f),bl,target);
|
|
|
|
|
|
+ if (td)
|
|
|
|
+ tick = DIFF_TICK(td->tick, gettick());
|
|
|
|
+ clif_efst_status_change((target == SELF) ? &sd->bl : bl, bl->id, target, StatusIconChangeTable[type], tick, tsd->sc_display[i]->val1, tsd->sc_display[i]->val2, tsd->sc_display[i]->val3);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-/// 08ff <id>.L <index>.W <remain msec>.L { <val>.L }*3 (ZC_EFST_SET_ENTER) (PACKETVER >= 20111108)
|
|
|
|
|
|
+/// Notifies the client when a player enters the screen with an active EFST.
|
|
|
|
+/// 08ff <id>.L <index>.W <remain msec>.L { <val>.L }*3 (ZC_EFST_SET_ENTER) (PACKETVER >= 20111108)
|
|
/// 0984 <id>.L <index>.W <total msec>.L <remain msec>.L { <val>.L }*3 (ZC_EFST_SET_ENTER2) (PACKETVER >= 20120618)
|
|
/// 0984 <id>.L <index>.W <total msec>.L <remain msec>.L { <val>.L }*3 (ZC_EFST_SET_ENTER2) (PACKETVER >= 20120618)
|
|
-//! TODO
|
|
|
|
-//void clif_efst_enter();
|
|
|
|
|
|
+void clif_efst_status_change(struct block_list *bl, int tid, enum send_target target, int type, int tick, int val1, int val2, int val3) {
|
|
|
|
+ unsigned char buf[32];
|
|
|
|
+#if PACKETVER >= 20120618
|
|
|
|
+ const int cmd = 0x984;
|
|
|
|
+#elif PACKETVER >= 20111108
|
|
|
|
+ const int cmd = 0x8ff;
|
|
|
|
+#endif
|
|
|
|
+ int offset = 0;
|
|
|
|
+
|
|
|
|
+ if (type == SI_BLANK)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ nullpo_retv(bl);
|
|
|
|
+
|
|
|
|
+ if (tick <= 0)
|
|
|
|
+ tick = 9999;
|
|
|
|
|
|
|
|
+ WBUFW(buf,offset + 0) = cmd;
|
|
|
|
+ WBUFL(buf,offset + 2) = tid;
|
|
|
|
+ WBUFW(buf,offset + 6) = type;
|
|
|
|
+#if PACKETVER >= 20111108
|
|
|
|
+ WBUFL(buf,offset + 8) = tick; // Set remaining status duration [exneval]
|
|
|
|
+#if PACKETVER >= 20120618
|
|
|
|
+ WBUFL(buf,offset + 12) = tick;
|
|
|
|
+ offset += 4;
|
|
|
|
+#endif
|
|
|
|
+ WBUFL(buf,offset + 12) = val1;
|
|
|
|
+ WBUFL(buf,offset + 16) = val2;
|
|
|
|
+ WBUFL(buf,offset + 20) = val3;
|
|
|
|
+#endif
|
|
|
|
+ clif_send(buf,packet_len(cmd),bl,target);
|
|
|
|
+}
|
|
|
|
|
|
/// Send message (modified by [Yor]) (ZC_NOTIFY_PLAYERCHAT).
|
|
/// Send message (modified by [Yor]) (ZC_NOTIFY_PLAYERCHAT).
|
|
/// 008e <packet len>.W <message>.?B
|
|
/// 008e <packet len>.W <message>.?B
|
|
@@ -19124,7 +19134,7 @@ void packetdb_readdb(bool reload)
|
|
0, 0, 0, 0, 0, 0, 0, 20, 34, 0, 0, 0, 0, 0, 0, 10,
|
|
0, 0, 0, 0, 0, 0, 0, 20, 34, 0, 0, 0, 0, 0, 0, 10,
|
|
9, 7, 10, 0, 0, 0, 6, 0, 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