summaryrefslogtreecommitdiff
path: root/src/map/mob.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-02-09 21:18:26 +0100
committerGitHub <noreply@github.com>2020-02-09 21:18:26 +0100
commit481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3 (patch)
tree807314fa875ca53ab1508f347bcf5ad12e9f3348 /src/map/mob.h
parent9e68350a054d5ec181a40528728d8de185a4f43c (diff)
parentd84aee4cd917fd1a151d7ec0b3a2d7e32df02441 (diff)
downloadhercules-481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3.tar.gz
hercules-481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3.tar.bz2
hercules-481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3.tar.xz
hercules-481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3.zip
Merge pull request #2590 from Kenpachi2k13/issue#2530
Change unload NPC behavior to kill mobs that were spawned by unloaded NPC (non-permanent monster spawns) [Issue #2530]
Diffstat (limited to 'src/map/mob.h')
-rw-r--r--src/map/mob.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/mob.h b/src/map/mob.h
index 8fd16f191..8839809f2 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -255,6 +255,7 @@ struct mob_data {
int areanpc_id; //Required in OnTouchNPC (to avoid multiple area touchs)
unsigned int bg_id; // BattleGround System
int clan_id; // Clan System
+ int npc_id; // NPC ID if spawned with monster/areamonster/guardian/bg_monster/atcommand("@monster xy") (Used to kill mob on NPC unload.)
int64 next_walktime, last_thinktime, last_linktime, last_pcneartime, dmgtick;
short move_fail_count;
@@ -507,14 +508,14 @@ struct mob_interface {
int (*db_checkid) (const int id);
struct view_data* (*get_viewdata) (int class_);
int (*parse_dataset) (struct spawn_data *data);
- struct mob_data* (*spawn_dataset) (struct spawn_data *data);
+ struct mob_data* (*spawn_dataset) (struct spawn_data *data, int npc_id);
int (*get_random_id) (int type, int flag, int lv);
bool (*ksprotected) (struct block_list *src, struct block_list *target);
- struct mob_data* (*once_spawn_sub) (struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai);
+ struct mob_data* (*once_spawn_sub) (struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai, int npc_id);
int (*once_spawn) (struct map_session_data *sd, int16 m, int16 x, int16 y, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai);
int (*once_spawn_area) (struct map_session_data *sd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai);
- int (*spawn_guardian) (const char *mapname, short x, short y, const char *mobname, int class_, const char *event, int guardian, bool has_index);
- int (*spawn_bg) (const char *mapname, short x, short y, const char *mobname, int class_, const char *event, unsigned int bg_id);
+ int (*spawn_guardian) (const char *mapname, short x, short y, const char *mobname, int class_, const char *event, int guardian, bool has_index, int npc_id);
+ int (*spawn_bg) (const char *mapname, short x, short y, const char *mobname, int class_, const char *event, unsigned int bg_id, int npc_id);
int (*can_reach) (struct mob_data *md, struct block_list *bl, int range, int state);
int (*linksearch) (struct block_list *bl, va_list ap);
int (*delayspawn) (int tid, int64 tick, int id, intptr_t data);