mob.hpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. // Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef MOB_HPP
  4. #define MOB_HPP
  5. #include <vector>
  6. #include <common/database.hpp>
  7. #include <common/mmo.hpp> // struct item
  8. #include <common/timer.hpp>
  9. #include "status.hpp" // struct status data, struct status_change
  10. #include "unit.hpp" // unit_stop_walking(), unit_stop_attack()
  11. struct guardian_data;
  12. //This is the distance at which @autoloot works,
  13. //if the item drops farther from the player than this,
  14. //it will not be autolooted. [Skotlex]
  15. //Note: The range is unlimited unless this define is set.
  16. //#define AUTOLOOT_DISTANCE AREA_SIZE
  17. //The number of drops all mobs have and the max drop-slot that the steal skill will attempt to steal from.
  18. #define MAX_MOB_DROP 10
  19. #define MAX_MVP_DROP 3
  20. #define MAX_MOB_DROP_ADD 5
  21. #define MAX_MVP_DROP_ADD 2
  22. #define MAX_MOB_DROP_TOTAL (MAX_MOB_DROP+MAX_MOB_DROP_ADD)
  23. #define MAX_MVP_DROP_TOTAL (MAX_MVP_DROP+MAX_MVP_DROP_ADD)
  24. #define MAX_MINCHASE 30 //Max minimum chase value to use for mobs.
  25. //Min time between AI executions
  26. const t_tick MIN_MOBTHINKTIME = 100;
  27. //Min time before mobs do a check to call nearby friends for help (or for slaves to support their master)
  28. const t_tick MIN_MOBLINKTIME = 1000;
  29. //Min time between random walks
  30. const t_tick MIN_RANDOMWALKTIME = 4000;
  31. // How often a monster will check for using a skill on non-attack states (in ms)
  32. const t_tick MOB_SKILL_INTERVAL = 1000;
  33. //Distance that slaves should keep from their master.
  34. #define MOB_SLAVEDISTANCE 2
  35. //Used to determine default enemy type of mobs (for use in eachinrange calls)
  36. #define DEFAULT_ENEMY_TYPE(md) (md->special_state.ai?BL_CHAR:BL_MOB|BL_PC|BL_HOM|BL_MER)
  37. /**
  38. * Mob constants
  39. * Added definitions for WoE:SE objects and other [L0ne_W0lf], [aleos]
  40. */
  41. enum MOBID {
  42. MOBID_PORING = 1002,
  43. MOBID_RED_PLANT = 1078,
  44. MOBID_BLUE_PLANT,
  45. MOBID_GREEN_PLANT,
  46. MOBID_YELLOW_PLANT,
  47. MOBID_WHITE_PLANT,
  48. MOBID_SHINING_PLANT,
  49. MOBID_BLACK_MUSHROOM = 1084,
  50. MOBID_MARINE_SPHERE = 1142,
  51. MOBID_EMPERIUM = 1288,
  52. MOBID_G_PARASITE = 1555,
  53. MOBID_G_FLORA = 1575,
  54. MOBID_G_HYDRA = 1579,
  55. MOBID_G_MANDRAGORA = 1589,
  56. MOBID_G_GEOGRAPHER = 1590,
  57. MOBID_GUARDIAN_STONE1 = 1907,
  58. MOBID_GUARDIAN_STONE2,
  59. MOBID_SILVERSNIPER = 2042,
  60. MOBID_MAGICDECOY_FIRE,
  61. MOBID_MAGICDECOY_WATER,
  62. MOBID_MAGICDECOY_EARTH,
  63. MOBID_MAGICDECOY_WIND,
  64. MOBID_ZANZOU = 2308,
  65. MOBID_S_HORNET = 2158,
  66. MOBID_S_GIANT_HORNET,
  67. MOBID_S_LUCIOLA_VESPA,
  68. MOBID_GUILD_SKILL_FLAG = 20269,
  69. MOBID_ABR_BATTLE_WARIOR = 20834,
  70. MOBID_ABR_DUAL_CANNON,
  71. MOBID_ABR_MOTHER_NET,
  72. MOBID_ABR_INFINITY,
  73. MOBID_BIONIC_WOODENWARRIOR = 20848,
  74. MOBID_BIONIC_WOODEN_FAIRY,
  75. MOBID_BIONIC_CREEPER,
  76. MOBID_BIONIC_HELLTREE,
  77. };
  78. ///Mob skill states.
  79. enum MobSkillState {
  80. MSS_ANY = -1,
  81. MSS_IDLE,
  82. MSS_WALK,
  83. MSS_LOOT,
  84. MSS_DEAD,
  85. MSS_BERSERK, //Aggressive mob attacking
  86. MSS_ANGRY, //Mob retaliating from being attacked.
  87. MSS_RUSH, //Mob following a player after being attacked.
  88. MSS_FOLLOW, //Mob following a player without being attacked.
  89. MSS_ANYTARGET,
  90. };
  91. enum MobDamageLogFlag
  92. {
  93. MDLF_NORMAL = 0,
  94. MDLF_HOMUN,
  95. MDLF_PET,
  96. MDLF_SELF
  97. };
  98. enum e_size : uint8 {
  99. SZ_SMALL = 0,
  100. SZ_MEDIUM,
  101. SZ_BIG,
  102. SZ_ALL,
  103. SZ_MAX
  104. };
  105. /// Random Monster Groups
  106. enum e_random_monster : uint16 {
  107. MOBG_BRANCH_OF_DEAD_TREE = 0,
  108. MOBG_PORING_BOX,
  109. MOBG_BLOODY_DEAD_BRANCH,
  110. MOBG_RED_POUCH_OF_SURPRISE,
  111. MOBG_CLASSCHANGE,
  112. MOBG_TAEKWON_MISSION,
  113. MOBG_MAX,
  114. };
  115. /// Random Monster Group Flags
  116. enum e_random_monster_flags {
  117. RMF_NONE = 0x00, ///< Apply no flags
  118. RMF_DB_RATE = 0x01, ///< Apply the summon success chance found in the list (otherwise get any monster from the db)
  119. RMF_CHECK_MOB_LV = 0x02, ///< Apply a monster level check
  120. RMF_MOB_NOT_BOSS = 0x04, ///< Selected monster should not be a Boss type (except those from MOBG_BLOODY_DEAD_BRANCH)
  121. RMF_MOB_NOT_SPAWN = 0x08, ///< Selected monster must have normal spawn
  122. RMF_MOB_NOT_PLANT = 0x10, ///< Selected monster should not be a Plant type
  123. RMF_ALL = 0xFF, ///< Apply all flags
  124. };
  125. enum e_mob_bosstype : uint8{
  126. BOSSTYPE_NONE,
  127. BOSSTYPE_MINIBOSS,
  128. BOSSTYPE_MVP
  129. };
  130. /// Monster Aegis AI types
  131. enum e_aegis_monstertype : uint16 {
  132. MONSTER_TYPE_01 = 0x81,
  133. MONSTER_TYPE_02 = 0x83,
  134. MONSTER_TYPE_03 = 0x1089,
  135. MONSTER_TYPE_04 = 0x3885,
  136. MONSTER_TYPE_05 = 0x2085,
  137. MONSTER_TYPE_06 = 0,
  138. MONSTER_TYPE_07 = 0x108B,
  139. MONSTER_TYPE_08 = 0x7085,
  140. MONSTER_TYPE_09 = 0x3095,
  141. MONSTER_TYPE_10 = 0x84,
  142. MONSTER_TYPE_11 = 0x84,
  143. MONSTER_TYPE_12 = 0x2085,
  144. MONSTER_TYPE_13 = 0x308D,
  145. //MONSTER_TYPE_14
  146. //MONSTER_TYPE_15
  147. //MONSTER_TYPE_16
  148. MONSTER_TYPE_17 = 0x91,
  149. //MONSTER_TYPE_18
  150. MONSTER_TYPE_19 = 0x3095,
  151. MONSTER_TYPE_20 = 0x3295,
  152. MONSTER_TYPE_21 = 0x3695,
  153. //MONSTER_TYPE_22
  154. //MONSTER_TYPE_23
  155. MONSTER_TYPE_24 = 0xA1,
  156. MONSTER_TYPE_25 = 0x1,
  157. MONSTER_TYPE_26 = 0xB695,
  158. MONSTER_TYPE_27 = 0x8084,
  159. };
  160. /// Aegis monster class types
  161. enum e_aegis_monsterclass : int8 {
  162. CLASS_NONE = -1,
  163. CLASS_NORMAL = 0,
  164. CLASS_BOSS,
  165. CLASS_GUARDIAN,
  166. CLASS_BATTLEFIELD = 4,
  167. CLASS_EVENT,
  168. CLASS_ALL,
  169. CLASS_MAX,
  170. };
  171. struct s_mob_skill {
  172. enum MobSkillState state;
  173. uint16 skill_id,skill_lv;
  174. short permillage;
  175. int casttime,delay;
  176. short cancel;
  177. short cond1;
  178. int64 cond2;
  179. short target;
  180. int val[5];
  181. short emotion;
  182. unsigned short msg_id;
  183. };
  184. struct s_mob_chat {
  185. uint16 msg_id;
  186. uint32 color;
  187. std::string msg;
  188. };
  189. class MobChatDatabase : public TypesafeYamlDatabase<uint16, s_mob_chat> {
  190. public:
  191. MobChatDatabase() : TypesafeYamlDatabase("MOB_CHAT_DB", 1) {
  192. }
  193. const std::string getDefaultLocation() override;
  194. uint64 parseBodyNode(const ryml::NodeRef& node) override;
  195. };
  196. struct s_mob_item_drop_ratio {
  197. t_itemid nameid;
  198. uint32 drop_ratio;
  199. std::vector<uint16> mob_ids;
  200. };
  201. class MobItemRatioDatabase : public TypesafeYamlDatabase<t_itemid, s_mob_item_drop_ratio> {
  202. public:
  203. MobItemRatioDatabase() : TypesafeYamlDatabase("MOB_ITEM_RATIO_DB", 1) {
  204. }
  205. const std::string getDefaultLocation() override;
  206. uint64 parseBodyNode(const ryml::NodeRef& node) override;
  207. };
  208. struct spawn_info {
  209. unsigned short mapindex;
  210. unsigned short qty;
  211. };
  212. /// Loooitem struct
  213. struct s_mob_lootitem {
  214. struct item item; ///< Item info
  215. unsigned short mob_id; ///< ID of monster that dropped the item
  216. };
  217. /// Struct for monster's drop item
  218. struct s_mob_drop {
  219. t_itemid nameid;
  220. uint32 rate;
  221. uint16 randomopt_group;
  222. bool steal_protected;
  223. };
  224. struct s_mob_db {
  225. uint32 id{};
  226. std::string sprite{}, name{}, jname{};
  227. t_exp base_exp{};
  228. t_exp job_exp{};
  229. t_exp mexp{};
  230. uint16 range2{}, range3{};
  231. std::vector<e_race2> race2{}; // celest
  232. uint16 lv{ 1 };
  233. s_mob_drop dropitem[MAX_MOB_DROP_TOTAL]{}, mvpitem[MAX_MVP_DROP_TOTAL]{};
  234. status_data status{};
  235. view_data vd{};
  236. uint32 option{};
  237. std::vector<std::shared_ptr<s_mob_skill>> skill{};
  238. uint16 damagetaken{ 100 };
  239. e_mob_bosstype get_bosstype();
  240. s_mob_db();
  241. };
  242. class MobDatabase : public TypesafeCachedYamlDatabase <uint32, s_mob_db> {
  243. private:
  244. bool parseDropNode(std::string nodeName, const ryml::NodeRef& node, uint8 max, s_mob_drop *drops);
  245. public:
  246. MobDatabase() : TypesafeCachedYamlDatabase("MOB_DB", 4, 1) {
  247. }
  248. const std::string getDefaultLocation() override;
  249. uint64 parseBodyNode(const ryml::NodeRef& node) override;
  250. void loadingFinished() override;
  251. };
  252. extern MobDatabase mob_db;
  253. struct s_map_mob_drop{
  254. uint16 mob_id;
  255. std::shared_ptr<s_mob_drop> drop;
  256. };
  257. struct s_map_drops{
  258. uint16 mapid;
  259. std::unordered_map<uint16, std::shared_ptr<s_mob_drop>> globals;
  260. std::unordered_map<uint16, std::unordered_map<uint16, std::shared_ptr<s_mob_drop>>> specific;
  261. };
  262. class MapDropDatabase : public TypesafeYamlDatabase<uint16, s_map_drops>{
  263. public:
  264. MapDropDatabase() : TypesafeYamlDatabase( "MAP_DROP_DB", 2 ){
  265. }
  266. const std::string getDefaultLocation() override;
  267. uint64 parseBodyNode( const ryml::NodeRef& node ) override;
  268. private:
  269. bool parseDrop( const ryml::NodeRef& node, std::unordered_map<uint16, std::shared_ptr<s_mob_drop>>& drops );
  270. };
  271. extern MapDropDatabase map_drop_db;
  272. extern std::unordered_map<uint16, std::vector<spawn_info>> mob_spawn_data;
  273. struct mob_data {
  274. struct block_list bl;
  275. struct unit_data ud;
  276. struct view_data *vd;
  277. bool vd_changed;
  278. struct status_data status, *base_status; //Second one is in case of leveling up mobs, or tiny/large mobs.
  279. status_change sc;
  280. std::shared_ptr<s_mob_db> db; //For quick data access (saves doing mob_db(md->mob_id) all the time) [Skotlex]
  281. char name[NAME_LENGTH];
  282. struct s_specialState {
  283. uint32 size : 2; //Small/Big monsters.
  284. enum mob_ai ai; //Special ai for summoned monsters.
  285. uint32 clone : 1;/* is clone? 1:0 */
  286. } special_state; //Special mob information that does not needs to be zero'ed on mob respawn.
  287. struct s_MobState {
  288. uint32 aggressive : 1; //Signals whether the mob AI is in aggressive mode or reactive mode. [Skotlex]
  289. uint32 steal_coin_flag : 1;
  290. uint32 soul_change_flag : 1; // Celest
  291. uint32 can_escape: 1;
  292. uint32 npc_killmonster: 1; //for new killmonster behavior
  293. uint32 rebirth: 1; // NPC_Rebirth used
  294. uint32 boss : 1;
  295. uint32 copy_master_mode : 1; ///< Whether the spawned monster should copy the master's mode.
  296. enum MobSkillState skillstate;
  297. unsigned char steal_flag; //number of steal tries (to prevent steal exploit on mobs with few items) [Lupus]
  298. unsigned char attacked_count; //For rude attacked.
  299. int provoke_flag; // Celest
  300. } state;
  301. struct guardian_data* guardian_data;
  302. struct s_dmglog {
  303. int id; //char id
  304. uint32 dmg;
  305. uint32 flag : 2; //0: Normal. 1: Homunc exp. 2: Pet exp
  306. } dmglog[DAMAGELOG_SIZE];
  307. uint32 spotted_log[DAMAGELOG_SIZE];
  308. struct spawn_data *spawn; //Spawn data.
  309. int spawn_timer; //Required for Convex Mirror
  310. int16 centerX, centerY; // Spawn center of this individual monster
  311. struct s_mob_lootitem *lootitems;
  312. short mob_id;
  313. uint32 tdmg; //Stores total damage given to the mob, for exp calculations. [Skotlex]
  314. int level;
  315. int target_id,attacked_id,norm_attacked_id;
  316. int areanpc_id; //Required in OnTouchNPC (to avoid multiple area touchs)
  317. int bg_id; // BattleGround System
  318. t_tick next_walktime,last_thinktime,last_linktime,last_pcneartime,dmgtick,last_canmove,last_skillcheck;
  319. short move_fail_count;
  320. short lootitem_count;
  321. short min_chase;
  322. unsigned char walktoxy_fail_count; //Pathfinding succeeds but the actual walking failed (e.g. Icewall lock)
  323. int deletetimer;
  324. int master_id,master_dist;
  325. int8 skill_idx; // Index of last used skill from db->skill[]
  326. t_tick skilldelay[MAX_MOBSKILL];
  327. char npc_event[EVENT_NAME_LENGTH];
  328. char idle_event[EVENT_NAME_LENGTH];
  329. /**
  330. * Did this monster summon something?
  331. * Used to flag summon deletions, saves a worth amount of memory
  332. **/
  333. bool can_summon;
  334. /**
  335. * MvP Tombstone NPC ID
  336. **/
  337. int tomb_nid;
  338. uint16 damagetaken;
  339. e_mob_bosstype get_bosstype();
  340. };
  341. class MobAvailDatabase : public YamlDatabase {
  342. public:
  343. MobAvailDatabase() : YamlDatabase("MOB_AVAIL_DB", 1) {
  344. }
  345. void clear() override{ };
  346. const std::string getDefaultLocation() override;
  347. uint64 parseBodyNode(const ryml::NodeRef& node) override;
  348. };
  349. struct s_randomsummon_entry {
  350. uint16 mob_id;
  351. uint32 rate;
  352. };
  353. struct s_randomsummon_group {
  354. uint16 random_id;
  355. uint16 default_mob_id;
  356. std::unordered_map<uint16, std::shared_ptr<s_randomsummon_entry>> list;
  357. };
  358. class MobSummonDatabase : public TypesafeYamlDatabase<uint16, s_randomsummon_group> {
  359. public:
  360. MobSummonDatabase() : TypesafeYamlDatabase("MOB_SUMMONABLE_DB", 1) {
  361. }
  362. const std::string getDefaultLocation() override;
  363. uint64 parseBodyNode(const ryml::NodeRef& node) override;
  364. };
  365. enum e_mob_skill_target {
  366. MST_TARGET = 0,
  367. MST_RANDOM, //Random Target!
  368. MST_SELF,
  369. MST_FRIEND,
  370. MST_MASTER,
  371. MST_AROUND5,
  372. MST_AROUND6,
  373. MST_AROUND7,
  374. MST_AROUND8,
  375. MST_AROUND1,
  376. MST_AROUND2,
  377. MST_AROUND3,
  378. MST_AROUND4,
  379. MST_AROUND = MST_AROUND4,
  380. };
  381. enum e_mob_skill_condition {
  382. MSC_ALWAYS = 0x0000,
  383. MSC_MYHPLTMAXRATE,
  384. MSC_MYHPINRATE,
  385. MSC_FRIENDHPLTMAXRATE,
  386. MSC_FRIENDHPINRATE,
  387. MSC_MYSTATUSON,
  388. MSC_MYSTATUSOFF,
  389. MSC_FRIENDSTATUSON,
  390. MSC_FRIENDSTATUSOFF,
  391. MSC_ATTACKPCGT,
  392. MSC_ATTACKPCGE,
  393. MSC_SLAVELT,
  394. MSC_SLAVELE,
  395. MSC_CLOSEDATTACKED,
  396. MSC_LONGRANGEATTACKED,
  397. MSC_AFTERSKILL,
  398. MSC_SKILLUSED,
  399. MSC_CASTTARGETED,
  400. MSC_RUDEATTACKED,
  401. MSC_MASTERHPLTMAXRATE,
  402. MSC_MASTERATTACKED,
  403. MSC_ALCHEMIST,
  404. MSC_SPAWN,
  405. MSC_MOBNEARBYGT,
  406. MSC_GROUNDATTACKED,
  407. MSC_DAMAGEDGT,
  408. };
  409. // The data structures for storing delayed item drops
  410. struct s_item_drop{
  411. struct item item_data;
  412. unsigned short mob_id;
  413. enum bl_type src_type;
  414. };
  415. struct s_item_drop_list{
  416. // coordinates
  417. int16 m, x, y;
  418. // charid's of players with higher pickup priority
  419. int first_charid, second_charid, third_charid;
  420. std::vector<std::shared_ptr<s_item_drop>> items;
  421. };
  422. uint16 mobdb_searchname(const char * const str);
  423. std::shared_ptr<s_mob_db> mobdb_search_aegisname( const char* str );
  424. uint16 mobdb_searchname_array(const char *str, uint16 * out, uint16 size);
  425. int mobdb_checkid(const int id);
  426. struct view_data* mob_get_viewdata(int mob_id);
  427. void mob_set_dynamic_viewdata( struct mob_data* md );
  428. void mob_free_dynamic_viewdata( struct mob_data* md );
  429. struct mob_data *mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int mob_id, const char *event, uint32 size, enum mob_ai ai);
  430. int mob_once_spawn(map_session_data* sd, int16 m, int16 x, int16 y,
  431. const char* mobname, int mob_id, int amount, const char* event, uint32 size, enum mob_ai ai);
  432. int mob_once_spawn_area(map_session_data* sd, int16 m,
  433. int16 x0, int16 y0, int16 x1, int16 y1, const char* mobname, int mob_id, int amount, const char* event, uint32 size, enum mob_ai ai);
  434. bool mob_ksprotected (struct block_list *src, struct block_list *target);
  435. int mob_spawn_guardian(const char* mapname, int16 x, int16 y, const char* mobname, int mob_id, const char* event, int guardian, bool has_index); // Spawning Guardians [Valaris]
  436. int mob_spawn_bg(const char* mapname, int16 x, int16 y, const char* mobname, int mob_id, const char* event, uint32 bg_id);
  437. int mob_guardian_guildchange(struct mob_data *md); //Change Guardian's ownership. [Skotlex]
  438. int mob_randomwalk(struct mob_data *md,t_tick tick);
  439. int mob_warpchase(struct mob_data *md, struct block_list *target);
  440. int mob_target(struct mob_data *md,struct block_list *bl,int dist);
  441. int mob_unlocktarget(struct mob_data *md, t_tick tick);
  442. struct mob_data* mob_spawn_dataset(struct spawn_data *data);
  443. int mob_spawn(struct mob_data *md);
  444. TIMER_FUNC(mob_delayspawn);
  445. int mob_setdelayspawn(struct mob_data *md);
  446. int mob_parse_dataset(struct spawn_data *data);
  447. void mob_log_damage(struct mob_data *md, struct block_list *src, int damage);
  448. void mob_damage(struct mob_data *md, struct block_list *src, int damage);
  449. int mob_dead(struct mob_data *md, struct block_list *src, int type);
  450. void mob_revive(struct mob_data *md, uint32 hp);
  451. void mob_heal(struct mob_data *md,uint32 heal);
  452. #define mob_stop_walking(md, type) unit_stop_walking(&(md)->bl, type)
  453. #define mob_stop_attack(md) unit_stop_attack(&(md)->bl)
  454. void mob_clear_spawninfo();
  455. void do_init_mob(void);
  456. void do_final_mob(bool is_reload);
  457. TIMER_FUNC(mob_timer_delete);
  458. int mob_deleteslave(struct mob_data *md);
  459. int mob_random_class (int *value, size_t count);
  460. int mob_get_random_id(int type, enum e_random_monster_flags flag, int lv);
  461. int mob_class_change(struct mob_data *md,int mob_id);
  462. int mob_warpslave(struct block_list *bl, int range);
  463. int mob_linksearch(struct block_list *bl,va_list ap);
  464. bool mob_chat_display_message (mob_data &md, uint16 msg_id);
  465. int mobskill_use(struct mob_data *md,t_tick tick,int event, int64 damage = 0);
  466. int mobskill_event(struct mob_data *md,struct block_list *src,t_tick tick, int flag, int64 damage = 0);
  467. int mob_summonslave(struct mob_data *md2,int *value,int amount,uint16 skill_id);
  468. int mob_countslave(struct block_list *bl);
  469. int mob_count_sub(struct block_list *bl, va_list ap);
  470. int mob_removeslaves(block_list* bl);
  471. int mob_is_clone(int mob_id);
  472. int mob_clone_spawn(map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, uint32 duration);
  473. int mob_clone_delete(struct mob_data *md);
  474. void mob_reload_itemmob_data(void);
  475. void mob_reload(void);
  476. void mob_add_spawn(uint16 mob_id, const struct spawn_info& new_spawn);
  477. const std::vector<spawn_info> mob_get_spawns(uint16 mob_id);
  478. bool mob_has_spawn(uint16 mob_id);
  479. int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md = nullptr);
  480. // MvP Tomb System
  481. int mvptomb_setdelayspawn(struct npc_data *nd);
  482. TIMER_FUNC(mvptomb_delayspawn);
  483. void mvptomb_create(struct mob_data *md, char *killer, time_t time);
  484. void mvptomb_destroy(struct mob_data *md);
  485. void mob_setdropitem_option( item& itm, s_mob_drop& mobdrop );
  486. #define CHK_MOBSIZE(size) ((size) >= SZ_SMALL && (size) < SZ_MAX) /// Check valid Monster Size
  487. #endif /* MOB_HPP */