Преглед на файлове

- 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://svn.code.sf.net/p/rathena/svn/trunk@5890 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex преди 19 години
родител
ревизия
8980b04387
променени са 5 файла, в които са добавени 27 реда и са изтрити 3 реда
  1. 4 0
      Changelog-Trunk.txt
  2. 3 0
      conf-tmpl/battle/monster.conf
  3. 2 0
      src/map/battle.c
  4. 1 0
      src/map/battle.h
  5. 17 3
      src/map/mob.c

+ 4 - 0
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

+ 3 - 0
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

+ 2 - 0
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;

+ 1 - 0
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]

+ 17 - 3
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: