diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-03 18:43:19 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-03 18:43:19 +0000 |
commit | be9cf2aec39f2e29990d945f783e3dbc2ad88ae9 (patch) | |
tree | cfc6acc69ee9e5da8e39e5416cce9d97b7e9ea52 /src/map/mob.c | |
parent | 7b9cddaed2958e41f570ada6cdaec0cceb5ec103 (diff) | |
download | hercules-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
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 20 |
1 files changed, 17 insertions, 3 deletions
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:
|