diff options
author | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-29 19:18:18 +0000 |
---|---|---|
committer | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-29 19:18:18 +0000 |
commit | ab0a9edc2f5754c4f778c008caff1682d43d65eb (patch) | |
tree | 639e173ce8010bd59ddddb5460fdc56858a1ac1a /src/map/mob.c | |
parent | e5bce970b13d3485cfa823aa4810787c2006181a (diff) | |
download | hercules-ab0a9edc2f5754c4f778c008caff1682d43d65eb.tar.gz hercules-ab0a9edc2f5754c4f778c008caff1682d43d65eb.tar.bz2 hercules-ab0a9edc2f5754c4f778c008caff1682d43d65eb.tar.xz hercules-ab0a9edc2f5754c4f778c008caff1682d43d65eb.zip |
cxx updates
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@861 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index c6b772209..539a10c1a 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -99,7 +99,7 @@ int mob_spawn_dataset(struct mob_data *md,const char *mobname,int class) memcpy(md->name,mobname,24); md->n = 0; - md->base_class = md->class = class; + md->base_class = md->class_ = class; md->bl.id= npc_get_new_npc_id(); memset(&md->state,0,sizeof(md->state)); @@ -600,11 +600,11 @@ static int mob_attack(struct mob_data *md,unsigned int tick,int data) if(!md->mode) - mode=mob_db[md->class].mode; + mode=mob_db[md->class_].mode; else mode=md->mode; - race=mob_db[md->class].race; + race=mob_db[md->class_].race; if(!(mode&0x80)){ md->target_id=0; md->state.targettype = NONE_ATTACKABLE; @@ -617,7 +617,7 @@ static int mob_attack(struct mob_data *md,unsigned int tick,int data) return 0; } - range = mob_db[md->class].range; + range = mob_db[md->class_].range; if(mode&1) range++; if(distance(md->bl.x,md->bl.y,tbl->x,tbl->y) > range) @@ -912,7 +912,7 @@ int mob_spawn(int id) map_delblock(&md->bl); } else - md->class = md->base_class; + md->class_ = md->base_class; md->bl.m =md->m; do { @@ -946,11 +946,11 @@ int mob_spawn(int id) md->move_fail_count = 0; if(!md->speed) - md->speed = mob_db[md->class].speed; - md->def_ele = mob_db[md->class].element; + md->speed = mob_db[md->class_].speed; + md->def_ele = mob_db[md->class_].element; if(!md->level) // [Valaris] - md->level=mob_db[md->class].lv; + md->level=mob_db[md->class_].lv; md->master_id=0; md->master_dist=0; @@ -964,7 +964,7 @@ int mob_spawn(int id) md->canmove_tick = tick; md->guild_id = 0; - if (md->class >= 1285 && md->class <= 1288) { + if (md->class_ >= 1285 && md->class_ <= 1288) { struct guild_castle *gc=guild_mapname2gc(map[md->bl.m].name); if(gc) md->guild_id = gc->guild_id; @@ -998,7 +998,7 @@ int mob_spawn(int id) md->hp = battle_get_max_hp(&md->bl); if(md->hp<=0){ - mob_makedummymobdb(md->class); + mob_makedummymobdb(md->class_); md->hp = battle_get_max_hp(&md->bl); } @@ -1094,7 +1094,7 @@ int mob_can_reach(struct mob_data *md,struct block_list *bl,int range) //=========== guildcastle guardian no search start=========== //when players are the guild castle member not attack them ! - if(md->class >= 1285 && md->class <= 1287){ + if(md->class_ >= 1285 && md->class_ <= 1287){ struct map_session_data *sd; struct guild *g=NULL; struct guild_castle *gc=guild_mapname2gc(map[bl->m].name); @@ -1171,10 +1171,10 @@ int mob_target(struct mob_data *md,struct block_list *bl,int dist) sc_data = battle_get_sc_data(bl); option = battle_get_option(bl); - race=mob_db[md->class].race; + race=mob_db[md->class_].race; if(!md->mode) - mode=mob_db[md->class].mode; + mode=mob_db[md->class_].mode; else mode=md->mode; @@ -1236,13 +1236,13 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) return 0; if(!smd->mode) - mode=mob_db[smd->class].mode; + mode=mob_db[smd->class_].mode; else mode=smd->mode; // アクティブでターゲット射程内にいるなら、ロックする if( mode&0x04 ){ - race=mob_db[smd->class].race; + race=mob_db[smd->class_].race; //対象がPCの場合 if(tsd && !pc_isdead(tsd) && @@ -1295,7 +1295,7 @@ static int mob_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap) nullpo_retr(0, itc=va_arg(ap,int *)); if(!md->mode) - mode=mob_db[md->class].mode; + mode=mob_db[md->class_].mode; else mode=md->mode; @@ -1332,8 +1332,8 @@ static int mob_ai_sub_hard_linksearch(struct block_list *bl,va_list ap) nullpo_retr(0, target=va_arg(ap,struct block_list *)); // same family free in a range at a link monster -- it will be made to lock if MOB is -/* if( (md->target_id > 0 && md->state.targettype == ATTACKABLE) && mob_db[md->class].mode&0x08){ - if( tmd->class==md->class && (!tmd->target_id || md->state.targettype == NONE_ATTACKABLE) && tmd->bl.m == md->bl.m){ +/* if( (md->target_id > 0 && md->state.targettype == ATTACKABLE) && mob_db[md->class_].mode&0x08){ + if( tmd->class_==md->class_ && (!tmd->target_id || md->state.targettype == NONE_ATTACKABLE) && tmd->bl.m == md->bl.m){ if( mob_can_reach(tmd,target,12) ){ // Reachability judging tmd->target_id=md->target_id; tmd->state.targettype = ATTACKABLE; @@ -1341,8 +1341,8 @@ static int mob_ai_sub_hard_linksearch(struct block_list *bl,va_list ap) } } }*/ - if( md->attacked_id > 0 && mob_db[md->class].mode&0x08){ - if( tmd->class==md->class && tmd->bl.m == md->bl.m && (!tmd->target_id || md->state.targettype == NONE_ATTACKABLE)){ + if( md->attacked_id > 0 && mob_db[md->class_].mode&0x08){ + if( tmd->class_==md->class_ && tmd->bl.m == md->bl.m && (!tmd->target_id || md->state.targettype == NONE_ATTACKABLE)){ if( mob_can_reach(tmd,target,12) ){ // Reachability judging tmd->target_id=md->attacked_id; tmd->state.targettype = ATTACKABLE; @@ -1368,7 +1368,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick) if((bl=map_id2bl(md->master_id)) != NULL ) mmd=(struct mob_data *)bl; - mode=mob_db[md->class].mode; + mode=mob_db[md->class_].mode; // It is not main monster/leader. if(!mmd || mmd->bl.type!=BL_MOB || mmd->bl.id!=md->master_id) @@ -1439,7 +1439,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick) struct map_session_data *sd=map_id2sd(mmd->target_id); if(sd!=NULL && !pc_isdead(sd) && sd->invincible_timer == -1 && !pc_isinvisible(sd)){ - race=mob_db[md->class].race; + race=mob_db[md->class_].race; if(mode&0x20 || (sd->sc_data[SC_TRICKDEAD].timer == -1 && sd->sc_data[SC_BASILICA].timer == -1 && ( (!pc_ishiding(sd) && !sd->state.gangsterparadise) || ((race == 4 || race == 6) && !sd->perfect_hiding) ) ) ){ // 妨害がないか判定 @@ -1457,7 +1457,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick) struct map_session_data *sd=map_id2sd(md->target_id); if(sd!=NULL && !pc_isdead(sd) && sd->invincible_timer == -1 && !pc_isinvisible(sd)){ - race=mob_db[mmd->class].race; + race=mob_db[mmd->class_].race; if(mode&0x20 || (sd->sc_data[SC_TRICKDEAD].timer == -1 && (!(sd->status.option&0x06) || race==4 || race==6) @@ -1525,7 +1525,7 @@ static int mob_randomwalk(struct mob_data *md,int tick) md->target_dir = 0; if(md->move_fail_count>1000){ if(battle_config.error_log) - printf("MOB cant move. random spawn %d, class = %d\n",md->bl.id,md->class); + printf("MOB cant move. random spawn %d, class = %d\n",md->bl.id,md->class_); md->move_fail_count=0; mob_spawn(md->bl.id); } @@ -1577,11 +1577,11 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) } if(!md->mode) - mode=mob_db[md->class].mode; + mode=mob_db[md->class_].mode; else mode=md->mode; - race=mob_db[md->class].race; + race=mob_db[md->class_].race; // Abnormalities if((md->opt1 > 0 && md->opt1 != 6) || md->state.state==MS_DELAY || md->sc_data[SC_BLADESTOP].timer != -1) @@ -1674,7 +1674,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) ((pc_ishiding(tsd) || tsd->state.gangsterparadise) && !((race == 4 || race == 6) && !tsd->perfect_hiding) )) ) mob_unlocktarget(md,tick); // スキルなどによる策敵妨害 - else if(!battle_check_range(&md->bl,tbl,mob_db[md->class].range)){ + else if(!battle_check_range(&md->bl,tbl,mob_db[md->class_].range)){ // 攻撃範囲外なので移動 if(!(mode&1)){ // 移動しないモード mob_unlocktarget(md,tick); @@ -1889,7 +1889,7 @@ static int mob_ai_sub_lazy(void * key,void * data,va_list app) } if(DIFF_TICK(md->next_walktime,tick)<0 && - (mob_db[md->class].mode&1) && mob_can_move(md) ){ + (mob_db[md->class_].mode&1) && mob_can_move(md) ){ if( map[md->bl.m].users>0 ){ // Since PC is in the same map, somewhat better negligent processing is carried out. @@ -1900,7 +1900,7 @@ static int mob_ai_sub_lazy(void * key,void * data,va_list app) // MOB which is not not the summons MOB but BOSS, either sometimes reboils. else if( rand()%1000<MOB_LAZYWARPPERC && md->x0<=0 && md->master_id!=0 && - mob_db[md->class].mexp <= 0 && !(mob_db[md->class].mode & 0x20)) + mob_db[md->class_].mexp <= 0 && !(mob_db[md->class_].mode & 0x20)) mob_spawn(md->bl.id); }else{ @@ -1908,7 +1908,7 @@ static int mob_ai_sub_lazy(void * key,void * data,va_list app) // MOB which is not BOSS which is not Summons MOB, either -- a case -- sometimes -- leaping if( rand()%1000<MOB_LAZYWARPPERC && md->x0<=0 && md->master_id!=0 && - mob_db[md->class].mexp <= 0 && !(mob_db[md->class].mode & 0x20)) + mob_db[md->class_].mexp <= 0 && !(mob_db[md->class_].mode & 0x20)) mob_warp(md,-1,-1,-1,-1); } @@ -2018,7 +2018,7 @@ int mob_delete(struct mob_data *md) mob_changestate(md,MS_DEAD,0); clif_clearchar_area(&md->bl,1); map_delblock(&md->bl); - if(mob_get_viewclass(md->class) <= 1000) + if(mob_get_viewclass(md->class_) <= 1000) clif_clearchar_delay(gettick()+3000,&md->bl,0); mob_deleteslave(md); mob_setdelayspawn(md->bl.id); @@ -2220,7 +2220,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) md->hp-=damage; - if(md->class >= 1285 && md->class <=1287) { // guardian hp update [Valaris] + if(md->class_ >= 1285 && md->class_ <=1287) { // guardian hp update [Valaris] struct guild_castle *gc=guild_mapname2gc(map[md->bl.m].name); if(gc) { @@ -2292,7 +2292,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) if(md->state.special_mob_ai == 2){//スフィアーマイン int skillidx=0; - if((skillidx=mob_skillid2skillidx(md->class,NPC_SELFDESTRUCTION2))>=0){ + if((skillidx=mob_skillid2skillidx(md->class_,NPC_SELFDESTRUCTION2))>=0){ md->mode |= 0x1; md->next_walktime=tick; mobskill_use_id(md,&md->bl,skillidx);//自爆詠唱開始 @@ -2374,13 +2374,13 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) // jAthena's exp formula // per = ((double)md->dmglog[i].dmg)*(9.+(double)((count > 6)? 6:count))/10./((double)max_hp) * dmg_rate; per = ((double)md->dmglog[i].dmg)*(9.+(double)((count > 6)? 6:count))/10./tdmg; - temp = (double)mob_db[md->class].base_exp * per; + temp = (double)mob_db[md->class_].base_exp * per; base_exp = (temp > 2147483647.)? 0x7fffffff:(int)temp; - if(mob_db[md->class].base_exp > 0 && base_exp < 1) base_exp = 1; + if(mob_db[md->class_].base_exp > 0 && base_exp < 1) base_exp = 1; if(base_exp < 0) base_exp = 0; - temp = (double)mob_db[md->class].job_exp * per; + temp = (double)mob_db[md->class_].job_exp * per; job_exp = (temp > 2147483647.)? 0x7fffffff:(int)temp; - if(mob_db[md->class].job_exp > 0 && job_exp < 1) job_exp = 1; + if(mob_db[md->class_].job_exp > 0 && job_exp < 1) job_exp = 1; if(job_exp < 0) job_exp = 0; } else if (battle_config.exp_calc_type == 1) { @@ -2388,9 +2388,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) per=(double)md->dmglog[i].dmg*256*(9+(double)((count > 6)? 6:count))/10/(double)max_hp; if(per>512) per=512; if(per<1) per=1; - base_exp=mob_db[md->class].base_exp*per/256; + base_exp=mob_db[md->class_].base_exp*per/256; if(base_exp < 1) base_exp = 1; - job_exp=mob_db[md->class].job_exp*per/256; + job_exp=mob_db[md->class_].job_exp*per/256; if(job_exp < 1) job_exp = 1; } else { @@ -2398,16 +2398,16 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) per=(double)md->dmglog[i].dmg*256*(9+(double)((count > 6)? 6:count))/10/tdmg; if(per>512) per=512; if(per<1) per=1; - base_exp=mob_db[md->class].base_exp*per/256; + base_exp=mob_db[md->class_].base_exp*per/256; if(base_exp < 1) base_exp = 1; - job_exp=mob_db[md->class].job_exp*per/256; + job_exp=mob_db[md->class_].job_exp*per/256; if(job_exp < 1) job_exp = 1; } - if(sd && battle_config.pk_mode && (mob_db[md->class].lv - sd->status.base_level >= 20)) { + if(sd && battle_config.pk_mode && (mob_db[md->class_].lv - sd->status.base_level >= 20)) { base_exp*=1.15; // pk_mode additional exp if monster >20 levels [Valaris] } - if(sd && battle_config.pk_mode && (mob_db[md->class].lv - sd->status.base_level >= 20)) { + if(sd && battle_config.pk_mode && (mob_db[md->class_].lv - sd->status.base_level >= 20)) { job_exp*=1.15; // pk_mode additional exp if monster >20 levels [Valaris] } if(md->master_id || (md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1)) { // for summoned creatures [Valaris] @@ -2417,12 +2417,12 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) else { if(battle_config.zeny_from_mobs) { if(md->level > 0) zeny=(md->level+rand()%md->level)*per/256; // zeny calculation moblv + random moblv [Valaris] - if(mob_db[md->class].mexp > 0) + if(mob_db[md->class_].mexp > 0) zeny*=rand()%250; } - if(battle_config.mobs_level_up && md->level > mob_db[md->class].lv) { // [Valaris] - job_exp+=((md->level-mob_db[md->class].lv)*mob_db[md->class].job_exp*.03)*per/256; - base_exp+=((md->level-mob_db[md->class].lv)*mob_db[md->class].base_exp*.03)*per/256; + if(battle_config.mobs_level_up && md->level > mob_db[md->class_].lv) { // [Valaris] + job_exp+=((md->level-mob_db[md->class_].lv)*mob_db[md->class_].job_exp*.03)*per/256; + base_exp+=((md->level-mob_db[md->class_].lv)*mob_db[md->class_].base_exp*.03)*per/256; } } @@ -2473,18 +2473,18 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) if(md->master_id || (md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1)) // Added [Valaris] break; // End - if(mob_db[md->class].dropitem[i].nameid <= 0) + if(mob_db[md->class_].dropitem[i].nameid <= 0) continue; - drop_rate = mob_db[md->class].dropitem[i].p; + drop_rate = mob_db[md->class_].dropitem[i].p; if(drop_rate <= 0 && battle_config.drop_rate0item) drop_rate = 1; if(battle_config.drops_by_luk>0 && sd && md) drop_rate+=(sd->status.luk*battle_config.drops_by_luk)/100; // drops affected by luk [Valaris] - if(sd && md && battle_config.pk_mode==1 && (mob_db[md->class].lv - sd->status.base_level >= 20)) drop_rate*=1.25; // pk_mode increase drops if 20 level difference [Valaris] + if(sd && md && battle_config.pk_mode==1 && (mob_db[md->class_].lv - sd->status.base_level >= 20)) drop_rate*=1.25; // pk_mode increase drops if 20 level difference [Valaris] if(drop_rate <= rand()%10000) continue; ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop)); - ditem->nameid = mob_db[md->class].dropitem[i].nameid; + ditem->nameid = mob_db[md->class_].dropitem[i].nameid; log_item[i] = ditem->nameid; ditem->amount = 1; ditem->m = md->bl.m; @@ -2498,7 +2498,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) #ifndef TXT_ONLY if(log_config.drop > 0) - log_drop(mvp_sd, md->class, log_item); + log_drop(mvp_sd, md->class_, log_item); #endif // Ore Discovery [Celest] @@ -2520,7 +2520,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) #ifndef TXT_ONLY if(log_config.drop > 0) - log_drop(mvp_sd, md->class, log_item); + log_drop(mvp_sd, md->class_, log_item); #endif if(sd && sd->state.attack_type == BF_WEAPON) { @@ -2530,8 +2530,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) if(sd->monster_drop_itemid[i] <= 0) continue; if(sd->monster_drop_race[i] & (1<<race) || - (mob_db[md->class].mode & 0x20 && sd->monster_drop_race[i] & 1<<10) || - (!(mob_db[md->class].mode & 0x20) && sd->monster_drop_race[i] & 1<<11) ) { + (mob_db[md->class_].mode & 0x20 && sd->monster_drop_race[i] & 1<<10) || + (!(mob_db[md->class_].mode & 0x20) && sd->monster_drop_race[i] & 1<<11) ) { if(sd->monster_drop_itemrate[i] <= rand()%10000) continue; @@ -2548,7 +2548,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) } } if(sd->get_zeny_num > 0) - pc_getzeny(sd,mob_db[md->class].lv*10 + rand()%(sd->get_zeny_num+1)); + pc_getzeny(sd,mob_db[md->class_].lv*10 + rand()%(sd->get_zeny_num+1)); } if(md->lootitem) { for(i=0;i<md->lootitem_count;i++) { @@ -2568,11 +2568,11 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) } // mvp処理 - if(mvp_sd && mob_db[md->class].mexp > 0 ){ + if(mvp_sd && mob_db[md->class_].mexp > 0 ){ int log_mvp[2] = {0}; int j; int mexp; - temp = ((double)mob_db[md->class].mexp * (9.+(double)count)/10.); //[Gengar] + temp = ((double)mob_db[md->class_].mexp * (9.+(double)count)/10.); //[Gengar] mexp = (temp > 2147483647.)? 0x7fffffff:(int)temp; if(mexp < 1) mexp = 1; clif_mvp_effect(mvp_sd); // エフェクト @@ -2581,9 +2581,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) log_mvp[1] = mexp; for(j=0;j<3;j++){ i = rand() % 3; - if(mob_db[md->class].mvpitem[i].nameid <= 0) + if(mob_db[md->class_].mvpitem[i].nameid <= 0) continue; - drop_rate = mob_db[md->class].mvpitem[i].p; + drop_rate = mob_db[md->class_].mvpitem[i].p; if(drop_rate <= 0 && battle_config.drop_rate0item) drop_rate = 1; if(drop_rate < battle_config.item_drop_mvp_min) @@ -2593,7 +2593,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) if(drop_rate <= rand()%10000) continue; memset(&item,0,sizeof(item)); - item.nameid=mob_db[md->class].mvpitem[i].nameid; + item.nameid=mob_db[md->class_].mvpitem[i].nameid; item.identify=!itemdb_isequip3(item.nameid); clif_mvp_item(mvp_sd,item.nameid); log_mvp[0] = item.nameid; @@ -2607,7 +2607,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) } #ifndef TXT_ONLY if(log_config.mvpdrop > 0) - log_mvpdrop(mvp_sd, md->class, log_mvp); + log_mvpdrop(mvp_sd, md->class_, log_mvp); #endif } @@ -2649,7 +2649,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) clif_clearchar_area(&md->bl,1); if(md->level) md->level=0; map_delblock(&md->bl); - if(mob_get_viewclass(md->class) <= 1000) + if(mob_get_viewclass(md->class_) <= 1000) clif_clearchar_delay(tick+3000,&md->bl,0); mob_deleteslave(md); mob_setdelayspawn(md->bl.id); @@ -2683,7 +2683,7 @@ int mob_class_change(struct mob_data *md,int *value) max_hp = battle_get_max_hp(&md->bl); hp_rate = md->hp*100/max_hp; clif_mob_class_change(md,class); - md->class = class; + md->class_ = class; max_hp = battle_get_max_hp(&md->bl); if(battle_config.monster_class_change_full_recover==1) { md->hp = max_hp; @@ -2700,8 +2700,8 @@ int mob_class_change(struct mob_data *md,int *value) md->target_id = 0; md->move_fail_count = 0; - md->speed = mob_db[md->class].speed; - md->def_ele = mob_db[md->class].element; + md->speed = mob_db[md->class_].speed; + md->def_ele = mob_db[md->class_].element; mob_changestate(md,MS_IDLE,0); skill_castcancel(&md->bl,0); @@ -2742,7 +2742,7 @@ int mob_heal(struct mob_data *md,int heal) if( max_hp < md->hp ) md->hp = max_hp; - if(md->class >= 1285 && md->class <=1287) { // guardian hp update [Valaris] + if(md->class_ >= 1285 && md->class_ <=1287) { // guardian hp update [Valaris] struct guild_castle *gc=guild_mapname2gc(map[md->bl.m].name); if(gc) { if(md->bl.id==gc->GID0) gc->Ghp0=md->hp; @@ -2835,7 +2835,7 @@ int mob_warp(struct mob_data *md,int m,int x,int y,int type) }else { m=md->bl.m; if(battle_config.error_log==1) - printf("MOB %d warp failed, class = %d\n",md->bl.id,md->class); + printf("MOB %d warp failed, class = %d\n",md->bl.id,md->class_); } md->target_id=0; // タゲを解除する @@ -2846,7 +2846,7 @@ int mob_warp(struct mob_data *md,int m,int x,int y,int type) if(type>0 && i==1000) { if(battle_config.battle_log) - printf("MOB %d warp to (%d,%d), class = %d\n",md->bl.id,x,y,md->class); + printf("MOB %d warp to (%d,%d), class = %d\n",md->bl.id,x,y,md->class_); } map_addblock(&md->bl); @@ -3107,7 +3107,7 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data ) md->skilldelay[md->skillidx]=tick; if(battle_config.mob_skill_log) - printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class); + printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class_); // mob_stop_walking(md,0); switch( skill_get_nk(md->skillid) ) @@ -3117,7 +3117,7 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data ) skill_castend_damage_id(&md->bl,bl,md->skillid,md->skilllv,tick,0); break; case 1:// 支援系 - if(!mob_db[md->class].skill[md->skillidx].val[0] && + if(!mob_db[md->class_].skill[md->skillidx].val[0] && (md->skillid==AL_HEAL || (md->skillid==ALL_RESURRECTION && bl->type != BL_PC)) && battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl)) ) skill_castend_damage_id(&md->bl,bl,md->skillid,md->skilllv,tick,0); else @@ -3238,7 +3238,7 @@ int mobskill_castend_pos( int tid, unsigned int tick, int id,int data ) md->skilldelay[md->skillidx]=tick; if(battle_config.mob_skill_log) - printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class); + printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class_); // mob_stop_walking(md,0); skill_castend_pos2(&md->bl,md->skillx,md->skilly,md->skillid,md->skilllv,tick,0); @@ -3258,7 +3258,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx) int skill_id, skill_lv, forcecast = 0; nullpo_retr(0, md); - nullpo_retr(0, ms=&mob_db[md->class].skill[skill_idx]); + nullpo_retr(0, ms=&mob_db[md->class_].skill[skill_idx]); if( target==NULL && (target=map_id2bl(md->target_id))==NULL ) return 0; @@ -3326,7 +3326,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx) } if(battle_config.mob_skill_log) - printf("MOB skill use target_id=%d skill=%d lv=%d cast=%d, class = %d\n",target->id,skill_id,skill_lv,casttime,md->class); + printf("MOB skill use target_id=%d skill=%d lv=%d cast=%d, class = %d\n",target->id,skill_id,skill_lv,casttime,md->class_); if(casttime>0 || forcecast){ // 詠唱が必要 // struct mob_data *md2; @@ -3335,7 +3335,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx) md->bl.id, target->id, 0,0, skill_id,casttime); // 詠唱反応モンスター -/* if( target->type==BL_MOB && mob_db[(md2=(struct mob_data *)target)->class].mode&0x10 && +/* if( target->type==BL_MOB && mob_db[(md2=(struct mob_data *)target)->class_].mode&0x10 && md2->state.state!=MS_ATTACK){ md2->target_id=md->bl.id; md->state.targettype = ATTACKABLE; @@ -3379,7 +3379,7 @@ int mobskill_use_pos( struct mob_data *md, int skill_id, skill_lv; nullpo_retr(0, md); - nullpo_retr(0, ms=&mob_db[md->class].skill[skill_idx]); + nullpo_retr(0, ms=&mob_db[md->class_].skill[skill_idx]); if( md->bl.prev==NULL ) return 0; @@ -3424,7 +3424,7 @@ int mobskill_use_pos( struct mob_data *md, if(battle_config.mob_skill_log) printf("MOB skill use target_pos=(%d,%d) skill=%d lv=%d cast=%d, class = %d\n", - skill_x,skill_y,skill_id,skill_lv,casttime,md->class); + skill_x,skill_y,skill_id,skill_lv,casttime,md->class_); if( casttime>0 ) { // A cast time is required. mob_stop_walking(md,0); // 歩行停止 @@ -3475,7 +3475,7 @@ int mob_getfriendhpltmaxrate_sub(struct block_list *bl,va_list ap) return 0; rate=va_arg(ap,int); fr=va_arg(ap,struct mob_data **); - if( md->hp < mob_db[md->class].max_hp*rate/100 ) + if( md->hp < mob_db[md->class_].max_hp*rate/100 ) (*fr)=md; return 0; } @@ -3547,7 +3547,7 @@ int mobskill_use(struct mob_data *md,unsigned int tick,int event) int i,max_hp; nullpo_retr(0, md); - nullpo_retr(0, ms = mob_db[md->class].skill); + nullpo_retr(0, ms = mob_db[md->class_].skill); max_hp = battle_get_max_hp(&md->bl); @@ -3560,7 +3560,7 @@ int mobskill_use(struct mob_data *md,unsigned int tick,int event) if(md->sc_data[SC_SELFDESTRUCTION].timer!=-1) //自爆中はスキルを使わない return 0; - for(i=0;i<mob_db[md->class].maxskill;i++){ + for(i=0;i<mob_db[md->class_].maxskill;i++){ int c2=ms[i].cond2,flag=0; struct mob_data *fmd=NULL; @@ -3697,18 +3697,18 @@ int mob_gvmobcheck(struct map_session_data *sd, struct block_list *bl) nullpo_retr(0,bl); if(bl->type==BL_MOB && (md=(struct mob_data *)bl) && - (md->class == 1288 || md->class == 1287 || md->class == 1286 || md->class == 1285)) + (md->class_ == 1288 || md->class_ == 1287 || md->class_ == 1286 || md->class_ == 1285)) { struct guild_castle *gc=guild_mapname2gc(map[sd->bl.m].name); struct guild *g=guild_search(sd->status.guild_id); - if(g == NULL && md->class == 1288) + if(g == NULL && md->class_ == 1288) return 0;//ギルド未加入ならダメージ無し else if(gc != NULL && !map[sd->bl.m].flag.gvg) return 0;//砦内でGvじゃないときはダメージなし else if(g && gc != NULL && g->guild_id == gc->guild_id) return 0;//自占領ギルドのエンペならダメージ無し - else if(g && guild_checkskill(g,GD_APPROVAL) <= 0 && md->class == 1288) + else if(g && guild_checkskill(g,GD_APPROVAL) <= 0 && md->class_ == 1288) return 0;//正規ギルド承認がないとダメージ無し } |