Jump to content

Recommended Posts

Posted

Ολα ειναι αυτοματα.

 

Καθε 2 ωρες(μπορειτε να το αλλαξετε) ενα item(μπορειτε να το αλλαξετε , default: rabbit ears) πεφτει σε μια τυχαια περιοχη(εσεις διαλεγετε ολα τα πιθανα coordinates που μπορει να πεσει) και οι παικτες ενημερωνονται οτι το event ξεκινησε και σε ποια περιοχη επεσε. Π.χ μπορει να ειναι στην Giran Town , αλλα μπορει να ειναι οπουδηποτε εκει.Εχουν 15 λεπτα(μπορειτε να το αλλαξετε) να το βρουνε αλλιως εξαφανιζεται και το event τελειωνει.Ο πρωτος που το βρει και το κανει drop κερδιζει το event και παιρνει το reward(Default: 50 gold bars, μπορειτε να το αλλαξετε). Το event αρχιζει παλι σε 2 ωρες(οπως ειπα μπορειτε να το αλλαξετε).Στην διαρκεια του event ο admin μπορει να πατησει //gohide για να παει στην περιοχη που ειναι το item ακριβως.

 

 

### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -51,6 +51,7 @@
import net.sf.l2j.gameserver.ai.L2PlayerAI;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.cache.WarehouseCacheManager;
+import net.sf.l2j.gameserver.clientpackets.Say2;
import net.sf.l2j.gameserver.communitybbs.BB.Forum;
import net.sf.l2j.gameserver.communitybbs.Manager.ForumsBBSManager;
import net.sf.l2j.gameserver.datatables.CharTemplateTable;
@@ -82,6 +83,7 @@
import net.sf.l2j.gameserver.model.BlockList;
import net.sf.l2j.gameserver.model.FishData;
import net.sf.l2j.gameserver.model.ForceBuff;
+import net.sf.l2j.gameserver.model.Hide;
import net.sf.l2j.gameserver.model.Inventory;
import net.sf.l2j.gameserver.model.ItemContainer;
import net.sf.l2j.gameserver.model.L2Attackable;
@@ -137,6 +139,7 @@
import net.sf.l2j.gameserver.serverpackets.ChangeWaitType;
import net.sf.l2j.gameserver.serverpackets.CharInfo;
import net.sf.l2j.gameserver.serverpackets.ConfirmDlg;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
import net.sf.l2j.gameserver.serverpackets.EtcStatusUpdate;
import net.sf.l2j.gameserver.serverpackets.ExAutoSoulShot;
import net.sf.l2j.gameserver.serverpackets.ExDuelUpdateUserInfo;
@@ -3826,6 +3829,16 @@
	        		&& (target.getOwnerId() == getObjectId() || isInLooterParty(target.getOwnerId())))
	        	target.resetOwnerTimer();

+	        if(target.isHide()){
+	        	
+	        	getInventory().addItem("", Hide.rewardId, Hide.rewardCount, this, null);
+	        	sendPacket(new InventoryUpdate());
+	        	sendMessage("You won the event!");
+	        	Hide.cleanEvent();
+	        	Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Winner is: "+getName()+".Event ended."));
+	        	target.setHide(false);
+	        	return;
+	        }
			// Remove the L2ItemInstance from the world and send server->client GetItem packets
			target.pickupMe(this);
			 if(Config.SAVE_DROPPED_ITEM) // item must be removed from ItemsOnGroundManager if is active
Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGoHide.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGoHide.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGoHide.java	(revision 0)
@@ -0,0 +1,59 @@
+/* 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.handler.admincommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
+import net.sf.l2j.gameserver.model.Hide;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ *
+ * @author  Iracundus
+ */
+public class AdminGoHide implements IAdminCommandHandler
+{
+
+	private static String[] ADMIN_COMMANDS = {"admin_gohide"};
+
+	@Override
+	public boolean useAdminCommand(String command, L2PcInstance activeChar)
+	{
+		if(command.startsWith("admin_gohide")){
+			if(activeChar == null)
+				return false;
+			
+			if(Hide.running == false){
+				activeChar.sendMessage("Event is not in progress");
+				return false;
+			}
+			
+			int x = Hide.getX() , y = Hide.getY() , z = Hide.getZ();
+			activeChar.teleToLocation(x, y, z);
+		}
+		
+		return true;
+	}
+
+	
+	@Override
+	public String[] getAdminCommandList()
+	{
+		return ADMIN_COMMANDS;
+	}
+	
+}
Index: java/net/sf/l2j/gameserver/model/L2ItemInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/L2ItemInstance.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/model/L2ItemInstance.java	(working copy)
@@ -92,6 +92,8 @@
	/** Slot where item is stored */
	private int _locData;

+	private boolean hide;
+	
	/** Level of enchantment of the item */
	private int _enchantLevel;

@@ -286,6 +288,14 @@
		}
	}

+	public boolean isHide(){
+		return hide;
+	}
+	
+	public void setHide(boolean j){
+		hide = j;
+	}
+	
	// No logging (function designed for shots only)
	public void changeCountWithoutTrace(String process, int count, L2PcInstance creator, L2Object reference)
	{
Index: java/net/sf/l2j/gameserver/model/Hide.java
===================================================================
--- java/net/sf/l2j/gameserver/model/Hide.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/Hide.java	(revision 0)
@@ -0,0 +1,120 @@
+package net.sf.l2j.gameserver.model;
+
+
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.clientpackets.Say2;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
+import net.sf.l2j.gameserver.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.util.Broadcast;
+import net.sf.l2j.util.Rnd;
+
+public class Hide{
+	
+	public static final int rewardId = 2807;
+	public static final int rewardCount = 50;
+	private static Hide _instance;
+	private final int delay = 180000;
+	private final static int itemId = 7683;
+	private final static int itemCount = 1;
+	public static boolean running = false;
+	private static int x;
+	private static int y;
+	private static int z = 0;
+	private final int[][] teleports = { {116496,145020,-2569} , {18605,145378,-3129} , {-83083,150505,-3134} };
+	static L2ItemInstance item = null;
+	
+	public static int getX(){
+		return x;
+	}
+	
+	public static int getY(){
+		return y;
+	}
+	
+	public static int getZ(){
+		return z;
+	}
+	
+	public static int getItemId(){
+		return itemId;
+	}
+	
+	public static int getItemCount(){
+		return itemCount;
+	}
+	
+	public void startEvent(){
+		running = true;
+		System.out.println("Automatic Hide Event started with success.");
+		int s = Rnd.get(teleports.length);
+		x = teleports[s][0];
+		y = teleports[s][1];
+		z = teleports[s][2];
+		SystemMessage sm = new SystemMessage(SystemMessageId.S2_WAS_DROPPED_IN_THE_S1_REGION);
+		sm.addZoneName(getX(), getY(), getZ()); 
+		sm.addItemName(itemId);
+		item = new L2ItemInstance(Rnd.get(65535),itemId);
+		L2World.getInstance().storeObject(item);
+		item.setCount(itemCount);
+		item.setHide(true);
+		item.getPosition().setWorldPosition(x, y ,z);
+        item.getPosition().setWorldRegion(L2World.getInstance().getRegion(item.getPosition().getWorldPosition()));
+        item.getPosition().getWorldRegion().addVisibleObject(item);
+        item.setProtected(false);
+        item.setIsVisible(true);
+        L2World.getInstance().addVisibleObject(item, item.getPosition().getWorldRegion(), null);
+	    
+        
+   
+        Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Event started, Item dropped: "+item.getItem().getName()+", find it and win!"));
+        Broadcast.toAllOnlinePlayers(sm);
+        ThreadPoolManager.getInstance().scheduleGeneral(new Check(), 60000);
+	}
+	
+	public void checkAfterTime(){
+		if(running == false)
+			return;
+		if(item.isHide())
+			item.setHide(false);
+		item.decayMe();
+		L2World.getInstance().removeObject(item);
+		cleanEvent(); 
+		Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Unfortunately,none find the item , event finished!"));
+	}
+	
+	public static void cleanEvent(){
+		x = 0;
+		y = 0;
+		z = 0;
+		running = false;
+		if(item != null){
+			item.decayMe();
+		L2World.getInstance().removeObject(item);
+		}
+		item = null;
+	}
+	
+	private Hide(){
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Event(), delay, delay);
+		System.out.println("Automatic Hide event loaded with success.");
+	}
+	
+	public static Hide getInstance(){
+		if(_instance == null)
+			_instance = new Hide();
+		return _instance;
+	}
+	
+	public class Check implements Runnable{
+		public void run(){
+			checkAfterTime();
+		}
+	}
+	
+	public class Event implements Runnable{
+		public void run(){
+			startEvent();	
+		}
+	}
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -90,6 +90,7 @@
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminGeodata;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminGm;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminGmChat;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminGoHide;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHeal;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHelpPage;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminInvul;
@@ -218,6 +219,7 @@
import net.sf.l2j.gameserver.instancemanager.SiegeManager;
import net.sf.l2j.gameserver.model.AutoChatHandler;
import net.sf.l2j.gameserver.model.AutoSpawnHandler;
+import net.sf.l2j.gameserver.model.Hide;
import net.sf.l2j.gameserver.model.L2Manor;
import net.sf.l2j.gameserver.model.L2PetDataTable;
import net.sf.l2j.gameserver.model.L2World;
@@ -518,6 +520,7 @@

		_adminCommandHandler = AdminCommandHandler.getInstance();
		_adminCommandHandler.registerAdminCommandHandler(new AdminAdmin());
+		_adminCommandHandler.registerAdminCommandHandler(new AdminGoHide());
		_adminCommandHandler.registerAdminCommandHandler(new AdminInvul());
		_adminCommandHandler.registerAdminCommandHandler(new AdminDelete());
		_adminCommandHandler.registerAdminCommandHandler(new AdminKill());
@@ -604,6 +607,7 @@
			CoupleManager.getInstance();

         TaskManager.getInstance();
+        Hide.getInstance();

		GmListTable.getInstance();

 

Credits me

Posted

dwste karma gia ti douleia pou ekane

gj file sunexeise etsi kai na se rwteisw auto edw den to eixes sto market place ?

να σαι καλα φιλε.

Ναι το ειχα , 2 αντιγραφα πουληθηκαν αλλα αποφασισα να το κανω share τελικα. Αυτοι που το αγορασαν πηραν δωρο ακομα 2 event για να μην αδικηθουν.

Posted

Μόλις το έβαλα στο source μου και δεν έδειξε κανένα error,πολύ καλό code!

Μία ερώτηση:Που αλλάζω το reward που θα παίρνει ο νικητής και αυτό που θα γίνεται dropped?

Posted

Μόλις το έβαλα στο source μου και δεν έδειξε κανένα error,πολύ καλό code!

Μία ερώτηση:Που αλλάζω το reward που θα παίρνει ο νικητής και αυτό που θα γίνεται dropped?

Ευχαριστω

 

 

public static final int rewardId = 2807;
public static final int rewardCount = 50;

Posted

Κάτι τελευταίο που μου ήρθε στο μυαλό, γίνεται να βάλω 3,4 items και να πετάει 1 από αυτά όποιο θέλει;

 

Posted

file to dokimasa kai douleuei kanonika alla exw ena provlima

den leei se poio Town aipese to item

epeisis o xronos pou prepei na vroun to item einai auto edw ?

 

(new Check(), 60000);

  • 1 month later...
  • 1 month later...
Posted

Ολα ειναι αυτοματα.

 

Καθε 2 ωρες(μπορειτε να το αλλαξετε) ενα item(μπορειτε να το αλλαξετε , default: rabbit ears) πεφτει σε μια τυχαια περιοχη(εσεις διαλεγετε ολα τα πιθανα coordinates που μπορει να πεσει) και οι παικτες ενημερωνονται οτι το event ξεκινησε και σε ποια περιοχη επεσε. Π.χ μπορει να ειναι στην Giran Town , αλλα μπορει να ειναι οπουδηποτε εκει.Εχουν 15 λεπτα(μπορειτε να το αλλαξετε) να το βρουνε αλλιως εξαφανιζεται και το event τελειωνει.Ο πρωτος που το βρει και το κανει drop κερδιζει το event και παιρνει το reward(Default: 50 gold bars, μπορειτε να το αλλαξετε). Το event αρχιζει παλι σε 2 ωρες(οπως ειπα μπορειτε να το αλλαξετε).Στην διαρκεια του event ο admin μπορει να πατησει //gohide για να παει στην περιοχη που ειναι το item ακριβως.

 

 

### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -51,6 +51,7 @@
import net.sf.l2j.gameserver.ai.L2PlayerAI;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.cache.WarehouseCacheManager;
+import net.sf.l2j.gameserver.clientpackets.Say2;
import net.sf.l2j.gameserver.communitybbs.BB.Forum;
import net.sf.l2j.gameserver.communitybbs.Manager.ForumsBBSManager;
import net.sf.l2j.gameserver.datatables.CharTemplateTable;
@@ -82,6 +83,7 @@
import net.sf.l2j.gameserver.model.BlockList;
import net.sf.l2j.gameserver.model.FishData;
import net.sf.l2j.gameserver.model.ForceBuff;
+import net.sf.l2j.gameserver.model.Hide;
import net.sf.l2j.gameserver.model.Inventory;
import net.sf.l2j.gameserver.model.ItemContainer;
import net.sf.l2j.gameserver.model.L2Attackable;
@@ -137,6 +139,7 @@
import net.sf.l2j.gameserver.serverpackets.ChangeWaitType;
import net.sf.l2j.gameserver.serverpackets.CharInfo;
import net.sf.l2j.gameserver.serverpackets.ConfirmDlg;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
import net.sf.l2j.gameserver.serverpackets.EtcStatusUpdate;
import net.sf.l2j.gameserver.serverpackets.ExAutoSoulShot;
import net.sf.l2j.gameserver.serverpackets.ExDuelUpdateUserInfo;
@@ -3826,6 +3829,16 @@
	        		&& (target.getOwnerId() == getObjectId() || isInLooterParty(target.getOwnerId())))
	        	target.resetOwnerTimer();

+	        if(target.isHide()){
+	        	
+	        	getInventory().addItem("", Hide.rewardId, Hide.rewardCount, this, null);
+	        	sendPacket(new InventoryUpdate());
+	        	sendMessage("You won the event!");
+	        	Hide.cleanEvent();
+	        	Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Winner is: "+getName()+".Event ended."));
+	        	target.setHide(false);
+	        	return;
+	        }
			// Remove the L2ItemInstance from the world and send server->client GetItem packets
			target.pickupMe(this);
			 if(Config.SAVE_DROPPED_ITEM) // item must be removed from ItemsOnGroundManager if is active
Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGoHide.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGoHide.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGoHide.java	(revision 0)
@@ -0,0 +1,59 @@
+/* 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.handler.admincommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
+import net.sf.l2j.gameserver.model.Hide;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ *
+ * @author  Iracundus
+ */
+public class AdminGoHide implements IAdminCommandHandler
+{
+
+	private static String[] ADMIN_COMMANDS = {"admin_gohide"};
+
+	@Override
+	public boolean useAdminCommand(String command, L2PcInstance activeChar)
+	{
+		if(command.startsWith("admin_gohide")){
+			if(activeChar == null)
+				return false;
+			
+			if(Hide.running == false){
+				activeChar.sendMessage("Event is not in progress");
+				return false;
+			}
+			
+			int x = Hide.getX() , y = Hide.getY() , z = Hide.getZ();
+			activeChar.teleToLocation(x, y, z);
+		}
+		
+		return true;
+	}
+
+	
+	@Override
+	public String[] getAdminCommandList()
+	{
+		return ADMIN_COMMANDS;
+	}
+	
+}
Index: java/net/sf/l2j/gameserver/model/L2ItemInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/L2ItemInstance.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/model/L2ItemInstance.java	(working copy)
@@ -92,6 +92,8 @@
	/** Slot where item is stored */
	private int _locData;

+	private boolean hide;
+	
	/** Level of enchantment of the item */
	private int _enchantLevel;

@@ -286,6 +288,14 @@
		}
	}

+	public boolean isHide(){
+		return hide;
+	}
+	
+	public void setHide(boolean j){
+		hide = j;
+	}
+	
	// No logging (function designed for shots only)
	public void changeCountWithoutTrace(String process, int count, L2PcInstance creator, L2Object reference)
	{
Index: java/net/sf/l2j/gameserver/model/Hide.java
===================================================================
--- java/net/sf/l2j/gameserver/model/Hide.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/Hide.java	(revision 0)
@@ -0,0 +1,120 @@
+package net.sf.l2j.gameserver.model;
+
+
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.clientpackets.Say2;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
+import net.sf.l2j.gameserver.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.util.Broadcast;
+import net.sf.l2j.util.Rnd;
+
+public class Hide{
+	
+	public static final int rewardId = 2807;
+	public static final int rewardCount = 50;
+	private static Hide _instance;
+	private final int delay = 180000;
+	private final static int itemId = 7683;
+	private final static int itemCount = 1;
+	public static boolean running = false;
+	private static int x;
+	private static int y;
+	private static int z = 0;
+	private final int[][] teleports = { {116496,145020,-2569} , {18605,145378,-3129} , {-83083,150505,-3134} };
+	static L2ItemInstance item = null;
+	
+	public static int getX(){
+		return x;
+	}
+	
+	public static int getY(){
+		return y;
+	}
+	
+	public static int getZ(){
+		return z;
+	}
+	
+	public static int getItemId(){
+		return itemId;
+	}
+	
+	public static int getItemCount(){
+		return itemCount;
+	}
+	
+	public void startEvent(){
+		running = true;
+		System.out.println("Automatic Hide Event started with success.");
+		int s = Rnd.get(teleports.length);
+		x = teleports[s][0];
+		y = teleports[s][1];
+		z = teleports[s][2];
+		SystemMessage sm = new SystemMessage(SystemMessageId.S2_WAS_DROPPED_IN_THE_S1_REGION);
+		sm.addZoneName(getX(), getY(), getZ()); 
+		sm.addItemName(itemId);
+		item = new L2ItemInstance(Rnd.get(65535),itemId);
+		L2World.getInstance().storeObject(item);
+		item.setCount(itemCount);
+		item.setHide(true);
+		item.getPosition().setWorldPosition(x, y ,z);
+        item.getPosition().setWorldRegion(L2World.getInstance().getRegion(item.getPosition().getWorldPosition()));
+        item.getPosition().getWorldRegion().addVisibleObject(item);
+        item.setProtected(false);
+        item.setIsVisible(true);
+        L2World.getInstance().addVisibleObject(item, item.getPosition().getWorldRegion(), null);
+	    
+        
+   
+        Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Event started, Item dropped: "+item.getItem().getName()+", find it and win!"));
+        Broadcast.toAllOnlinePlayers(sm);
+        ThreadPoolManager.getInstance().scheduleGeneral(new Check(), 60000);
+	}
+	
+	public void checkAfterTime(){
+		if(running == false)
+			return;
+		if(item.isHide())
+			item.setHide(false);
+		item.decayMe();
+		L2World.getInstance().removeObject(item);
+		cleanEvent(); 
+		Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Unfortunately,none find the item , event finished!"));
+	}
+	
+	public static void cleanEvent(){
+		x = 0;
+		y = 0;
+		z = 0;
+		running = false;
+		if(item != null){
+			item.decayMe();
+		L2World.getInstance().removeObject(item);
+		}
+		item = null;
+	}
+	
+	private Hide(){
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Event(), delay, delay);
+		System.out.println("Automatic Hide event loaded with success.");
+	}
+	
+	public static Hide getInstance(){
+		if(_instance == null)
+			_instance = new Hide();
+		return _instance;
+	}
+	
+	public class Check implements Runnable{
+		public void run(){
+			checkAfterTime();
+		}
+	}
+	
+	public class Event implements Runnable{
+		public void run(){
+			startEvent();	
+		}
+	}
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -90,6 +90,7 @@
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminGeodata;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminGm;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminGmChat;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminGoHide;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHeal;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHelpPage;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminInvul;
@@ -218,6 +219,7 @@
import net.sf.l2j.gameserver.instancemanager.SiegeManager;
import net.sf.l2j.gameserver.model.AutoChatHandler;
import net.sf.l2j.gameserver.model.AutoSpawnHandler;
+import net.sf.l2j.gameserver.model.Hide;
import net.sf.l2j.gameserver.model.L2Manor;
import net.sf.l2j.gameserver.model.L2PetDataTable;
import net.sf.l2j.gameserver.model.L2World;
@@ -518,6 +520,7 @@

		_adminCommandHandler = AdminCommandHandler.getInstance();
		_adminCommandHandler.registerAdminCommandHandler(new AdminAdmin());
+		_adminCommandHandler.registerAdminCommandHandler(new AdminGoHide());
		_adminCommandHandler.registerAdminCommandHandler(new AdminInvul());
		_adminCommandHandler.registerAdminCommandHandler(new AdminDelete());
		_adminCommandHandler.registerAdminCommandHandler(new AdminKill());
@@ -604,6 +607,7 @@
			CoupleManager.getInstance();

         TaskManager.getInstance();
+        Hide.getInstance();

		GmListTable.getInstance();

 

Credits me

 

kapoios na help wste na bgalw config gia auto???

ta exw kanei poutana me ta boolean kai ta loipa!!!

  • 4 weeks later...
Posted

Γεία Χαρά!

Πέρασα αυτό το event σε L2j H5 Server...

Τρέχω τον server και εμφανίζει πως τρέχει το event ..

 

j137n9.jpg

 

Μπαίνω στο game και ξεκινά κανονικά το event..

 

34pcjte.jpg

 

Όταν βάζω την εντολή //gohide μου βγάζει πως δεν υπάρχει..

 

width=1024 height=578http://i46.tinypic.com/166hs35.jpg[/img]

 

και στο παράθυρο του game server βγάζει αυτό το μήνυμα..

 

vh83m8.jpg

 

στο αρχείο /adminCommands.xml έβαλα την εντολή gohide..

 

15nkbjr.jpg

 

το μόνο που δεν μπόρεσα να προσθέσω απο το code είναι στο αρχείο GameServer.java

_adminCommandHandler.registerAdminCommandHandler(new AdminGoHide());

 

Μπορεί κάποιος να βοηθήσει;

Posted

Γεία Χαρά!

Πέρασα αυτό το event σε L2j H5 Server...

Τρέχω τον server και εμφανίζει πως τρέχει το event ..

 

j137n9.jpg

 

Μπαίνω στο game και ξεκινά κανονικά το event..

 

34pcjte.jpg

 

Όταν βάζω την εντολή //gohide μου βγάζει πως δεν υπάρχει..

 

width=1024 height=578http://i46.tinypic.com/166hs35.jpg[/img]

 

και στο παράθυρο του game server βγάζει αυτό το μήνυμα..

 

vh83m8.jpg

 

στο αρχείο /adminCommands.xml έβαλα την εντολή gohide..

 

15nkbjr.jpg

 

το μόνο που δεν μπόρεσα να προσθέσω απο το code είναι στο αρχείο GameServer.java

_adminCommandHandler.registerAdminCommandHandler(new AdminGoHide());

 

Μπορεί κάποιος να βοηθήσει;

 

den sou douleuei h entolh giati apla den thn ekanes register alla den xero apo hi5 poy akribws kaneis register

phgene mia sto gameserver/handler/AdminCommandHandler.java mallon ekei thn kaneis register

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

    • From Salvation onwards I think you need a patched nwindow.dll that allows such modifications, try to see if you get what you need here: https://drive.google.com/drive/u/1/folders/1LLbQFGf8KlR-O0Iv5umfF-pwZgrDh9bd
    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
  • Topics

×
×
  • Create New...