From 75e3dc137ae4916a47cdd748fd10cd4ed9c438b3 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Fri, 6 Jul 2012 22:16:06 -0700 Subject: Make mob splash range configurable --- src/map/battle.c | 6 +++++- src/map/battle.h | 1 + src/map/mob.c | 7 +++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/map/battle.c b/src/map/battle.c index 6edf996..5e87b07 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5654,6 +5654,8 @@ int battle_config_read (const char *cfgName) battle_config.packet_spam_kick = 1; battle_config.mask_ip_gms = 1; + + battle_config.mob_splash_radius = -1; } fp = fopen_ (cfgName, "r"); @@ -6106,7 +6108,9 @@ int battle_config_read (const char *cfgName) { "packet_spam_kick", &battle_config.packet_spam_kick}, { - "mask_ip_gms", &battle_config.mask_ip_gms} + "mask_ip_gms", &battle_config.mask_ip_gms}, + { + "mob_splash_radius", &battle_config.mob_splash_radius}, }; if (line[0] == '/' && line[1] == '/') diff --git a/src/map/battle.h b/src/map/battle.h index 3153925..66ca3d4 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -349,6 +349,7 @@ extern struct Battle_Config int drop_pickup_safety_zone; // [Fate] Max. distance to an object dropped by a kill by self in which dropsteal protection works int itemheal_regeneration_factor; // [Fate] itemheal speed factor + int mob_splash_radius; } battle_config; int battle_config_read (const char *cfgName); diff --git a/src/map/mob.c b/src/map/mob.c index 439287e..67ceb03 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -931,8 +931,11 @@ static int mob_attack (struct mob_data *md, unsigned int tick, int data) md->target_lv = battle_weapon_attack (&md->bl, tbl, tick, 0); // If you are reading this, please note: // it is highly platform-specific that this even works at all. - if (tbl->type == BL_PC) - map_foreachincell(mob_ancillary_attack, tbl->m, tbl->x, tbl->y, BL_PC, + int radius = battle_config.mob_splash_radius; + if (radius >= 0 && tbl->type == BL_PC) + map_foreachinarea(mob_ancillary_attack, + tbl->m, tbl->x - radius, tbl->y - radius, tbl->x + radius, tbl->y + radius, + BL_PC, &md->bl, tbl, tick); if (!(battle_config.monster_cloak_check_type & 2) -- cgit v1.2.3-60-g2f50