Browse Source

- Adjusted Battle_check_target so that alchemist summoned mobs are targetted by everyone as long as 1. The top-level master is a player and 2. the actual attacker is not a mob-type.
- Added config force_random_spawn which overrides the spawn-files defined coordinates to make all mobs always spawn randomly on the map.
- SC_SPEEDUP0 is no longer dispellable by SA_DISPEL


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8159 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 years ago
parent
commit
8fa60b9249
6 changed files with 46 additions and 14 deletions
  1. 8 0
      Changelog-Trunk.txt
  2. 5 0
      conf-tmpl/battle/monster.conf
  3. 6 3
      src/map/battle.c
  4. 1 0
      src/map/battle.h
  5. 5 0
      src/map/npc.c
  6. 21 11
      src/map/skill.c

+ 8 - 0
Changelog-Trunk.txt

@@ -2,6 +2,14 @@ Date	Added
 
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+
+2006/08/07
+	* Adjusted Battle_check_target so that alchemist summoned mobs are
+	  targetted by everyone as long as 1. The top-level master is a player and 2.
+	  the actual attacker is not a mob-type. [Skotlex]
+	* Added config force_random_spawn which overrides the spawn-files defined
+	  coordinates to make all mobs always spawn randomly on the map. [Skotlex]
+	* SC_SPEEDUP0 is no longer dispellable by SA_DISPEL [Skotlex]
 2006/08/06
 	* Updated item_db.sql & mob_db.sql to latest. [Toms]
 	* Little fixes on homunc (hp/sp are now saved and init stats changed) [Toms]

+ 5 - 0
conf-tmpl/battle/monster.conf

@@ -116,6 +116,11 @@ boss_spawn_delay: 100
 // 5 seconds.
 no_spawn_on_player: 0
 
+// Should spawn coordinates in the mob-spawn files be ignored? (Note 1)
+// If set to yes, all monsters will have a random respawn spot across the whole
+// map regardless of what the mob-spawn file says.
+force_random_spawn: no
+
 // Do summon slaves inherit the passive/aggressive traits of their master? (Note 1)
 slaves_inherit_mode: yes
 

+ 6 - 3
src/map/battle.c

@@ -1763,7 +1763,6 @@ static struct Damage battle_calc_weapon_attack(
 			wd.damage = battle_addmastery(sd,target,wd.damage,0);
 			if (flag.lh) wd.damage2 = battle_addmastery(sd,target,wd.damage2,1);
 
-
 			if((skill=pc_checkskill(sd,SG_STAR_ANGER)) >0 && (t_class == sd->hate_mob[2] || (sc && sc->data[SC_MIRACLE].timer!=-1)))
 			{
 				skillratio = (sd->status.base_level + sstatus->str + sstatus->dex + sstatus->luk)/(skill<4?12-3*skill:1);
@@ -3173,8 +3172,9 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 				return -1; //Cannot be targeted yet.
 			break;
 		case BL_MOB:
-			if (((TBL_MOB*)target)->special_state.ai > 1)
-			{	//Alchemist summoned mobs are sort of universal enemies.
+			if (((TBL_MOB*)target)->special_state.ai > 1 &&
+				s_bl->type == BL_PC && src->type != BL_MOB)
+			{	//Alchemist summoned mobs are always targettable by players
 				state |= BCT_ENEMY;
 				strip_enemy = 0;
 			}
@@ -3509,6 +3509,8 @@ static const struct battle_data_short {
 	{ "mob_count_rate",                    &battle_config.mob_count_rate			},
 	{ "mob_spawn_delay",                   &battle_config.mob_spawn_delay			},
 	{ "no_spawn_on_player",                &battle_config.no_spawn_on_player	},
+
+	{ "force_random_spawn",                &battle_config.force_random_spawn	},
 	{ "plant_spawn_delay",                 &battle_config.plant_spawn_delay			},
 	{ "boss_spawn_delay",                  &battle_config.boss_spawn_delay			},
 	{ "slaves_inherit_mode",               &battle_config.slaves_inherit_mode	},
@@ -3914,6 +3916,7 @@ void battle_set_defaults() {
 	battle_config.mob_count_rate=100;
 	battle_config.mob_spawn_delay=100;
 	battle_config.no_spawn_on_player=0;
+	battle_config.force_random_spawn=0;
 	battle_config.plant_spawn_delay=100;
 	battle_config.boss_spawn_delay=100;
 	battle_config.slaves_inherit_mode=1;

+ 1 - 0
src/map/battle.h

@@ -157,6 +157,7 @@ extern struct Battle_Config {
 	unsigned short mob_skill_delay;	//[Skotlex]
 	unsigned short mob_count_rate;
 	unsigned short no_spawn_on_player; //[Skotlex]
+	unsigned short force_random_spawn; //[Skotlex]
 	unsigned short mob_spawn_delay, plant_spawn_delay, boss_spawn_delay;	// [Skotlex]
 	unsigned short slaves_inherit_mode;
 	unsigned short slaves_inherit_speed;

+ 5 - 0
src/map/npc.c

@@ -2217,6 +2217,11 @@ int npc_parse_mob (char *w1, char *w2, char *w3, char *w4)
 			mob.num = 1;
 	}
 
+	if (battle_config.force_random_spawn)
+	{	//Force a random spawn anywhere on the map.
+		mob.x = mob.y = mob.xs = mob.ys = 0;
+	}
+
 	//Apply the spawn delay fix [Skotlex]
 	mode = mob_db(class_)->status.mode;
 	if (mode & MD_BOSS) {	//Bosses

+ 21 - 11
src/map/skill.c

@@ -4438,14 +4438,24 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		int strip_fix, equip = 0;
 		int sclist[4] = {0,0,0,0};
 
-		if (skillid == RG_STRIPWEAPON || skillid == ST_FULLSTRIP || skillid == GS_DISARM)
-		   equip |= EQP_WEAPON;
-		if (skillid == RG_STRIPSHIELD || skillid == ST_FULLSTRIP)
-		   equip |= EQP_SHIELD;
-		if (skillid == RG_STRIPARMOR || skillid == ST_FULLSTRIP)
-		   equip |= EQP_ARMOR;
-		if (skillid == RG_STRIPHELM || skillid == ST_FULLSTRIP)
-		   equip |= EQP_HELM;
+		switch (skillid) {
+		case RG_STRIPWEAPON:
+		case GS_DISARM:
+		   equip = EQP_WEAPON;
+			break;
+		case RG_STRIPSHIELD:
+		   equip = EQP_SHIELD;
+			break;
+		case RG_STRIPARMOR:
+		   equip = EQP_ARMOR;
+			break;
+		case RG_STRIPHELM:
+		   equip = EQP_HELM;
+			break;
+		case ST_FULLSTRIP:
+		   equip = EQP_WEAPON|EQP_SHIELD|EQP_ARMOR|EQP_HELM;
+			break;
+		}
 
 		strip_fix = sstatus->dex - tstatus->dex;
 		if(strip_fix < 0)
@@ -4462,7 +4472,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 					continue;
 				switch (i) {
 				case EQI_HAND_L: //Shield / left-hand weapon
-					if(dstsd->inventory_data[dstsd->equip_index[EQI_HAND_L]]->type == IT_ARMOR)
+					if(dstsd->inventory_data[dstsd->equip_index[i]]->type == IT_ARMOR)
 					{ //Shield
 						if (equip&EQP_SHIELD &&
 							!(dstsd->unstripable_equip&EQP_SHIELD) &&
@@ -4475,7 +4485,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 					}
 					//Continue to weapon
 				case EQI_HAND_R:
-					if (equip &EQP_WEAPON &&
+					if (equip&EQP_WEAPON &&
 						!(dstsd->unstripable_equip&EQP_WEAPON) &&
 				  		!(tsc && tsc->data[SC_CP_WEAPON].timer != -1)
 					) {
@@ -4663,7 +4673,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 					|| i==SC_CP_WEAPON || i==SC_CP_SHIELD || i==SC_CP_ARMOR || i==SC_CP_HELM
 					|| i==SC_COMBO || i==SC_DANCING || i==SC_GUILDAURA || i==SC_EDP
 					|| i==SC_AUTOBERSERK  || i==SC_CARTBOOST || i==SC_MELTDOWN || i==SC_MOONLIT
-					|| i==SC_SAFETYWALL || i==SC_SMA
+					|| i==SC_SAFETYWALL || i==SC_SMA || i==SC_SPEEDUP0
 					)
 					continue;
 				if(i==SC_BERSERK) tsc->data[i].val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.