summaryrefslogtreecommitdiff
path: root/src/emap/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap/clif.c')
-rw-r--r--src/emap/clif.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c
index d0ab8bd..2faf394 100644
--- a/src/emap/clif.c
+++ b/src/emap/clif.c
@@ -1608,3 +1608,46 @@ void eclif_addskill_pre(struct map_session_data **sdPtr,
hookStop();
}
+
+void eclif_skillinfo_pre(struct map_session_data **sdPtr,
+ int *skill_idPtr,
+ int *infPtr)
+{
+ struct map_session_data *sd = *sdPtr;
+ nullpo_retv(sd);
+
+ struct SessionExt *data = session_get_bysd(sd);
+ if (!data)
+ return;
+ if (data->clientVersion < 18)
+ return;
+
+ int skill_id = *skill_idPtr;
+ int idx = skill->get_index(skill_id);
+ Assert_retv(idx >= 0 && idx < MAX_SKILL);
+ int inf = *infPtr;
+
+ const int fd = sd->fd;
+ int skill_lv = sd->status.skill[idx].lv;
+
+ const int sz = 21;
+ WFIFOHEAD(fd, sz);
+ WFIFOW(fd, 0) = 0xb20;
+ WFIFOW(fd, 2) = sz;
+ WFIFOW(fd, 4) = skill_id;
+ WFIFOL(fd, 6) = inf ? inf : skill->get_inf(skill_id);
+ WFIFOL(fd, 10) = skill->get_inf2(skill_id);
+ WFIFOW(fd, 14) = skill_lv;
+ if (skill_lv > 0) {
+ WFIFOW(fd, 16) = skill->get_sp(skill_id, skill_lv);
+ WFIFOW(fd, 18) = skill->get_range2(&sd->bl, skill_id, skill_lv);
+ } else {
+ WFIFOW(fd, 16) = 0;
+ WFIFOW(fd, 18) = 0;
+ }
+ if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT)
+ WFIFOB(fd, 20) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class_)) ? 1 : 0;
+ else
+ WFIFOB(fd, 20) = 0;
+ WFIFOSET(fd, sz);
+}