diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-20 21:25:47 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-20 21:25:47 +0000 |
commit | 38d6992791ab2ee1713093be2cfb3077a689d28e (patch) | |
tree | 52d2efe662580f475fe29dc51fe1c1e2e3866b62 /src/map/mob.c | |
parent | 99f319c197d5e783eef978859535287b45c9f989 (diff) | |
download | hercules-38d6992791ab2ee1713093be2cfb3077a689d28e.tar.gz hercules-38d6992791ab2ee1713093be2cfb3077a689d28e.tar.bz2 hercules-38d6992791ab2ee1713093be2cfb3077a689d28e.tar.xz hercules-38d6992791ab2ee1713093be2cfb3077a689d28e.zip |
- The max level of NPC_SPLASHATTACK is now 1.
- Implemented NPC_DEFENDER. Reduces ranged Physical+Misc damage by 80%
- Improved the battle config reader so it accepts hexadecimal values. Updated the monster_ai description to make use of this.
- Added monster_ai&0x200. When set, mob skill delays are shared. That is, if the mob has several lines with the same skill, when the skill is used, the delay will be set to all of them, not just the one entry used.
- Cleaned mob.c to use hex values when refering mob_ai
- Corrected NPC_BARRIER so it grants 100 def/mdef (and not just mdef)
- Weapon ATK bonuses will now only apply to watk and NOT watk2 on players (on players watk2 is refine bonus)
- Corrected NPC_KEEPING. it should give 90 def, not 100
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9277 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 3e5338654..a1adac8fb 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -546,7 +546,7 @@ int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state switch (state) { case MSS_RUSH: case MSS_FOLLOW: - easy = 0; //(battle_config.mob_ai&1?0:1); + easy = 0; //(battle_config.mob_ai&0x1?0:1); break; case MSS_LOOT: default: @@ -722,14 +722,14 @@ static int mob_can_changetarget(struct mob_data* md, struct block_list* target, { if (md->state.provoke_flag == target->id) return 1; - else if (!battle_config.mob_ai&4) + else if (!battle_config.mob_ai&0x4) return 0; } switch (md->state.skillstate) { case MSS_BERSERK: //Only Assist, Angry or Aggressive+CastSensor mobs can change target while attacking. if (mode&(MD_ASSIST|MD_ANGRY) || (mode&(MD_AGGRESSIVE|MD_CASTSENSOR)) == (MD_AGGRESSIVE|MD_CASTSENSOR)) - return (battle_config.mob_ai&4 || check_distance_bl(&md->bl, target, 3)); + return (battle_config.mob_ai&0x4 || check_distance_bl(&md->bl, target, 3)); else return 0; case MSS_RUSH: @@ -802,7 +802,7 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) !(status_get_mode(&md->bl)&MD_BOSS)) return 0; //Gangster paradise protection. default: - if (!(battle_config.mob_ai&128) && (*target) && (*target)->type == BL_HOM && bl->type != BL_HOM) + if (!(battle_config.mob_ai&0x80) && (*target) && (*target)->type == BL_HOM && bl->type != BL_HOM) return 0; //For some reason Homun targets are never overriden. dist = distance_bl(&md->bl, bl); @@ -1102,20 +1102,20 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) tbl = map_id2bl(md->target_id); if (!tbl || tbl->m != md->bl.m || (md->ud.attacktimer == -1 && !status_check_skilluse(&md->bl, tbl, 0, 0)) || - (md->ud.walktimer != -1 && !(battle_config.mob_ai&1) && !check_distance_bl(&md->bl, tbl, md->min_chase)) || + (md->ud.walktimer != -1 && !(battle_config.mob_ai&0x1) && !check_distance_bl(&md->bl, tbl, md->min_chase)) || ( tbl->type == BL_PC && !(mode&MD_BOSS) && ((TBL_PC*)tbl)->state.gangsterparadise )) { //Unlock current target. - if (tbl && tbl->m != md->bl.m && battle_config.mob_ai&64) + if (tbl && tbl->m != md->bl.m && battle_config.mob_ai&0x40) { //Chase to a nearby warp [Skotlex] tbl = NULL; map_foreachinrange (mob_ai_sub_hard_warpsearch, &md->bl, view_range, BL_NPC, md, &tbl); if (tbl) unit_walktobl(&md->bl, tbl, 0, 1); - } else if (battle_config.mob_ai&8) //Inmediately stop chasing. + } else if (battle_config.mob_ai&0x8) //Inmediately stop chasing. mob_stop_walking(md,1); - mob_unlocktarget(md, tick-(battle_config.mob_ai&8?3000:0)); //Imediately do random walk. + mob_unlocktarget(md, tick-(battle_config.mob_ai&0x8?3000:0)); //Imediately do random walk. tbl = NULL; } } @@ -1126,7 +1126,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) if (md->attacked_id == md->target_id) { if (!battle_check_range(&md->bl, tbl, md->status.rhw.range) && - ((!can_move && battle_config.mob_ai&2) || + ((!can_move && battle_config.mob_ai&0x2) || (!mob_can_reach(md, tbl, md->min_chase, MSS_RUSH)))) { //Rude-attacked (avoid triggering due to can-walk delay). if (DIFF_TICK(tick, md->ud.canmove_tick) > 0 && @@ -1138,7 +1138,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) if (md->bl.m != abl->m || abl->prev == NULL || (dist = distance_bl(&md->bl, abl)) >= MAX_MINCHASE || battle_check_target(bl, abl, BCT_ENEMY) <= 0 || - (battle_config.mob_ai&2 && !status_check_skilluse(bl, abl, 0, 0)) || + (battle_config.mob_ai&0x2 && !status_check_skilluse(bl, abl, 0, 0)) || !mob_can_reach(md, abl, dist+md->db->range3, MSS_RUSH) || ( //Gangster Paradise check abl->type == BL_PC && !(mode&MD_BOSS) && @@ -1154,7 +1154,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) unit_walktoxy(&md->bl, md->bl.x + dist * mask[dir][0], md->bl.y + dist * mask[dir][1], 0); } } - } else if (!(battle_config.mob_ai&2) && !status_check_skilluse(bl, abl, 0, 0)) { + } else if (!(battle_config.mob_ai&0x2) && !status_check_skilluse(bl, abl, 0, 0)) { //Can't attack back, but didn't invoke a rude attacked skill... md->attacked_id = 0; //Simply unlock, shouldn't attempt to run away when in dumb_ai mode. } else { //Attackable @@ -1238,7 +1238,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) md->state.skillstate = md->state.aggressive?MSS_FOLLOW:MSS_RUSH; if (md->ud.walktimer != -1 && md->ud.target == tbl->id && ( - !(battle_config.mob_ai&1) || + !(battle_config.mob_ai&0x1) || check_distance_blxy(tbl, md->ud.to_x, md->ud.to_y, md->status.rhw.range) )) //Current target tile is still within attack range. return 0; @@ -1352,7 +1352,7 @@ static int mob_ai_sub_lazy(DBKey key,void * data,va_list ap) if(md->bl.type!=BL_MOB || md->bl.prev == NULL) return 0; - if (md->nd || (battle_config.mob_ai&32 && map[md->bl.m].users>0)) + if (md->nd || (battle_config.mob_ai&0x20 && map[md->bl.m].users>0)) return mob_ai_sub_hard(&md->bl, ap); tick=va_arg(ap,unsigned int); @@ -1421,7 +1421,7 @@ static int mob_ai_lazy(int tid,unsigned int tick,int id,int data) static int mob_ai_hard(int tid,unsigned int tick,int id,int data) { - if (battle_config.mob_ai&32) + if (battle_config.mob_ai&0x20) map_foreachiddb(mob_ai_sub_lazy,tick); else clif_foreachclient(mob_ai_sub_foreachclient,tick); @@ -2547,7 +2547,7 @@ int mob_getfriendhprate_sub(struct block_list *bl,va_list ap) max_rate=va_arg(ap,int); fr=va_arg(ap,struct block_list **); - if( md->bl.id == bl->id && !(battle_config.mob_ai&16)) + if( md->bl.id == bl->id && !(battle_config.mob_ai&0x10)) return 0; if ((*fr) != NULL) //A friend was already found. @@ -2604,7 +2604,7 @@ int mob_getfriendstatus_sub(struct block_list *bl,va_list ap) nullpo_retr(0, md=(struct mob_data *)bl); nullpo_retr(0, mmd=va_arg(ap,struct mob_data *)); - if( mmd->bl.id == bl->id && !(battle_config.mob_ai&16) ) + if( mmd->bl.id == bl->id && !(battle_config.mob_ai&0x10) ) return 0; if (battle_check_target(&mmd->bl,bl,BCT_ENEMY)>0) @@ -2657,7 +2657,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) return 0; //Skill act delay only affects non-event skills. //Pick a starting position and loop from that. - i = battle_config.mob_ai&256?rand()%md->db->maxskill:0; + i = battle_config.mob_ai&0x100?rand()%md->db->maxskill:0; for (n = 0; n < md->db->maxskill; i++, n++) { int c2, flag = 0; |