Advertisement
clydelion

Boss Delay on restart

Feb 28th, 2013
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.78 KB | None | 0 0
  1. Index: atcommand.c
  2. ===================================================================
  3. --- atcommand.c (revision 17161)
  4. +++ atcommand.c (working copy)
  5. @@ -6080,7 +6080,7 @@
  6.         if( md->spawn_timer == INVALID_TIMER )
  7.             snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%3d:%3d] %s", number, md->bl.x, md->bl.y, md->name);
  8.         else
  9. -           snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s", number, "dead", md->name);
  10. +           snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s - Re-spawn in %d seconds", number, "dead", md->name, (get_timer(md->spawn_timer)->tick-gettick())/1000); // Display the delay in seconds [clydelion]
  11.         clif_displaymessage(fd, atcmd_output);
  12.     }
  13.     mapit_free(it);
  14. Index: map.h
  15. ===================================================================
  16. --- map.h   (revision 17161)
  17. +++ map.h   (working copy)
  18. @@ -341,6 +341,7 @@
  19.         unsigned int boss : 1; //0: Non-boss monster | 1: Boss monster
  20.     } state;
  21.     char name[NAME_LENGTH], eventname[EVENT_NAME_LENGTH]; //Name/event
  22. +   unsigned int spawn_status;
  23.  };
  24.  
  25.  struct flooritem_data {
  26. Index: mob.c
  27. ===================================================================
  28. --- mob.c   (revision 17161)
  29. +++ mob.c   (working copy)
  30. @@ -920,6 +920,12 @@
  31.         md->bl.x = md->spawn->x;
  32.         md->bl.y = md->spawn->y;
  33.  
  34. +       if (md->spawn->spawn_status == 0 && md->db->mexp) {
  35. +           md->spawn->spawn_status = 1;
  36. +           md->spawn_timer = add_timer(tick+1000*60*5+(rand()%1000*60*40), mob_delayspawn, md->bl.id, 0); // 5-45 minutes, adjust this to your desired delay
  37. +           return 1;
  38. +       }
  39. +
  40.         if( (md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys )
  41.         {   //Monster can be spawned on an area.
  42.             if( !map_search_freecell(&md->bl, -1, &md->bl.x, &md->bl.y, md->spawn->xs, md->spawn->ys, battle_config.no_spawn_on_player?4:0) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement