Browse Source

* Added packet 0x1b1 (ZC_SHOWDIGIT).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14539 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 years ago
parent
commit
a313575e51
3 changed files with 20 additions and 0 deletions
  1. 1 0
      Changelog-Trunk.txt
  2. 17 0
      src/map/clif.c
  3. 2 0
      src/map/clif.h

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2010/12/01
+	* Added packet 0x1b1 (ZC_SHOWDIGIT). [Ai4rei]
 	* Confirmed packet 0x291 (ZC_MSG) to be general-purpose msgstringtable.txt packet and updated all functions using it (related r12245 and r13126). [Ai4rei]
 	* Fixed using main chat nick longer than 15 characters would cause a buffer overflow (bugreport:2671, since r5013). [Ai4rei]
 	* Fixed bAutoSpellOnSkill bonuses could not be chained (bugreport:4421, since r13596). [Ai4rei]

+ 17 - 0
src/map/clif.c

@@ -13960,6 +13960,23 @@ void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, b
     return;
 }
 
+/// Displays digital clock digits on top of the screen (ZC_SHOWDIGIT).
+/// type:
+///   0: Displays 'value' for 5 seconds.
+///   1: Incremental counter (1 tick/second), negated 'value' specifies start value (e.g. using -10 lets the counter start at 10).
+///   2: Decremental counter (1 tick/second), negated 'value' specifies start value (does not stop when reaching 0, but overflows).
+///   3: Decremental counter (2 ticks/second), 'value' specifies start value (stops when reaching 0, displays at most 2 digits).
+/// value:
+///   Except for type 3 it is interpreted as seconds for displaying as DD:HH:MM:SS, HH:MM:SS, MM:SS or SS (leftmost '00' is not displayed).
+void clif_showdigit(struct map_session_data* sd, unsigned char type, int value)
+{
+	WFIFOHEAD(sd->fd, packet_len(0x1b1));
+	WFIFOW(sd->fd,0) = 0x1b1;
+	WFIFOB(sd->fd,0) = type;
+	WFIFOL(sd->fd,0) = value;
+	WFIFOSET(sd->fd, packet_len(0x1b1));
+}
+
 /*==========================================
  * ƒpƒPƒbƒgƒfƒoƒbƒO
  *------------------------------------------*/

+ 2 - 0
src/map/clif.h

@@ -571,4 +571,6 @@ void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_boo
 void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index);
 void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
 
+void clif_showdigit(struct map_session_data* sd, unsigned char type, int value);
+
 #endif /* _CLIF_H_ */