Advertisement
warc222

Reshare Double Exp-Sp In Saturday(Working)

Jan 24th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. By AbsolutePower
  2. Config.java
  3.  
  4. public static float RATE_XP;
  5. public static float RATE_SP;
  6. + public static float SATURDAY_RATE_XP;
  7. + public static float SATURDAY_RATE_SP;
  8.  
  9.  
  10. RATE_XP = Float.parseFloat(server.getProperty("RateXp", "1."));
  11. RATE_SP = Float.parseFloat(server.getProperty("RateSp", "1."));
  12. + SATURDAY_RATE_XP = Float.parseFloat(server.getProperty("SaturDayXp", "2."));
  13. + SATURDAY_RATE_SP = Float.parseFloat(server.getProperty("SaturDaySp", "2."));
  14.  
  15. Config.properties
  16.  
  17. # =================================================================
  18. # RATES
  19. # =================================================================
  20.  
  21. # Rate control
  22. RateXp = 1.
  23. RateSp = 1.
  24. + SaturDayXp = 2.
  25. + SaturDaySp = 2.
  26.  
  27.  
  28. L2Npc.java
  29. _ /**
  30. _ * Return the Exp Reward of this L2Npc contained in the L2NpcTemplate (modified by _RATE_XP).<BR><BR>
  31. _ */
  32. _ public int getExpReward()
  33. _ {
  34. _ return (int) (getTemplate().rewardExp * Config.RATE_XP);
  35. _ }
  36.  
  37. + private int Savvato()
  38. + {
  39. + return Calendar.SATURDAY;
  40. + }
  41. + private int dayofweek()
  42. + {
  43. + return Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
  44. + }
  45.  
  46. + /**
  47. + * Return the Exp Reward of this L2Npc contained in the L2NpcTemplate (modified by +RATE_XP).<BR><BR>
  48. + */
  49. + public int getExpReward()
  50. + {
  51. + if(dayofweek() == Savvato())
  52. + return (int) (getTemplate().rewardExp * Config.SATURDAY_RATE_XP);
  53. + else
  54. + return (int) (getTemplate().rewardExp * Config.RATE_XP);
  55. +
  56. + }
  57.  
  58. _ /**
  59. _ * Return the SP Reward of this L2Npc contained in the L2NpcTemplate (modified by _RATE_SP).<BR><BR>
  60. _ */
  61. _ public int getSpReward()
  62. _ {
  63. _ return (int) (getTemplate().rewardSp * Config.RATE_SP);
  64. _ }
  65.  
  66. + /**
  67. + * Return the SP Reward of this L2Npc contained in the L2NpcTemplate (modified by +RATE_SP).<BR><BR>
  68. + */
  69. + public int getSpReward()
  70. + {
  71. + if(dayofweek() == Savvato())
  72. + return (int) (getTemplate().rewardExp * Config.SATURDAY_RATE_SP);
  73. + else
  74. + return (int) (getTemplate().rewardSp * Config.RATE_SP);
  75. + }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement