summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2017-12-09 01:13:36 +0000
committerAsheraf <acheraf1998@gmail.com>2017-12-11 13:54:19 +0000
commitea8dbdb04470859abe00eabc39990ee23adb398e (patch)
tree67ba090542d323a54e34bb02e344b64e486daffb /src/map/clif.c
parent85b71be7fd1134de6b45f9510006b84dc39975ac (diff)
downloadhercules-ea8dbdb04470859abe00eabc39990ee23adb398e.tar.gz
hercules-ea8dbdb04470859abe00eabc39990ee23adb398e.tar.bz2
hercules-ea8dbdb04470859abe00eabc39990ee23adb398e.tar.xz
hercules-ea8dbdb04470859abe00eabc39990ee23adb398e.zip
Add support for packet ZC_PROGRESS_ACTOR
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 5f7cf3b5d..14a8a22b6 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9914,7 +9914,6 @@ void clif_parse_Hotkey(int fd, struct map_session_data *sd) {
/// Displays cast-like progress bar (ZC_PROGRESS).
/// 02f0 <color>.L <time>.L
-/* TODO ZC_PROGRESS_ACTOR <account_id>.L */
void clif_progressbar(struct map_session_data * sd, unsigned int color, unsigned int second)
{
int fd;
@@ -9943,6 +9942,30 @@ void clif_progressbar_abort(struct map_session_data * sd)
WFIFOSET(fd,packet_len(0x2f2));
}
+/**
+* Displays cast-like progress bar on a unit.
+* 09d1 <id>.L <color>.L <time>.L
+*
+* @param bl Source block list.
+* @param color Message color (RGB format: 0xRRGGBB).
+* @param time Time in seconds.
+*/
+void clif_progressbar_unit(struct block_list *bl, uint32 color, uint32 time)
+{
+#if PACKETVER >= 20130821
+ struct ZC_PROGRESS_ACTOR p;
+ nullpo_retv(bl);
+
+ p.PacketType = progressbarunit;
+ p.GID = bl->id;
+ p.color = color;
+ p.time = time;
+ clif->send(&p, sizeof(p), bl, AREA);
+#else
+ ShowWarning("clif_progressbar_unit: Using progressbar with units available for PACKETVER >= 20130821 only.");
+#endif
+}
+
void clif_parse_progressbar(int fd, struct map_session_data * sd) __attribute__((nonnull (2)));
/// Notification from the client, that the progress bar has reached 100% (CZ_PROGRESS).
/// 02f1
@@ -20365,6 +20388,7 @@ void clif_defaults(void) {
clif->font = clif_font;
clif->progressbar = clif_progressbar;
clif->progressbar_abort = clif_progressbar_abort;
+ clif->progressbar_unit = clif_progressbar_unit;
clif->showdigit = clif_showdigit;
clif->elementalconverter_list = clif_elementalconverter_list;
clif->spellbook_list = clif_spellbook_list;