Jump to content

Recommended Posts

Posted

Requested και αυτο επισης αρα το κανω share, ειναι απλο.

Π.χ ενας gm θελει να κανει δικο του event και βαριεται να κανει recall Ολους τους παιχτες η μπορει και καποιος να μη θελει. Απλα παταει //register_available και ολοι μπορουν να πατανε .joinevent για να παρουν μερος.Επισης υπαρχει και το .eventinfo που εχει πληροφοριες.Τελος..ενα μετα απο 10 λεπτα (default) γινονται teleport οσοι πατησαν joinevent

 

### Eclipse Workspace Patch 1.0
#P aVa Tester
Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEvent.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEvent.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEvent.java	(revision 0)
@@ -0,0 +1,105 @@
+/*
+ * 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.handler.admincommandhandlers;
+
+import javolution.util.FastList;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author irat
+ *
+ */
+public class AdminEvent implements IAdminCommandHandler
+{
+
+	public static FastList<L2PcInstance> players = new FastList<L2PcInstance>();
+	private static boolean active = false;
+	private final String[] command = {"admin_register_available"};
+	
+	private int minutes = Config.MINUTES_OPEN;
+	
+	public static boolean isActive()
+	{
+		return active;
+	}
+	
+	public static void setActive(boolean t)
+	{
+		active = t;
+	}
+	
+	@Override
+	public boolean useAdminCommand(String command, L2PcInstance activeChar)
+	{
+		if(activeChar == null)
+			return false;
+		
+		if(command.equalsIgnoreCase("admin_register_available"))
+		{
+			if(isActive())
+			{
+				activeChar.sendMessage("You have already open the registrations");
+				return false;
+			}
+			
+			setActive(true);
+			
+			int time = minutes * 60000;
+			
+			Announcements.getInstance().announceToAll("Event registrations opened , type .joinevent to join. You have 10 minutes...");
+			ThreadPoolManager.getInstance().scheduleGeneral(new Close(activeChar), time);
+		}
+		
+		return true;
+	}
+
+	
+	private class Close implements Runnable{
+		
+		private L2PcInstance p;
+		
+		private Close(L2PcInstance j)
+		{
+			p = j;
+		}
+		
+		public void run()
+		{
+			setActive(false);
+			Announcements.getInstance().announceToAll("Registrations closed");
+			if(p != null)
+			for(L2PcInstance k : players)
+			{
+				if(k == null)
+					continue;
+				
+				k.teleToLocation(p.getX(), p.getY(), p.getZ());
+                                           players.clear();
+			}
+		}
+	}
+
+
+	@Override
+	public String[] getAdminCommandList()
+	{
+		return command;
+	}
+	
+}
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)
@@ -86,6 +86,7 @@
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEditNpc;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEffects;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEnchant;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEvent;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEventEngine;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminExpSp;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminFightCalculator;
@@ -202,6 +203,7 @@
import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.castle;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.joinevent;
import net.sf.l2j.gameserver.idfactory.IdFactory;
import net.sf.l2j.gameserver.instancemanager.AuctionManager;
import net.sf.l2j.gameserver.instancemanager.BoatManager;
@@ -516,6 +518,8 @@

		_adminCommandHandler = AdminCommandHandler.getInstance();
		_adminCommandHandler.registerAdminCommandHandler(new AdminAdmin());
+		if(Config.ALLOW_EVENT_COMMANDS)
+		_adminCommandHandler.registerAdminCommandHandler(new AdminEvent());
		_adminCommandHandler.registerAdminCommandHandler(new AdminInvul());
		_adminCommandHandler.registerAdminCommandHandler(new AdminDelete());
		_adminCommandHandler.registerAdminCommandHandler(new AdminKill());
@@ -594,6 +598,9 @@

		if(Config.L2JMOD_ALLOW_WEDDING)
			_voicedCommandHandler.registerVoicedCommandHandler(new Wedding());
+		
+		if(Config.ALLOW_EVENT_COMMANDS)
+		_voicedCommandHandler.registerVoicedCommandHandler(new joinevent());

		_log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");

Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/joinevent.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/joinevent.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/joinevent.java	(revision 0)
@@ -0,0 +1,75 @@
+/*
+ * 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.handler.voicedcommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEvent;
+
+/**
+ * @author irat
+ *
+ */
+public class joinevent implements IVoicedCommandHandler
+{
+
+	private final String[] command = {"joinevent","eventinfo"};
+	
+	@Override
+	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+	{
+		if(activeChar == null)
+			return false;
+		
+		if(command.equalsIgnoreCase("joinevent"))
+		{
+			if(AdminEvent.players.contains("activeChar"))
+			{
+				activeChar.sendMessage("You have already registed!");
+				return false;
+			}
+			
+			if(!AdminEvent.isActive())
+			   return false;
+			
+			AdminEvent.players.add(activeChar);
+			activeChar.sendMessage("You registed successfully!");
+		}
+		else if(command.equalsIgnoreCase("eventinfo"))
+		{
+			if(!AdminEvent.isActive())
+			{
+				activeChar.sendMessage("Event isn't active.");
+				return false;
+			}
+			
+			activeChar.sendMessage("---Event is Active---");
+			activeChar.sendMessage("---Players Registed:"+AdminEvent.players.size()+"---");
+			activeChar.sendMessage("---You are registed:"+AdminEvent.players.contains(activeChar)+ "---");
+		}
+		
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
+	 */
+	@Override
+	public String[] getVoicedCommandList()
+	{
+		return command;
+	}
+	
+}
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 13)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -859,6 +859,9 @@
     public static boolean L2JMOD_WEDDING_SAMESEX;
     public static boolean L2JMOD_WEDDING_FORMALWEAR;
     public static int L2JMOD_WEDDING_DIVORCE_COSTS;
+    
+    public static boolean ALLOW_EVENT_COMMANDS;
+    public static int MINUTES_OPEN;

     // Packet information
     /** Count the a-beep-t of packets per minute ? */
@@ -1832,6 +1835,8 @@
                 L2JMOD_WEDDING_FORMALWEAR               = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
                 L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));

+                ALLOW_EVENT_COMMANDS                    = Boolean.valueOf(L2JModSettings.getProperty("AllowEventCommands","True"));
+                MINUTES_OPEN                            = Integer.parseInt(L2JModSettings.getProperty("MinutesOpen","10"));
             }
             catch (Exception e)
             {
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 13)
+++ java/config/l2jmods.properties	(working copy)
@@ -90,3 +90,9 @@
WeddingFormalWear=True
#Cost of Divorce, % of Adena
WeddingDivorceCosts=20
+
+#Event configs
+#allow?
+AllowEventCommands = True
+#Minutes to wait for register
+MinutesOpen = 10
\ No newline at end of file

Posted

Announcements.getInstance().announceToAll("Event registrations opened , type .joinevent to join. You have 10 minutes...");

 

Το μήνυμα αυτό μπορώ να το αλλάξω μέσα από τον server ή μόνο από τον κώδικα?

Posted

Announcements.getInstance().announceToAll("Event registrations opened , type .joinevent to join. You have 10 minutes...");

 

Το μήνυμα αυτό μπορώ να το αλλάξω μέσα από τον server ή μόνο από τον κώδικα?

μόνο από τον κώδικα, ή φτιάξε ένα config

edit: Γιώργο ξέχασες το .leaveevent και το //register_cancel

Posted

αυτο που εψαχνα ευχαριστώ πολύ φίλε που το εκανες  share  μου είναι πολύ χρήσιμο.

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • ✯✯✯✯✯✯✯✯✯✯✯✯ UPDATE ✯✯✯✯✯✯✯✯✯✯✯✯✯✯ LINEAGE2 ESSENCE HIGH-ELVES 464 EU  [Date 23.04.2024][LANG:EUROPE-ORIGINAL] Clean System Patch Lineage 2 L2exe + Core.dll + Engine.dll unpacked*super clean 100% [unpacked REVERSECODE-TEAM ] [ Kill game guard ][ Kill FROST ] [ Kill AwesomiumProcess ] [SELL WTS PM ME ]       VIDEO GAME TEST LINK - https://goo.su/lFp327N   <   VIDEO DEVMODE LINK -  https://goo.su/yjAVk   < DEVMODE - works tested 100% pv+sv+nv ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ ✯✯✯✯✯✯✯✯✯✯✯✯ UPDATE ✯✯✯✯✯✯✯✯✯✯✯✯✯✯ LINEAGE2 MAIN SHIELD OF THE KINGDOM 474-EU [Date 30.07.2024][LANG:EUROPE-ORIGINAL] Clean System Patch Lineage 2 L2exe + Core.dll + Engine.dll unpacked*super clean 100% [LobbyMapChange added config Switch.ini] [unpacked REVERSECODE-TEAM ] [ Kill game guard ][ Kill FROST ] [ Kill AwesomiumProcess ][ LCID FIX ] [SELL WTS PM ME ]   VIDEO DEVMODE LINK - https://goo.su/jxQmAk   < DEVMODE - works tested 100% pv+sv+nv ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯  VIDEO DEVMODE LINK -  https://goo.su/43WKOD < DEVMODE - works tested 100% pv+sv+nv ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ ✯✯✯✯✯✯✯✯✯✯✯✯ UPDATE ✯✯✯✯✯✯✯✯✯✯✯✯✯✯ LINEAGE2 [MAIN] SUPERION 502 EU [UPDATE 13.01.2025][LANG:EUROPE-ORIGINAL] Clean System Patch Lineage 2 L2exe + Core.dll + Engine.dll unpacked*super clean 100% [unpacked REVERSECODE-TEAM ] [ Kill game guard ][ Kill FROST ] [ Kill AwesomiumProcess ] [SELL WTS PM ME ] VIDEO TEST LINK - https://goo.su/jmFi8H8  ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ ✯✯✯✯✯✯✯✯✯✯✯✯ UPDATE ✯✯✯✯✯✯✯✯✯✯✯✯✯✯ LINEAGE2 ESSENCE TYPE-PTS2 WARG 507 EU [Date 26.03.2025][LANG:EUROPE-ORIGINAL] Clean System Patch Lineage 2 Core.dll + Engine.dll unpacked*super clean 100% [unpacked REVERSECODE-TEAM ] [ Kill game guard ][ Kill FROST ] [ Kill AwesomiumProcess ][patched] [SELL WTS PM ME ] VIDEO GAME TEST LINK - https://goo.su/0rTsCUJ  <  VIDEO DEVMODE LINK -   https://goo.su/F1qrx   < [DEVMODE full fixed x3 classic,aden,main,all commands work] adapting to the new version DEVMODE full fixed x3 classic,aden,main works tested 100% pv+sv+nv All buttons and all commands work.  VIDEO SPECIAL DEVMODE LINK - - https://goo.su/85YbU   < ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ ✯✯✯✯✯✯✯✯✯✯✯ UPDATE ✯✯✯✯✯✯✯✯✯✯✯✯✯✯ [MAIN] LINEAGE2 Cold Witch 516 KR  [UPDATE 01.04.2025][LANG:KOREAN-ORIGINAL] Clean System Patch Lineage 2 Core.dll + Engine.dll unpacked*super clean 100% [unpacked  RED-TEAM REVERSECODE-TEAM ] [ Kill game guard ][ Kill FROST ] [ Kill AwesomiumProcess ] [SELL WTS PM ME ][DEVMODE-BETA] VIDEO GAME TEST LINK  - https://goo.su/yotKnWL  < VIDEO DEVMODE TEST GAME  - https://goo.su/08UnUHN < DEVMODE - works tested 100% pv+sv+nv ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ ✯✯✯✯✯✯✯✯✯✯✯✯ UPDATE ✯✯✯✯✯✯✯✯✯✯✯✯✯✯ LINEAGE2 ESSENCE WOLF 507 EU [UPDATE 29.04.2025][LANG:EUROPE-ORIGINAL] [patched] Clean System Patch Lineage 2  Core.dll + Engine.dll unpacked*super clean 100% [unpacked REVERSECODE-TEAM ] [ Kill game guard ][ Kill FROST ] [ Kill AwesomiumProcess ] [SELL WTS PM ME ] VIDEO~OFFICIAL 4GAME TEST - https://goo.su/UrZhe < VIDEO~ADMIN NEVER DIE ^_^ - https://goo.su/sL5Eok < DEVMODE VIDEO MAPS WOLF - https://goo.su/xhgEfI  < ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ [RED-TEAM REVERSECODE]LINEAGE2 ROSE VAIN Protocols:520 [DEVMODE works tested100% pv+sv+nv] ✯✯✯✯✯✯✯✯✯✯✯ UPDATE ✯✯✯✯✯✯✯✯✯✯✯✯✯✯ [MAIN] LINEAGE2 ROSE VAIN 520 KR  [UPDATE 10.06.2025][LANG:KOREAN-ORIGINAL] Clean System Patch Lineage 2 Core.dll + Engine.dll unpacked*super clean 100% [unpacked  RED-TEAM REVERSECODE-TEAM ] [ Kill game guard ][ Kill FROST ] [ Kill AwesomiumProcess ] [SELL WTS PM ME ] VIDEO-TEST-LOBBY https://goo.su/ARZZOTS <<< VIDEO DEVMODE TEST GAME  - https://goo.su/lgHnp < DEVMODE - works tested 100% pv+sv+nv ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ [RED-TEAM REVERSECODE]LINEAGE2 ROSE VAIN Protocols:523 [DEVMODE works tested100% pv+sv+nv] ✯✯✯✯✯✯✯✯✯✯✯ UPDATE ✯✯✯✯✯✯✯✯✯✯✯✯✯✯ [MAIN] LINEAGE2 ROSE VAIN 523 KR  [UPDATE 08.07.2025][LANG:KOREAN-ORIGINAL] Clean System Patch Lineage 2 Core.dll + Engine.dll unpacked*super clean 100% [unpacked  RED-TEAM REVERSECODE-TEAM ] [ Kill game guard ][ Kill FROST ] [ Kill AwesomiumProcess ] [SELL WTS PM ME ] VIDEO-TEST-LOBBY   https://goo.su/loLoUs  <<< VIDEO DEVMODE TEST GAME  - https://goo.su/ewIvS7  <<< DEVMODE - works tested 100% pv+sv+nv ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ in my profile there is a link to my discord group  we write all the questions there - if you are interested in something ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯  REVERSECODE-TEAM  Service Creating Full Clean Patched Systems  Unreal Scripts / Reverse Enginering / Game Client Modifications Portfolio Discord Group https://discord.gg/56EuZyFJj2   ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯ DO NOT LEAVE POSTS IN THIS SECTION  IF YOU HAVE ANY QUESTIONS, CONTACT US IN THE DISCORD AND ASK YOUR QUESTIONS ( prices are shown in green text in the first post ) Anyone who leaves a message in this section will be denied services and the post will be deleted. [  A large selection of Products In our group at the link in the Discord   ]                      
    • the developer doesn't answer your messages!  lordwinter!!!
    • i send discord.. I want to buy but you didnt answer for like a year(
    • Starting at €20 per mod, feature, or add-on, and €10 for fixes or modifications. Discounts available for multiple small tasks — prices are negotiable.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock