summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsketchyphoenix <sketchyphoenix@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-06-22 00:27:30 +0000
committersketchyphoenix <sketchyphoenix@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-06-22 00:27:30 +0000
commitc724e71f0e8487cdb3c1016c30e7a739f73497ef (patch)
treeff506116e52583cf432c383ef66b0c0f8e7cafa5 /src
parenta496d2693dd3727a8e3991b05fe57601e44b48b1 (diff)
downloadhercules-c724e71f0e8487cdb3c1016c30e7a739f73497ef.tar.gz
hercules-c724e71f0e8487cdb3c1016c30e7a739f73497ef.tar.bz2
hercules-c724e71f0e8487cdb3c1016c30e7a739f73497ef.tar.xz
hercules-c724e71f0e8487cdb3c1016c30e7a739f73497ef.zip
* Modified *killmonsterall to support a new argument that will allow it to kill monsters using the new OnMyMobDead behavior (in order to avoid breaking older scripts) (bugreport:1734)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12873 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 6026345b7..09a7b0089 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7500,6 +7500,17 @@ BUILDIN_FUNC(killmonster)
return 0;
}
+static int buildin_killmonsterall_sub_strip(struct block_list *bl,va_list ap)
+{ //Strips the event from the mob if it's killed the old method.
+ struct mob_data *md;
+
+ md = BL_CAST(BL_MOB, bl);
+ if (md->npc_event[0])
+ md->npc_event[0] = 0;
+
+ status_kill(bl);
+ return 0;
+}
static int buildin_killmonsterall_sub(struct block_list *bl,va_list ap)
{
status_kill(bl);
@@ -7510,9 +7521,16 @@ BUILDIN_FUNC(killmonsterall)
const char *mapname;
int m;
mapname=script_getstr(st,2);
-
+
if( (m=map_mapname2mapid(mapname))<0 )
return 0;
+
+ if( script_hasdata(st,3) )
+ if ( script_getnum(st,3) == 1 ) {
+ map_foreachinmap(buildin_killmonsterall_sub_strip,m,BL_MOB);
+ return 0;
+ }
+
map_foreachinmap(buildin_killmonsterall_sub,
m,BL_MOB);
return 0;
@@ -13438,7 +13456,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(monster,"siisii*"),
BUILDIN_DEF(areamonster,"siiiisii*"),
BUILDIN_DEF(killmonster,"ss"),
- BUILDIN_DEF(killmonsterall,"s"),
+ BUILDIN_DEF(killmonsterall,"s?"),
BUILDIN_DEF(clone,"siisi*"),
BUILDIN_DEF(doevent,"s"),
BUILDIN_DEF(donpcevent,"s"),