diff options
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 544d53a1c..73b563d4b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -220,9 +220,9 @@ int battle_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) { src = map->id2bl(dat->src_id); //Check to see if you haven't teleported. [Skotlex] - if( src && target->m == src->m + if( src && (target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER) - && check_distance_bl(src, target, dat->distance) + && (dat->skill_id == MO_EXTREMITYFIST || (target->m == src->m && check_distance_bl(src, target, dat->distance)) ) ) { map->freeblock_lock(); status_fix_damage(src, target, dat->damage, dat->delay); @@ -663,10 +663,10 @@ int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,in break; case W_1HSPEAR: case W_2HSPEAR: - if((skill_lv = pc->checkskill(sd,KN_SPEARMASTERY)) > 0) { - if(pc_isridingdragon(sd)) + if ((skill_lv = pc->checkskill(sd,KN_SPEARMASTERY)) > 0) { + if (pc_isridingdragon(sd)) damage += (skill_lv * 10); - else if(pc_isriding(sd)) + else if (pc_isridingpeco(sd)) damage += (skill_lv * 5); else damage += (skill_lv * 4); @@ -2707,10 +2707,6 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam sc_start2(src,bl,SC_COMBOATTACK,100,GC_WEAPONBLOCKING,src->id,2000); return 0; } - if( sc->data[SC_HOVERING] && skill_id && (skill->get_inf(skill_id)&INF_GROUND_SKILL || skill_id == SR_WINDMILL) ) { - d->dmg_lv = ATK_BLOCK; - return 0; - } if ((sce=sc->data[SC_AUTOGUARD]) && flag&BF_WEAPON && !(skill->get_nk(skill_id)&NK_NO_CARDFIX_ATK) && rnd()%100 < sce->val2) { int delay; struct block_list *d_bl = NULL; @@ -2783,7 +2779,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam return 0; } - if((sc->data[SC_HERMODE] || sc->data[SC_HOVERING]) && flag&BF_MAGIC) + if((sc->data[SC_HERMODE]) && flag&BF_MAGIC) return 0; if(sc->data[SC_NJ_TATAMIGAESHI] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG) @@ -3190,8 +3186,9 @@ int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64 switch (skill_id) { #ifndef RENEWAL case MO_TRIPLEATTACK: -#endif case HW_GRAVITATION: +#endif + case TF_DOUBLE: break; default: return 0; @@ -5105,6 +5102,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list } #endif +#ifndef RENEWAL // Offensive damage increment in renewal is done somewhere else if (sd) { if (skill_id != CR_SHIELDBOOMERANG) //Only Shield boomerang doesn't takes the Star Crumbs bonus. ATK_ADD2(wd.div_*sd->right_weapon.star, wd.div_*sd->left_weapon.star); @@ -5126,7 +5124,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list ATK_ADD(10*sd->status.inventory[index].refine); } } - +#endif //Card Fix, tsd side if(tsd){ //if player on player then it was already measured above wd.damage = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, (flag.lh?1:0), wd.flag); @@ -5814,6 +5812,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t if( --(sc->data[SC_SPELLFIST]->val1) >= 0 ){ struct Damage ad = battle->calc_attack(BF_MAGIC,src,target,sc->data[SC_SPELLFIST]->val3,sc->data[SC_SPELLFIST]->val4,flag|BF_SHORT); wd.damage = ad.damage; + damage_div_fix(wd.damage, wd.div_); }else status_change_end(src,SC_SPELLFIST,INVALID_TIMER); } @@ -6146,7 +6145,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f TBL_SKILL *su = (TBL_SKILL*)target; if( !su->group ) return 0; - if( skill->get_inf2(su->group->skill_id)&INF2_TRAP ) { //Only a few skills can target traps... + if( skill->get_inf2(su->group->skill_id)&INF2_TRAP && su->group->unit_id != UNT_USED_TRAPS) { //Only a few skills can target traps... switch( battle->get_current_skill(src) ) { case RK_DRAGONBREATH:// it can only hit traps in pvp/gvg maps case RK_DRAGONBREATH_WATER: @@ -6245,6 +6244,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f break; case BL_SKILL: { struct skill_unit *su = (struct skill_unit *)src; + struct status_change* sc = status->get_sc(target); if (!su->group) return 0; @@ -6255,6 +6255,11 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if (inf2&INF2_TARGET_SELF) return 1; } + //Status changes that prevent traps from triggering + if (sc && sc->count && skill->get_inf2(su->group->skill_id)&INF2_TRAP) { + if( sc->data[SC_WZ_SIGHTBLASTER] && sc->data[SC_WZ_SIGHTBLASTER]->val2 > 0 && sc->data[SC_WZ_SIGHTBLASTER]->val4%2 == 0) + return -1; + } } break; case BL_MER: @@ -6417,6 +6422,12 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range if( src->m != bl->m ) return false; +#ifndef CIRCULAR_AREA + if( src->type == BL_PC ) { // Range for players' attacks and skills should always have a circular check. [Angezerus] + if ( !check_distance_client_bl(src, bl, range) ) + return false; + } else +#endif if( !check_distance_bl(src, bl, range) ) return false; @@ -6451,7 +6462,7 @@ static const struct battle_data { { "skill_add_range", &battle_config.skill_add_range, 0, 0, INT_MAX, }, { "skill_out_range_consume", &battle_config.skill_out_range_consume, 1, 0, 1, }, { "skillrange_by_distance", &battle_config.skillrange_by_distance, ~BL_PC, BL_NUL, BL_ALL, }, - { "skillrange_from_weapon", &battle_config.use_weapon_skill_range, ~BL_PC, BL_NUL, BL_ALL, }, + { "skillrange_from_weapon", &battle_config.use_weapon_skill_range, BL_NUL, BL_NUL, BL_ALL, }, { "player_damage_delay_rate", &battle_config.pc_damage_delay_rate, 100, 0, INT_MAX, }, { "defunit_not_enemy", &battle_config.defnotenemy, 0, 0, 1, }, { "gvg_traps_target_all", &battle_config.vs_traps_bctall, BL_PC, BL_NUL, BL_ALL, }, @@ -6628,7 +6639,8 @@ static const struct battle_data { { "bone_drop", &battle_config.bone_drop, 0, 0, 2, }, { "buyer_name", &battle_config.buyer_name, 1, 0, 1, }, { "skill_wall_check", &battle_config.skill_wall_check, 1, 0, 1, }, - { "cell_stack_limit", &battle_config.cell_stack_limit, 1, 1, 255, }, + { "official_cell_stack_limit", &battle_config.official_cell_stack_limit, 1, 1, 255, }, + { "custom_cell_stack_limit", &battle_config.custom_cell_stack_limit, 1, 1, 255, }, { "dancing_weaponswitch_fix", &battle_config.dancing_weaponswitch_fix, 1, 0, 1, }, // eAthena additions @@ -6826,6 +6838,10 @@ static const struct battle_data { { "guild_castle_expulsion", &battle_config.guild_castle_expulsion, 0, 0, 1, }, { "song_timer_reset", &battle_config.song_timer_reset, 0, 0, 1, }, { "snap_dodge", &battle_config.snap_dodge, 0, 0, 1, }, + { "monster_chase_refresh", &battle_config.mob_chase_refresh, 1, 0, 30, }, + { "mob_icewall_walk_block", &battle_config.mob_icewall_walk_block, 75, 0, 255, }, + { "boss_icewall_walk_block", &battle_config.boss_icewall_walk_block, 0, 0, 255, }, + { "feature.roulette", &battle_config.feature_roulette, 1, 0, 1, }, }; #ifndef STATS_OPT_OUT /** @@ -7077,6 +7093,13 @@ void battle_adjust_conf(void) { } #endif +#if PACKETVER < 20141022 + if( battle_config.feature_roulette ) { + ShowWarning("conf/battle/feature.conf roulette is enabled but it requires PACKETVER 2014-10-22 or newer, disabling...\n"); + battle_config.feature_roulette = 0; + } +#endif + #if PACKETVER > 20120000 && PACKETVER < 20130515 /* exact date (when it started) not known */ if( battle_config.feature_auction == 1 ) { ShowWarning("conf/battle/feature.conf:feature.auction is enabled but it is not stable on PACKETVER "EXPAND_AND_QUOTE(PACKETVER)", disabling...\n"); @@ -7087,8 +7110,8 @@ void battle_adjust_conf(void) { #ifndef CELL_NOSTACK - if (battle_config.cell_stack_limit != 1) - ShowWarning("Battle setting 'cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support (CELL_NOSTACK).\n"); + if (battle_config.custom_cell_stack_limit != 1) + ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n"); #endif } |