warc222

[aCis] Limits Players

Mar 6th, 2024
6
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ### Eclipse Workspace Patch 1.0
  2. #P trunk_335
  3. Index: aCis_gameserver/config/players.properties
  4. ===================================================================
  5. --- aCis_gameserver/config/players.properties (revision 76)
  6. +++ aCis_gameserver/config/players.properties (working copy)
  7. @@ -218,15 +218,6 @@
  8. GMStartupAutoList = True
  9.  
  10. #=============================================================
  11. -# Limits System
  12. -#=============================================================
  13. -
  14. -# Those settings put a cap limit to some players' stats.
  15. -# Default: 1400, 1600
  16. -MaxPAtkSpeed = 1400
  17. -MaxMAtkSpeed = 1600
  18. -
  19. -#=============================================================
  20. # Petitions
  21. #=============================================================
  22.  
  23. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java
  24. ===================================================================
  25. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java (revision 76)
  26. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java (working copy)
  27. @@ -153,36 +153,76 @@
  28. * @param skill
  29. * @return the Critical Hit rate (base+modifier) of the L2Character.
  30. */
  31. - public int getCriticalHit(L2Character target, L2Skill skill)
  32. - {
  33. - return Math.min((int) calcStat(Stats.CRITICAL_RATE, _activeChar.getTemplate().getBaseCritRate(), target, skill), 500);
  34. - }
  35. + public int getCriticalHit(L2Character target, L2Skill skill)
  36. + {
  37. + if (_activeChar == null)
  38. + {
  39. + return 1;
  40. + }
  41. +
  42. + int criticalHit = Math.min((int)calcStat(Stats.CRITICAL_RATE, _activeChar.getTemplate().getBaseCritRate(), target, skill), 500);
  43. +
  44. + if (criticalHit > Config.MAX_PCRIT_RATE) {
  45. + criticalHit = Config.MAX_PCRIT_RATE;
  46. + }
  47. + return criticalHit;
  48. + }
  49.  
  50. /**
  51. * @param target
  52. * @param skill
  53. * @return the Magic Critical Hit rate (base+modifier) of the L2Character.
  54. */
  55. - public final int getMCriticalHit(L2Character target, L2Skill skill)
  56. - {
  57. - return (int) calcStat(Stats.MCRITICAL_RATE, 8, target, skill);
  58. - }
  59. + public final int getMCriticalHit(L2Character target, L2Skill skill)
  60. + {
  61. + if (_activeChar == null)
  62. + {
  63. + return 1;
  64. + }
  65. +
  66. + double mrate = calcStat(Stats.MCRITICAL_RATE, 8.0D, target, skill);
  67. +
  68. + if (mrate > Config.MAX_MCRIT_RATE) {
  69. + mrate = Config.MAX_MCRIT_RATE;
  70. + }
  71. + return (int)mrate;
  72. + }
  73.  
  74. /**
  75. * @param target
  76. * @return the Attack Evasion rate (base+modifier) of the L2Character.
  77. */
  78. - public int getEvasionRate(L2Character target)
  79. - {
  80. - return (int) calcStat(Stats.EVASION_RATE, 0, target, null);
  81. - }
  82. + public int getEvasionRate(L2Character target)
  83. + {
  84. + if (_activeChar == null)
  85. + {
  86. + return 1;
  87. + }
  88. + int val = (int)Math.round(calcStat(Stats.EVASION_RATE, 0.0D, target, null));
  89. +
  90. + if ((val > Config.MAX_EVASION) && (!_activeChar.isGM()))
  91. + {
  92. + val = Config.MAX_EVASION;
  93. + }
  94. + return val;
  95. + }
  96.  
  97. /**
  98. * @return the Accuracy (base+modifier) of the L2Character in function of the Weapon Expertise Penalty.
  99. */
  100. public int getAccuracy()
  101. {
  102. - return (int) calcStat(Stats.ACCURACY_COMBAT, 0, null, null);
  103. + if (_activeChar == null)
  104. + {
  105. + return 1;
  106. + }
  107. + int val = (int)Math.round(calcStat(Stats.ACCURACY_COMBAT, 0.0D, null, null));
  108. +
  109. + if ((val > Config.MAX_ACCURACY) && (!_activeChar.isGM()))
  110. + {
  111. + val = Config.MAX_ACCURACY;
  112. + }
  113. + return val;
  114. }
  115.  
  116. public int getMaxHp()
  117. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java
  118. ===================================================================
  119. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (revision 76)
  120. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (working copy)
  121. @@ -330,67 +330,61 @@
  122. else
  123. val = super.getRunSpeed();
  124.  
  125. - final int penalty = getActiveChar().getExpertiseArmorPenalty();
  126. - if (penalty > 0)
  127. - val *= Math.pow(0.84, penalty);
  128. -
  129. - return val;
  130. + val += Config.RUN_SPD_BOOST;
  131. +
  132. + if ((val > Config.MAX_RUN_SPEED) && (!getActiveChar().isGM()))
  133. + {
  134. + return Config.MAX_RUN_SPEED;
  135. + }
  136. + return val;
  137. }
  138.  
  139. @Override
  140. - public int getMAtkSpd()
  141. - {
  142. - int val = super.getMAtkSpd();
  143. -
  144. - if (val > Config.MAX_MATK_SPEED)
  145. - return Config.MAX_MATK_SPEED;
  146. -
  147. - final int penalty = getActiveChar().getExpertiseArmorPenalty();
  148. - if (penalty > 0)
  149. - val *= Math.pow(0.84, penalty);
  150. -
  151. - return val;
  152. - }
  153. + public int getMAtkSpd()
  154. + {
  155. + int val = super.getMAtkSpd();
  156. +
  157. + if ((val > Config.MAX_MATK_SPEED) && (!getActiveChar().isGM()))
  158. + {
  159. + return Config.MAX_MATK_SPEED;
  160. + }
  161. + return val;
  162. + }
  163.  
  164. @Override
  165. - public int getPAtkSpd()
  166. - {
  167. - if (getActiveChar() == null)
  168. - return 1;
  169. -
  170. - int val = super.getPAtkSpd();
  171. -
  172. - if (val > Config.MAX_PATK_SPEED)
  173. - return Config.MAX_PATK_SPEED;
  174. -
  175. - final int penalty = getActiveChar().getExpertiseArmorPenalty();
  176. - if (penalty > 0)
  177. - val *= Math.pow(0.84, penalty);
  178. -
  179. - return val;
  180. - }
  181. + public int getPAtkSpd()
  182. + {
  183. + int val = super.getPAtkSpd();
  184. +
  185. + if ((val > Config.MAX_PATK_SPEED) && (!getActiveChar().isGM()))
  186. + {
  187. + return Config.MAX_PATK_SPEED;
  188. + }
  189. + return val;
  190. + }
  191.  
  192. @Override
  193. - public int getEvasionRate(L2Character target)
  194. - {
  195. - int val = super.getEvasionRate(target);
  196. -
  197. - final int penalty = getActiveChar().getExpertiseArmorPenalty();
  198. - if (penalty > 0)
  199. - val -= (2 * penalty);
  200. -
  201. - return val;
  202. - }
  203. + public int getEvasionRate(L2Character target)
  204. + {
  205. + int val = super.getEvasionRate(target);
  206. +
  207. + if ((val > Config.MAX_EVASION) && (!getActiveChar().isGM()))
  208. + {
  209. + return Config.MAX_EVASION;
  210. + }
  211. + return val;
  212. + }
  213.  
  214. @Override
  215. public int getAccuracy()
  216. {
  217. - int val = super.getAccuracy();
  218. -
  219. - if (getActiveChar().getExpertiseWeaponPenalty())
  220. - val -= 20;
  221. -
  222. - return val;
  223. + int val = super.getAccuracy();
  224. +
  225. + if ((val > Config.MAX_ACCURACY) && (!getActiveChar().isGM()))
  226. + {
  227. + return Config.MAX_ACCURACY;
  228. + }
  229. + return val;
  230. }
  231.  
  232. @Override
  233. Index: aCis_gameserver/java/net/sf/l2j/Config.java
  234. ===================================================================
  235. --- aCis_gameserver/java/net/sf/l2j/Config.java (revision 77)
  236. +++ aCis_gameserver/java/net/sf/l2j/Config.java (working copy)
  237. @@ -416,6 +416,15 @@
  238. public static int PVP_TO_USE_STORE;
  239. public static boolean SERVER_TIME_ON_START;
  240. public static boolean ALLOW_ONLINE_VIEW;
  241. + /** Limits */
  242. + public static int RUN_SPD_BOOST;
  243. + public static int MAX_RUN_SPEED;
  244. + public static int MAX_PCRIT_RATE;
  245. + public static int MAX_MCRIT_RATE;
  246. + public static int MAX_PATK_SPEED;
  247. + public static int MAX_MATK_SPEED;
  248. + public static int MAX_EVASION;
  249. + public static int MAX_ACCURACY;
  250.  
  251. // --------------------------------------------------
  252. // Players
  253. @@ -510,9 +519,6 @@
  254. public static boolean GM_STARTUP_SILENCE;
  255. public static boolean GM_STARTUP_AUTO_LIST;
  256.  
  257. - /** Limits */
  258. - public static int MAX_PATK_SPEED;
  259. - public static int MAX_MATK_SPEED;
  260.  
  261. /** petitions */
  262. public static boolean PETITIONING_ALLOWED;
  263. @@ -961,7 +967,15 @@
  264. PVP_TO_USE_STORE = aCis.getProperty("PvPToUseStore", 0);
  265. SERVER_TIME_ON_START = aCis.getProperty("ShowServerTimeOnStart", false);
  266. ALLOW_ONLINE_VIEW = aCis.getProperty("AllowOnlineView", false);
  267. -
  268. + RUN_SPD_BOOST = aCis.getProperty("RunSpeedBoost", 0);
  269. + MAX_RUN_SPEED = aCis.getProperty("MaxRunSpeed", 250);
  270. + MAX_PCRIT_RATE = aCis.getProperty("MaxPCritRate", 500);
  271. + MAX_MCRIT_RATE = aCis.getProperty("MaxMCritRate", 200);
  272. + MAX_PATK_SPEED = aCis.getProperty("MaxPAtkSpeed", 1500);
  273. + MAX_MATK_SPEED = aCis.getProperty("MaxMAtkSpeed", 1999);
  274. + MAX_EVASION = aCis.getProperty("MaxEvasion", 250);
  275. + MAX_ACCURACY = aCis.getProperty("MaxAccuracy", 300);
  276. +
  277. // NPCs / Monsters
  278. ExProperties npcs = load(NPCS_FILE);
  279. CHAMPION_FREQUENCY = npcs.getProperty("ChampionFrequency", 0);
  280. @@ -1154,8 +1168,6 @@
  281. GM_STARTUP_SILENCE = players.getProperty("GMStartupSilence", true);
  282. GM_STARTUP_AUTO_LIST = players.getProperty("GMStartupAutoList", true);
  283.  
  284. - MAX_PATK_SPEED = Integer.parseInt(players.getProperty("MaxPAtkSpeed", "1400"));
  285. - MAX_MATK_SPEED = Integer.parseInt(players.getProperty("MaxMAtkSpeed", "1600"));
  286.  
  287. PETITIONING_ALLOWED = players.getProperty("PetitioningAllowed", true);
  288. MAX_PETITIONS_PER_PLAYER = players.getProperty("MaxPetitionsPerPlayer", 5);
  289. Index: aCis_gameserver/config/aCis.properties
  290. ===================================================================
  291. --- aCis_gameserver/config/aCis.properties (revision 77)
  292. +++ aCis_gameserver/config/aCis.properties (working copy)
  293. @@ -30,3 +30,38 @@
  294. # Displays The Number of The Players That are Currently Online.
  295. # Default : False
  296. AllowOnlineView = False
  297. +
  298. +#=============================================================
  299. +# Limits
  300. +#=============================================================
  301. +
  302. +# Run speed modifier. Example: Setting this to 5 will give players +5 to their running speed.
  303. +# Default: 0
  304. +RunSpeedBoost = 0
  305. +
  306. +# Maximum character running speed.
  307. +# Default: 250
  308. +MaxRunSpeed = 250
  309. +
  310. +# Maximum character Physical Critical Rate. (10 = 1%)
  311. +# Default: 500
  312. +MaxPCritRate = 500
  313. +
  314. +# Maximum character Magic Critical Rate. (10 = 1%)
  315. +# Default: 200
  316. +MaxMCritRate = 200
  317. +
  318. +# Maximum character Attack Speed.
  319. +# Default: 1500
  320. +MaxPAtkSpeed = 1500
  321. +
  322. +# Maximum character Cast Speed.
  323. +# Default: 1999
  324. +MaxMAtkSpeed = 1999
  325. +
  326. +# Maximum character Evasion.
  327. +# Default: 250
  328. +MaxEvasion = 250
  329. +
  330. +# Maxmum character Accuracy
  331. +MaxAccuracy = 300
Add Comment
Please, Sign In to add comment