Browse Source

- Small fixes on mob_skill_use
- slaves inherit speeds will only work if the master can move.


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

skotlex 19 years ago
parent
commit
4070588825
2 changed files with 10 additions and 3 deletions
  1. 1 0
      Changelog-Trunk.txt
  2. 9 3
      src/map/mob.c

+ 1 - 0
Changelog-Trunk.txt

@@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EV
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
 
 2006/03/02
 2006/03/02
+	* Slaves inherit speed will now only work if the master can move. [Skotlex]
 	* Some cleanup and reorganization on the way pet-skill variables are
 	* Some cleanup and reorganization on the way pet-skill variables are
 	  handled. [Skotlex]
 	  handled. [Skotlex]
 	* Fixed a typo that disabled all pet support skills from triggering (except
 	* Fixed a typo that disabled all pet support skills from triggering (except

+ 9 - 3
src/map/mob.c

@@ -3205,7 +3205,8 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
 		md->y0=y;
 		md->y0=y;
 		md->xs=0;
 		md->xs=0;
 		md->ys=0;
 		md->ys=0;
-		if (battle_config.slaves_inherit_speed && (skill_id != NPC_METAMORPHOSIS && skill_id != NPC_TRANSFORMATION))
+		if (battle_config.slaves_inherit_speed && md2->db->mode&MD_CANMOVE 
+			&& (skill_id != NPC_METAMORPHOSIS && skill_id != NPC_TRANSFORMATION))
 			md->speed=md2->speed;
 			md->speed=md2->speed;
 		md->special_state.cached= battle_config.dynamic_mobs;	//[Skotlex]
 		md->special_state.cached= battle_config.dynamic_mobs;	//[Skotlex]
 		md->spawndelay1=-1;	// ˆê“x‚̂݃tƒ‰ƒO
 		md->spawndelay1=-1;	// ˆê“x‚̂݃tƒ‰ƒO
@@ -3849,7 +3850,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
 				do {
 				do {
 					bx = x + rand() % (r*2+1) - r;
 					bx = x + rand() % (r*2+1) - r;
 					by = y + rand() % (r*2+1) - r;
 					by = y + rand() % (r*2+1) - r;
-				} while (map_getcell(m, bx, by, CELL_CHKNOPASS) && (i++) < 1000);
+				} while (map_getcell(m, bx, by, CELL_CHKNOREACH) && (i++) < 1000);
 				if (i < 1000){
 				if (i < 1000){
 					x = bx; y = by;
 					x = bx; y = by;
 				}
 				}
@@ -3860,7 +3861,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
 				do {
 				do {
 					bx = x + rand() % (r*2+1) - r;
 					bx = x + rand() % (r*2+1) - r;
 					by = y + rand() % (r*2+1) - r;
 					by = y + rand() % (r*2+1) - r;
-				} while (map_getcell(m, bx, by, CELL_CHKNOPASS) && (i++) < 1000);
+				} while (map_getcell(m, bx, by, CELL_CHKNOREACH) && (i++) < 1000);
 				if (i < 1000){
 				if (i < 1000){
 					x = bx; y = by;
 					x = bx; y = by;
 				}
 				}
@@ -3895,6 +3896,11 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
 				}
 				}
 				if (bl && !mobskill_use_id(md, bl, i))
 				if (bl && !mobskill_use_id(md, bl, i))
 					return 0;
 					return 0;
+			} else {
+				if (battle_config.error_log)
+					ShowWarning("Wrong mob skill target 'around' for non-ground skill %d (%s). Mob %d - %s\n",
+						ms[i].skill_id, skill_get_name(ms[i].skill_id), md->class_, md->db->jname);
+				continue;
 			}
 			}
 		}
 		}
 		return 1;
 		return 1;