Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: head-src/com/l2jfrozen/gameserver/model/entity/event/CrazyRates
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/entity/event/CrazyRates.java
- +++ head-src/com/l2jfrozen/gameserver/model/entity/event/CrazyRates.java
- +/**
- + * @author Axcel Baseado no de Allan
- + *
- + */
- +package com.l2jfrozen.gameserver.model.entity.event;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.model.entity.Announcements;
- +
- +public class CrazyRates
- +{
- +
- + {
- +
- + }
- +
- + public static void DoubleRates()
- + {
- + {
- +
- + Config.RATE_XP = Config.RateMultipler * Config.RATE_XP;
- + Config.RATE_SP = Config.RateMultipler * Config.RATE_SP;
- + Config.RATE_DROP_ITEMS = Config.RateMultipler * Config.RATE_DROP_ITEMS;
- + Config.ITEMS_RAID = Config.RateMultipler * Config.ITEMS_RAID;
- + Config.RATE_DROP_ADENA = Config.RateMultipler * Config.RATE_DROP_ADENA;
- + Announcements.getInstance().gameAnnounceToAll("El evento Crazy rates tienes " + Config.time_crazyrate + " minutos para farmear! Los rates aumentaron a: " + Config.RateMultipler) !!!;
- + }
- + }
- +
- + public static void DivideRates()
- + {
- + Config.RATE_XP = Config.RATE_XP / Config.RateMultipler;
- + Config.RATE_SP = Config.RATE_SP / Config.RateMultipler;
- + Config.RATE_DROP_ITEMS = Config.RATE_DROP_ITEMS / Config.RateMultipler;
- + Config.ITEMS_RAID = Config.ITEMS_RAID / Config.RateMultipler;
- + Config.RATE_DROP_ADENA = Config.RATE_DROP_ADENA / Config.RateMultipler;
- + Announcements.getInstance().gameAnnounceToAll("El evento termino! Gracias por participar !!");
- + }
- +
- + public static void EventManager()
- + {
- + DoubleRates();
- + try
- + {
- + Thread.sleep(Config.time_crazyrate * 1000 * 60); // Tempo em Minutos
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + }
- + DivideRates();
- +
- + }
- +
- +}
- Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCrazy.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCrazy.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCrazy.java
- +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
- +
- +import java.util.StringTokenizer;
- +import java.util.logging.Logger;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +
- +public class AdminCrazy implements IAdminCommandHandler
- +{
- + private final static Logger _log = Logger.getLogger(AdminCrazy.class.getName());
- +
- + private static String[] _adminCommands =
- + {
- + "admin_crazy_event"
- + };
- +
- + private enum CommandEnum
- + {
- + admin_crazy_event
- + }
- +
- + public void run()
- + {
- + com.l2jfrozen.gameserver.model.entity.event.CrazyRates.EventManager();
- + }
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + /*
- + if(!AdminCommandAccessRights.getInstance().hasAccess(command, activeChar.getAccessLevel())){
- + return false;
- + }
- +
- + if(Config.GMAUDIT)
- + {
- + Logger _logAudit = Logger.getLogger("gmaudit");
- + LogRecord record = new LogRecord(Level.INFO, command);
- + record.setParameters(new Object[]
- + {
- + "GM: " + activeChar.getName(), " to target [" + activeChar.getTarget() + "] "
- + });
- + _logAudit.log(record);
- + }
- + */
- +
- + StringTokenizer st = new StringTokenizer(command);
- +
- + CommandEnum comm = CommandEnum.valueOf(st.nextToken());
- +
- + if(comm == null)
- + return false;
- + long flush2 = 0,timeL = 0;
- +
- + switch(comm){
- + case admin_crazy_event:{
- +
- + boolean no_token = false;
- +
- + if(st.hasMoreTokens()){
- + String doublerate = st.nextToken();
- + int rate = Integer.parseInt(doublerate);
- + Config.RateMultipler = rate;
- + if(1 == 1){
- +
- + if (st.hasMoreTokens()) //time
- + {
- + String time = st.nextToken();
- +
- + try{
- + int value = Integer.parseInt(time);
- + Config.time_crazyrate = value;
- +
- + ThreadPoolManager.getInstance().scheduleGeneral(new StartEvent(), flush2);
- +
- +
- + if(value>0){
- +
- +
- + }else{
- +
- + activeChar.sendMessage("Time must be bigger then 0!");
- + return false;
- + }
- +
- + }catch(NumberFormatException e){
- + activeChar.sendMessage("Time must be a number!");
- + return false;
- + }
- +
- + }else{
- + no_token = true;
- + }
- +
- + }
- +
- + }else{
- +
- + no_token=true;
- +
- + }
- +
- + if(no_token){
- + activeChar.sendMessage("Usage: //crazy_event <rate Multiplique> [time](In Minutes)");
- + return false;
- + }
- +
- + }
- + }
- +
- + return true;
- +
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return _adminCommands;
- + }
- +}
- Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/StartEvent.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/StartEvent.java (revision 0) */ATENCION! Tiene que crear este archivo!
- +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/StartEvent.java
- +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
- +
- +/**
- + * @author UnrealShare
- + *
- + */
- +public class StartEvent implements Runnable
- +{
- +
- + @Override
- + public void run()
- + {
- + com.l2jfrozen.gameserver.model.entity.event.CrazyRates.EventManager();
- +
- + }
- +
- +}
- Index: head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
- +++ head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java .
- import com.l2jfrozen.gameserver.model.entity.event.CrazyRates;
- registerAdminCommandHandler(new AdminAio());
- registerAdminCommandHandler(new AdminCharSupervision());
- + registerAdminCommandHandler(new AdminCrazy());
- //ATTENTION: adding new command handlers, you have to change the
- Index: head-src/com/l2jfrozen/Config.java
- ===================================================================
- --- head-src/com/l2jfrozen/Config.java
- +++ hhead-src/com/l2jfrozen/Config.java
- public static int MASTERACCESS_NAME_COLOR;
- public static int MASTERACCESS_TITLE_COLOR;
- + public static float RateMultipler;
- + public static int time_crazyrate;
- @new line@
- PM_TEXT1 = frozenSettings.getProperty("PMText1", "Have Fun and Nice Stay on");
- PM_TEXT2 = frozenSettings.getProperty("PMText2", "Vote for us every 24h");
- +
- + RateMultipler = Float.parseFloat(frozenSettings.getProperty("RateMultipler", "2.00"));
- + time_crazyrate = Integer.parseInt(frozenSettings.getProperty("TimeCrazy", "1"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement