From d0c501816214cd604e7f7efddb8debff03c514e8 Mon Sep 17 00:00:00 2001 From: jaBote Date: Fri, 24 May 2013 00:55:00 +0200 Subject: Edited doc/script_commands.txt: - Now lines will have up to 75 characters, no more (this does not affect functions or example codes, except most comments). - Some random lines have been shortened up a bit in order to fit wherever possible, in a way that doesn't affect quality of explanation. - Removed any references to past eA/rA revisions, changed SVN references to Git (except in get_revision), and removed most references to past devs of *Athena: this text is informative, not for credits. - Removed any references to TXT servers. - Removed any references to mob control suite. - Improved a bit the part on how to obtain a GID. - Slight improvements on some commands explanations. - Corrected mes script command definition as it can show more than 1 string at once. - Improved set script command to tell the abridged method: a = 7; - Removed reference to an unused parameter (flag) in source, in guildskill script command. - Corrected an error in the rate of autobonus command (100% is 10000, not 1000 as it was before). - Added ways to get a monster's GID through 'monster' and 'areamonster' script commands. - rAthena reference removed in sprintf and sscanf functions. - Please remove cell_basilica references in sercell function if it doesn't work anymore, as said in http://hercules.ws/board/topic/546-how-to-put-safe-zone-on-some-pvp-map/?hl=cell_basilica - Removed "Whew. That's about all of them." at end of the document. Edited src/map/script.c: - Added modification to 'monster' and 'areamonster' to return GID of summoned monster. Signed-off-by: jaBote --- src/map/script.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index 41f8e7472..9a123705b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8417,6 +8417,7 @@ BUILDIN(monster) const char* event = ""; unsigned int size = SZ_SMALL; unsigned int ai = AI_NONE; + int mob_id; struct map_session_data* sd; int16 m; @@ -8470,7 +8471,8 @@ BUILDIN(monster) } } - mob_once_spawn(sd, m, x, y, str, class_, amount, event, size, ai); + mob_id = mob_once_spawn(sd, m, x, y, str, class_, amount, event, size, ai); + script_pushint(st, mob_id); return true; } /*========================================== @@ -8524,6 +8526,7 @@ BUILDIN(areamonster) const char* event = ""; unsigned int size = SZ_SMALL; unsigned int ai = AI_NONE; + int mob_id; struct map_session_data* sd; int16 m; @@ -8571,7 +8574,9 @@ BUILDIN(areamonster) } } - mob_once_spawn_area(sd, m, x0, y0, x1, y1, str, class_, amount, event, size, ai); + mob_id = mob_once_spawn_area(sd, m, x0, y0, x1, y1, str, class_, amount, event, size, ai); + script_pushint(st, mob_id); + return true; } /*========================================== -- cgit v1.2.3-70-g09d2