diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/map.c | 18 | ||||
-rw-r--r-- | src/map/map.h | 1 | ||||
-rw-r--r-- | src/map/mob.c | 1 | ||||
-rw-r--r-- | src/map/mob.h | 1 | ||||
-rw-r--r-- | src/map/npc.c | 4 |
5 files changed, 15 insertions, 10 deletions
diff --git a/src/map/map.c b/src/map/map.c index 7cad8961b..acf203615 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -476,7 +476,7 @@ int map_count_oncell(int m, int x, int y, int type) return count; } /* - * E̸ĪE˫ëȪ + * E̸ĪE˫ëȪ? */ struct skill_unit* map_find_skill_unit_oncell(struct block_list* target,int x,int y,int skill_id,struct skill_unit* out_unit) { @@ -710,7 +710,7 @@ int map_foreachinarea(int (*func)(struct block_list*,va_list), int m, int x0, in } /*========================================== - * `(x0,y0)-(x1,y1)(dx,dy)ړb + * `(x0,y0)-(x1,y1)(dx,dy)ړb? * ̈OɂȂ̈(`L`)?obj * ?funcĂ * @@ -1165,7 +1165,7 @@ int map_get_new_object_id(void) /*========================================== * ACe * - * data==0̎btimerŏ * data!=0̎b͏EŏbƂē + * data==0̎btimerŏ * data!=0̎b͏EŏbƂē? * * ҂́Amap_clearflooritem(id) * map.h?#defineĂ @@ -1462,7 +1462,7 @@ void map_addiddb(struct block_list *bl) TBL_MOB* md = (TBL_MOB*)bl; idb_put(mobid_db,bl->id,bl); - if( (md->db->status.mode&MD_BOSS) && md->db->mexp > 0 ) + if( md->boss ) idb_put(bossid_db, bl->id, bl); } @@ -1700,11 +1700,11 @@ struct mob_data * map_getmob_boss(int m) iter = db_iterator(bossid_db); for( md = (struct mob_data*)dbi_first(iter); dbi_exists(iter); md = (struct mob_data*)dbi_next(iter) ) { - if( md->bl.m != m || !md->spawn ) - continue; - - found = true; - break; + if( md->bl.m == m ) + { + found = true; + break; + } } dbi_destroy(iter); diff --git a/src/map/map.h b/src/map/map.h index 8aaccde2b..a2740bf56 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -239,6 +239,7 @@ struct block_list { // Expanded to specify all mob-related spawn data by [Skotlex] struct spawn_data { short class_; //Class, used because a mob can change it's class + unsigned boss : 1; unsigned short m,x,y; //Spawn information (map, point, spawn-area around point) signed short xs,ys; unsigned short num; //Number of mobs using this structure diff --git a/src/map/mob.c b/src/map/mob.c index 407c24456..531939885 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -211,6 +211,7 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data) md->bl.x = data->x; md->bl.y = data->y; md->class_ = data->class_; + md->boss = data->boss; md->db = mob_db(md->class_); memcpy(md->name, data->name, NAME_LENGTH); if (data->state.ai) diff --git a/src/map/mob.h b/src/map/mob.h index 0ea82abcd..b0a7a11e9 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -124,6 +124,7 @@ struct mob_data { int spawn_timer; //Required for Convex Mirror struct item *lootitem; short class_; + unsigned boss : 1; unsigned int tdmg; //Stores total damage given to the mob, for exp calculations. [Skotlex] int level; int target_id,attacked_id; diff --git a/src/map/npc.c b/src/map/npc.c index 042da1a0c..97e54a8fe 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2485,6 +2485,8 @@ static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const c memset(&mob, 0, sizeof(struct spawn_data)); + mob.boss = !strcmpi(w2,"boss_monster"); + // w1=<map name>,<x>,<y>,<xs>,<ys> // w4=<mob id>,<amount>,<delay1>,<delay2>,<event> if( sscanf(w1, "%31[^,],%d,%d,%d,%d", mapname, &x, &y, &xs, &ys) < 3 @@ -3023,7 +3025,7 @@ void npc_parsesrcfile(const char* filepath) { p = npc_parse_duplicate(w1,w2,w3,w4, p, buffer, filepath); } - else if( strcmpi(w2,"monster") == 0 && count > 3 ) + else if( (strcmpi(w2,"monster") == 0 || strcmpi(w2,"boss_monster") == 0) && count > 3 ) { p = npc_parse_mob(w1, w2, w3, w4, p, buffer, filepath); } |