Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- By AbsolutePower
- Config.java
- public static float RATE_XP;
- public static float RATE_SP;
- + public static float SATURDAY_RATE_XP;
- + public static float SATURDAY_RATE_SP;
- RATE_XP = Float.parseFloat(server.getProperty("RateXp", "1."));
- RATE_SP = Float.parseFloat(server.getProperty("RateSp", "1."));
- + SATURDAY_RATE_XP = Float.parseFloat(server.getProperty("SaturDayXp", "2."));
- + SATURDAY_RATE_SP = Float.parseFloat(server.getProperty("SaturDaySp", "2."));
- Config.properties
- # =================================================================
- # RATES
- # =================================================================
- # Rate control
- RateXp = 1.
- RateSp = 1.
- + SaturDayXp = 2.
- + SaturDaySp = 2.
- L2Npc.java
- _ /**
- _ * Return the Exp Reward of this L2Npc contained in the L2NpcTemplate (modified by _RATE_XP).<BR><BR>
- _ */
- _ public int getExpReward()
- _ {
- _ return (int) (getTemplate().rewardExp * Config.RATE_XP);
- _ }
- + private int Savvato()
- + {
- + return Calendar.getInstance().get(Calendar.SATURDAY);
- + }
- + private int dayofweek()
- + {
- + return Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
- + }
- + /**
- + * Return the Exp Reward of this L2Npc contained in the L2NpcTemplate (modified by +RATE_XP).<BR><BR>
- + */
- + public int getExpReward()
- + {
- + if(dayofweek() == Savvato())
- + return (int) (getTemplate().rewardExp * Config.SATURDAY_RATE_XP);
- + else
- + return (int) (getTemplate().rewardExp * Config.RATE_XP);
- +
- + }
- _ /**
- _ * Return the SP Reward of this L2Npc contained in the L2NpcTemplate (modified by _RATE_SP).<BR><BR>
- _ */
- _ public int getSpReward()
- _ {
- _ return (int) (getTemplate().rewardSp * Config.RATE_SP);
- _ }
- + /**
- + * Return the SP Reward of this L2Npc contained in the L2NpcTemplate (modified by +RATE_SP).<BR><BR>
- + */
- + public int getSpReward()
- + {
- + if(dayofweek() == Savvato())
- + return (int) (getTemplate().rewardExp * Config.SATURDAY_RATE_SP);
- + else
- + return (int) (getTemplate().rewardSp * Config.RATE_SP);
- + }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement