Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ===================================================================
- com/l2jfrozen/Config.java
- ===================================================================
- + public static boolean ALLOW_AUTO_REWARDER;
- + public static int AUTO_REWARD_DELAY;
- + public static int AUTO_REWARD_ID;
- + public static int AUTO_REWARD_COUNT;
- + public static String NAME_ITEM_REWARD;
- +
- public static String ALLOWED_SKILLS;
- ;
- + /** Automatic Restart **/
- + ALLOW_AUTO_REWARDER = Boolean.parseBoolean(L2JSanneSettings.getProperty("AllowAutoRewarder", "True"));
- + AUTO_REWARD_DELAY = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardDelay", "1200"));
- + AUTO_REWARD_ID = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardID", "57"));
- + AUTO_REWARD_COUNT = Integer.parseInt(L2JSanneSettings.getProperty("AutoRewardCount", "1000"));
- + NAME_ITEM_REWARD = L2JSanneSettings.getProperty("RewardItemName", "Event medal");
- +
- /** Server Name **/
- gameserver/model/entity/AutoRewarder.java
- ===================================================================
- gameserver/model/entity/AutoRewarder.java (revision 0)
- gameserver/model/entity/AutoRewarder.java (working copy)
- /*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see .
- */
- package com.l2jfrozen.gameserver.model.entity;
- import java.util.Collection;
- import com.l2jfrozen.Config;
- import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- import com.l2jfrozen.gameserver.model.L2World;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- /**
- * @author Dagger
- *
- */
- public class AutoRewarder
- {
- public static void getInstance()
- {
- ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
- {
- @Override
- public void run()
- {
- AutoReward();
- }
- }, 0,Config.AUTO_REWARD_DELAY * 1000);
- }
- public static void AutoReward()
- {
- Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();
- for (L2PcInstance p : pls)
- {
- p.sendMessage("AutoReward: Usted ha recibido " + Config.AUTO_REWARD_COUNT +" "+ Config.NAME_ITEM_REWARD + " Por Estar online 1 Hora");
- p.getInventory().addItem("", Config.AUTO_REWARD_ID, Config.AUTO_REWARD_COUNT, p, null);
- }
- }
- }
- \ No newline at end of file
- ===================================================================
- gameserver/GameServer.java
- ===================================================================
- import com.l2jfrozen.gameserver.model.entity.Announcements;
- +import com.l2jfrozen.gameserver.model.entity.AutoRewarder;
- import com.l2jfrozen.gameserver.model.entity.Hero;
- Util.printSection("Custom Mods");
- - if (Config.L2JMOD_ALLOW_WEDDING || Config.ALLOW_AWAY_STATUS || Config.PCB_ENABLE || Config.POWERPAK_ENABLED)
- + if (Config.L2JMOD_ALLOW_WEDDING || Config.ALLOW_AWAY_STATUS || Config.PCB_ENABLE || Config.POWERPAK_ENABLED || Config.ALLOW_AUTO_REWARDER)
- {
- if (Config.L2JMOD_ALLOW_WEDDING)
- CoupleManager.getInstance();
- if (Config.POWERPAK_ENABLED)
- PowerPak.getInstance();
- +
- + if (Config.ALLOW_AUTO_REWARDER)
- + AutoRewarder.getInstance();
- }
- else
- LOGGER.info("All custom mods are Disabled.");
- config/functions/L2Jfrozen.properties
- ===================================================================
- +# Auto rewarder.
- +AllowAutoRewarder = True
- +# Delay for reward. (in seconds)
- +AutoRewardDelay = 1200
- +# ID of item reward.
- +AutoRewardID = 6392
- +# Count of item reward.
- +AutoRewardCount = 1000
- +# Item Name SendMensagem the payer will win ex Medal Event.
- +RewardItemNameItemName = Event Medal
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement