From 021b26b8409a84b4c83eb0cc1eedbd65eedfd4e0 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 22 Mar 2006 23:58:16 +0000 Subject: - Merged the unit_data structure from jA for handling unit-related data (attack times, walking, auto-attack timers, skill related data) - Modified unit_skillcastcancel to receive flag&2, which stands for "cancel casting only if current skill is cancellable" - Battle config options changed from yes/no to BL_TYPE settings: skillrange_by_distance, skill_noreiteration, skill_nofootset, gvg_traps_target_all, skill_log, attack_direction_change, auto_counter_type - Clif.c will disconnect sessions that send an unknown command packet above 0x30000 instead of just ignoring it. - Cleaned up/rewrite of the pet ai, same for pet_calc_pos - Implemented use of mob variable attacked_players as it is used on jA - Cleaned up error reporting during mob-skill loading to be less spamy with non-loaded mobs. - Corrected water_height reading. I forgot to give credits to LittleWolf for providing the water-reading function :X git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5707 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/map/mob.h') diff --git a/src/map/mob.h b/src/map/mob.h index 2e12114ec..e7e3eb07e 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -4,6 +4,8 @@ #ifndef _MOB_H_ #define _MOB_H_ +#include "unit.h" + #define MAX_RANDOMMONSTER 3 #define MAX_MOB_RACE_DB 6 #define MAX_MOB_DB 10000 @@ -11,6 +13,9 @@ a larger mob database. Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes. */ +//Min time before mobs do a check to call nearby friends for help (or for slaves to support their master) +#define MIN_MOBLINKTIME 1000 + // These define the range of available IDs for clones. [Valaris] #define MOB_CLONE_START 9001 #define MOB_CLONE_END 10000 @@ -92,6 +97,7 @@ enum { //Mob skill states. enum { + MSS_ANY = -1, MSS_IDLE, MSS_WALK, MSS_LOOT, @@ -116,20 +122,19 @@ int mob_spawn_guardian(struct map_session_data *sd,char *mapname, // Spawning Gu int x,int y,const char *mobname,int class_,int amount,const char *event,int guardian); // Spawning Guardians [Valaris] int mob_guardian_guildchange(struct block_list *bl,va_list ap); //Change Guardian's ownership. [Skotlex] -int mob_walktoxy(struct mob_data *md,int x,int y,int easy); int mob_randomwalk(struct mob_data *md,int tick); -int mob_can_move(struct mob_data *md); int mob_target(struct mob_data *md,struct block_list *bl,int dist); int mob_unlocktarget(struct mob_data *md,int tick); -int mob_stop_walking(struct mob_data *md,int type); -int mob_stopattack(struct mob_data *); -int mob_spawn(int); -int mob_setdelayspawn(int); +struct mob_data* mob_spawn_dataset(struct spawn_data *data); +int mob_spawn(struct mob_data *md); +int mob_setdelayspawn(struct mob_data *md); +int mob_parse_dataset(struct spawn_data *data); int mob_damage(struct block_list *,struct mob_data*,int,int); -int mob_changestate(struct mob_data *md,int state,int type); int mob_heal(struct mob_data*,int); +#define mob_stop_walking(md, type) { if (md->ud.walktimer != -1) unit_stop_walking(&md->bl, type); } +#define mob_stop_attack(md) { if (md->ud.attacktimer != -1) unit_stop_attack(&md->bl); } //Defines to speed up search. #define mob_get_viewclass(class_) mob_db(class_)->view_class #define mob_get_sex(class_) mob_db(class_)->sex @@ -146,9 +151,6 @@ int mob_heal(struct mob_data*,int); int do_init_mob(void); int do_final_mob(void); -void mob_unload(struct mob_data *md); -int mob_remove_map(struct mob_data *md, int type); -int mob_delete(struct mob_data *md); int mob_timer_delete(int tid, unsigned int tick, int id, int data); int mob_deleteslave(struct mob_data *md); @@ -157,8 +159,8 @@ int mob_deleteslave(struct mob_data *md); int mob_random_class (int *value, size_t count); int mob_get_random_id(int type, int flag, int lv); int mob_class_change(struct mob_data *md,int class_); -int mob_warp(struct mob_data *md,int m,int x,int y,int type); int mob_warpslave(struct block_list *bl, int range); +int mob_linksearch(struct block_list *bl,va_list ap); int mobskill_use(struct mob_data *md,unsigned int tick,int event); int mobskill_event(struct mob_data *md,struct block_list *src,unsigned int tick, int flag); -- cgit v1.2.3-70-g09d2