瀏覽代碼

Corrected bResEff behavior (fixes #996)
* Removed the common SC range check.
* A few of the Eff_* values are tied to a SC that's not within the common SC range.

aleos89 8 年之前
父節點
當前提交
efdc748a7a
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 1 1
      src/map/pc.c
  2. 5 2
      src/map/status.c

+ 1 - 1
src/map/pc.c

@@ -3132,7 +3132,7 @@ void pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
 			sd->state.lr_flag != 2 ? val : 0, sd->state.lr_flag == 2 ? val : 0, ATF_SELF, 0);
 		break;
 	case SP_RESEFF: // bonus2 bResEff,eff,n;
-		if (type2 < SC_COMMON_MIN || type2 > SC_COMMON_MAX) {
+		if (type2 <= SC_NONE || type2 >= SC_MAX) {
 			ShowError("pc_bonus2: SP_RESEFF: %d is invalid effect.\n", type2);
 			break;
 		}

+ 5 - 2
src/map/status.c

@@ -7735,9 +7735,12 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
 		}
 
 		// Item resistance (only applies to rate%)
+		// TODO: Need to come up with a better way of flagging "common" SC rather than setting them at the start of sc_enum
+		if(sd && type > SC_NONE && type < SC_MAX) {
+			if( sd->reseff[type] > 0 )
+				rate -= ((rate*sd->reseff[type])/10000);
+		}
 		if(sd && SC_COMMON_MIN <= type && type <= SC_COMMON_MAX) {
-			if( sd->reseff[type-SC_COMMON_MIN] > 0 )
-				rate -= rate*sd->reseff[type-SC_COMMON_MIN]/10000;
 			if( sd->sc.data[SC_COMMONSC_RESIST] )
 				rate -= rate*sd->sc.data[SC_COMMONSC_RESIST]->val1/100;
 		}