summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-01-14 15:20:45 +0100
committerGitHub <noreply@github.com>2018-01-14 15:20:45 +0100
commitbe6b748363717519019cd606d2013868ae6d9378 (patch)
tree9e1214545aa69a7806cc7bc7a7f1a284d1e6b779 /src/map/clif.c
parent41c6f0bcfbad0de2c647dcc65af534c7f5e8fce3 (diff)
parentea8dbdb04470859abe00eabc39990ee23adb398e (diff)
downloadhercules-be6b748363717519019cd606d2013868ae6d9378.tar.gz
hercules-be6b748363717519019cd606d2013868ae6d9378.tar.bz2
hercules-be6b748363717519019cd606d2013868ae6d9378.tar.xz
hercules-be6b748363717519019cd606d2013868ae6d9378.zip
Merge pull request #1929 from Asheraf/progressbar
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 7edc1ec5a..3d125571d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9915,7 +9915,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;
@@ -9944,6 +9943,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
@@ -20367,6 +20390,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;