|
Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo. Caso seja registrado, efetue login. Esqueceu sua senha? Clique aqui Recomendamos o uso do Mozilla Firefox para uma melhor visualização. |
|
| Início | Postados Hoje | Marcar Fóruns Como Lidos | Álbums | Banidos | SE Team | Medalhas |
|
|||||||
| Registrar | Loteria VIP | Staff SE | Regras do fórum | Comunidade | Arcade | Postados Hoje | Pesquisar | Experience |
|
|
|
||||||||||||||||||||||||||||||||||||||
|
|
|
|
Ferramentas do Tópico | Modos de Exibição |
|
|
#1 | ||||||||||||||
|
Membro - Coronel
![]() Registrado em: Feb 2009
Localização: Em Casa
Posts: 191
Agradeceu: 102
Agradecido 193 Vezes em 70 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Estado:
![]()
Nome Real: AiramCruZ
|
Você poe um certo tempo para todos os players receberem um certo item.
Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/entity/custom/AutoRewarder.java
===================================================================
--- java/net/sf/l2j/gameserver/model/entity/custom/AutoRewarder.java (revision 0)
+++ java/net/sf/l2j/gameserver/model/entity/custom/AutoRewarder.java (working copy)
@@ -0,0 +1,51 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package net.sf.l2j.gameserver.model.entity.custom;
+
+import java.util.Collection;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author Debian
+ *
+ */
+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().values();
+ for (L2PcInstance p : pls)
+ {
+ p.addItem(null, Config.AUTO_REWARD_ID, Config.AUTO_REWARD_COUNT, p, true);
+ }
+ }
+
+}
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java (revision 13)
+++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
@@ -90,6 +90,7 @@
import net.sf.l2j.gameserver.model.PartyMatchRoomList;
import net.sf.l2j.gameserver.model.PartyMatchWaitingList;
import net.sf.l2j.gameserver.model.entity.custom.AnnounceOnlinePlayers;
+import net.sf.l2j.gameserver.model.entity.custom.AutoRewarder;
import net.sf.l2j.gameserver.model.entity.Castle;
import net.sf.l2j.gameserver.model.entity.Hero;
import net.sf.l2j.gameserver.model.olympiad.Olympiad;
@@ -272,6 +273,10 @@
_log.config("UserCommandHandler: Loaded " + UserCommandHandler.getInstance().size() + " handlers.");
Util.printSection("Custom");
+
+ if (Config.ALLOW_AUTO_REWARDER)
+ AutoRewarder.getInstance();
+
if (Config.ALLOW_WEDDING)
{
CoupleManager.getInstance();
Index: config/aCis.properties
===================================================================
--- config/aCis.properties (revision 15)
+++ config/aCis.properties (working copy)
@@ -113,4 +113,13 @@
+
+# Auto rewarder.
+AllowAutoRewarder = True
+# Delay for reward. (in seconds)
+AutoRewardDelay = 1200
+# ID of item reward.
+AutoRewardID = 57
+# Count of item reward.
+AutoRewardCount = 1000
\ No newline at end of file
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 15)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -131,6 +131,11 @@
+
+ public static boolean ALLOW_AUTO_REWARDER;
+ public static int AUTO_REWARD_DELAY;
+ public static int AUTO_REWARD_ID;
+ public static int AUTO_REWARD_COUNT;
// --------------------------------------------------
// Clans settings
@@ -866,6 +871,11 @@
+
+ ALLOW_AUTO_REWARDER = Boolean.parseBoolean(aCis.getProperty("AllowAutoRewarder", "True"));
+ AUTO_REWARD_DELAY = Integer.parseInt(aCis.getProperty("AutoRewardDelay", "1200"));
+ AUTO_REWARD_ID = Integer.parseInt(aCis.getProperty("AutoRewardID", "57"));
+ AUTO_REWARD_COUNT = Integer.parseInt(aCis.getProperty("AutoRewardCount", "1000"));
}
catch (Exception e)
{
|
||||||||||||||
|
|
|||||||||||||||
| O seguinte membro ao lado disse Obrigado(a) a : AiramCruZ por gostar deste Post : |
WilliamFS (19-07-2013)
|
| Links Patrocinados |