Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +/*
- + * 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.event;
- +
- +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;
- +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
- +
- +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 player : pls)
- + {
- + if (!(player != null))
- + return;
- + L2PcInstance activeChar = player;
- + if(activeChar.isOnline() == 1)
- + {
- + player.sendPacket(new ExShowScreenMessage( "AutoReward: Voce ganhou um premio por estar online: " + Config.AUTO_REWARD_COUNT, 4000));
- + player.getInventory().addItem("", Config.AUTO_REWARD_ID, Config.AUTO_REWARD_COUNT, player, null);
- + }
- + }
- + }
- +
- +}
- Index: package com/l2jfrozen/gameserver/datatables/OfflineTradeTable.java
- }
- items.close();
- stm_items.close();
- player.sitDown();
- if (Config.OFFLINE_SET_NAME_COLOR)
- {
- player._originalNameColorOffline = player.getAppearance().getNameColor();
- player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
- }
- player.setPrivateStoreType(type);
- - player.setOnlineStatus(true);
- + player.setOnlineStatus(false);
- player.restoreEffects();
- player.broadcastUserInfo();
- nTraders++;
- }
Add Comment
Please, Sign In to add comment