Просмотр исходного кода

- Fixed a crash when using SL_SMA and the "combo" ain't ready.
- Hopefully fixed changing a mob's class causing them to get all sort of stat bonuses due to the mobs-level-up setting.


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

skotlex 19 лет назад
Родитель
Сommit
7847189eae
4 измененных файлов с 8 добавлено и 3 удалено
  1. 3 0
      Changelog-Trunk.txt
  2. 2 1
      src/map/mob.c
  3. 1 1
      src/map/skill.c
  4. 2 1
      src/map/status.c

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ 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/06/05
+	* Fixed a crash when using SL_SMA and the "combo" ain't ready. [Skotlex]
+	* Hopefully fixed changing a mob's class causing them to get all sort of
+	  stat bonuses due to the mobs-level-up setting. [Skotlex]
 	* Changed hit, flee, cri, flee2, def2 and mdef2 to signed short, def, mdef
 	  to signed char to correctly account for cards with penalties in said stats.
 	  [Skotlex]

+ 2 - 1
src/map/mob.c

@@ -2241,6 +2241,7 @@ int mob_class_change (struct mob_data *md, int class_)
 
 	hp_rate = md->status.hp*100/md->status.max_hp;
 	md->db = mob_db(class_);
+	md->level = md->db->lv; //Also reset their level.
 	
 	if (battle_config.override_mob_names==1)
 		memcpy(md->name,md->db->name,NAME_LENGTH-1);
@@ -2252,7 +2253,7 @@ int mob_class_change (struct mob_data *md, int class_)
 	unit_skillcastcancel(&md->bl, 0);
 	status_set_viewdata(&md->bl, class_);
 	clif_mob_class_change(md,class_);
-	status_calc_mob(md, 1);
+	status_calc_mob(md, 3);
 	
 	if (battle_config.monster_class_change_full_recover) {
 		memset(md->dmglog, 0, sizeof(md->dmglog));

+ 1 - 1
src/map/skill.c

@@ -7790,7 +7790,7 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ
 		break;
 	case SL_SMA:
 		if(type) break; //Only do the combo check when the target is selected (type == 0)
-		if(!sd || sc->data[SC_SMA].timer == -1)
+		if(!sc || sc->data[SC_SMA].timer == -1)
 			return 0;
 		break;	
 

+ 2 - 1
src/map/status.c

@@ -1006,6 +1006,7 @@ void status_calc_misc(struct status_data *status, int level)
 
 //Skotlex: Calculates the initial status for the given mob
 //first will only be false when the mob leveled up or got a GuardUp level.
+//first&2: Class-change invoked.
 int status_calc_mob(struct mob_data* md, int first)
 {
 	struct status_data *status;
@@ -1014,7 +1015,7 @@ int status_calc_mob(struct mob_data* md, int first)
 
 	if(first)
 	{	//Set basic level on respawn.
-		if (md->spawn)
+		if (md->spawn && !(flag&2))
 		  	md->level = md->spawn->level;
 		else
 			md->level = md->db->lv; // [Valaris]