hi! i added this code but its giving me a little error in this line of L2PcInstance.java
the full code
Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java
=========================================================================================================
--- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java
+++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java
import com.l2jfrozen.gameserver.model.entity.event.CTF;
import com.l2jfrozen.gameserver.model.entity.event.DM;
+/** Hide Event */
+import com.l2jfrozen.gameserver.model.entity.event.Hide;
import com.l2jfrozen.util.database.L2DatabaseFactory;
import com.l2jfrozen.util.random.Rnd;
+/** hide event */
+import com.l2jfrozen.gameserver.network.clientpackets.Say2;
if (target.getItemLootShedule() != null && (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);
+ System.out.println("Automatic Hide Event finished with success.");
+ return;
+ }
+
// Fixed it's not possible pick up the object if you exceed the maximum weight.
if (_inventory.getTotalWeight() + target.getItem().getWeight() * target.getCount() > getMaxLoad())
{
sendMessage("You have reached the maximun weight.");
return;
}
Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
============================================================================================================
--- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
+++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWho;
import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminZone;
+/** Hide Event */
+import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminGoHide;
registerAdminCommandHandler(new AdminBuffs());
registerAdminCommandHandler(new AdminAio());
+ /** Hide Event */
+ registerAdminCommandHandler(new AdminGoHide());
Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java
=======================================================================================================================
--- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java
+++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java
+/* 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 com.l2jfrozen.gameserver.handler.admincommandhandlers;
+
+import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.entity.event.Hide;
+
+/**
+ *
+ * @author Iracundus ( Remaded Sakretsos )
+ */
+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: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java
===================================================================================================================
--- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java
+++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java
/** Location of the item : Inventory, PaperDoll, WareHouse. */
private ItemLocation _loc;
/** Slot where item is stored. */
private int _locData;
+
+ /** Hide Event */
+ private boolean hide;
if(Config.LOG_ITEMS)
{
LogRecord record = new LogRecord(Level.INFO, "CHANGE:" + process);
record.setLoggerName("item");
record.setParameters(new Object[]
{
this, creator, reference
});
_logItems.log(record);
record = null;
}
}
+
+ /** Hide Event */
+ public boolean isHide()
+ {
+ return hide;
+ }
+
+ public void setHide(boolean j)
+ {
+ hide = j;
+ }
+
Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java
=======================================================================================================
--- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java
+++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java
+/* 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 com.l2jfrozen.gameserver.model.entity.event;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
+import com.l2jfrozen.gameserver.network.clientpackets.Say2;
+import com.l2jfrozen.gameserver.network.SystemMessageId;
+import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
+import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
+import com.l2jfrozen.gameserver.util.Broadcast;
+import com.l2jfrozen.util.random.Rnd;
+import com.l2jfrozen.gameserver.model.L2World;
+import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
+
+public class Hide{
+
+ public static final int rewardId = (Config.HIDE_EVENT_REWARD_ID);
+ public static final int rewardCount = (Config.HIDE_EVENT_REWARD_COUNT);
+ private static Hide _instance;
+ private final int delay = (Config.HIDE_EVENT_DELAY_BEFORE_START);
+ private final static int itemId = (Config.HIDE_EVENT_ITEM_WILL_DROP);
+ 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!"));
+ System.out.println("Automatic Hide event finished with success.");
+ }
+
+ 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 aboarded with success.");
+ }
+
+ public static Hide getInstance(){
+ if(_instance == null)
+ _instance = new Hide();
+ return _instance;
+ }
+
+ public class Check implements Runnable{
+ @Override
+ public void run(){
+ checkAfterTime();
+ }
+ }
+ public class Event implements Runnable{
+ @Override
+ public void run(){
+ startEvent();
+ }
+ }
+}
Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java
==========================================================================================
--- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java
+++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java
import com.l2jfrozen.gameserver.model.entity.Hero;
import com.l2jfrozen.gameserver.model.entity.MonsterRace;
+import com.l2jfrozen.gameserver.model.entity.event.Hide;
CursedWeaponsManager.getInstance();
TaskManager.getInstance();
+ /** Hide Event */
+ if (Config.HIDE_EVENT)
+ {
+ Hide.getInstance();
+ }
Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java
===========================================================================
--- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java
+++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java
public static String PVP1_CUSTOM_MESSAGE;
public static String PVP2_CUSTOM_MESSAGE;
+ /** Hide Event Enabled */
+ public static boolean HIDE_EVENT;
+ public static int HIDE_EVENT_REWARD_ID;
+ public static int HIDE_EVENT_REWARD_COUNT;
+ public static int HIDE_EVENT_ITEM_WILL_DROP;
+ public static int HIDE_EVENT_DELAY_BEFORE_START;
+
PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
+ /** Hide Event */
+ HIDE_EVENT = Boolean.parseBoolean(L2JFrozenSettings.getProperty("HideEvent", "false"));
+ HIDE_EVENT_REWARD_ID = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventRewardId", "2807"));
+ HIDE_EVENT_REWARD_COUNT = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventRewardCount", "1"));
+ HIDE_EVENT_ITEM_WILL_DROP = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventItemWillDrop", "2807"));
+ HIDE_EVENT_DELAY_BEFORE_START = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventDelayBeforeStart", "180000"));
+
Index: C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties
==============================================================================
--- C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties
+++ C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties
+
+# -----------------------------------------
+# Hide Event -
+# -----------------------------------------
+# Default = False
+HideEvent = True
+HideEventRewardId = 2807
+HideEventRewardCount = 20
+HideEventItemWillDrop = 6579
+#Hide Event Start Every ( 180000 Milliseconds )
+#Milliseconds ( 180000 milliseconds = 180 seconds )
+HideEventDelayBeforeStart = 18000
and this is the line of error
Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Winner is: "+getName()+". Event ended."));
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.
Sell ready interlude server files, with all popular features and tested, stable source + fully functional premium geodata for free.
Features include:
Events: DM CTF TVT LM
Dressme system
Custom Buffer
GM Shop
Custom community board
Donation manager
Auto Farm
Album:
sell c6 — ImgBB
Test Server online:
Patch link: https://drive.google.com/file/d/1mvEbv9XESsvfWwc638xFyyzyESeE2U95/view?usp=drive_link
Auto acc create and auto admin
Price: 300$.
Discord: l2retro
Faltan demasiados archivos, y lógicas en clases claves como L2pcInstance, entre otras. si bien muchas cosas están y el flujo es valorable. Gracias por tu esfuerzo es bastante... pero realmente no esta completo el código, falta que subas todas las modificaciones en clases colaterales... podrías intentar subir un diff de todo el mod completo de tu pack y bueno ahí si que cada uno adapte... pero faltan muchas cosas, dudo que haya gente que lo haya echo funcionar con esto...
I know people who have fully bypassed and reversed AAC. One day, they might even release the full source code, but for now, they’re still making money off it. I won’t name anyone, but it’s clear that there aren’t any truly solid anticheats for Lineage2. As I’ve said before, kernel level anticheats are the only real solution. Anything that runs as Internal and injects gets flagged, and your account ends up getting kicked or banned. That’s just how most games handle it nowadays.
To TL;DR the whole thing cheating will always exist because there are people out there smart enough to bypass any protection and run private cheats. Public cheats are always detected eventually, so I don’t see any point in buying AAC, especially when they claim it blocks adr, which simply isn’t true.
🌐 Website: https://l2adonis.com
📅 GRAND OPENING: July 18, 2025 – 20:00 (UTC+2)
💬 Discord: https://discord.com/invite/tZBj8JxAwx
🚫 No auto-farm • No auto-macro • No pay-to-win • No custom
Some Basic Info's (More detalied info's on website)
EXP/SP: x25
Adena: x15
Drop: x15
Spoil: x15
Seal Stones: x15
Raid Boss Drop: x10
Epic Boss Drop: x1
Manor: x10
Safe Enchant: +4
Max Enchant: +16
Normal Scroll Chance: 50%
Blessed Scroll Chance: 66% (If enchant fail item remain +4)
Buff Slots (30+4 extra with Divine Inspiration)
Dances/Songs Slots 14
Auto-learn skills
⚔️ Real PvP • Real Progression • Retail-like experience
JOIN NOW and relive the real L2 experience!
Question
heladito
hi! i added this code but its giving me a little error in this line of L2PcInstance.java
the full code
Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java ========================================================================================================= --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java import com.l2jfrozen.gameserver.model.entity.event.CTF; import com.l2jfrozen.gameserver.model.entity.event.DM; +/** Hide Event */ +import com.l2jfrozen.gameserver.model.entity.event.Hide; import com.l2jfrozen.util.database.L2DatabaseFactory; import com.l2jfrozen.util.random.Rnd; +/** hide event */ +import com.l2jfrozen.gameserver.network.clientpackets.Say2; if (target.getItemLootShedule() != null && (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); + System.out.println("Automatic Hide Event finished with success."); + return; + } + // Fixed it's not possible pick up the object if you exceed the maximum weight. if (_inventory.getTotalWeight() + target.getItem().getWeight() * target.getCount() > getMaxLoad()) { sendMessage("You have reached the maximun weight."); return; } Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java ============================================================================================================ --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWho; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminZone; +/** Hide Event */ +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminGoHide; registerAdminCommandHandler(new AdminBuffs()); registerAdminCommandHandler(new AdminAio()); + /** Hide Event */ + registerAdminCommandHandler(new AdminGoHide()); Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java ======================================================================================================================= --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java +/* 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 com.l2jfrozen.gameserver.handler.admincommandhandlers; + +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler; +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.entity.event.Hide; + +/** + * + * @author Iracundus ( Remaded Sakretsos ) + */ +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: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java =================================================================================================================== --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java /** Location of the item : Inventory, PaperDoll, WareHouse. */ private ItemLocation _loc; /** Slot where item is stored. */ private int _locData; + + /** Hide Event */ + private boolean hide; if(Config.LOG_ITEMS) { LogRecord record = new LogRecord(Level.INFO, "CHANGE:" + process); record.setLoggerName("item"); record.setParameters(new Object[] { this, creator, reference }); _logItems.log(record); record = null; } } + + /** Hide Event */ + public boolean isHide() + { + return hide; + } + + public void setHide(boolean j) + { + hide = j; + } + Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java ======================================================================================================= --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java +/* 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 com.l2jfrozen.gameserver.model.entity.event; + +import com.l2jfrozen.Config; +import com.l2jfrozen.gameserver.thread.ThreadPoolManager; +import com.l2jfrozen.gameserver.network.clientpackets.Say2; +import com.l2jfrozen.gameserver.network.SystemMessageId; +import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay; +import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage; +import com.l2jfrozen.gameserver.util.Broadcast; +import com.l2jfrozen.util.random.Rnd; +import com.l2jfrozen.gameserver.model.L2World; +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; + +public class Hide{ + + public static final int rewardId = (Config.HIDE_EVENT_REWARD_ID); + public static final int rewardCount = (Config.HIDE_EVENT_REWARD_COUNT); + private static Hide _instance; + private final int delay = (Config.HIDE_EVENT_DELAY_BEFORE_START); + private final static int itemId = (Config.HIDE_EVENT_ITEM_WILL_DROP); + 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!")); + System.out.println("Automatic Hide event finished with success."); + } + + 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 aboarded with success."); + } + + public static Hide getInstance(){ + if(_instance == null) + _instance = new Hide(); + return _instance; + } + + public class Check implements Runnable{ + @Override + public void run(){ + checkAfterTime(); + } + } + public class Event implements Runnable{ + @Override + public void run(){ + startEvent(); + } + } +} Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java ========================================================================================== --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java import com.l2jfrozen.gameserver.model.entity.Hero; import com.l2jfrozen.gameserver.model.entity.MonsterRace; +import com.l2jfrozen.gameserver.model.entity.event.Hide; CursedWeaponsManager.getInstance(); TaskManager.getInstance(); + /** Hide Event */ + if (Config.HIDE_EVENT) + { + Hide.getInstance(); + } Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java =========================================================================== --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java public static String PVP1_CUSTOM_MESSAGE; public static String PVP2_CUSTOM_MESSAGE; + /** Hide Event Enabled */ + public static boolean HIDE_EVENT; + public static int HIDE_EVENT_REWARD_ID; + public static int HIDE_EVENT_REWARD_COUNT; + public static int HIDE_EVENT_ITEM_WILL_DROP; + public static int HIDE_EVENT_DELAY_BEFORE_START; + PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!"); PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!"); + /** Hide Event */ + HIDE_EVENT = Boolean.parseBoolean(L2JFrozenSettings.getProperty("HideEvent", "false")); + HIDE_EVENT_REWARD_ID = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventRewardId", "2807")); + HIDE_EVENT_REWARD_COUNT = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventRewardCount", "1")); + HIDE_EVENT_ITEM_WILL_DROP = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventItemWillDrop", "2807")); + HIDE_EVENT_DELAY_BEFORE_START = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventDelayBeforeStart", "180000")); + Index: C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties ============================================================================== --- C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties +++ C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties + +# ----------------------------------------- +# Hide Event - +# ----------------------------------------- +# Default = False +HideEvent = True +HideEventRewardId = 2807 +HideEventRewardCount = 20 +HideEventItemWillDrop = 6579 +#Hide Event Start Every ( 180000 Milliseconds ) +#Milliseconds ( 180000 milliseconds = 180 seconds ) +HideEventDelayBeforeStart = 18000
and this is the line of error
Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Winner is: "+getName()+". Event ended."));
Anyone can help me with this? :(
7 answers to this question
Recommended Posts
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.