Advertisement
warc222

Double Exp-Sp In Saturday(Working)

Jan 17th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. By AbsolutePower
  2. Config.java
  3.  
  4.  
  5.  
  6. public static float RATE_XP;
  7.  
  8. public static float RATE_SP;
  9.  
  10. + public static float SATURDAY_RATE_XP;
  11.  
  12. + public static float SATURDAY_RATE_SP;
  13.  
  14.  
  15.  
  16.  
  17.  
  18. RATE_XP = Float.parseFloat(server.getProperty("RateXp", "1."));
  19.  
  20. RATE_SP = Float.parseFloat(server.getProperty("RateSp", "1."));
  21.  
  22. + SATURDAY_RATE_XP = Float.parseFloat(server.getProperty("SaturDayXp", "2."));
  23.  
  24. + SATURDAY_RATE_SP = Float.parseFloat(server.getProperty("SaturDaySp", "2."));
  25.  
  26.  
  27.  
  28. Config.properties
  29.  
  30.  
  31.  
  32. # =================================================================
  33.  
  34. # RATES
  35.  
  36. # =================================================================
  37.  
  38.  
  39.  
  40. # Rate control
  41.  
  42. RateXp = 1.
  43.  
  44. RateSp = 1.
  45.  
  46. + SaturDayXp = 2.
  47.  
  48. + SaturDaySp = 2.
  49.  
  50.  
  51.  
  52.  
  53.  
  54. L2Npc.java
  55.  
  56. _ /**
  57.  
  58. _ * Return the Exp Reward of this L2Npc contained in the L2NpcTemplate (modified by _RATE_XP).<BR><BR>
  59.  
  60. _ */
  61.  
  62. _ public int getExpReward()
  63.  
  64. _ {
  65.  
  66. _ return (int) (getTemplate().rewardExp * Config.RATE_XP);
  67.  
  68. _ }
  69.  
  70.  
  71.  
  72. + private int Savvato()
  73.  
  74. + {
  75.  
  76. + return Calendar.getInstance().get(Calendar.SATURDAY);
  77.  
  78. + }
  79.  
  80. + private int dayofweek()
  81.  
  82. + {
  83.  
  84. + return Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
  85.  
  86. + }
  87.  
  88.  
  89.  
  90. + /**
  91.  
  92. + * Return the Exp Reward of this L2Npc contained in the L2NpcTemplate (modified by +RATE_XP).<BR><BR>
  93.  
  94. + */
  95.  
  96. + public int getExpReward()
  97.  
  98. + {
  99.  
  100. + if(dayofweek() == Savvato())
  101.  
  102. + return (int) (getTemplate().rewardExp * Config.SATURDAY_RATE_XP);
  103.  
  104. + else
  105.  
  106. + return (int) (getTemplate().rewardExp * Config.RATE_XP);
  107.  
  108. +
  109.  
  110. + }
  111.  
  112.  
  113.  
  114. _ /**
  115.  
  116. _ * Return the SP Reward of this L2Npc contained in the L2NpcTemplate (modified by _RATE_SP).<BR><BR>
  117.  
  118. _ */
  119.  
  120. _ public int getSpReward()
  121.  
  122. _ {
  123.  
  124. _ return (int) (getTemplate().rewardSp * Config.RATE_SP);
  125.  
  126. _ }
  127.  
  128.  
  129.  
  130. + /**
  131.  
  132. + * Return the SP Reward of this L2Npc contained in the L2NpcTemplate (modified by +RATE_SP).<BR><BR>
  133.  
  134. + */
  135.  
  136. + public int getSpReward()
  137.  
  138. + {
  139.  
  140. + if(dayofweek() == Savvato())
  141.  
  142. + return (int) (getTemplate().rewardExp * Config.SATURDAY_RATE_SP);
  143.  
  144. + else
  145.  
  146. + return (int) (getTemplate().rewardSp * Config.RATE_SP);
  147.  
  148. + }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement