diff options
author | Guilherme G. M <guilherme-gm@users.noreply.github.com> | 2017-02-26 03:41:50 -0300 |
---|---|---|
committer | Dastgir <dastgirpojee@rocketmail.com> | 2017-02-26 12:11:50 +0530 |
commit | 113865cd441c1ebd04f8d0b9d7380cc852a08fb9 (patch) | |
tree | c580d334d86accdb19bac294926c5cffe5f9cccd /src/map/script.c | |
parent | 9a7a165d4dbad598907d3ecd54196e8f76c4f3f5 (diff) | |
download | hercules-113865cd441c1ebd04f8d0b9d7380cc852a08fb9.tar.gz hercules-113865cd441c1ebd04f8d0b9d7380cc852a08fb9.tar.bz2 hercules-113865cd441c1ebd04f8d0b9d7380cc852a08fb9.tar.xz hercules-113865cd441c1ebd04f8d0b9d7380cc852a08fb9.zip |
Added option to show classchange only to one player (#1587)
* Added option to show classchange only to one player
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/map/script.c b/src/map/script.c index ef63697a7..30295b8dc 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13840,15 +13840,26 @@ BUILDIN(undisguise) * Transform a bl to another class, * @type unused *------------------------------------------*/ -BUILDIN(classchange) { - int class, type; - struct block_list *bl=map->id2bl(st->oid); +BUILDIN(classchange) +{ + int class, type, target; + struct block_list *bl = map->id2bl(st->oid); - if(bl==NULL) return true; + if (bl == NULL) + return true; - class = script_getnum(st,2); - type=script_getnum(st,3); - clif->class_change(bl, class, type); + class = script_getnum(st, 2); + type = script_getnum(st, 3); + target = script_hasdata(st, 4) ? script_getnum(st, 4) : 0; + + if (target > 0) { + struct map_session_data *sd = script->charid2sd(st, target); + if (sd != NULL) { + clif->class_change(bl, class, type, sd); + } + } else { + clif->class_change(bl, class, type, NULL); + } return true; } @@ -21032,7 +21043,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(getcartinventorylist,""), BUILDIN_DEF(getskilllist,""), BUILDIN_DEF(clearitem,""), - BUILDIN_DEF(classchange,"ii"), + BUILDIN_DEF(classchange,"ii?"), BUILDIN_DEF(misceffect,"i"), BUILDIN_DEF(playbgm,"s"), BUILDIN_DEF(playbgmall,"s?????"), |