浏览代码

Follow up to af108b2, I forgot to think about Pre-Renewal - http://rathena.org/board/tracker/issue-8189-recent-long-range-attack-rate-update-problem!/
Update Force of Vanguard to 2011 - http://rathena.org/board/tracker/issue-8181-forceofvanguard-sp-upkeep-cost/
Merge a processing improvement on HP meters - Credits to Ind

Akinari1087 11 年之前
父节点
当前提交
4e88d117af
共有 6 个文件被更改,包括 23 次插入4 次删除
  1. 5 0
      src/map/battle.c
  2. 7 1
      src/map/clif.c
  3. 3 0
      src/map/map.h
  4. 1 0
      src/map/pc.h
  5. 3 3
      src/map/status.c
  6. 4 0
      src/map/unit.c

+ 5 - 0
src/map/battle.c

@@ -637,6 +637,11 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
 					}
 				}
 
+#ifndef RENEWAL
+				if( flag&BF_LONG )
+					cardfix = cardfix * ( 100 + sd->bonus.long_attack_atk_rate ) / 100;
+#endif
+
 				if( (left&1) && cardfix_ != 1000 )
 					bccDAMAGE_RATE(cardfix_)
 				else if( cardfix != 1000 )

+ 7 - 1
src/map/clif.c

@@ -2804,7 +2804,8 @@ void clif_updatestatus(struct map_session_data *sd,int type)
 	case SP_HP:
 		WFIFOL(fd,4)=sd->battle_status.hp;
 		// TODO: Won't these overwrite the current packet?
-		clif_hpmeter(sd);
+		if( map[sd->bl.m].hpmeter_visible )
+			clif_hpmeter(sd);
 		if( !battle_config.party_hp_mode && sd->status.party_id )
 			clif_party_hp(sd);
 		if( sd->bg_id )
@@ -9397,6 +9398,11 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 			clif_broadcast(&sd->bl, output, strlen(output) + 1, 0x10, SELF);
 		}
 
+		if( pc_has_permission(sd,PC_PERM_VIEW_HPMETER) ) {
+			map[sd->bl.m].hpmeter_visible++;
+			sd->state.hpmeter_visible = 1;
+		}
+
 		map_iwall_get(sd); // Updates Walls Info on this Map to Client
 		status_calc_pc(sd, false); // Some conditions are map-dependent so we must recalculate
 		sd->state.changemap = false;

+ 3 - 0
src/map/map.h

@@ -638,6 +638,9 @@ struct map_data {
 
 	/* rAthena Local Chat */
 	struct Channel *channel;
+	
+	/* speeds up clif_updatestatus processing by causing hpmeter to run only when someone with the permission can view it */
+	unsigned short hpmeter_visible;
 };
 
 /// Stores information about a remote map (for multi-mapserver setups).

+ 1 - 0
src/map/pc.h

@@ -192,6 +192,7 @@ struct map_session_data {
 		unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
 		unsigned int warping : 1;//states whether you're in the middle of a warp processing
 		unsigned int permanent_speed : 1; // When 1, speed cannot be changed through status_calc_pc().
+		unsigned int hpmeter_visible : 1;
 	} state;
 	struct {
 		unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;

+ 3 - 3
src/map/status.c

@@ -8610,7 +8610,7 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 			tick_time = 1000; // [GodLesZ] tick time
 			break;
 		case SC_FORCEOFVANGUARD: // This is not the official way to handle it but I think we should use it. [pakpil]
-			val2 = 20 + 12 * (val1 - 1); // Chance
+			val2 = 8 + (12 * val1); // Chance
 			val3 = 5 + (2 * val1); // Max rage counters
 			tick = -1; //endless duration in the client
 			tick_time = 6000; // [GodLesZ] tick time
@@ -10773,9 +10773,9 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
 		break;
 
 	case SC_FORCEOFVANGUARD:
-		if( !status_charge(bl,0,20) )
+		if( !status_charge(bl,0,24 - (4 * sce->val1)) )
 			break;
-		sc_timer_next(6000 + tick, status_change_timer, bl->id, data);
+		sc_timer_next(10000 + tick, status_change_timer, bl->id, data);
 		return 0;
 
 	case SC_BANDING:

+ 4 - 0
src/map/unit.c

@@ -2227,6 +2227,10 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
 			{// decrement the number of active pvp players on the map
 				--map[bl->m].users_pvp;
 			}
+			if( sd->state.hpmeter_visible ) {
+				map[bl->m].hpmeter_visible--;
+				sd->state.hpmeter_visible = 0;
+			}
 			sd->state.debug_remove_map = 1; // temporary state to track double remove_map's [FlavioJS]
 			sd->debug_file = file;
 			sd->debug_line = line;