I WANT TO HAPPEN EVERY 1 HOUR FOR EXAMPLE, IT DOES NOT WORK :sssss HOW CAN I MAKE IT TO WORK? CAN ANYONE HELP ME :/
### Eclipse Workspace Patch 1.0
#P testGameserver
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java (revision 5117)
+++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
@@ -217,6 +217,7 @@
import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager;
import net.sf.l2j.gameserver.instancemanager.SiegeManager;
import net.sf.l2j.gameserver.model.AutoChatHandler;
+import net.sf.l2j.gameserver.model.entity.AutoRewardLords;
import net.sf.l2j.gameserver.model.AutoSpawnHandler;
import net.sf.l2j.gameserver.model.L2Manor;
import net.sf.l2j.gameserver.model.L2PetDataTable;
@@ -343,6 +344,7 @@
RecipeController.getInstance();
+ AutoRewardLords.getInstance();
SkillTreeTable.getInstance();
ArmorSetsTable.getInstance();
FishTable.getInstance();
Index: java/net/sf/l2j/gameserver/model/entity/AutoRewardLords.java
===================================================================
--- java/net/sf/l2j/gameserver/model/entity/AutoRewardLords.java (revision 0)
+++ java/net/sf/l2j/gameserver/model/entity/AutoRewardLords.java (revision 0)
@@ -0,0 +1,69 @@
+/* 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 2, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.model.entity;
+
+import java.util.Collection;
+
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ *
+ * @author Cafr
+ */
+public class AutoRewardLords
+{
+ Collection<L2PcInstance> players = L2World.getInstance().getAllPlayers();
+
+ class AutoRewardTask implements Runnable
+ {
+ public void run()
+ {
+ for(L2PcInstance player : players)
+ {
+ if(player != null) if(player.getClan() != null)
+ if(player.getClan().getHasCastle() > 0 && player.isClanLeader())
+ {
+ player.getInventory().addAdena(null, 25000000, player, null);
+ player.sendMessage("Auto rewarding castle lords activated,look your inventory.");
+ }
+ }
+ Announcements.getInstance().announceToAll("All online castle lords rewarded.");
+ System.out.println("Auto Castle Lords Reward Activated");
+ }
+ }
+
+ private AutoRewardLords()
+ {
+ ThreadPoolManager.getInstance().scheduleGeneral(new AutoRewardTask(), 60000);
+ }
+
+
+ public static AutoRewardLords getInstance()
+ {
+ return SingletonHolder._instance;
+ }
+
+ private static class SingletonHolder
+ {
+ @SuppressWarnings("synthetic-access")
+ protected static final AutoRewardLords _instance = new AutoRewardLords();
+ }
+}
\ No newline at end of file
Hello, I'd like to change a title color for custom npc.
I created custom NPC, cloned existing. I put unique id for it in npcname-e, npcgrp and database.
I have "0" to serverSideName in db, so that it would use npcname-e, but instead it has "NoNameNPC"and no title color change.
📢 ¡ATENCIÓN JUGADORES DE LINEAGE 2! 📢
¡L2 Crest Converter ha llegado! El programa creado por PulserX para obtener crests de clan (banderas) que realmente funciona, programado y distribuido de manera gratuita a todo el mundo por su humilde servidor.
¿Cansado de que el viejo CrestMaker falle y arruine tus imágenes en Windows 10/11? Hemos creado una solución actualizada.
✅ Optimizado para Windows 10/11
✅ Convierte PNG/JPG perfectamente
✅ Adiós a las imágenes cuadriculadas
L2 Crest Converter es la herramienta que garantiza que tu crest se vea tal como la diseñaste.
Descárgalo y velo en acción aquí:
👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE
👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE
👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE
Question
KOZANE
I WANT TO HAPPEN EVERY 1 HOUR FOR EXAMPLE, IT DOES NOT WORK :sssss HOW CAN I MAKE IT TO WORK? CAN ANYONE HELP ME :/
### Eclipse Workspace Patch 1.0 #P testGameserver Index: java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- java/net/sf/l2j/gameserver/GameServer.java (revision 5117) +++ java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -217,6 +217,7 @@ import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager; import net.sf.l2j.gameserver.instancemanager.SiegeManager; import net.sf.l2j.gameserver.model.AutoChatHandler; +import net.sf.l2j.gameserver.model.entity.AutoRewardLords; import net.sf.l2j.gameserver.model.AutoSpawnHandler; import net.sf.l2j.gameserver.model.L2Manor; import net.sf.l2j.gameserver.model.L2PetDataTable; @@ -343,6 +344,7 @@ RecipeController.getInstance(); + AutoRewardLords.getInstance(); SkillTreeTable.getInstance(); ArmorSetsTable.getInstance(); FishTable.getInstance(); Index: java/net/sf/l2j/gameserver/model/entity/AutoRewardLords.java =================================================================== --- java/net/sf/l2j/gameserver/model/entity/AutoRewardLords.java (revision 0) +++ java/net/sf/l2j/gameserver/model/entity/AutoRewardLords.java (revision 0) @@ -0,0 +1,69 @@ +/* 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 2, 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * http://www.gnu.org/copyleft/gpl.html + */ +package net.sf.l2j.gameserver.model.entity; + +import java.util.Collection; + +import net.sf.l2j.gameserver.Announcements; +import net.sf.l2j.gameserver.ThreadPoolManager; +import net.sf.l2j.gameserver.model.L2World; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + * + * @author Cafr + */ +public class AutoRewardLords +{ + Collection<L2PcInstance> players = L2World.getInstance().getAllPlayers(); + + class AutoRewardTask implements Runnable + { + public void run() + { + for(L2PcInstance player : players) + { + if(player != null) if(player.getClan() != null) + if(player.getClan().getHasCastle() > 0 && player.isClanLeader()) + { + player.getInventory().addAdena(null, 25000000, player, null); + player.sendMessage("Auto rewarding castle lords activated,look your inventory."); + } + } + Announcements.getInstance().announceToAll("All online castle lords rewarded."); + System.out.println("Auto Castle Lords Reward Activated"); + } + } + + private AutoRewardLords() + { + ThreadPoolManager.getInstance().scheduleGeneral(new AutoRewardTask(), 60000); + } + + + public static AutoRewardLords getInstance() + { + return SingletonHolder._instance; + } + + private static class SingletonHolder + { + @SuppressWarnings("synthetic-access") + protected static final AutoRewardLords _instance = new AutoRewardLords(); + } +} \ No newline at end of file23 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now