diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-08-31 21:05:35 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-08-31 21:05:35 +0000 |
commit | 0c3fe037b7df653d91b03bc19526dbc8b7e641cb (patch) | |
tree | e1b4f575caec62050d264de5abdf28f078c7a192 /src/map/script.c | |
parent | 690ef2ae18deedd44bf4670eaf751c3888cb5a37 (diff) | |
download | hercules-0c3fe037b7df653d91b03bc19526dbc8b7e641cb.tar.gz hercules-0c3fe037b7df653d91b03bc19526dbc8b7e641cb.tar.bz2 hercules-0c3fe037b7df653d91b03bc19526dbc8b7e641cb.tar.xz hercules-0c3fe037b7df653d91b03bc19526dbc8b7e641cb.zip |
- Implemented script commands for mercenary items (mercenary_heal and mercenary_sc_start).
- Fixed a bug crashing server with mercenary.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13159 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 05d7a0736..dd3a2cc15 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12815,6 +12815,37 @@ BUILDIN_FUNC(createmercenary) return 0; } +BUILDIN_FUNC(mercenary_heal) +{ + struct map_session_data *sd = script_rid2sd(st); + int hp, sp; + + if( sd == NULL || sd->md == NULL ) + return 0; + hp = script_getnum(st,2); + sp = script_getnum(st,3); + + status_heal(&sd->md->bl, hp, sp, 0); + return 0; +} + +BUILDIN_FUNC(mercenary_sc_start) +{ + struct map_session_data *sd = script_rid2sd(st); + enum sc_type type; + int tick, val1; + + if( sd == NULL || sd->md == NULL ) + return 0; + + type = (sc_type)script_getnum(st,2); + tick = script_getnum(st,3); + val1 = script_getnum(st,4); + + status_change_start(&sd->md->bl, type, 10000, val1, 0, 0, 0, tick, 2); + return 0; +} + /****************** Questlog script commands *******************/ @@ -13246,5 +13277,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(setwall,"siiiiis"), BUILDIN_DEF(delwall,"s"), BUILDIN_DEF(createmercenary,"ii"), + BUILDIN_DEF(mercenary_heal,"ii"), + BUILDIN_DEF(mercenary_sc_start,"iii"), {NULL,NULL,NULL}, }; |