Prechádzať zdrojové kódy

- Fixed @homlvup bug
- Fixed AM_REST & AM_RESU consumming SP if they fail
- Fixed homunc spawning bug

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

toms 19 rokov pred
rodič
commit
a2f9e1bd0a
5 zmenil súbory, kde vykonal 20 pridanie a 3 odobranie
  1. 3 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/atcommand.c
  3. 1 1
      src/map/clif.c
  4. 1 1
      src/map/pc.c
  5. 14 0
      src/map/skill.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/08/19
+	* Fixed @homlvup bug [Toms]
+	* Fixed AM_REST & AM_RESU consumming SP if they fail [Toms]
+	* Fixed homunc spawning bug (they was spawned after an AM_REST + master warp for example)[Toms]
 	* Fixed GS_GROUNDDRIFT [Skotlex]
 	* Increased chance of GS_DESPERADO connecting to 20% [Skotlex]
 	* Fixed battle_calc_base_damage being called for the left hand even for

+ 1 - 1
src/map/atcommand.c

@@ -9783,7 +9783,7 @@ int atcommand_homlevel(
 	if (!message || !*message)
 		return -1;
 		
-	if ( sd->status.hom_id == 0 || !sd->homunculus.hp || sd->homunculus.vaporize )
+	if ( !merc_is_hom_active(sd->hd) )
 		return 1 ;
 
 	level = atoi(message);

+ 1 - 1
src/map/clif.c

@@ -8289,7 +8289,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 	}
 
 	//homunculus [blackhole89]
-	if(sd->hd && sd->hd->battle_status.hp) {
+	if(merc_is_hom_active(sd->hd)) {
 		map_addblock(&sd->hd->bl);
 		clif_spawn(&sd->hd->bl);
 //		clif_homunack(sd);

+ 1 - 1
src/map/pc.c

@@ -3368,7 +3368,7 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
 		sd->pd->ud.dir = sd->ud.dir;
 	}
 
-	if(sd->status.hom_id > 0 && sd->hd ) {	//orn
+	if(sd->status.hom_id > 0 && merc_is_hom_active(sd->hd)) {	//orn
 		sd->hd->bl.m = m;
 		sd->hd->bl.x = sd->hd->ud.to_x = x;
 		sd->hd->bl.y = sd->hd->ud.to_y = y;

+ 14 - 0
src/map/skill.c

@@ -8349,6 +8349,20 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
 		if (sd->status.hom_id) //Don't delete items when hom is already out.
 			checkitem_flag = delitem_flag = 0;
 		break;
+	case AM_REST: //Can't vapo homun if you don't have an active homunc or it's hp is < 80%
+		if (!merc_is_hom_active(sd->hd) || sd->hd->battle_status.hp < (sd->hd->battle_status.max_hp*80/100))
+		{
+			clif_skill_fail(sd,skill,0,0);
+			return 0;
+		}
+		break;
+	case AM_RESURRECTHOMUN: // Can't resurrect homun if you don't have a dead homun
+		if (!sd->status.hom_id || sd->homunculus.vaporize || !sd->hd || sd->hd->battle_status.hp)
+		{
+			clif_skill_fail(sd,skill,0,0);
+			return 0;
+		}
+		break;
 	}
 
 	if(!(type&2)){