ソースを参照

- Modified item-granded status resistance reduction to behave as explained by Vicious (Ragnarok Monthly magazine)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8921 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 年 前
コミット
946a0d9d89
3 ファイル変更15 行追加9 行削除
  1. 2 0
      Changelog-Trunk.txt
  2. 4 2
      src/map/pc.c
  3. 9 7
      src/map/status.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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/10/02
+	* Modified item-granded status resistance reduction to behave as explained
+	  by Vicious (Ragnarok Monthly magazine) [Skotlex]
 	* Added the opt3 values to Eske [Skotlex]
 	* Fixed the txt->sql converter only saving the very first character
 	  permanent variable. [Skotlex]

+ 4 - 2
src/map/pc.c

@@ -1902,8 +1902,10 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
 			ShowWarning("pc_bonus2 (Resist Effect): %d is not supported.\n", type2);
 			break;
 		}
-		if(sd->state.lr_flag != 2)
-			sd->reseff[type2-SC_COMMON_MIN]+=val;
+		if(sd->state.lr_flag == 2)
+			break;
+		i = sd->reseff[type2-SC_COMMON_MIN]+val;
+		sd->reseff[type2-SC_COMMON_MIN]= cap_value(i, 0, 10000);
 		break;
 	case SP_MAGIC_ADDELE:
 		if(type2 >= ELE_MAX) {

+ 9 - 7
src/map/status.c

@@ -4479,13 +4479,15 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 				return 0;
 		}
 
-		//Item defenses do not reduce duration, so they go out of the function.
-		if(sd && SC_COMMON_MIN<=type && type<=SC_COMMON_MAX
-			&& sd->reseff[type-SC_COMMON_MIN] > 0)
-			def += sd->reseff[type-SC_COMMON_MIN];
-
-		if (def && !(flag&8))
-			rate -= rate*def/10000;
+		if (!(flag&8)) {
+			if (def) //Natural resistance
+				rate -= rate*def/10000;
+
+			//Item resistance (only applies to rate%)
+			if(sd && SC_COMMON_MIN<=type && type<=SC_COMMON_MAX
+				&& sd->reseff[type-SC_COMMON_MIN] > 0)
+				rate -= rate*sd->reseff[type-SC_COMMON_MIN]/10000;
+		}
 
 		if (!(rand()%10000 < rate))
 			return 0;