From c724e71f0e8487cdb3c1016c30e7a739f73497ef Mon Sep 17 00:00:00 2001 From: sketchyphoenix Date: Sun, 22 Jun 2008 00:27:30 +0000 Subject: * 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 --- src/map/script.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src') 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"), -- cgit v1.2.3-60-g2f50