From a9763770c28c1e79cc43a0a43b46745ea3090940 Mon Sep 17 00:00:00 2001 From: L0ne_W0lf Date: Tue, 3 Nov 2009 01:39:45 +0000 Subject: * Added battle_config.mob_slave_keep_target config option (monster.conf) - When yes (default) MVP slaves will always keep their prior targets. - When no the old behavior of switching to the closest target is enabled. * Updated MAX_MOB_DB to 4000 (Monsters are starting to appear in the 2k ranges) * Changed default respawn time (when 0) to 500 from 5000. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14119 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/mob.c | 4 ++-- src/map/mob.h | 2 +- src/map/unit.c | 5 ++++- 5 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.c b/src/map/battle.c index e1ee7afa9..adf87c367 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3835,6 +3835,7 @@ static const struct _battle_data { { "skill_add_heal_rate", &battle_config.skill_add_heal_rate, 7, 0, INT_MAX, }, { "eq_single_target_reflectable", &battle_config.eq_single_target_reflectable, 1, 0, 1, }, { "invincible.nodamage", &battle_config.invincible_nodamage, 0, 0, 1, }, + { "mob_slave_keep_target", &battle_config.mob_slave_keep_target, 0, 0, 1, }, // BattleGround Settings { "bg_update_interval", &battle_config.bg_update_interval, 1000, 100, INT_MAX, }, { "bg_short_attack_damage_rate", &battle_config.bg_short_damage_rate, 80, 0, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index 06897e891..17e80c408 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -468,6 +468,7 @@ extern struct Battle_Config int skill_add_heal_rate; //skills that bHealPower has effect on [Inkfish] int eq_single_target_reflectable; int invincible_nodamage; + int mob_slave_keep_target; // [BattleGround Settings] int bg_update_interval; diff --git a/src/map/mob.c b/src/map/mob.c index f0741a2cf..95f6964a7 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -792,8 +792,8 @@ int mob_setdelayspawn(struct mob_data *md) if (md->spawn->delay2) //random variance spawntime+= rand()%md->spawn->delay2; - if (spawntime < 5000) //Min respawn time (is it needed?) - spawntime = 5000; + if (spawntime < 500) //Min respawn time (is it needed?) + spawntime = 500; if( md->spawn_timer != INVALID_TIMER ) delete_timer(md->spawn_timer, mob_delayspawn); diff --git a/src/map/mob.h b/src/map/mob.h index 360c69e06..235e93756 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -17,7 +17,7 @@ // Change this to increase the table size in your mob_db to accomodate a larger mob database. // Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes. // Notice that the last 1000 entries are used for player clones, so always set this to desired value +1000 -#define MAX_MOB_DB 3000 +#define MAX_MOB_DB 4000 //The number of drops all mobs have and the max drop-slot that the steal skill will attempt to steal from. #define MAX_MOB_DROP 10 diff --git a/src/map/unit.c b/src/map/unit.c index 56969f1db..d828832c6 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1874,7 +1874,10 @@ int unit_remove_map_(struct block_list *bl, int clrtype, const char* file, int l case BL_MOB: { struct mob_data *md = (struct mob_data*)bl; - md->target_id=0; + // Drop previous target mob_slave_keep_target: no. + if (!battle_config.mob_slave_keep_target) + md->target_id=0; + md->attacked_id=0; md->state.skillstate= MSS_IDLE; -- cgit v1.2.3-60-g2f50