viewing paste killmonster | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena/src/map
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: atcommand.c
--- atcommand.c Base (BASE)
+++ atcommand.c Locally Modified (Based On LOCAL)
@@ -2037,10 +2037,12 @@
 static int atkillmonster_sub(struct block_list *bl, va_list ap)
 {
        struct mob_data *md;
+       struct block_list *src;
        int flag;
 
        nullpo_ret(md=(struct mob_data *)bl);
        flag = va_arg(ap, int);
+       src = va_arg(ap, struct block_list *);
 
        if (md->guardian_data)
                return 0; //Do not touch WoE mobs!
@@ -2048,28 +2050,35 @@
        if (flag)
                status_zap(bl,md->status.hp, 0);
        else
-               status_kill(bl);
+               status_percent_damage(src, bl, 100, 0, true);
        return 1;
 }
 
 ACMD_FUNC(killmonster)
 {
        int map_id, drop_flag;
+       int charid;
+       struct block_list *src;
        char map_name[MAP_NAME_LENGTH_EXT];
        nullpo_retr(-1, sd);
 
        memset(map_name, '\0', sizeof(map_name));
 
-       if (!message || !*message || sscanf(message, "%15s", map_name) < 1)
+       if (!message || !*message || sscanf(message, "%15s %d", map_name, &charid) < 1)
                map_id = sd->bl.m;
        else {
                if ((map_id = map_mapname2mapid(map_name)) < 0)
                        map_id = sd->bl.m;
        }
+       if(charid){
+           TBL_PC *sd = map_charid2sd(charid);
+           src = &sd->bl;
+       }
+       else src = NULL;
 
        drop_flag = strcmp(command+1, "killmonster2");
 
-       map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag);
+       map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag, src);
 
        clif_displaymessage(fd, msg_txt(165)); // All monsters killed!
Viewed 622 times, submitted by lighta.