summaryrefslogtreecommitdiff
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
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
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--doc/script_commands.txt11
-rw-r--r--src/map/script.c22
3 files changed, 32 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 387362364..6dbdedf6b 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,9 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2008/06/22
* Extended script command 'set' to return the variable reference (topic:190602). [FlavioJS]
+ * Fixed a bug where the "OnMyMobDead" event wouldn't trigger if the mob was killed and never attacked. (bugreport:1725) [SketchyPhoenix]
+ * Reworded a comment in can_copy to make more sense.
+ * 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).
2008/06/19
* Added Sirius_White's fix for sense working on emperium. (bugreport: 1679) [SketchyPhoenix]
* Fixed SC_CHANGEUNDEAD behavior: Blessing and Increase AGI deals 1 damage and does not apply buffs to those inflicted by it.
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 9ebfdb381..091ad5293 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -4623,10 +4623,17 @@ of the event label value.
---------------------------------------
-*killmonsterall "<map name>";
+*killmonsterall "<map name>"{,<type>};
This command will kill all monsters on a specified map name, regardless of how
-they were spawned or what they are.
+they were spawned or what they are. As of r12873, The behavior has changed slightly.
+In light of a label behavior fix for mob spawning commands that will now allow the label to
+trigger when there is no player, killmonsterall has also been modified to support this.
+
+Using this the normal/old way means labels dont trigger when a player didn't
+attack/kill a monster. This is because it breaks compatability with older scripts if
+forced to use the new method. However, if you wish to use the new label type with this
+command, simply use 1 for type. Any other number won't be recognized.
---------------------------------------
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"),