Noticias:

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

Menú Principal

Evento Town War Event

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

Tema anterior - Siguiente tema

Swarlog

Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTownWar.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTownWar.java (revision 0)
+++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTownWar.java (revision 0)
@@ -0,0 +1,185 @@
+
+package net.sf.l2j.gameserver.handler.admincommandhandlers;
+
+import java.util.Collection;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
+import net.sf.l2j.gameserver.instancemanager.TownManager;
+import net.sf.l2j.gameserver.model.L2Object;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.model.zone.type.L2TownZone;
+
+public class AdminTownWar implements IAdminCommandHandler
+{
+ private static final String[] ADMIN_COMMANDS =
+ {
+ "admin_townwar_start",
+ "admin_townwar_end"
+ };
+     private L2Object _activeObject;
+     public final L2Object getActiveObject()
+    {
+        return _activeObject;
+    }
+ public boolean useAdminCommand(String command, L2PcInstance activeChar)
+ {
+ if (command.startsWith("admin_townwar_start"))
+ {
+ startTW(activeChar);
+ }
+ if (command.startsWith("admin_townwar_end"))
+ {
+ endTW(activeChar);
+ }
+ return true;
+ }
+ @SuppressWarnings("deprecation")
+ private void startTW(L2PcInstance activeChar)
+ {
+ if (Config.TW_ALL_TOWNS)
+ {
+ TownManager.getTown(1).setParameter("isPeaceZone", "false");
+ TownManager.getTown(2).setParameter("isPeaceZone", "false");
+ TownManager.getTown(3).setParameter("isPeaceZone", "false");
+ TownManager.getTown(4).setParameter("isPeaceZone", "false");
+ TownManager.getTown(5).setParameter("isPeaceZone", "false");
+ TownManager.getTown(6).setParameter("isPeaceZone", "false");
+ TownManager.getTown(7).setParameter("isPeaceZone", "false");
+ TownManager.getTown(8).setParameter("isPeaceZone", "false");
+ TownManager.getTown(9).setParameter("isPeaceZone", "false");
+ TownManager.getTown(10).setParameter("isPeaceZone", "false");
+ TownManager.getTown(11).setParameter("isPeaceZone", "false");
+ TownManager.getTown(12).setParameter("isPeaceZone", "false");
+ TownManager.getTown(13).setParameter("isPeaceZone", "false");
+ TownManager.getTown(14).setParameter("isPeaceZone", "false");
+ TownManager.getTown(15).setParameter("isPeaceZone", "false");
+ TownManager.getTown(16).setParameter("isPeaceZone", "false");
+ TownManager.getTown(17).setParameter("isPeaceZone", "false");
+ TownManager.getTown(19).setParameter("isPeaceZone", "false");
+ TownManager.getTown(20).setParameter("isPeaceZone", "false");
+ }
+ if (!Config.TW_ALL_TOWNS && Config.TW_TOWN_ID != 18 && Config.TW_TOWN_ID != 21 && Config.TW_TOWN_ID != 22)
+ {
+ TownManager.getTown(Config.TW_TOWN_ID).setParameter("isPeaceZone", "false");
+ }
+
+ Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
+ {
+            int x,y,z;
+            L2TownZone Town;
+            byte zonaPaz = 1;
+           
+          for (L2PcInstance onlinePlayer : pls)
+               if (onlinePlayer.isOnline() == 1 )
+                  {
+                  x = onlinePlayer.getX();
+                  y = onlinePlayer.getY();
+                  z = onlinePlayer.getZ();
+                 
+                  Town = TownManager.getTown(x, y, z);
+                  if (Town != null)
+                  {
+                  if(Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
+                  {
+                  onlinePlayer.setInsideZone(zonaPaz, false);
+                          onlinePlayer.revalidateZone(true);
+                  }
+                  else if (Config.TW_ALL_TOWNS)
+                  {
+                  onlinePlayer.setInsideZone(zonaPaz, false);
+                          onlinePlayer.revalidateZone(true);
+                  }
+                  }
+                  onlinePlayer.setInTownWar(true);
+                   }
+ }
+
+ if (Config.TW_ALL_TOWNS)
+ {
+ Announcements.getInstance().announceToAll("All towns have been set war zone by " + activeChar.getName() + ".");
+ }
+ if (!Config.TW_ALL_TOWNS)
+ {
+ Announcements.getInstance().announceToAll(TownManager.getTown(Config.TW_TOWN_ID).getName() + " has been set war zone by " + activeChar.getName() + ".");
+ }
+ }
+
+
+ @SuppressWarnings("deprecation")
+ private void endTW(L2PcInstance activeChar)
+ {
+ if (Config.TW_ALL_TOWNS)
+ {
+ TownManager.getTown(1).setParameter("isPeaceZone", "true");
+ TownManager.getTown(2).setParameter("isPeaceZone", "true");
+ TownManager.getTown(3).setParameter("isPeaceZone", "true");
+ TownManager.getTown(4).setParameter("isPeaceZone", "true");
+ TownManager.getTown(5).setParameter("isPeaceZone", "true");
+ TownManager.getTown(6).setParameter("isPeaceZone", "true");
+ TownManager.getTown(7).setParameter("isPeaceZone", "true");
+ TownManager.getTown(8).setParameter("isPeaceZone", "true");
+ TownManager.getTown(9).setParameter("isPeaceZone", "true");
+ TownManager.getTown(10).setParameter("isPeaceZone", "true");
+ TownManager.getTown(11).setParameter("isPeaceZone", "true");
+ TownManager.getTown(12).setParameter("isPeaceZone", "true");
+ TownManager.getTown(13).setParameter("isPeaceZone", "true");
+ TownManager.getTown(14).setParameter("isPeaceZone", "true");
+ TownManager.getTown(15).setParameter("isPeaceZone", "true");
+ TownManager.getTown(16).setParameter("isPeaceZone", "true");
+ TownManager.getTown(17).setParameter("isPeaceZone", "true");
+ TownManager.getTown(19).setParameter("isPeaceZone", "true");
+ TownManager.getTown(20).setParameter("isPeaceZone", "true");
+ }
+ if (!Config.TW_ALL_TOWNS && Config.TW_TOWN_ID != 18 && Config.TW_TOWN_ID != 21 && Config.TW_TOWN_ID != 22)
+ {
+ TownManager.getTown(Config.TW_TOWN_ID).setParameter("isPeaceZone", "true");
+ }
+
+ Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
+ {
+             int xx,yy,zz;
+             L2TownZone Town;
+             byte zonaPaz = 1;
+
+            for (L2PcInstance onlinePlayer : pls)
+              if (onlinePlayer.isOnline() == 1 )
+                  {
+                  xx = onlinePlayer.getX();
+                  yy = onlinePlayer.getY();
+                  zz = onlinePlayer.getZ();
+                 
+                  Town = TownManager.getTown(xx,yy,zz);
+                  if (Town != null)
+                  {
+                  if(Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
+                  {
+                  onlinePlayer.setInsideZone(zonaPaz, true);
+                          onlinePlayer.revalidateZone(true);
+                  }
+                  else if (Config.TW_ALL_TOWNS)
+                  {
+                  onlinePlayer.setInsideZone(zonaPaz, true);
+                          onlinePlayer.revalidateZone(true);
+                  }
+                  }
+                  onlinePlayer.setInTownWar(false);
+                  }
+            }
+ if (Config.TW_ALL_TOWNS)
+ {
+ Announcements.getInstance().announceToAll("All towns have been set back to normal by " + activeChar.getName() + ".");
+ }
+ if (!Config.TW_ALL_TOWNS)
+ {
+ Announcements.getInstance().announceToAll(TownManager.getTown(Config.TW_TOWN_ID).getName() + " has been set back to normal by " + activeChar.getName() + ".");
+ }
+ }
+
+ public String[] getAdminCommandList()
+ {
+ return ADMIN_COMMANDS;
+ }
+}\ No newline at end of file
Index: java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 2797)
+++ java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (working copy)
@@ -105,6 +105,7 @@
  registerAdminCommandHandler(new AdminTvTEvent());
  registerAdminCommandHandler(new AdminUnblockIp());
  registerAdminCommandHandler(new AdminZone());
+ registerAdminCommandHandler(new AdminTownWar());
  _log.config("AdminCommandHandler: Loaded " + _datatable.size() + " handlers.");
  }
 
Index: java/net/sf/l2j/gameserver/model/L2Character.java
===================================================================
--- java/net/sf/l2j/gameserver/model/L2Character.java (revision 2797)
+++ java/net/sf/l2j/gameserver/model/L2Character.java (working copy)
@@ -75,6 +75,7 @@
 import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
 import net.sf.l2j.gameserver.model.quest.Quest;
 import net.sf.l2j.gameserver.model.quest.QuestState;
+import net.sf.l2j.gameserver.model.zone.type.L2TownZone;
 import net.sf.l2j.gameserver.network.SystemMessageId;
 import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
 import net.sf.l2j.gameserver.network.serverpackets.Attack;
@@ -559,8 +566,31 @@
  * <li>Modify the position of the pet if necessary</li><BR><BR>
  *
  */
+     private boolean _inTownWar;
+ public final boolean isinTownWar() { return _inTownWar; }
+ public final void setInTownWar(boolean value) { _inTownWar = value; }
  public void teleToLocation(int x, int y, int z, boolean allowRandomOffset)
  {
+ if(Config.TW_DISABLE_GK)
+ {
+ int x1,y1,z1;
+ x1 = getX();
+ y1 = getY();
+ z1 = getZ();
+ L2TownZone Town;
+ Town = TownManager.getTown(x1,y1,z1);
+ if (Town != null && isinTownWar() )
+ {
+       if (Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
+         {
+       return;
+         }
+         else if (Config.TW_ALL_TOWNS)
+         {
+     return;
+         }
+ }
+ }
  // Stop movement
  stopMove(null, false);
  abortAttack();
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 2797)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -81,6 +81,7 @@
 import net.sf.l2j.gameserver.instancemanager.ItemsOnGroundManager;
 import net.sf.l2j.gameserver.instancemanager.QuestManager;
 import net.sf.l2j.gameserver.instancemanager.SiegeManager;
+import net.sf.l2j.gameserver.instancemanager.TownManager;
 import net.sf.l2j.gameserver.model.BlockList;
 import net.sf.l2j.gameserver.model.FishData;
 import net.sf.l2j.gameserver.model.L2AccessLevel;
@@ -139,6 +140,7 @@
 import net.sf.l2j.gameserver.model.quest.Quest;
 import net.sf.l2j.gameserver.model.quest.QuestState;
 import net.sf.l2j.gameserver.model.quest.State;
+import net.sf.l2j.gameserver.model.zone.type.L2TownZone;
 import net.sf.l2j.gameserver.network.L2GameClient;
 import net.sf.l2j.gameserver.network.SystemMessageId;
 import net.sf.l2j.gameserver.network.serverpackets.AbnormalStatusUpdate;

@@ -4950,6 +4952,26 @@
  @Override
  public boolean doDie(L2Character killer)
  {
+ if (Config.TW_RESS_ON_DIE)
+ {
+ int x1,y1,z1;
+ x1 = getX();
+ y1 = getY();
+ z1 = getZ();
+ L2TownZone Town;
+ Town = TownManager.getTown(x1,y1,z1);
+ if (Town != null && isinTownWar())
+ {
+ if (Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
+ {
+ reviveRequest(this, null, false);
+ }
+ else if (Config.TW_ALL_TOWNS)
+ {
+ reviveRequest(this, null, false);
+ }
+ }
+ }
  // Kill the L2PcInstance
  if (!super.doDie(killer))
  return false;
@@ -5283,6 +5285,25 @@
      */
     public void increasePvpKills()
     {
+      int x,y,z;
+    x = getX();
+      y = getY();
+      z = getZ();
+        L2TownZone Town;
+      Town = TownManager.getTown(x,y,z);
+      if (Town != null && isinTownWar())
+      {
+      if (Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
+        {
+        getInventory().addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, this, this);
+        sendMessage("You received your prize for a town war kill!");
+        }
+        else if (Config.TW_ALL_TOWNS)
+        {
+     getInventory().addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, this, this);
+     sendMessage("You received your prize for a town war kill!");
+        }
+      }
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);
@@ -5334,8 +5355,42 @@
             newKarma = Integer.MAX_VALUE - getKarma();
 
         // Add karma to attacker and increase its PK counter
+        int x,y,z;
+    x = getX();
+      y = getY();
+      z = getZ();
+        L2TownZone Town;
+      Town = TownManager.getTown(x,y,z);
+     
         setPkKills(getPkKills() + 1);
-        setKarma(getKarma() + newKarma);
+         if (Town != null && isinTownWar())
+         {
+         //nothing
+         }
+         else if (Town != null && !isinTownWar())
+         {
+        setKarma(getKarma() + newKarma);
+         }
+         else if (Town == null)
+         {
+        setKarma(getKarma() + newKarma);
+         }
+     
+         
+         if (Town != null && isinTownWar())
+      {
+      if (Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
+        {
+        getInventory().addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, this, this);
+        sendMessage("You received your prize for a town war kill!");
+        }
+        else if (Config.TW_ALL_TOWNS && Town.getTownId() != 0)
+        {
+     getInventory().addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, this, this);
+     sendMessage("You received your prize for a town war kill!");
+        }
+      }
+               
 
         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
         sendPacket(new UserInfo(this));

@@ -11945,30 +12084,51 @@
      }
      super.setIsCastingNow(value);
     }
-    public void checkItemRestriction()
-    {
-    for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
+
+ /**
+ * @param b
+ */
+    private boolean isintwtown = false;
+   
+    public boolean isInsideTWTown()
+ {
+    if (isintwtown)
      {
-    L2ItemInstance equippedItem = getInventory().getPaperdollItem(i);
-    if (equippedItem != null && !equippedItem.getItem().checkCondition(this, this))
-    {
- getInventory().unEquipItemInSlotAndRecord(i);
- if (equippedItem.isWear())
- continue;
- SystemMessage sm = null;
- if (equippedItem.getEnchantLevel() > 0)
- {
- sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
- sm.addNumber(equippedItem.getEnchantLevel());
- sm.addItemName(equippedItem);
- }
- else
- {
- sm = new SystemMessage(SystemMessageId.S1_DISARMED);
- sm.addItemName(equippedItem);
- }
- sendPacket(sm);
-    }
+    return true;
      }
-    }
+ else
+ return false;
+
+ }
+   
+ public void setInsideTWTown(boolean b)
+ {
+ isintwtown = true;
+ }
+     public void checkItemRestriction()
+     {
+     for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
+     {
+     L2ItemInstance equippedItem = getInventory().getPaperdollItem(i);
+     if (equippedItem != null && !equippedItem.getItem().checkCondition(this, this))
+     {
+ getInventory().unEquipItemInSlotAndRecord(i);
+ if (equippedItem.isWear())
+ continue;
+ SystemMessage sm = null;
+ if (equippedItem.getEnchantLevel() > 0)
+ {
+ sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
+ sm.addNumber(equippedItem.getEnchantLevel());
+ sm.addItemName(equippedItem);
+ }
+ else
+ {
+ sm = new SystemMessage(SystemMessageId.S1_DISARMED);
+ sm.addItemName(equippedItem);
+ }
+ sendPacket(sm);
+     }
+     }
+    }
 }
Index: java/net/sf/l2j/gameserver/instancemanager/TownManager.java
===================================================================
--- java/net/sf/l2j/gameserver/instancemanager/TownManager.java (revision 2797)
+++ java/net/sf/l2j/gameserver/instancemanager/TownManager.java (working copy)
@@ -14,12 +14,14 @@
  */
 package net.sf.l2j.gameserver.instancemanager;
 
+import java.util.logging.Logger;
+
+import javolution.util.FastList;
 import net.sf.l2j.gameserver.datatables.MapRegionTable;
 import net.sf.l2j.gameserver.model.L2Object;
 import net.sf.l2j.gameserver.model.entity.Castle;
+import net.sf.l2j.gameserver.model.zone.type.L2TownZone;
 import net.sf.l2j.gameserver.model.zone.L2ZoneType;
-import net.sf.l2j.gameserver.model.zone.type.L2TownZone;
-
 public class TownManager
 {
     //private static final Logger _log = Logger.getLogger(TownManager.class.getName());
@@ -167,12 +169,11 @@
 
     public final static L2TownZone getTown(int townId)
     {
-    for (L2ZoneType temp : ZoneManager.getInstance().getAllZones())
-    {
-        if (temp instanceof L2TownZone && ((L2TownZone) temp).getTownId() == townId)
-        return (L2TownZone) temp;
-    }
-        return null;
+        for (L2ZoneType temp : ZoneManager.getInstance().getAllZones())
+        {
+            if (temp instanceof L2TownZone && ((L2TownZone) temp).getTownId() == townId)
+            return (L2TownZone) temp;
+        }        return null;
     }
 
     /**
@@ -184,11 +185,10 @@
      */
     public final static L2TownZone getTown(int x, int y, int z)
     {
-        for (L2ZoneType temp : ZoneManager.getInstance().getZones(x, y, z))
-        {
-        if (temp instanceof L2TownZone)
-        return (L2TownZone) temp;
-        }
-        return null;
+            for (L2ZoneType temp : ZoneManager.getInstance().getZones(x, y, z))
+            {
+            if (temp instanceof L2TownZone)
+            return (L2TownZone) temp;
+            }        return null;
     }
 }
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 2797)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -109,6 +109,7 @@
     public static Map<Integer, Integer> SKILL_REUSE_LIST;
     public static boolean AUTO_LEARN_SKILLS;
     public static boolean AUTO_LOOT_HERBS;
+    public static boolean AUTO_LOOT_RAID;
     public static byte BUFFS_MAX_AMOUNT;
     public static byte DANCES_MAX_AMOUNT;
     public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
@@ -395,6 +396,7 @@
     public static int MIN_MONSTER_ANIMATION;
     public static int MAX_MONSTER_ANIMATION;
     public static int COORD_SYNCHRONIZE;
+    public static int MULTISELL_MAX_AMOUNT;
     public static boolean GRIDS_ALWAYS_ON;
     public static int GRID_NEIGHBOR_TURNON_TIME;
     public static int GRID_NEIGHBOR_TURNOFF_TIME;
@@ -560,7 +562,12 @@
     public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
     public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
     public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
-   
+    public static int TW_TOWN_ID;
+    public static boolean TW_ALL_TOWNS;
+    public static int TW_ITEM_ID;
+    public static int TW_ITEM_AMOUNT;
+    public static boolean TW_ALLOW_KARMA;
+    public static boolean TW_DISABLE_GK;
+    public static boolean TW_RESS_ON_DIE;
     /** ************************************************** **/
  /** L2JMods Settings -End                              **/
  /** ************************************************** **/
@@ -1344,6 +1351,7 @@
                  ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
                  STARTING_ADENA = Integer.parseInt(Character.getProperty("StartingAdena", "100"));
                  AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "true"));
+                 AUTO_LOOT_RAID = Boolean.parseBoolean(Character.getProperty("AutoLootRaid", "true"));
                  UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
                  PLAYER_SPAWN_PROTECTION = Integer.parseInt(Character.getProperty("PlayerSpawnProtection", "0"));
                  RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(Character.getProperty("RespawnRandomInTown", "False"));
@@ -1512,6 +1520,7 @@
                  MIN_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MinMonsterAnimation", "5"));
                  MAX_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MaxMonsterAnimation", "20"));
                  COORD_SYNCHRONIZE = Integer.parseInt(General.getProperty("CoordSynchronize", "-1"));
+                 MULTISELL_MAX_AMOUNT      = Integer.parseInt(General.getProperty("MaxAmountBuy", "5000"));
                  GRIDS_ALWAYS_ON = Boolean.parseBoolean(General.getProperty("GridsAlwaysOn", "False"));
                  GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOnTime", "1"));
                  GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOffTime", "90"));
@@ -1767,7 +1776,15 @@
                  L2JMOD_ENABLE_WAREHOUSESORTING_CLAN     = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
                  L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE  = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
                  L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT  = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingFreight", "False"));
-
+                
+                 TW_TOWN_ID                    = Integer.parseInt(L2JModSettings.getProperty("TWTownId", "9"));                
+                 TW_ALL_TOWNS   = Boolean.parseBoolean(L2JModSettings.getProperty("TWAllTowns", "False"));
+                 TW_ITEM_ID                    = Integer.parseInt(L2JModSettings.getProperty("TownWarItemId", "57"));
+                 TW_ITEM_AMOUNT                    = Integer.parseInt(L2JModSettings.getProperty("TownWarItemAmount", "5000"));
+                 TW_ALLOW_KARMA   = Boolean.parseBoolean(L2JModSettings.getProperty("AllowKarma", "False"));
+                 TW_DISABLE_GK   = Boolean.parseBoolean(L2JModSettings.getProperty("DisableGK", "True"));
+                 TW_RESS_ON_DIE   = Boolean.parseBoolean(L2JModSettings.getProperty("SendRessOnDeath", "False"));
+
+                
                  if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
                  {
                      TVT_EVENT_ENABLED = false;
@@ -2104,6 +2121,7 @@
         else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
         else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
         else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("MaxAmountBuy")) MULTISELL_MAX_AMOUNT = Integer.parseInt(pValue);
         else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);
 
         else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
@@ -2249,6 +2267,7 @@
         else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
         else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.parseBoolean(pValue);
         else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.parseBoolean(pValue);
+        else if (pName.equalsIgnoreCase("AutoLootRaid")) AUTO_LOOT_RAID = Boolean.parseBoolean(pValue);
         else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
 
         else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
@@ -2298,7 +2317,14 @@
         else if (pName.equalsIgnoreCase("TvTEventParticipationTime")) TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
         else if (pName.equalsIgnoreCase("TvTEventRunningTime")) TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
         else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId")) TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
-       
+
+        else if (pName.equalsIgnoreCase("TownWarItemId")) TW_ITEM_ID = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("TownWarItemAmount")) TW_ITEM_AMOUNT = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AllowKarma")) TW_ALLOW_KARMA = Boolean.parseBoolean(pValue);
+        else if (pName.equalsIgnoreCase("DisableGK")) TW_DISABLE_GK = Boolean.parseBoolean(pValue);
+        else if (pName.equalsIgnoreCase("TWTownId")) TW_TOWN_ID = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("TWAllTowns")) TW_ALL_TOWNS = Boolean.parseBoolean(pValue);
+        else if (pName.equalsIgnoreCase("SendRessOnDeath")) TW_RESS_ON_DIE = Boolean.parseBoolean(pValue);
+
         // L2JMOD Warehouse Sorting
         else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan")) L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
         else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate")) L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties (revision 2797)
+++ java/config/l2jmods.properties (working copy)
@@ -161,4 +161,51 @@
 #----------------------------------
 EnableWarehouseSortingClan = False
 EnableWarehouseSortingPrivate = False
-EnableWarehouseSortingFreight = False
\ No newline at end of file
+EnableWarehouseSortingFreight = False
+
+#----------------------------------
+#Town War
+#----------------------------------
+# //townwar_start - Starts town war in Giran
+# //townwar_end - Ends townwar in Giran
+# Town id
+#2: // Talking Island
+#3: // Elven village
+#1: // Dark elf village
+#4: // Orc village
+#6: // Dwarven village
+#7: // Gludio
+#5: // Gludin
+#8: // Dion
+#9: // Giran
+#10: // Oren
+#12: // Aden
+#11: // Hunters village
+#9: // Giran Harbour
+#15: // Heine
+#14: // Rune
+#13: // Goddard
+#17: // Schuttgart
+#16: // Floran
+#20: //Kamael Village
+TWTownId = 9
+
+#Set all towns?
+TWAllTowns = False
+
+#Reward for each kill:
+
+TownWarItemId = 57
+TownWarItemAmount = 5000
+
+# Give PKers karma during townwar?
+AllowKarma = False
+
+# Disable GK while in event?
+DisableGK = True
+
+# If yes it will send a ressurect ask on death.
+# If no when you die youll be there dead until the event ends.
+# Set to false if you want KOTH town.
+SendRessOnDeath = false
+