Jump to content

Event Kratei Cube


Recommended Posts

core

### Eclipse Workspace Patch 1.0
#P L2JOfficial
Index: lin2srv/java/net/sf/l2j/gameserver/model/L2World.java
===================================================================
--- lin2srv/java/net/sf/l2j/gameserver/model/L2World.java (revision 1451)
+++ lin2srv/java/net/sf/l2j/gameserver/model/L2World.java (working copy)
@@ -187,6 +187,16 @@
  return time;
  }
  
+ public L2PcInstance findPlayer(int objectId)
+ {
+ L2Object obj = _allObjects.get(objectId);
+ 
+ if (obj instanceof L2PcInstance)
+ return (L2PcInstance) obj;
+ 
+ return null;
+ }
+ 
  /**
   * Added by Tempy - 08 Aug 05
   * Allows easy retrevial of all visible objects in world.
Index: lin2srv/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- lin2srv/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 1451)
+++ lin2srv/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -423,6 +423,8 @@
 
  private boolean _isIn7sDungeon = false;
  
+ private boolean _isInKrateisCube = false;
+ 
  public int _bookmarkslot = 0; // The Teleport Bookmark Slot
  
  public FastList<TeleportBookmark> tpbookmark = new FastList<TeleportBookmark>();
@@ -11472,7 +11474,20 @@
  _inAirShipPosition = pt;
  }
 
+ public void setIsInKrateisCube(boolean choice)
+ {
+ _isInKrateisCube = choice;
+ }
+
  /**
+  * @return
+  */
+ public boolean getIsInKrateisCube()
+ {
+ return _isInKrateisCube;
+ }
+ 
+ /**
   * Manage the delete task of a L2PcInstance (Leave Party, Unsummon pet, Save its inventory in the database, Remove it from the world...).<BR><BR>
   *
   * <B><U> Actions</U> :</B><BR><BR>
Index: lin2srv/java/net/sf/l2j/gameserver/model/actor/instance/L2KrateisCubeManagerInstance.java
===================================================================
--- lin2srv/java/net/sf/l2j/gameserver/model/actor/instance/L2KrateisCubeManagerInstance.java (revision 0)
+++ lin2srv/java/net/sf/l2j/gameserver/model/actor/instance/L2KrateisCubeManagerInstance.java (revision 0)
@@ -0,0 +1,120 @@
+/*
+ * 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.actor.instance;
+
+import net.sf.l2j.gameserver.instancemanager.KrateisCubeManager;
+import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+
+/**
+ * @author Psycho(killer1888)
+ */
+public class L2KrateisCubeManagerInstance extends L2NpcInstance
+{
+
+ public L2KrateisCubeManagerInstance(int objectId, L2NpcTemplate template)
+ {
+ super(objectId, template);
+ }
+
+ @Override
+ public void onBypassFeedback(L2PcInstance player, String command)
+ {
+ if (command.startsWith("Register"))
+ {
+ if (player.getInventoryLimit() * 0.8 <= player.getInventory().getSize())
+ {
+ player.sendPacket(SystemMessageId.INVENTORY_LESS_THAN_80_PERCENT);
+ showChatWindow(player, "data/html/krateisCube/32503-9.htm");
+ return;
+ }
+
+ boolean canParticipate = true;
+ int cmdChoice = Integer.parseInt(command.substring(9, 10).trim());
+ switch (cmdChoice)
+ {
+ case 1:
+ if (player.getLevel() < 70 || player.getLevel() > 75)
+ {
+ showChatWindow(player, "data/html/krateisCube/32503-7.htm");
+ return;
+ }
+ break;
+ case 2:
+ if (player.getLevel() < 76 || player.getLevel() > 79)
+ {
+ showChatWindow(player, "data/html/krateisCube/32503-7.htm");
+ return;
+ }
+ break;
+ case 3:
+ if (player.getLevel() < 80)
+ {
+ showChatWindow(player, "data/html/krateisCube/32503-7.htm");
+ return;
+ }
+ break;
+ }
+
+ if (KrateisCubeManager.getInstance().isTimeToRegister())
+ {
+ if (KrateisCubeManager.getInstance().registerPlayer(player))
+ {
+ showChatWindow(player, "data/html/krateisCube/32503-4.htm");
+ return;
+ }
+ else
+ {
+ showChatWindow(player, "data/html/krateisCube/32503-5.htm");
+ return;
+ }
+ }
+ else
+ {
+ showChatWindow(player, "data/html/krateisCube/32503-8.htm");
+ return;
+ }
+ 
+ }
+ else if (command.startsWith("Cancel"))
+ {
+ KrateisCubeManager.getInstance().removePlayer(player);
+ showChatWindow(player, "data/html/krateisCube/32503-6.htm");
+ return;
+ }
+ else if (command.startsWith("TeleportIn"))
+ {
+ KrateisCubeManager.getInstance().teleportPlayerIn(player);
+ return;
+ }
+ else
+ super.onBypassFeedback(player,command);
+ }
+
+ @Override
+ public String getHtmlPath(int npcId, int val)
+ {
+ String pom = "";
+
+ if (val == 0)
+ pom = "" + npcId;
+ else
+ pom = npcId + "-" + val;
+
+ return "data/html/krateisCube/" + pom + ".htm";
+ }
+}
Index: lin2srv/java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- lin2srv/java/net/sf/l2j/gameserver/GameServer.java (revision 1451)
+++ lin2srv/java/net/sf/l2j/gameserver/GameServer.java (working copy)
@@ -91,6 +91,7 @@
 import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
 import net.sf.l2j.gameserver.instancemanager.InstanceManager;
 import net.sf.l2j.gameserver.instancemanager.ItemsOnGroundManager;
+import net.sf.l2j.gameserver.instancemanager.KrateisCubeManager;
 import net.sf.l2j.gameserver.instancemanager.MercTicketManager;
 import net.sf.l2j.gameserver.instancemanager.PetitionManager;
 import net.sf.l2j.gameserver.instancemanager.QuestManager;
@@ -356,6 +357,9 @@
  if (Config.AUTODESTROY_ITEM_AFTER > 0 || Config.HERB_AUTO_DESTROY_TIME > 0)
  ItemsAutoDestroy.getInstance();
  
+ _log.info("Krateis Cube loaded");
+ KrateisCubeManager.getInstance().init();
+ 
  MonsterRace.getInstance();
  
  SevenSigns.getInstance().spawnSevenSignsNPC();
Index: lin2srv/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- lin2srv/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 1451)
+++ lin2srv/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
@@ -35,6 +35,7 @@
 import net.sf.l2j.gameserver.instancemanager.FortManager;
 import net.sf.l2j.gameserver.instancemanager.FortSiegeManager;
 import net.sf.l2j.gameserver.instancemanager.InstanceManager;
+import net.sf.l2j.gameserver.instancemanager.KrateisCubeManager;
 import net.sf.l2j.gameserver.instancemanager.PetitionManager;
 import net.sf.l2j.gameserver.instancemanager.QuestManager;
 import net.sf.l2j.gameserver.instancemanager.SiegeManager;
@@ -190,6 +191,9 @@
  GmListTable.getInstance().addGm(activeChar, true);
  }
  
+ if (KrateisCubeManager.getInstance().isRegistered(activeChar))
+ activeChar.setIsInKrateisCube(true);
+ 
  activeChar.setPvpColor();
  
  // Set dead status if applies
Index: lin2srv/java/net/sf/l2j/gameserver/instancemanager/KrateisCubeManager.java
===================================================================
--- lin2srv/java/net/sf/l2j/gameserver/instancemanager/KrateisCubeManager.java (revision 0)
+++ lin2srv/java/net/sf/l2j/gameserver/instancemanager/KrateisCubeManager.java (revision 0)
@@ -0,0 +1,726 @@
+/*
+ * 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.instancemanager;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Calendar;
+//import java.util.Map.Entry;
+import java.util.concurrent.ScheduledFuture;
+import java.util.Date;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.datatables.DoorTable;
+import net.sf.l2j.gameserver.datatables.NpcTable;
+import net.sf.l2j.gameserver.datatables.SpawnTable;
+import net.sf.l2j.gameserver.model.L2Spawn;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.L2Character;
+import net.sf.l2j.gameserver.model.actor.L2Npc;
+import net.sf.l2j.gameserver.model.actor.L2Summon;
+import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
+import net.sf.l2j.util.Rnd;
+//import net.sf.l2j.util.L2FastSet;
+import net.sf.l2j.util.ValueSortMap;
+
+/**
+ * @author Psycho(killer1888)
+ */
+
+public class KrateisCubeManager
+{
+ protected static final Logger  _log  = Logger.getLogger(KrateisCubeManager.class.getName());
+ private static boolean  _started   = false;
+ private static boolean  _canRegister  = true;
+ private static int  _rotation  = 0;
+ private static int  _level   = 0;
+ protected ScheduledFuture<?>  _rotateRoomTask = null;
+ private static L2Npc _manager;
+ private static int _playersToReward = 0;
+ private static int _playerTotalKill = 0;
+ private static double _playerTotalCoin = 0;
+ private static int _matchDuration = 20;
+ private static int _waitingTime = 3;
+
+ private final FastList<L2Npc>  _watchers = new FastList<L2Npc>();
+ private final FastList<L2Npc>  _mobs = new FastList<L2Npc>();
+ private static FastList<Integer> _players = new FastList<Integer>();
+ private static FastList<Integer> _tempPlayers = new FastList<Integer>();
+ private static Map<Integer, Integer> _killList = new FastMap<Integer, Integer>();
+
+ private static int  _redWatcher  = 18601;
+ private static int  _blueWatcher  = 18602;
+ private static int _fantasyCoin  = 13067;
+
+ private static int[]  _doorlistA  = {17150014,17150013,17150019,17150024,17150039,17150044,17150059,17150064,17150079,17150084,17150093,17150094,17150087,17150088,17150082,17150077,17150062,17150057,17150008,17150007,17150018,17150023,17150038,17150043,17150058,17150063,17150078,17150083,17150030,17150029,17150028,17150027,17150036,17150041,17150056,17150061};
+ private static int[]  _doorlistB  = {17150020,17150025,17150034,17150033,17150032,17150031,17150012,17150011,17150010,17150009,17150017,17150022,17150016,17150021,17150037,17150042,17150054,17150053,17150052,17150051,17150050,17150049,17150048,17150047,17150085,17150080,17150074,17150073,17150072,17150071,17150070,17150069,17150068,17150067,17150076,17150081,17150092,17150091,17150090,17150089};
+
+ private static int[]  _level70Mobs  = {18587,18580,18581,18584,18591,18589,18583};
+ private static int[]  _level76Mobs  = {18590,18591,18589,18585,18586,18583,18592,18582};
+ private static int[]  _level80Mobs  = {18595,18597,18596,18598,18593,18600,18594,18599};
+
+ private static final String GET_PLAYED_MATCH = "SELECT played_matchs, total_kills, total_coins FROM krateis_cube WHERE charId=?";
+ private static final String SAVE_PLAYED_MATCH = "INSERT INTO krateis_cube (charId,played_matchs,total_kills,total_coins) VALUES (?,?,?,?)";
+ private static final String UPDATE_PLAYED_MATCH = "UPDATE krateis_cube SET played_matchs = ?, total_kills = ?, total_coins = ? WHERE charId = ?";
+
+ private static int[][][]  _spawnLocs = {
+ {{-77663, -85716, -8365},{-77701, -85948, -8365},{-77940, -86090, -8365},{-78142, -85934, -8365},{-78180, -85659, -8365}},
+ {{-79653, -85689, -8365},{-79698, -86017, -8365},{-80003, -86025, -8365},{-80102, -85880, -8365},{-80061, -85603, -8365}},
+ {{-81556, -85765, -8365},{-81794, -85528, -8365},{-82111, -85645, -8365},{-82044, -85928, -8364},{-81966, -86116, -8365}},
+ {{-83750, -85882, -8365},{-84079, -86021, -8365},{-84123, -85663, -8365},{-83841, -85748, -8364},{-83951, -86120, -8365}},
+ {{-85785, -85943, -8364},{-86088, -85626, -8365},{-85698, -85678, -8365},{-86154, -85879, -8365},{-85934, -85961, -8365}},
+ {{-85935, -84131, -8365},{-86058, -83921, -8365},{-85841, -83684, -8364},{-86082, -83557, -8365},{-85680, -83816, -8365}},
+ {{-84128, -83747, -8365},{-83877, -83597, -8365},{-83609, -83946, -8365},{-83911, -83955, -8364},{-83817, -83888, -8364}},
+ {{-82039, -83971, -8365},{-81815, -83972, -8365},{-81774, -83742, -8364},{-81996, -83733, -8364},{-82124, -83589, -8365}},
+ {{-80098, -83862, -8365},{-79973, -84058, -8365},{-79660, -83848, -8365},{-79915, -83570, -8365},{-79803, -83832, -8364}},
+ {{-78023, -84066, -8365},{-77869, -83891, -8364},{-77674, -83757, -8365},{-77861, -83540, -8365},{-78107, -83660, -8365}},
+ {{-77876, -82141, -8365},{-77674, -81822, -8365},{-77885, -81607, -8365},{-78078, -81779, -8365},{-78071, -81874, -8365}},
+ {{-79740, -81636, -8365},{-80094, -81713, -8365},{-80068, -82004, -8365},{-79677, -81987, -8365},{-79891, -81734, -8364}},
+ {{-81703, -81748, -8365},{-81857, -81661, -8364},{-82058, -81863, -8365},{-81816, -82011, -8365},{-81600, -81809, -8365}},
+ {{-83669, -82007, -8365},{-83815, -81965, -8365},{-84121, -81805, -8365},{-83962, -81626, -8365},{-83735, -81625, -8365}},
+ {{-85708, -81838, -8365},{-86062, -82009, -8365},{-86129, -81814, -8365},{-85957, -81634, -8365},{-85929, -81460, -8365}},
+ {{-86160, -79933, -8365},{-85766, -80061, -8365},{-85723, -79691, -8365},{-85922, -79623, -8365},{-85941, -79879, -8364}},
+ {{-84082, -79638, -8365},{-83923, -80082, -8365},{-83687, -79778, -8365},{-83863, -79619, -8365},{-83725, -79942, -8365}},
+ {{-81963, -80020, -8365},{-81731, -79707, -8365},{-81957, -79589, -8365},{-82151, -79788, -8365},{-81837, -79868, -8364}},
+ {{-80093, -80020, -8365},{-80160, -79716, -8365},{-79727, -79699, -8365},{-79790, -80049, -8365},{-79942, -79594, -8365}},
+ {{-78113, -79658, -8365},{-77967, -80022, -8365},{-77692, -79779, -8365},{-77728, -79603, -8365},{-78078, -79857, -8365}},
+ {{-77648, -77923, -8365},{-77714, -77742, -8365},{-78109, -77640, -8365},{-78114, -77904, -8365},{-77850, -77816, -8364}},
+ {{-79651, -77492, -8365},{-79989, -77613, -8365},{-80134, -77981, -8365},{-79759, -78011, -8365},{-79644, -77779, -8365}},
+ {{-81672, -77966, -8365},{-81867, -77536, -8365},{-82129, -77926, -8365},{-82057, -78064, -8365},{-82114, -77608, -8365}},
+ {{-83938, -77574, -8365},{-84129, -77924, -8365},{-83909, -78111, -8365},{-83652, -78006, -8365},{-83855, -77756, -8364}},
+ {{-85660, -78078, -8365},{-85842, -77649, -8365},{-85989, -77556, -8365},{-86075, -77783, -8365},{-86074, -78132, -8365}}};
+
+ private static int[][]  _teleports = {
+ {-77906, -85809, -8362},
+ {-79903, -85807, -8364},
+ {-81904, -85807, -8364},
+ {-83901, -85806, -8364},
+ {-85903, -85807, -8364},
+ {-77904, -83808, -8364},
+ {-79904, -83807, -8364},
+ {-81905, -83810, -8364},
+ {-83903, -83807, -8364},
+ {-85899, -83807, -8364},
+ {-77903, -81808, -8364},
+ {-79906, -81807, -8364},
+ {-81901, -81808, -8364},
+ {-83905, -81805, -8364},
+ {-85907, -81809, -8364},
+ {-77904, -79807, -8364},
+ {-79905, -79807, -8364},
+ {-81908, -79808, -8364},
+ {-83907, -79806, -8364},
+ {-85912, -79806, -8364},
+ {-77905, -77808, -8364},
+ {-79902, -77805, -8364},
+ {-81904, -77808, -8364},
+ {-83904, -77808, -8364},
+ {-85904, -77807, -8364}};
+
+ public static final KrateisCubeManager getInstance()
+ {
+ return SingletonHolder._instance;
+ }
+
+ public void init()
+ {
+ Calendar cal = Calendar.getInstance();
+
+ if (cal.get(Calendar.MINUTE) >= 57)
+ {
+ cal.add(Calendar.HOUR, 1);
+ cal.set(Calendar.MINUTE, 27);
+ }
+ else if (cal.get(Calendar.MINUTE) >= 0 && cal.get(Calendar.MINUTE) <= 26)
+ cal.set(Calendar.MINUTE, 27);
+ else
+ cal.set(Calendar.MINUTE, 57);
+
+ cal.set(Calendar.SECOND, 0);
+
+ ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new checkRegistered(), cal.getTimeInMillis() - System.currentTimeMillis(), 30*60*1000);
+ 
+ Date date = new Date(cal.getTimeInMillis());
+ _log.info("Krateis Cube initialized, next match: " + date);
+ }
+
+ protected class checkRegistered implements Runnable
+ {
+ public void run()
+ {
+ if (!_started)
+ {
+ if (_tempPlayers.isEmpty())
+ {
+ _log.info("Krateis Cube: Match canceled due to lack of participant, next round in 30 minutes.");
+ return;
+ }
+ else
+ {
+ _log.info("Krateis Cube: Match started.");
+ _canRegister = false;
+ teleportToWaitRoom();
+ }
+ }
+ }
+ }
+
+ protected class startKrateisCube implements Runnable
+ {
+ public void run()
+ {
+ _canRegister = true;
+
+ closeAllDoors();
+
+ L2PcInstance player;
+ int i = 0;
+ for (int objectId : _players)
+ {
+ player = L2World.getInstance().findPlayer(objectId);
+ if (player != null)
+ {
+ doTeleport(player, _teleports[i][0], _teleports[i][1], _teleports[i][2]);
+ i++;
+ }
+ }
+
+ L2Spawn spawnDat;
+ spawnDat = spawnNpc(32504, -86804, -81974, -8361, 34826, 60, 0);
+ _manager = spawnDat.doSpawn();
+
+ _rotateRoomTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new rotateRooms(), 10000, 50000);
+ ThreadPoolManager.getInstance().scheduleGeneral(new spawnMobs(), 10000);
+ ThreadPoolManager.getInstance().scheduleGeneral(new finishCube(), _matchDuration*60*1000);
+ }
+ }
+
+ protected class finishCube implements Runnable
+ {
+ public void run()
+ {
+ L2PcInstance player;
+
+ _log.info("Krateis Cube match ended.");
+ 
+ if (_rotateRoomTask != null)
+ _rotateRoomTask.cancel(true);
+
+ closeAllDoors();
+ globalDespawn();
+ rewardPlayers();
+
+ for (int objectId : _players)
+ {
+ player = L2World.getInstance().findPlayer(objectId);
+ if (player != null)
+ {
+ doTeleport(player, -70381, -70937, -1428);
+ player.setIsInKrateisCube(false);
+ }
+ }
+
+ _killList.clear();
+ _players.clear();
+ _started = false;
+ }
+ }
+
+ protected class spawnMobs implements Runnable
+ {
+ public void run()
+ {
+ int npcId;
+ int _instanceId = 0;
+ L2Spawn spawnDat;
+
+ for (int i = 0; i <= 24; i++)
+ {
+ for (int j = 0; j <= 4; j++)
+ {
+ npcId = _level76Mobs[Rnd.get(_level76Mobs.length)];
+ spawnDat = spawnNpc(npcId, _spawnLocs[i][j][0], _spawnLocs[i][j][1], _spawnLocs[i][j][2], 0, 60, _instanceId);
+ _mobs.add(spawnDat.doSpawn());
+ }
+ 
+ }
+ }
+ }
+
+ protected class rotateRooms implements Runnable
+ {
+ public void run()
+ {
+ L2Spawn spawnDat;
+ int instanceId = 0;
+ int watcherA;
+ int watcherB;
+
+ watcherA = (_rotation == 0) ? _blueWatcher : _redWatcher;
+ watcherB = (_rotation == 0) ? _redWatcher : _blueWatcher;
+
+ spawnDat = spawnNpc(watcherA, -77906, -85809, -8362, 34826, 60, instanceId); //1
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -79903, -85807, -8364, 32652, 60, instanceId); //2
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -81904, -85807, -8364, 32839, 60, instanceId); //3
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -83901, -85806, -8364, 33336, 60, instanceId); //4
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -85903, -85807, -8364, 32571, 60, instanceId); //5
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -77904, -83808, -8364, 32933, 60, instanceId); //6
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -79904, -83807, -8364, 33055, 60, instanceId); //7
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -81905, -83810, -8364, 32767, 60, instanceId); //8
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -83903, -83807, -8364, 32676, 60, instanceId); //9
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -85899, -83807, -8364, 33005, 60, instanceId); //10
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -77903, -81808, -8364, 32664, 60, instanceId); //11
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -79906, -81807, -8364, 32647, 60, instanceId); //12
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -81901, -81808, -8364, 33724, 60, instanceId); //13
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -83905, -81805, -8364, 32926, 60, instanceId); //14
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -85907, -81809, -8364, 34248, 60, instanceId); //15
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -77904, -79807, -8364, 32905, 60, instanceId); //16
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -79905, -79807, -8364, 32767, 60, instanceId); //17
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -81908, -79808, -8364, 32767, 60, instanceId); //18
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -83907, -79806, -8364, 32767, 60, instanceId); //19
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -85912, -79806, -8364, 29025, 60, instanceId); //20
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -77905, -77808, -8364, 32767, 60, instanceId); //21
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -79902, -77805, -8364, 32767, 60, instanceId); //22
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherB, -81904, -77808, -8364, 32478, 60, instanceId); //23
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -83904, -77808, -8364, 32698, 60, instanceId); //24
+ _watchers.add(spawnDat.doSpawn());
+ spawnDat = spawnNpc(watcherA, -85904, -77807, -8364, 32612, 60, instanceId); //25
+ _watchers.add(spawnDat.doSpawn());
+
+ openDoors();
+
+ _rotation = (_rotation == 0) ? 1 : 0;
+ }
+ }
+
+ protected class CloseDoors implements Runnable
+ {
+ public void run()
+ {
+ closeAllDoors();
+
+ for (L2Npc npc : _watchers)
+ {
+ npc.getSpawn().stopRespawn();
+ npc.deleteMe();
+ }
+ _watchers.clear();
+ }
+ }
+
+ public boolean teleportToWaitRoom()
+ {
+ if (_tempPlayers.size() >= 1)
+ {
+ L2PcInstance player;
+ for (int objectId : _tempPlayers)
+ {
+ _players.add(objectId);
+
+ player = L2World.getInstance().findPlayer(objectId);
+ if (player != null)
+ {
+ doTeleport(player, -87028, -81780, -8365);
+ player.setIsInKrateisCube(true);
+ }
+ }
+
+ _tempPlayers.clear();
+ _started = true;
+ ThreadPoolManager.getInstance().scheduleGeneral(new startKrateisCube(), _waitingTime*60*1000);
+ return true;
+ }
+ else
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void rewardPlayers()
+ {
+ int kills = 0;
+ int i = 0;
+ double amount = 0;
+ L2PcInstance player;
+
+ _playersToReward = getNumberPlayerToReward();
+ _killList = ValueSortMap.sortMapByValue(_killList, false);
+
+ for (int objectId : _killList.keySet())
+ {
+ player = L2World.getInstance().findPlayer(objectId);
+ if (player != null)
+ {
+ kills = _killList.get(objectId);
+
+ if (kills >= 10)
+ {
+ amount = getRewardAmount(player, i);
+ int coinAmount = (int)amount;
+ player.addItem("Krateis Cube Reward", _fantasyCoin, coinAmount, player, true);
+ player.getInventory().updateDatabase();
+ i++;
+ }
+ }
+ }
+ _playersToReward = 0;
+ _playerTotalKill = 0;
+ _playerTotalCoin = 0;
+ }
+
+ private double getRewardAmount(L2PcInstance player, int place)
+ {
+ int playedMatchs = getPlayedMatchs(player);
+ int n = Math.round(_playersToReward / 10);
+ double reward;
+
+ if (playedMatchs == 0)
+ {
+ savePlayedMatchs(player);
+ }
+
+ playedMatchs++;
+
+ switch (place)
+ {
+ case 0:
+ reward = Math.floor(20 + (n * 2) + (playedMatchs / 4));
+ if (reward > 50)
+ reward = 50;
+ break;
+ case 1:
+ reward = Math.floor(8 + (n * 2) + (playedMatchs / 4));
+ if (reward > 20)
+ reward = 20;
+ break;
+ default:
+ reward = Math.floor(1 + n + (playedMatchs / 6));
+ if (reward > 5)
+ reward = 5;
+ break;
+ }
+
+ updatePlayedMatchs(player, playedMatchs, reward);
+
+ return reward;
+ }
+
+ public void updatePlayedMatchs(L2PcInstance player, int playedMatchs, double amount)
+ {
+ Connection con = null;
+ try
+ {
+ con = L2DatabaseFactory.getInstance().getConnection();
+ PreparedStatement statement = con.prepareStatement(UPDATE_PLAYED_MATCH);
+
+ statement.setInt(1, playedMatchs);
+ statement.setInt(2, _playerTotalKill + _killList.get(player.getObjectId()));
+ statement.setDouble(3, _playerTotalCoin + amount);
+ statement.setInt(4, player.getObjectId());
+ statement.execute();
+ statement.close();
+ }
+ catch (Exception e)
+ {
+ _log.log(Level.SEVERE, "Could not update character played Krateis Cube matchs: ", e);
+ }
+ finally
+ {
+ try { con.close(); } catch (Exception e) {}
+ }
+ }
+
+ private void savePlayedMatchs(L2PcInstance player)
+ {
+ Connection con = null;
+ try
+ {
+ con = L2DatabaseFactory.getInstance().getConnection();
+ PreparedStatement statement = con.prepareStatement(SAVE_PLAYED_MATCH);
+
+ statement.setInt(1, player.getObjectId());
+ statement.setInt(2, 0);
+ statement.setInt(3, _killList.get(player.getObjectId()));
+ statement.setDouble(4, 0);
+ statement.execute();
+ statement.close();
+ }
+ catch (Exception e)
+ {
+ _log.log(Level.SEVERE, "Could not store character krateis cube played matchs: ", e);
+ }
+ finally
+ {
+ try { con.close(); } catch (Exception e) {}
+ }
+ }
+
+ private int getPlayedMatchs(L2PcInstance player)
+ {
+ Connection con = null;
+ int playedMatchs = 0;
+
+ try
+ {
+ con = L2DatabaseFactory.getInstance().getConnection();
+ PreparedStatement statement = con.prepareStatement(GET_PLAYED_MATCH);
+
+ statement.setInt(1, player.getObjectId());
+
+ ResultSet rset = statement.executeQuery();
+ while (rset.next())
+ {
+ playedMatchs = rset.getInt("played_matchs");
+ _playerTotalKill = rset.getInt("total_kills");
+ _playerTotalCoin = rset.getDouble("total_coins");
+ }
+ rset.close();
+ statement.close();
+ }
+ catch (Exception e)
+ {
+ _log.log(Level.SEVERE, "Could not get player total Krateis Cube played matchs: ", e);
+ }
+ finally
+ {
+ try { con.close(); } catch (Exception e) {}
+ }
+ return playedMatchs;
+ }
+
+ private int getNumberPlayerToReward()
+ {
+ int number = 0;
+ int kills = 0;
+
+ for (int objectId : _killList.keySet())
+ {
+ kills = _killList.get(objectId);
+
+ if (kills >= 10)
+ number++;
+ }
+ return number;
+ }
+
+ private void globalDespawn()
+ {
+ for (L2Npc npc : _mobs)
+ {
+ npc.getSpawn().stopRespawn();
+ npc.deleteMe();
+ }
+ _mobs.clear();
+
+ for (L2Npc npc : _watchers)
+ {
+ npc.getSpawn().stopRespawn();
+ npc.deleteMe();
+ }
+
+ _manager.getSpawn().stopRespawn();
+ _manager.deleteMe();
+
+ _manager = null;
+ _watchers.clear();
+ }
+
+ private void openDoors()
+ {
+ int[] doorToOpen = (_rotation == 1) ? _doorlistB : _doorlistA;
+
+ closeAllDoors();
+
+ for (int doorId : doorToOpen)
+ DoorTable.getInstance().getDoor(doorId).openMe();
+
+ ThreadPoolManager.getInstance().scheduleGeneral(new CloseDoors(), 25000);
+ }
+
+ private void closeAllDoors()
+ {
+ int doorId = 17150001;
+
+ while (doorId <= 17150103)
+ {
+ DoorTable.getInstance().getDoor(doorId).closeMe();
+ doorId += 1;
+ }
+ }
+
+ // Teleports player and his summon to given coords
+ private void doTeleport(L2PcInstance player, int x, int y, int z)
+ {
+ if (player.isOnline() == 0)
+ return;
+
+ player.teleToLocation(x, y, z, false);
+
+ L2Summon pet = player.getPet();
+ if (pet != null)
+ pet.teleToLocation(x, y, z, false);
+ }
+
+ private L2Spawn spawnNpc(int npcId, int x, int y, int z, int heading, int respawnTime, int instanceId)
+ {
+ L2NpcTemplate npcTemplate;
+ npcTemplate = NpcTable.getInstance().getTemplate(npcId);
+ L2Spawn spawnDat = null;
+
+ try
+ {
+ spawnDat = new L2Spawn(npcTemplate);
+ spawnDat.setAmount(1);
+ spawnDat.setLocx(x);
+ spawnDat.setLocy(y);
+ spawnDat.setLocz(z);
+ spawnDat.setHeading(heading);
+ spawnDat.setRespawnDelay(respawnTime);
+ spawnDat.setInstanceId(instanceId);
+ SpawnTable.getInstance().addNewSpawn(spawnDat, false);
+ spawnDat.init();
+ spawnDat.startRespawn();
+ if (respawnTime == 0)
+ spawnDat.stopRespawn();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return spawnDat;
+ }
+
+ public boolean registerPlayer(L2PcInstance player)
+ {
+ int objectId = player.getObjectId();
+
+ if (_tempPlayers.contains(objectId) || _tempPlayers.size() >= 25)
+ return false;
+
+ _tempPlayers.add(objectId);
+ return true;
+ }
+
+ public boolean removePlayer(L2PcInstance player)
+ {
+ int objectId = player.getObjectId();
+
+ if (!_tempPlayers.contains(objectId))
+ return false;
+
+ _tempPlayers.remove(objectId);
+ return true;
+ }
+
+ // Add one kill to this player
+ public void addKill(L2PcInstance player)
+ {
+ addKills(player, 1);
+ }
+
+ // Add value kills to this player
+ public boolean addKills(L2PcInstance player, int value)
+ {
+ int objectId = player.getObjectId();
+ int kills = 0;
+
+ if (_players.contains(objectId))
+ {
+ if (_killList.containsKey(objectId))
+ kills = _killList.get(objectId);
+
+ kills += value;
+ _killList.put(objectId, kills);
+ return true;
+ }
+ return false;
+ }
+
+ public int getKills(L2PcInstance player)
+ {
+ int objectId = player.getObjectId();
+ int kills = 0;
+ 
+ if (_players.contains(objectId))
+ {
+ if (_killList.containsKey(objectId))
+ kills = _killList.get(objectId);
+ }
+
+ return kills;
+ }
+
+ public boolean isTimeToRegister()
+ {
+ return _canRegister;
+ }
+
+ // This one is used to control if the player is registered in Krateis Cube on enterWorld
+ public boolean isRegistered(L2PcInstance player)
+ {
+ int objectId = player.getObjectId();
+
+ if (_players.contains(objectId))
+ return true;
+ return false;
+ }
+
+ // Used to teleport players in the cube from the waiting room after a death
+ public void teleportPlayerIn(L2PcInstance player)
+ {
+ int i = Rnd.get(_teleports.length);
+ doTeleport(player, _teleports[i][0], _teleports[i][1], _teleports[i][2]);
+ }
+
+ @SuppressWarnings("synthetic-access")
+ private static class SingletonHolder
+ {
+ protected static final KrateisCubeManager _instance = new KrateisCubeManager();
+ }
+}
\ No newline at end of file
 

dp
### Eclipse Workspace Patch 1.0
#P L2JOfficial
Index: data/tools/full_install.sql
===================================================================
--- data/tools/full_install.sql (revision 1451)
+++ data/tools/full_install.sql (working copy)
@@ -71,6 +71,7 @@
 DROP TABLE IF EXISTS items;
 DROP TABLE IF EXISTS itemsonground;
 DROP TABLE IF EXISTS kamaloka;
+DROP TABLE IF EXISTS krateis_cube;
 DROP TABLE IF EXISTS locations;
 DROP TABLE IF EXISTS lvlupgain;
 DROP TABLE IF EXISTS mapregion;
Index: data/sql/npc.sql
===================================================================
--- data/sql/npc.sql (revision 1451)
+++ data/sql/npc.sql (working copy)
@@ -9580,6 +9580,10 @@
 UPDATE `npc` SET `type`='L2Teleporter' WHERE (`id`='32534') LIMIT 1;
 UPDATE `npc` SET `type`='L2Teleporter' WHERE (`id`='32539') LIMIT 1;
 
+-- Krateis Cube Update
+UPDATE `npc` SET `type` = 'L2KrateisCubeManager' WHERE `id` = '32503' LIMIT 1;
+UPDATE `npc` SET `type` = 'L2KrateisCubeManager' WHERE `id` = '32504' LIMIT 1;
+
 -- Alegria Creation Day Celebration Helper
 UPDATE `npc` SET `collision_radius`='5', `collision_height`='21' WHERE `id`='32600';
 
Index: data/data/scripts.cfg
===================================================================
--- data/data/scripts.cfg (revision 1451)
+++ data/data/scripts.cfg (working copy)
@@ -623,6 +623,12 @@
 #instances/Hellbound/Town.py
 #teleports/1107_enter_hellbound_island/__init__.py
 
+
+# Krateis Cube
+handlers/admincommandhandlers/AdminKrateisCube.java
+ai/group_template/KrateisCubeMobs.py
+
+
 # Handlers
 
 # handlers/admincommandhandlers:
Index: data/data/scripts/handlers/admincommandhandlers/AdminKrateisCube.java
===================================================================
--- data/data/scripts/handlers/admincommandhandlers/AdminKrateisCube.java (revision 0)
+++ data/data/scripts/handlers/admincommandhandlers/AdminKrateisCube.java (revision 0)
@@ -0,0 +1,134 @@
+/*
+ * 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 handlers.admincommandhandlers;
+
+import java.util.StringTokenizer;
+
+import net.sf.l2j.gameserver.handler.model.AAdminCommandHandler;
+import net.sf.l2j.gameserver.instancemanager.KrateisCubeManager;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author Psycho(killer1888)
+ */
+
+public class AdminKrateisCube extends AAdminCommandHandler
+{
+ private static int _kills = 0;
+
+ private static final String[] ADMIN_COMMANDS =
+ {
+ "admin_start_krateis_cube",
+ "admin_stop_krateis_cube",
+ "admin_register_krateis_cube",
+ "admin_unregister_krateis_cube",
+ "admin_add_krateis_cube_kills",
+ "admin_remove_krateis_cube_kills",
+ "admin_get_krateis_cube_kills"
+ };
+
+ public boolean useAdminCommand(String command, L2PcInstance activeChar)
+ {
+ StringTokenizer st = new StringTokenizer(command, " ");
+ String cmd = st.nextToken();
+
+ if (cmd.equals("admin_start_krateis_cube"))
+ {
+ if (!KrateisCubeManager.getInstance().teleportToWaitRoom())
+ activeChar.sendMessage("Not enough registered to start Krateis Cube.");
+ return true;
+ }
+ /*else if (cmd.equals("stop_krateis_cube"))
+ {
+ new finishCube();
+ return true;
+ }*/
+
+ if (activeChar.getTarget() instanceof L2PcInstance)
+ {
+ L2PcInstance target;
+ target = (L2PcInstance) activeChar.getTarget();
+
+ if (cmd.equals("admin_register_krateis_cube"))
+ {
+ if (!KrateisCubeManager.getInstance().registerPlayer(target))
+ activeChar.sendMessage("This player is already registered.");
+ else
+ {
+ if (target == activeChar)
+ activeChar.sendMessage("You have successfully registered for the next Krateis Cube match.");
+ else
+ target.sendMessage("An admin registered you for the next Krateis Cube match.");
+ }
+ }
+ else if (cmd.equals("admin_unregister_krateis_cube"))
+ {
+ if (!KrateisCubeManager.getInstance().removePlayer(target))
+ activeChar.sendMessage("This player is not registered.");
+ else
+ {
+ target.sendMessage("An admin removed you from Krateis Cube playerlist.");
+ }
+ }
+ else if (cmd.equals("admin_add_krateis_cube_kills"))
+ {
+ try
+ {
+ _kills = Integer.parseInt(st.nextToken());
+ }
+ catch (Exception e)
+ {
+ activeChar.sendMessage("Please specify the kills amount you want to add.");
+ }
+
+ if (KrateisCubeManager.getInstance().addKills(target, _kills))
+ {
+ target.sendMessage("An admin added " + _kills + " kills to your Krateis Cube kills.");
+ activeChar.sendMessage("Added " + _kills + " kills to the player.");
+ }
+ else
+ {
+ activeChar.sendMessage("This player does not exist in Krateis Cube playerlist.");
+ }
+ }
+ else if (cmd.equals("admin_get_krateis_cube_kills"))
+ {
+ if (!KrateisCubeManager.getInstance().isRegistered(target))
+ activeChar.sendMessage("This player is not registered.");
+ else
+ {
+ _kills = KrateisCubeManager.getInstance().getKills(target);
+ activeChar.sendMessage("Player Krateis Cube kills: " + _kills + ".");
+ }
+ }
+ return true;
+ }
+ else
+ {
+ activeChar.sendMessage("Target must be a player!");
+ return false;
+ }
+ }
+
+ public String[] getAdminCommandList()
+ {
+ return ADMIN_COMMANDS;
+ }
+
+ public static void main(String[] args)
+ {
+ new AdminKrateisCube();
+ }
+}
Index: data/tools/database_installer.sh
===================================================================
--- data/tools/database_installer.sh (revision 1451)
+++ data/tools/database_installer.sh (working copy)
@@ -334,6 +334,7 @@
 $MYG < ../sql/items.sql &> /dev/null
 $MYG < ../sql/itemsonground.sql &> /dev/null
 $MYG < ../sql/kamaloka.sql &> /dev/null
+$MYG < ../sql/krateis_cube.sql &> /dev/null
 $MYG < ../sql/locations.sql &> /dev/null
 $MYG < ../sql/lvlupgain.sql &> /dev/null
 $MYG < ../sql/mapregion.sql &> /dev/null
Index: data/sql/krateis_cube.sql
===================================================================
--- data/sql/krateis_cube.sql (revision 0)
+++ data/sql/krateis_cube.sql (revision 0)
@@ -0,0 +1,7 @@
+CREATE TABLE IF NOT EXISTS `krateis_cube` (
+  `charId` int(10) NOT NULL,
+  `played_matchs` int(10) NOT NULL,
+  `total_kills` int(10) NOT NULL,
+  `total_coins` double(10,0) NOT NULL DEFAULT '0',
+  PRIMARY KEY  (`charId`)
+) DEFAULT CHARSET=utf8;
\ No newline at end of file
Index: data/data/scripts/ai/group_template/KrateisCubeMobs.py
===================================================================
--- data/data/scripts/ai/group_template/KrateisCubeMobs.py (revision 0)
+++ data/data/scripts/ai/group_template/KrateisCubeMobs.py (revision 0)
@@ -0,0 +1,20 @@
+# By Psycho(killer1888)
+import sys
+from net.sf.l2j.gameserver.instancemanager        import KrateisCubeManager
+from net.sf.l2j.gameserver.model.quest.jython     import QuestJython as JQuest
+
+class KrateisCubeMobs (JQuest) :
+
+ def __init__(self,id,name,descr):
+ JQuest.__init__(self,id,name,descr)
+
+ def onKill(self,npc,player,isPet):
+ KrateisCubeManager.getInstance().addKill(player)
+ return
+
+QUEST = KrateisCubeMobs(-1,"KrateisCubeMobs","ai")
+
+i = 18579
+while i <= 18602:
+ QUEST.addKillId(i)
+ i += 1
\ No newline at end of file
Index: data/tools/database_installer.bat
===================================================================
--- data/tools/database_installer.bat (revision 1451)
+++ data/tools/database_installer.bat (working copy)
@@ -582,6 +582,7 @@
 items.sql
 itemsonground.sql
 kamaloka.sql
+krateis_cube.sql
 locations.sql
 lvlupgain.sql
 mapregion.sql
Index: data/data/html/krateisCube/32504.htm
===================================================================
--- data/data/html/krateisCube/32504.htm (revision 0)
+++ data/data/html/krateisCube/32504.htm (revision 0)
@@ -0,0 +1,3 @@
+<html><body>Kratei's Cube Match Manager:<br>
+<a action="bypass -h npc_%objectId%_TeleportIn">Teleport me inside again!</a>
+</body></html>
\ No newline at end of file
Index: data/data/instances/krateisCube.xml
===================================================================
--- data/data/instances/krateisCube.xml (revision 0)
+++ data/data/instances/krateisCube.xml (revision 0)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Psycho -->
+<!-- Cube limit x+:-77304 x-:-86503 y+:-77208 y-:-86407 Room are 1199 square sided and have 2000 offset -->
+<list>
+  <zone id="1" name="Kratei's Cube Room 1" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4468,2" removeExit="4468"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-77304" y="-86407"/>
+      <point x="-78503" y="-85208"/>
+    </shape>
+  </zone>
+  <zone id="2" name="Kratei's Cube Room 2" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4644,2" removeExit="4644"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-79304" y="-86407"/>
+      <point x="-80503" y="-85208"/>
+    </shape>
+  </zone>
+  <zone id="3" name="Kratei's Cube Room 3" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4145,3" removeExit="4145"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-81304" y="-86407"/>
+      <point x="-82503" y="-85208"/>
+    </shape>
+  </zone>
+  <zone id="4" name="Kratei's Cube Room 4" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4648,2" removeExit="4648"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-83304" y="-86407"/>
+      <point x="-84503" y="-85208"/>
+    </shape>
+  </zone>
+  <zone id="5" name="Kratei's Cube Room 5" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4646,2" removeExit="4646"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-85304" y="-86407"/>
+      <point x="-86503" y="-85208"/>
+    </shape>
+  </zone>
+  <zone id="6" name="Kratei's Cube Room 6" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4150,6" removeExit="4150"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-77304" y="-84407"/>
+      <point x="-78503" y="-83208"/>
+    </shape>
+  </zone>
+  <zone id="7" name="Kratei's Cube Room 7" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4648,2" removeExit="4648"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-79304" y="-84407"/>
+      <point x="-80503" y="-83208"/>
+    </shape>
+  </zone>
+  <zone id="8" name="Kratei's Cube Room 8" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4148,5" removeExit="4148"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-81304" y="-84407"/>
+      <point x="-82503" y="-83208"/>
+    </shape>
+  </zone>
+  <zone id="9" name="Kratei's Cube Room 9" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4150,6" removeExit="4150"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-83304" y="-84407"/>
+      <point x="-84503" y="-83208"/>
+    </shape>
+  </zone>
+  <zone id="10" name="Kratei's Cube Room 10" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4148,5" removeExit="4148"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-85304" y="-84407"/>
+      <point x="-86503" y="-83208"/>
+    </shape>
+  </zone>
+  <zone id="11" name="Kratei's Cube Room 11" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4145,3" removeExit="4145"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-77304" y="-82407"/>
+      <point x="-78503" y="-81208"/>
+    </shape>
+  </zone>
+  <zone id="12" name="Kratei's Cube Room 12" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4646,2" removeExit="4646"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-79304" y="-82407"/>
+      <point x="-80503" y="-81208"/>
+    </shape>
+  </zone>
+  <zone id="13" name="Kratei's Cube Room 13" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4149,5" removeExit="4149"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-81304" y="-82407"/>
+      <point x="-82503" y="-81208"/>
+    </shape>
+  </zone>
+  <zone id="14" name="Kratei's Cube Room 14" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4646,2" removeExit="4646"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-83304" y="-82407"/>
+      <point x="-84503" y="-81208"/>
+    </shape>
+  </zone>
+  <zone id="15" name="Kratei's Cube Room 15" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4625,5" removeExit="4625"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-85304" y="-82407"/>
+      <point x="-86503" y="-81208"/>
+    </shape>
+  </zone>
+  <zone id="16" name="Kratei's Cube Room 16" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4149,5" removeExit="4149"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-77304" y="-80407"/>
+      <point x="-78503" y="-79208"/>
+    </shape>
+  </zone>
+  <zone id="17" name="Kratei's Cube Room 17" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4468,2" removeExit="4468"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-79304" y="-80407"/>
+      <point x="-80503" y="-79208"/>
+    </shape>
+  </zone>
+  <zone id="18" name="Kratei's Cube Room 18" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4625,5" removeExit="4625"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-81304" y="-80407"/>
+      <point x="-82503" y="-79208"/>
+    </shape>
+  </zone>
+  <zone id="19" name="Kratei's Cube Room 19" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4644,2" removeExit="4644"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-83304" y="-80407"/>
+      <point x="-84503" y="-79208"/>
+    </shape>
+  </zone>
+  <zone id="20" name="Kratei's Cube Room 20" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4150,6" removeExit="4150"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-85304" y="-80407"/>
+      <point x="-86503" y="-79208"/>
+    </shape>
+  </zone>
+  <zone id="21" name="Kratei's Cube Room 21" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4698,6" removeExit="4698"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-77304" y="-78407"/>
+      <point x="-78503" y="-77208"/>
+    </shape>
+  </zone>
+  <zone id="22" name="Kratei's Cube Room 22" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4646,2" removeExit="4646"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-79304" y="-78407"/>
+      <point x="-80503" y="-77208"/>
+    </shape>
+  </zone>
+  <zone id="23" name="Kratei's Cube Room 23" type="Danger">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4148,5" removeExit="4148"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-81304" y="-78407"/>
+      <point x="-82503" y="-77208"/>
+    </shape>
+  </zone>
+  <zone id="24" name="Kratei's Cube Room 24" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4468,2" removeExit="4468"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-83304" y="-78407"/>
+      <point x="-84503" y="-77208"/>
+    </shape>
+  </zone>
+  <zone id="25" name="Kratei's Cube Room 25" type="Regeneration">
+  <settings exitOnDeath="true" buffRepeat="true" affected="playable"/>
+    <skill applyEnter="4648,2" removeExit="4648"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-85304" y="-78407"/>
+      <point x="-86503" y="-77208"/>
+    </shape>
+  </zone>
+  <zone id="26" name="Kratei's Cube PvP Zone" type="Arena">
+  <settings pvp="Arena"/>
+  <restart_owner x="-87028" y="-81780" z="-8361"/>
+    <shape type="Rect" zMin="-8400" zMax="-8000">
+      <point x="-77200" y="-86600"/>
+      <point x="-86600" y="-77100"/>
+    </shape>
+  </zone>
+  <zone id="27" name="Kratei's Cube Waiting Zone">
+  <settings pvp="Peace"/>
+    <shape type="Rect" zMin="-8500" zMax="-8000">
+      <point x="-86611" y="-81287"/>
+      <point x="-87456" y="-82320"/>
+    </shape>
+  </zone>
+</list>
\ No newline at end of file
 

credits: Psycho

 

 

Link to comment
Share on other sites

 

+ public L2PcInstance findPlayer(int objectId)
+ {
+ L2Object obj = _allObjects.get(objectId);
+ 
+ if (obj instanceof L2PcInstance)
+ return (L2PcInstance) obj;
+ 
+ return null;
+ }

+

 

oh my god why????

Link to comment
Share on other sites

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.



×
×
  • Create New...