Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Zona Caótica

Iniciado por Swarlog, Ago 12, 2022, 02:19 AM

Tema anterior - Siguiente tema

Swarlog

CitarDATA:

### Eclipse Workspace Patch 1.0
#P L2J_DataPack
Index: dist/game/data/scripts/handlers/voicedcommandhandlers/Home.java
===================================================================
--- dist/game/data/scripts/handlers/voicedcommandhandlers/Home.java (revision 0)
+++ dist/game/data/scripts/handlers/voicedcommandhandlers/Home.java (revision 0)
@@ -0,0 +1,94 @@
+/*
+ * 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.voicedcommandhandlers;
+
+import com.l2jserver.gameserver.datatables.MapRegionTable;
+import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
+import com.l2jserver.gameserver.model.Location;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+
+/**
+ * ===Jeff===
+ *
+ */
+public class Home implements IVoicedCommandHandler
+{
+    private static final String[] VOICED_COMMANDS = { "home" };
+    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+    {   
+        if (command.equalsIgnoreCase("home"))
+        {
+        if(activeChar.isDead())
+        {
+                activeChar.sendMessage("You cannot use this feature if you're dead.");
+               return false;
+             }
+             if(activeChar.isInOlympiadMode())
+              {
+              activeChar.sendMessage("You cannot use this feature during olympiad.");
+             return false;
+           }
+           if(activeChar.isInJail())
+             {
+              activeChar.sendMessage("You cannot use this command while you are in Jail.");
+             return false;
+           }
+           if(activeChar.isInDuel())
+            {
+             activeChar.sendMessage("You cannot use this feature during Duel.");
+            return false;
+          }
+          if(activeChar.isFestivalParticipant())
+           {
+            activeChar.sendMessage("You cannot use this feature during a Festival.");
+           return false;
+          }
+          if(activeChar.inObserverMode())
+           {
+            activeChar.sendMessage("You cannot use this feature during Observer Mode.");
+           return false;
+          }
+           if(activeChar.getInventory().getItemByItemId(57) == null)
+           {
+              activeChar.sendMessage("You don't have enough adena to use command .home");
+             return false;
+           }   
+           if(activeChar instanceof L2PcInstance && ((L2PcInstance)activeChar).getWorldRegion().containsZone(42490))
+        {
+              activeChar.sendMessage("You will be send to nearest town!");
+              activeChar.getInventory().destroyItemByItemId("root", 57, 500, activeChar, activeChar.getTarget());
+              activeChar.broadcastUserInfo();
+              Location loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
+              activeChar.setInstanceId(0);
+              activeChar.teleToLocation(loc, true);
+        }
+        else
+        {
+        activeChar.sendMessage("Command .home can only be used inside Chaotic Zone");
+        }
+        }
+       return true;
+    }
+    public static int teleToLocation()
+ {
+ return teleToLocation();
+ }
+    public String[] getVoicedCommandList()
+    {
+        return VOICED_COMMANDS;
+    }
+
+}
\ No newline at end of file
Index: dist/game/data/scripts/handlers/MasterHandler.java
===================================================================
--- dist/game/data/scripts/handlers/MasterHandler.java (revision 8427)
+++ dist/game/data/scripts/handlers/MasterHandler.java (working copy)
@@ -240,12 +251,20 @@
 import handlers.voicedcommandhandlers.TvTVoicedInfo;
+import handlers.voicedcommandhandlers.Home;
 import handlers.voicedcommandhandlers.Wedding;
 import handlers.voicedcommandhandlers.stats;
 
 import java.util.logging.Logger;
@@ -535,7 +565,16 @@
 
  private static void loadVoicedHandlers()
  {
  VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());
+ VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Home());
                if (Config.L2JMOD_ALLOW_WEDDING)
  VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding());
  if (Config.BANKING_SYSTEM_ENABLED)

CitarCORE:

Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 4967)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -613,6 +625,11 @@
  /** The Clan Identifier of the L2PcInstance */
  private int _clanId;
 
+ //Chaotic Zone
+ private static int[] _x = {11551, 10999, 10401, 9472, 6918, 9780};
+    private static int[] _y = {-24264, -23576, -24030, -23369, -23188, -22286};
+    private static int[] _z = {-3644, -3651, -3660, -3703, -3653, -3699};
+
  /** The Clan object of the L2PcInstance */
  private L2Clan _clan;

@@ -2000,6 +2131,13 @@
  ExSetCompassZoneCode cz = new ExSetCompassZoneCode(ExSetCompassZoneCode.SIEGEWARZONE2);
  sendPacket(cz);
  }
+ else if (isInsideZone(ZONE_CHAOTIC))
+ {
+ if (_lastCompassZone == ExSetCompassZoneCode.CHAOTICZONE) return;
+ _lastCompassZone = ExSetCompassZoneCode.CHAOTICZONE;
+ ExSetCompassZoneCode cz = new ExSetCompassZoneCode(ExSetCompassZoneCode.CHAOTICZONE);
+ sendPacket(cz);
+ }
  else if (isInsideZone(ZONE_PVP))
  {
  if (_lastCompassZone == ExSetCompassZoneCode.PVPZONE) return;
@@ -5349,6 +5593,36 @@
  Announcements.getInstance().announceToAll(msg);
  }
  }
+ if (isInsideZone(ZONE_CHAOTIC))
+ {
+ {
+ sendMessage("Get ready! You will be revive in 5 seconds!");
+ ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
+ {
+ public void run()
+ {
+ int r = Rnd.get(3);
+ teleToLocation(_x[r] , _y[r], _z[r]);
+ doRevive();
+ }
+ }, 5000);
+ }
+ }
 
  broadcastStatusUpdate();
  // Clear resurrect xp calculation

Index: java/com/l2jserver/gameserver/network/serverpackets/Die.java
===================================================================
--- java/com/l2jserver/gameserver/network/serverpackets/Die.java (revision 4967)
+++ java/com/l2jserver/gameserver/network/serverpackets/Die.java (working copy)
@@ -62,10 +63,13 @@
 
  }
  _charObjId = cha.getObjectId();
_canTeleport = !((cha instanceof L2PcInstance && TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(_charObjId)) || cha.isPendingRevive());
  if (cha instanceof L2Attackable)
  _sweepable = ((L2Attackable)cha).isSweepActive();
 
+ if(cha instanceof L2PcInstance && ((L2PcInstance)cha).getWorldRegion().containsZone(42490))
+            _canTeleport = false;
+
  }
Index: java/com/l2jserver/gameserver/network/SystemMessageId.java
===================================================================
--- java/com/l2jserver/gameserver/network/SystemMessageId.java (revision 4967)
+++ java/com/l2jserver/gameserver/network/SystemMessageId.java (working copy)
@@ -14693,6 +14693,25 @@
  public static final SystemMessageId THOMAS_D_TURKEY_DISAPPEARED;
 
  /**
+ * ID: 6510<br>
+ * Message: Chaotic Zone
+ */
+ public static final SystemMessageId CHAOTIC_ZONE;
+
+
+ /**
  * Array containing all SystemMessageIds<br>
  * Important: Always initialize with a length of the highest SystemMessageId + 1!!!
  */
@@ -17116,7 +17135,9 @@
  THOMAS_D_TURKEY_APPEARED = new SystemMessageId(6503);
  THOMAS_D_TURKEY_DEFETED = new SystemMessageId(6504);
  THOMAS_D_TURKEY_DISAPPEARED = new SystemMessageId(6505);
-
+ CHAOTIC_ZONE = new SystemMessageId(6510);
  buildFastLookupTable();
  }
Index: java/com/l2jserver/gameserver/network/serverpackets/ExSetCompassZoneCode.java
===================================================================
--- java/com/l2jserver/gameserver/network/serverpackets/ExSetCompassZoneCode.java (revision 4967)
+++ java/com/l2jserver/gameserver/network/serverpackets/ExSetCompassZoneCode.java (working copy)
@@ -23,12 +23,13 @@
  private static final String _S__FE_32_EXSETCOMPASSZONECODE = "[S] FE:33 ExSetCompassZoneCode";
 
  public static final int ALTEREDZONE = 0x08;
public static final int SIEGEWARZONE1 = 0x0A;
  public static final int SIEGEWARZONE2 = 0x0B;
  public static final int PEACEZONE = 0x0C;
  public static final int SEVENSIGNSZONE = 0x0D;
  public static final int PVPZONE = 0x0E;
  public static final int GENERALZONE = 0x0F;
+ public static final int CHAOTICZONE = 0x09;
 
  private int _zoneType;
Index: java/com/l2jserver/gameserver/model/zone/type/L2ChaoticZone.java
===================================================================
--- java/com/l2jserver/gameserver/model/zone/type/L2ChaoticZone.java (revision 0)
+++ java/com/l2jserver/gameserver/model/zone/type/L2ChaoticZone.java (revision 0)
@@ -0,0 +1,82 @@
+/*
+ * 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 com.l2jserver.gameserver.model.zone.type;
+
+import com.l2jserver.gameserver.datatables.SkillTable;
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.zone.L2SpawnZone;
+
+
+/**
+ * Diffrent Version of Chaotic Zone
+ *
+ * @author  Jeff
+ */
+public class L2ChaoticZone extends L2SpawnZone
+{
+ public L2ChaoticZone(int id)
+ {
+ super(42490);
+ }
+
+ @Override
+ protected void onEnter(L2Character character)
+ {
+ character.setInsideZone(L2Character.ZONE_CHAOTIC, true);
+ character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);
+ character.setInsideZone(L2Character.ZONE_NOSTORE, true);
+ character.setInsideZone(L2Character.ZONE_NOBOOKMARK, true);
+ character.setInsideZone(L2Character.ZONE_NOITEMDROP, true);
+
+        if (character instanceof L2PcInstance)
+        {
+            ((L2PcInstance) character).setPvpFlag(1);
+            ((L2PcInstance) character).sendMessage("You entered a Chaotic Zone");
+            ((L2PcInstance) character).broadcastUserInfo();
+        }
+ }
+
+ @Override
+ protected void onExit(L2Character character)
+ {
+ character.setInsideZone(L2Character.ZONE_CHAOTIC, false);
+ character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
+ character.setInsideZone(L2Character.ZONE_NOSTORE, false);
+ character.setInsideZone(L2Character.ZONE_NOBOOKMARK, false);
+ character.setInsideZone(L2Character.ZONE_NOITEMDROP, false);
+
+ if (character instanceof L2PcInstance)
+ {
+ ((L2PcInstance) character).sendMessage("You left a Chaotic Zone");
+ ((L2PcInstance) character).setPvpFlag(0);
+ ((L2PcInstance) character).broadcastUserInfo();
+ }
+ }
+
+ @Override
+ public void onDieInside(L2Character character)
+ {
+        if (character instanceof L2PcInstance)
+        {
+        }
+ }
+
+ @Override
+ public void onReviveInside(L2Character character)
+ {
+        SkillTable.getInstance().getInfo(1323, 1).getEffects(character, character);
+ }
+}
\ No newline at end of file
Index: java/com/l2jserver/gameserver/network/clientpackets/Logout.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/Logout.java (revision 4967)
+++ java/com/l2jserver/gameserver/network/clientpackets/Logout.java (working copy)
@@ -83,6 +85,14 @@
  return;
  }
 
+ //Chaotic Zone
+ if (player.isInsideZone(player.ZONE_CHAOTIC))
+ {
+ player.sendMessage("You cannot log out while you are inside Chaotic Zone.");
+ sendPacket(RestartResponse.valueOf(false));
+ return;
+ }
+
  // Prevent player from logging out if they are a festival participant
  // and it is in progress, otherwise notify party members that the player
  // is not longer a participant.
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java (revision 4967)
+++ java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java (working copy)
@@ -87,6 +88,15 @@
  return;
  }
 
+ //Chaotic Zone
+ if (player.isInsideZone(player.ZONE_CHAOTIC))
+ {
+ player.sendMessage("You cannot restart while you are inside Chaotic Zone.");
+ sendPacket(RestartResponse.valueOf(false));
+ return;
+ }
+
+
  // Prevent player from restarting if they are a festival participant
  // and it is in progress, otherwise notify party members that the player
  // is not longer a participant.