summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-03 18:43:19 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-03 18:43:19 +0000
commitbe9cf2aec39f2e29990d945f783e3dbc2ad88ae9 (patch)
treecfc6acc69ee9e5da8e39e5416cce9d97b7e9ea52
parent7b9cddaed2958e41f570ada6cdaec0cceb5ec103 (diff)
downloadhercules-be9cf2aec39f2e29990d945f783e3dbc2ad88ae9.tar.gz
hercules-be9cf2aec39f2e29990d945f783e3dbc2ad88ae9.tar.bz2
hercules-be9cf2aec39f2e29990d945f783e3dbc2ad88ae9.tar.xz
hercules-be9cf2aec39f2e29990d945f783e3dbc2ad88ae9.zip
- Modified Rude-Attacked behaviour so that such skills only triggers when the rude-attacked count is greater than 3.
- Added config setting slaves_inherit_mode to determine whether slaves take on their master's aggressive/passive status (defaults to yes) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5890 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--conf-tmpl/battle/monster.conf3
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/mob.c20
5 files changed, 27 insertions, 3 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 66dd224b6..ad17dd2ef 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/03
+ * Modified Rude-Attacked behaviour so that such skills only triggers when
+ the rude-attacked count is greater than 3. [Skotlex]
+ * Added config setting slaves_inherit_mode to determine whether slaves take
+ on their master's aggressive/passive status (defaults to yes) [Skotlex]
* Disabled NPCs are now handled through nd->sc.option&OPTION_INVISIBLE
checks. Should fix disable/enablenpc calls not working. [Skotlex]
* Moved skill_counter_additional_effect calls to trigger right after
diff --git a/conf-tmpl/battle/monster.conf b/conf-tmpl/battle/monster.conf
index 8f22c0d5e..bcca6e6e8 100644
--- a/conf-tmpl/battle/monster.conf
+++ b/conf-tmpl/battle/monster.conf
@@ -103,6 +103,9 @@ boss_spawn_rate: 100
// 5 seconds.
no_spawn_on_player: 0
+// Do summon slaves inherit the passive/aggressive traits of their master? (Note 1)
+slaves_inherit_mode: yes
+
// Do summon slaves have the same walking speed as their master? (Note 1)
// NOTE: The default is yes for official servers.
slaves_inherit_speed: yes
diff --git a/src/map/battle.c b/src/map/battle.c
index 2851f0c88..e618d4e87 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3580,6 +3580,7 @@ static const struct battle_data_short {
{ "no_spawn_on_player", &battle_config.no_spawn_on_player },
{ "plant_spawn_delay", &battle_config.plant_spawn_delay },
{ "boss_spawn_delay", &battle_config.boss_spawn_delay },
+ { "slaves_inherit_mode", &battle_config.slaves_inherit_mode },
{ "slaves_inherit_speed", &battle_config.slaves_inherit_speed },
{ "summons_inherit_effects", &battle_config.summons_inherit_effects },
{ "pc_damage_walk_delay_rate", &battle_config.pc_walk_delay_rate },
@@ -3961,6 +3962,7 @@ void battle_set_defaults() {
battle_config.no_spawn_on_player=0;
battle_config.plant_spawn_delay=100;
battle_config.boss_spawn_delay=100;
+ battle_config.slaves_inherit_mode=1;
battle_config.slaves_inherit_speed=1;
battle_config.summons_inherit_effects=1;
battle_config.pc_walk_delay_rate=20;
diff --git a/src/map/battle.h b/src/map/battle.h
index bdfbd90e5..c7b913b54 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -154,6 +154,7 @@ extern struct Battle_Config {
unsigned short mob_count_rate;
unsigned short no_spawn_on_player; //[Skotlex]
unsigned short mob_spawn_delay, plant_spawn_delay, boss_spawn_delay; // [Skotlex]
+ unsigned short slaves_inherit_mode;
unsigned short slaves_inherit_speed;
unsigned short summons_inherit_effects;
unsigned short pc_walk_delay_rate; //Adjusts can't walk delay after being hit for players. [Skotlex]
diff --git a/src/map/mob.c b/src/map/mob.c
index c5d9c44e5..41a68180e 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2494,7 +2494,7 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
{
struct mob_data *md;
struct spawn_data data;
- int count = 0,k=0;
+ int count = 0,k=0,mode;
nullpo_retr(0, md2);
nullpo_retr(0, value);
@@ -2510,6 +2510,8 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
if(mobdb_checkid(value[0]) == 0)
return 0;
+ mode = status_get_mode(&md2->bl);
+
while(count < 5 && mobdb_checkid(value[count])) count++;
if(count < 1) return 0;
if (amount > 0 && amount < count) { //Do not start on 0, pick some random sub subset [Skotlex]
@@ -2536,9 +2538,21 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
md= mob_spawn_dataset(&data);
- if (battle_config.slaves_inherit_speed && md2->db->mode&MD_CANMOVE
+ if (battle_config.slaves_inherit_speed && mode&MD_CANMOVE
&& (skill_id != NPC_METAMORPHOSIS && skill_id != NPC_TRANSFORMATION))
md->speed=md2->speed;
+
+ //Inherit the aggressive mode of the master.
+ if (battle_config.slaves_inherit_mode) {
+ md->mode = md->db->mode;
+ if (mode&MD_AGGRESSIVE)
+ md->mode |= MD_AGGRESSIVE;
+ else
+ md->mode &=~MD_AGGRESSIVE;
+ if (md->mode == md->db->mode)
+ md->mode = 0; //No change.
+ }
+
md->special_state.cached= battle_config.dynamic_mobs; //[Skotlex]
if (!battle_config.monster_class_change_full_recover &&
@@ -2763,7 +2777,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
case MSC_SKILLUSED: // specificated skill used
flag = ((event & 0xffff) == MSC_SKILLUSED && ((event >> 16) == c2 || c2 == 0)); break;
case MSC_RUDEATTACKED:
- flag = (!md->attacked_id && md->attacked_count > 0);
+ flag = (md->attacked_count >= 3);
if (flag) md->attacked_count = 0; //Rude attacked count should be reset after the skill condition is met. Thanks to Komurka [Skotlex]
break;
case MSC_MASTERHPLTMAXRATE: