Quellcode durchsuchen

- Updated merc_reset_stats to handle resetting skill tree and points as well.
- Updated @homshuffle so that the skill tree and current skill points are not messed up.


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

skotlex vor 18 Jahren
Ursprung
Commit
fa2d2ced6e
3 geänderte Dateien mit 11 neuen und 1 gelöschten Zeilen
  1. 3 0
      Changelog-Trunk.txt
  2. 6 1
      src/map/atcommand.c
  3. 2 0
      src/map/mercenary.c

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ 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.
 
+2007/01/20
+	* Updated @homshuffle so that the skill tree and current skill points are
+	  not messed up.
 2007/01/19
 	* Fixed the label dup code, it now works correctly with const.txt switch
 	  labels.

+ 6 - 1
src/map/atcommand.c

@@ -10012,8 +10012,9 @@ int atcommand_homshuffle(
 	const char* command, const char* message)
 {
 	struct homun_data *hd;
-	int lv, i;
+	int lv, i, skillpts;
 	unsigned int exp;
+	struct skill b_skill;
 	TBL_PC* tsd = sd;
 
 	nullpo_retr(-1, sd);
@@ -10042,6 +10043,8 @@ int atcommand_homshuffle(
 	
 	lv = hd->homunculus.level;
 	exp = hd->homunculus.exp;
+	memcpy(&b_skill, &hd->homunculus.hskill, sizeof(b_skill));
+	skillpts = hd->homunculus.skillpts;
 	//Reset values to level 1.
 	merc_reset_stats(hd);
 	//Level it back up
@@ -10050,6 +10053,8 @@ int atcommand_homshuffle(
 		merc_hom_levelup(hd);
 	}
 	hd->homunculus.exp = exp;
+	memcpy(&hd->homunculus.hskill, &b_skill, sizeof(b_skill));
+	hd->homunculus.skillpts = skillpts;
 	status_calc_homunculus(hd,0);
 	status_percent_heal(&hd->bl, 100, 100);
 	clif_misceffect2(&hd->bl,568);

+ 2 - 0
src/map/mercenary.c

@@ -748,6 +748,8 @@ void merc_reset_stats(struct homun_data *hd)
 	hom->luk = db->baseLUK*10;
 	hom->exp = 0;
 	hd->exp_next = hexptbl[0];
+	memset(&hd->homunculus.hskill, 0, sizeof hd->homunculus.hskill);
+	hd->homunculus.skillpts = 0;
 }
 
 int read_homunculusdb(void)