浏览代码

Fixed bugreport:5650 GN Cart Remodeling weight boost should now be working properly.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16042 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 年之前
父节点
当前提交
9384614806
共有 5 个文件被更改,包括 14 次插入6 次删除
  1. 1 1
      src/map/battle.c
  2. 1 1
      src/map/clif.c
  3. 3 1
      src/map/pc.c
  4. 1 1
      src/map/pc.h
  5. 8 2
      src/map/status.c

+ 1 - 1
src/map/battle.c

@@ -1760,7 +1760,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
 				case MC_CARTREVOLUTION:
 					skillratio += 50;
 					if(sd && sd->cart_weight)
-						skillratio += 100*sd->cart_weight/battle_config.max_cart_weight; // +1% every 1% weight
+						skillratio += 100*sd->cart_weight/sd->cart_weight_max; // +1% every 1% weight
 					else if (!sd)
 						skillratio += 100; //Max damage for non players.
 					break;

+ 1 - 1
src/map/clif.c

@@ -2885,7 +2885,7 @@ void clif_updatestatus(struct map_session_data *sd,int type)
 		WFIFOW(fd,2)=sd->cart_num;
 		WFIFOW(fd,4)=MAX_CART;
 		WFIFOL(fd,6)=sd->cart_weight;
-		WFIFOL(fd,10)=battle_config.max_cart_weight;
+		WFIFOL(fd,10)=sd->cart_weight_max;
 		len=14;
 		break;
 

+ 3 - 1
src/map/pc.c

@@ -4122,7 +4122,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
 		return 1;
 	}
 
-	if( (w = data->weight*amount) + sd->cart_weight > battle_config.max_cart_weight )
+	if( (w = data->weight*amount) + sd->cart_weight > sd->cart_weight_max )
 		return 1;
 
 	i = MAX_CART;
@@ -5724,6 +5724,8 @@ int pc_skillup(struct map_session_data *sd,int skill_num)
 
 		clif_skillup(sd,skill_num);
 		clif_updatestatus(sd,SP_SKILLPOINT);
+		if( skill_num == GN_REMODELING_CART ) /* cart weight info was updated by status_calc_pc */
+			clif_updatestatus(sd,SP_CARTINFO);
 		if (!pc_has_permission(sd, PC_PERM_ALL_SKILL)) // may skill everything at any time anyways, and this would cause a huge slowdown
 			clif_skillinfoblock(sd);
 	}

+ 1 - 1
src/map/pc.h

@@ -170,7 +170,7 @@ struct map_session_data {
 	struct item_data* inventory_data[MAX_INVENTORY]; // direct pointers to itemdb entries (faster than doing item_id lookups)
 	short equip_index[14];
 	unsigned int weight,max_weight;
-	int cart_weight,cart_num;
+	int cart_weight,cart_num,cart_weight_max;
 	int fd;
 	unsigned short mapindex;
 	unsigned char head_dir; //0: Look forward. 1: Look right, 2: Look left.

+ 8 - 2
src/map/status.c

@@ -2155,7 +2155,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
 	struct status_data *status; // pointer to the player's base status
 	const struct status_change *sc = &sd->sc;
 	struct s_skill b_skill[MAX_SKILL]; // previous skill tree
-	int b_weight, b_max_weight; // previous weight
+	int b_weight, b_max_weight, b_cart_weight_max; // previous weight
 	int i,index;
 	int skill,refinedef=0;
 
@@ -2166,6 +2166,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
 	memcpy(b_skill, &sd->status.skill, sizeof(b_skill));
 	b_weight = sd->weight;
 	b_max_weight = sd->max_weight;
+	b_cart_weight_max = sd->cart_weight_max;
 
 	pc_calc_skilltree(sd);	// ƒXƒLƒ‹ƒcƒŠ?‚ÌŒvŽZ
 
@@ -2861,6 +2862,8 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
 	if((skill=pc_checkskill(sd,ALL_INCCARRY))>0)
 		sd->max_weight += 2000*skill;
 
+	sd->cart_weight_max = battle_config.max_cart_weight + (pc_checkskill(sd, GN_REMODELING_CART)*5000);
+	
 	if (pc_checkskill(sd,SM_MOVINGRECOVERY)>0)
 		sd->regen.state.walk = 1;
 	else
@@ -2973,7 +2976,10 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
 		clif_updatestatus(sd,SP_MAXWEIGHT);
 		pc_updateweightstatus(sd);
 	}
-
+	if( b_cart_weight_max != sd->cart_weight_max ) {
+		clif_updatestatus(sd,SP_CARTINFO);
+	}
+	
 	calculating = 0;
 
 	return 0;