diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-19 20:13:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-19 20:13:46 +0300 |
commit | b495c9d144b75bbc7877aaf4efb19f09f47b0181 (patch) | |
tree | b674cfcdcf5574b7899db59717ac7337c64c1dfd /src/emap/clif.c | |
parent | e7f1290ab54d37ef72c97721cbb4f53a8ab56b86 (diff) | |
download | evol-hercules-b495c9d144b75bbc7877aaf4efb19f09f47b0181.tar.gz evol-hercules-b495c9d144b75bbc7877aaf4efb19f09f47b0181.tar.bz2 evol-hercules-b495c9d144b75bbc7877aaf4efb19f09f47b0181.tar.xz evol-hercules-b495c9d144b75bbc7877aaf4efb19f09f47b0181.zip |
Send inf2 in add skill packet.
Diffstat (limited to 'src/emap/clif.c')
-rw-r--r-- | src/emap/clif.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c index 686cb08..d0ab8bd 100644 --- a/src/emap/clif.c +++ b/src/emap/clif.c @@ -1550,3 +1550,61 @@ void eclif_skillinfoblock_pre(struct map_session_data **sdPtr) } hookStop(); } + +void eclif_addskill_pre(struct map_session_data **sdPtr, + int *idPtr) +{ + struct map_session_data *sd = *sdPtr; + nullpo_retv(sd); + int id = *idPtr; + + struct SessionExt *data = session_get_bysd(sd); + if (!data) + return; + if (data->clientVersion < 18) + return; + + int fd = sd->fd; + if (!fd) + { + hookStop(); + return; + } + + const int idx = skill->get_index(id); + + if (sd->status.skill[idx].id <= 0) + { + hookStop(); + return; + } + + const int skill_lv = sd->status.skill[idx].lv; + const int sz = 45; + + WFIFOHEAD(fd, sz); + WFIFOW(fd, 0) = 0xb1f; + WFIFOW(fd, 2) = sz; + WFIFOW(fd, 4) = id; + WFIFOL(fd, 6) = skill->get_inf(id); + WFIFOL(fd, 10) = skill->get_inf2(id); + WFIFOW(fd, 14) = skill_lv; + if (skill_lv > 0) + { + WFIFOW(fd, 16) = skill->get_sp(id, skill_lv); + WFIFOW(fd, 18) = skill->get_range2(&sd->bl, id, skill_lv); + } + else + { + WFIFOW(fd, 16) = 0; + WFIFOW(fd, 18) = 0; + } + safestrncpy(WFIFOP(fd, 20), skill->get_name(id), NAME_LENGTH); + if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT) + WFIFOB(fd, 44) = (skill_lv < skill->tree_get_max(id, sd->status.class_)) ? 1 : 0; + else + WFIFOB(fd, 44) = 0; + WFIFOSET(fd, sz); + + hookStop(); +} |