Browse Source

L2J Public release No. 1
Codename - Informative Idiotus
Changelog will be possibly posted later (changes are self-explanatory)
Enjoy. Next release scheduled to 30/11/2010 16:34 CET.

JIV 14 years ago
parent
commit
7346e4a502
49 changed files with 3397 additions and 3309 deletions
  1. 57 15
      L2_GameServer/java/com/l2jserver/Config.java
  2. 3 1
      L2_GameServer/java/com/l2jserver/gameserver/GameServer.java
  3. 7 0
      L2_GameServer/java/com/l2jserver/gameserver/datatables/DoorTable.java
  4. 8 11
      L2_GameServer/java/com/l2jserver/gameserver/datatables/NpcTable.java
  5. 212 3
      L2_GameServer/java/com/l2jserver/gameserver/instancemanager/AntiFeedManager.java
  6. 9 0
      L2_GameServer/java/com/l2jserver/gameserver/model/CharSelectInfoPackage.java
  7. 3 1
      L2_GameServer/java/com/l2jserver/gameserver/model/L2ItemInstance.java
  8. 89 57
      L2_GameServer/java/com/l2jserver/gameserver/model/L2Manor.java
  9. 8 2
      L2_GameServer/java/com/l2jserver/gameserver/model/L2Skill.java
  10. 6 0
      L2_GameServer/java/com/l2jserver/gameserver/model/L2Transformation.java
  11. 1 1
      L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Character.java
  12. 7 4
      L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Decoy.java
  13. 1 1
      L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Npc.java
  14. 15 6
      L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Summon.java
  15. 42 1
      L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2DoorInstance.java
  16. 2630 2588
      L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
  17. 0 28
      L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java
  18. 1 1
      L2_GameServer/java/com/l2jserver/gameserver/model/entity/Castle.java
  19. 1 1
      L2_GameServer/java/com/l2jserver/gameserver/model/entity/Fort.java
  20. 6 6
      L2_GameServer/java/com/l2jserver/gameserver/model/entity/Hero.java
  21. 3 1
      L2_GameServer/java/com/l2jserver/gameserver/model/entity/Instance.java
  22. 16 0
      L2_GameServer/java/com/l2jserver/gameserver/model/entity/TvTEvent.java
  23. 15 0
      L2_GameServer/java/com/l2jserver/gameserver/model/olympiad/Olympiad.java
  24. 4 0
      L2_GameServer/java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java
  25. 2 2
      L2_GameServer/java/com/l2jserver/gameserver/model/quest/Quest.java
  26. 41 17
      L2_GameServer/java/com/l2jserver/gameserver/network/L2GameClient.java
  27. 0 297
      L2_GameServer/java/com/l2jserver/gameserver/network/SystemMessageId.java
  28. 3 3
      L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/AbstractEnchantPacket.java
  29. 17 0
      L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/CharacterSelect.java
  30. 11 5
      L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestActionUse.java
  31. 2 1
      L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java
  32. 7 6
      L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestExChangeName.java
  33. 3 1
      L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java
  34. 1 1
      L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestWithDrawPremiumItem.java
  35. 0 209
      L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java
  36. 17 5
      L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/CharInfo.java
  37. 1 0
      L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/CharSelected.java
  38. 17 7
      L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/CharSelectionInfo.java
  39. 2 2
      L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExBasicActionList.java
  40. 1 1
      L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExGetPremiumItemList.java
  41. 54 0
      L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/OnEventTrigger.java
  42. 2 2
      L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/StaticObject.java
  43. 1 5
      L2_GameServer/java/com/l2jserver/gameserver/templates/chars/L2CharTemplate.java
  44. 6 3
      L2_GameServer/java/com/l2jserver/gameserver/templates/chars/L2NpcTemplate.java
  45. 2 0
      L2_GameServer/java/com/l2jserver/gameserver/templates/skills/L2SkillType.java
  46. 17 0
      L2_GameServer/java/com/l2jserver/gameserver/util/Util.java
  47. 6 2
      L2_GameServer/java/config/Character.properties
  48. 12 12
      L2_GameServer/java/config/Grandboss.properties
  49. 28 0
      L2_GameServer/java/config/l2jmods.properties

+ 57 - 15
L2_GameServer/java/com/l2jserver/Config.java

@@ -30,6 +30,8 @@ import java.io.OutputStream;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.math.BigInteger;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -666,6 +668,7 @@ public final class Config
 	public static int TVT_EVENT_EFFECTS_REMOVAL;
 	public static TIntIntHashMap TVT_EVENT_FIGHTER_BUFFS;
 	public static TIntIntHashMap TVT_EVENT_MAGE_BUFFS;
+	public static int TVT_EVENT_MAX_PARTICIPANTS_PER_IP;
 	public static boolean TVT_ALLOW_VOICED_COMMAND;
 	public static boolean L2JMOD_ALLOW_WEDDING;
 	public static int L2JMOD_WEDDING_PRICE;
@@ -709,6 +712,9 @@ public final class Config
 	public static boolean L2JMOD_MULTILANG_VOICED_ALLOW;
 	public static boolean L2WALKER_PROTECTION;
 	public static boolean L2JMOD_DEBUG_VOICE_COMMAND;
+	public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
+	public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
+	public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
 	
 	//--------------------------------------------------
 	// NPC Settings
@@ -947,6 +953,7 @@ public final class Config
 	public static int ENCHANT_MAX_JEWELRY;
 	public static int ENCHANT_SAFE_MAX;
 	public static int ENCHANT_SAFE_MAX_FULL;
+	public static int[] ENCHANT_BLACKLIST;
 	public static int AUGMENTATION_NG_SKILL_CHANCE;
 	public static int AUGMENTATION_NG_GLOW_CHANCE;
 	public static int AUGMENTATION_MID_SKILL_CHANCE;
@@ -1504,7 +1511,7 @@ public final class Config
 					MAX_MCRIT_RATE = Integer.parseInt(Character.getProperty("MaxMCritRate", "200"));
 					MAX_PATK_SPEED = Integer.parseInt(Character.getProperty("MaxPAtkSpeed", "1500"));
 					MAX_MATK_SPEED = Integer.parseInt(Character.getProperty("MaxMAtkSpeed", "1999"));
-					MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "200"));
+					MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "250"));
 					MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
 					MAX_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("MaxSubclassLevel", "80"));
 					MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
@@ -1531,6 +1538,12 @@ public final class Config
 					ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "0"));
 					ENCHANT_SAFE_MAX = Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
 					ENCHANT_SAFE_MAX_FULL = Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
+					String[] notenchantable = Character.getProperty("EnchantBlackList","7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296").split(",");
+					ENCHANT_BLACKLIST = new int[notenchantable.length];					
+					for (int i = 0; i < notenchantable.length; i++)
+						ENCHANT_BLACKLIST[i] = Integer.parseInt(notenchantable[i]);					
+					Arrays.sort(ENCHANT_BLACKLIST);
+					
 					AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGSkillChance", "15"));
 					AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGGlowChance", "0"));
 					AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidSkillChance", "30"));
@@ -2222,6 +2235,7 @@ public final class Config
 							TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
 							TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
 							TVT_EVENT_EFFECTS_REMOVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventEffectsRemoval", "0"));
+							TVT_EVENT_MAX_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxParticipantsPerIP", "0"));
 							TVT_ALLOW_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowVoicedInfoCommand", "false"));
 							TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
 							propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
@@ -2407,6 +2421,34 @@ public final class Config
 					
 					L2WALKER_PROTECTION = Boolean.parseBoolean(L2JModSettings.getProperty("L2WalkerProtection", "False"));
 					L2JMOD_DEBUG_VOICE_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("DebugVoiceCommand", "False"));
+
+					L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxPlayersPerIP", "0"));
+					L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxOlympiadParticipantsPerIP", "0"));
+					String[] propertySplit = L2JModSettings.getProperty("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
+					L2JMOD_DUALBOX_CHECK_WHITELIST = new TIntIntHashMap(propertySplit.length);
+					for (String entry : propertySplit)
+					{
+						String[] entrySplit = entry.split(",");
+						if (entrySplit.length != 2)
+							_log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid config property -> DualboxCheckWhitelist \"", entry, "\""));
+						else
+						{
+							try
+							{
+								int num = Integer.parseInt(entrySplit[1]);
+								num = num == 0 ? -1 : num;
+								L2JMOD_DUALBOX_CHECK_WHITELIST.put(InetAddress.getByName(entrySplit[0]).hashCode(), num);
+							}
+							catch (UnknownHostException e)
+							{
+								_log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid address -> DualboxCheckWhitelist \"", entrySplit[0], "\""));
+							}
+							catch (NumberFormatException e)
+							{
+								_log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid number -> DualboxCheckWhitelist \"", entrySplit[1], "\""));
+							}
+						}
+					}
 				}
 				catch (Exception e)
 				{
@@ -2532,62 +2574,62 @@ public final class Config
 						Valakas_Wait_Time = 30;
 					Valakas_Wait_Time = Valakas_Wait_Time * 60000;
 					
-					Interval_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfAntharasSpawn", "192"));
+					Interval_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfAntharasSpawn", "264"));
 					if (Interval_Of_Antharas_Spawn < 1 || Interval_Of_Antharas_Spawn > 480)
 						Interval_Of_Antharas_Spawn = 192;
 					Interval_Of_Antharas_Spawn = Interval_Of_Antharas_Spawn * 3600000;
-					
-					Random_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfAntharasSpawn", "145"));
+
+					Random_Of_Antharas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfAntharasSpawn", "72"));
 					if (Random_Of_Antharas_Spawn < 1 || Random_Of_Antharas_Spawn > 192)
 						Random_Of_Antharas_Spawn = 145;
 					Random_Of_Antharas_Spawn = Random_Of_Antharas_Spawn * 3600000;
 					
-					Interval_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfValakasSpawn", "192"));
+					Interval_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfValakasSpawn", "264"));
 					if (Interval_Of_Valakas_Spawn < 1 || Interval_Of_Valakas_Spawn > 480)
 						Interval_Of_Valakas_Spawn = 192;
 					Interval_Of_Valakas_Spawn = Interval_Of_Valakas_Spawn * 3600000;
 					
-					Random_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfValakasSpawn", "145"));
+					Random_Of_Valakas_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfValakasSpawn", "72"));
 					if (Random_Of_Valakas_Spawn < 1 || Random_Of_Valakas_Spawn > 192)
 						Random_Of_Valakas_Spawn = 145;
 					Random_Of_Valakas_Spawn = Random_Of_Valakas_Spawn * 3600000;
 					
-					Interval_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfBaiumSpawn", "121"));
+					Interval_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfBaiumSpawn", "168"));
 					if (Interval_Of_Baium_Spawn < 1 || Interval_Of_Baium_Spawn > 480)
 						Interval_Of_Baium_Spawn = 121;
 					Interval_Of_Baium_Spawn = Interval_Of_Baium_Spawn * 3600000;
 					
-					Random_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfBaiumSpawn", "8"));
+					Random_Of_Baium_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfBaiumSpawn", "48"));
 					if (Random_Of_Baium_Spawn < 1 || Random_Of_Baium_Spawn > 192)
 						Random_Of_Baium_Spawn = 8;
 					Random_Of_Baium_Spawn = Random_Of_Baium_Spawn * 3600000;
 					
-					Interval_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfCoreSpawn", "27"));
+					Interval_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfCoreSpawn", "60"));
 					if (Interval_Of_Core_Spawn < 1 || Interval_Of_Core_Spawn > 480)
 						Interval_Of_Core_Spawn = 27;
 					Interval_Of_Core_Spawn = Interval_Of_Core_Spawn * 3600000;
 					
-					Random_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfCoreSpawn", "47"));
+					Random_Of_Core_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfCoreSpawn", "24"));
 					if (Random_Of_Core_Spawn < 1 || Random_Of_Core_Spawn > 192)
 						Random_Of_Core_Spawn = 47;
 					Random_Of_Core_Spawn = Random_Of_Core_Spawn * 3600000;
 					
-					Interval_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfOrfenSpawn", "28"));
+					Interval_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfOrfenSpawn", "48"));
 					if (Interval_Of_Orfen_Spawn < 1 || Interval_Of_Orfen_Spawn > 480)
 						Interval_Of_Orfen_Spawn = 28;
 					Interval_Of_Orfen_Spawn = Interval_Of_Orfen_Spawn * 3600000;
 					
-					Random_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfOrfenSpawn", "41"));
+					Random_Of_Orfen_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfOrfenSpawn", "20"));
 					if (Random_Of_Orfen_Spawn < 1 || Random_Of_Orfen_Spawn > 192)
 						Random_Of_Orfen_Spawn = 41;
 					Random_Of_Orfen_Spawn = Random_Of_Orfen_Spawn * 3600000;
 					
-					Interval_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfQueenAntSpawn", "19"));
+					Interval_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfQueenAntSpawn", "36"));
 					if (Interval_Of_QueenAnt_Spawn < 1 || Interval_Of_QueenAnt_Spawn > 480)
 						Interval_Of_QueenAnt_Spawn = 19;
 					Interval_Of_QueenAnt_Spawn = Interval_Of_QueenAnt_Spawn * 3600000;
 					
-					Random_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfQueenAntSpawn", "35"));
+					Random_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfQueenAntSpawn", "17"));
 					if (Random_Of_QueenAnt_Spawn < 1 || Random_Of_QueenAnt_Spawn > 192)
 						Random_Of_QueenAnt_Spawn = 35;
 					Random_Of_QueenAnt_Spawn = Random_Of_QueenAnt_Spawn * 3600000;
@@ -2602,7 +2644,7 @@ public final class Config
 						Random_Of_Zaken_Spawn = 35;
 					Random_Of_Zaken_Spawn = Random_Of_Zaken_Spawn * 3600000;
 					
-					Interval_Of_Frintezza_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfFrintezzaSpawn", "121"));
+					Interval_Of_Frintezza_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfFrintezzaSpawn", "48"));
 					if (Interval_Of_Frintezza_Spawn < 1 || Interval_Of_Frintezza_Spawn > 480)
 						Interval_Of_Frintezza_Spawn = 121;
 					Interval_Of_Frintezza_Spawn = Interval_Of_Frintezza_Spawn * 3600000;

+ 3 - 1
L2_GameServer/java/com/l2jserver/gameserver/GameServer.java

@@ -85,6 +85,7 @@ import com.l2jserver.gameserver.handler.UserCommandHandler;
 import com.l2jserver.gameserver.handler.VoicedCommandHandler;
 import com.l2jserver.gameserver.idfactory.IdFactory;
 import com.l2jserver.gameserver.instancemanager.AirShipManager;
+import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
 import com.l2jserver.gameserver.instancemanager.AuctionManager;
 import com.l2jserver.gameserver.instancemanager.BoatManager;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
@@ -384,7 +385,8 @@ public class GameServer
 			CoupleManager.getInstance();
 		
 		TaskManager.getInstance();
-		
+
+		AntiFeedManager.getInstance().registerEvent(AntiFeedManager.GAME_ID);
 		MerchantPriceConfigTable.getInstance().updateReferences();
 		CastleManager.getInstance().activateInstances();
 		FortManager.getInstance().activateInstances();

+ 7 - 0
L2_GameServer/java/com/l2jserver/gameserver/datatables/DoorTable.java

@@ -148,12 +148,17 @@ public class DoorTable
 			int hp = Integer.parseInt(st.nextToken());
 			int pdef = Integer.parseInt(st.nextToken());
 			int mdef = Integer.parseInt(st.nextToken());
+			int emitter = Integer.parseInt(st.nextToken());
 			boolean unlockable = false;
 			if (st.hasMoreTokens())
 				unlockable = Boolean.parseBoolean(st.nextToken());
 			boolean startOpen = false;
 			if (st.hasMoreTokens())
 				startOpen = Boolean.parseBoolean(st.nextToken());
+			boolean targetable = true;
+			if (st.hasMoreTokens())
+				targetable = Boolean.parseBoolean(st.nextToken());
+
 			if (rangeXMin > rangeXMax)
 				_log.severe("Error in door data, XMin > XMax, ID:" + id);
 			if (rangeYMin > rangeYMax)
@@ -217,6 +222,8 @@ public class DoorTable
 			door.setCurrentHpMp(door.getMaxHp(), door.getMaxMp());
 			door.setXYZInvisible(x, y, z);
 			door.setMapRegion(MapRegionTable.getInstance().getMapRegion(x, y));
+			door.setEmitter(emitter);
+			door.setTargetable(targetable);
 			
 			if (commanderDoor)
 				door.setIsCommanderDoor(startOpen);

+ 8 - 11
L2_GameServer/java/com/l2jserver/gameserver/datatables/NpcTable.java

@@ -78,8 +78,8 @@ public class NpcTable
 						+ L2DatabaseFactory.getInstance().safetyString(new String[] { "id", "idTemplate", "name", "serverSideName",
 								"title", "serverSideTitle", "class", "collision_radius", "collision_height", "level", "sex", "type",
 								"attackrange", "hp", "mp", "hpreg", "mpreg", "str", "con", "dex", "int", "wit", "men", "exp", "sp", "patk",
-								"pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "armor", "enchant", "walkspd", "runspd",
-								"isUndead", "dropHerbGroup" }) + " FROM npc");
+								"pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "enchant", "walkspd", "runspd",
+								"dropHerbGroup" }) + " FROM npc");
 				ResultSet npcdata = statement.executeQuery();
 				
 				fillNpcTable(npcdata, false);
@@ -99,8 +99,8 @@ public class NpcTable
 							+ L2DatabaseFactory.getInstance().safetyString(new String[] { "id", "idTemplate", "name", "serverSideName",
 									"title", "serverSideTitle", "class", "collision_radius", "collision_height", "level", "sex", "type",
 									"attackrange", "hp", "mp", "hpreg", "mpreg", "str", "con", "dex", "int", "wit", "men", "exp", "sp",
-									"patk", "pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "armor", "enchant", "walkspd",
-									"runspd", "isUndead", "dropHerbGroup" }) + " FROM custom_npc");
+									"patk", "pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "enchant", "walkspd",
+									"runspd", "dropHerbGroup" }) + " FROM custom_npc");
 					ResultSet npcdata = statement.executeQuery();
 					
 					fillNpcTable(npcdata, true);
@@ -631,7 +631,6 @@ public class NpcTable
 			npcDat.set("aggroRange", NpcData.getInt("aggro"));
 			npcDat.set("rhand", NpcData.getInt("rhand"));
 			npcDat.set("lhand", NpcData.getInt("lhand"));
-			npcDat.set("armor", NpcData.getInt("armor"));
 			npcDat.set("enchant", NpcData.getInt("enchant"));
 			npcDat.set("baseWalkSpd", NpcData.getInt("walkspd"));
 			npcDat.set("baseRunSpd", NpcData.getInt("runspd"));
@@ -654,8 +653,6 @@ public class NpcTable
 			npcDat.set("baseMAtk", NpcData.getInt("matk"));
 			npcDat.set("baseMDef", NpcData.getInt("mdef"));
 			
-			npcDat.set("isUndead", NpcData.getString("isUndead"));
-			
 			npcDat.set("dropHerbGroup", NpcData.getInt("dropHerbGroup"));
 			
 			// Default element resists
@@ -716,8 +713,8 @@ public class NpcTable
 					+ L2DatabaseFactory.getInstance().safetyString(new String[] { "id", "idTemplate", "name", "serverSideName", "title",
 							"serverSideTitle", "class", "collision_radius", "collision_height", "level", "sex", "type", "attackrange",
 							"hp", "mp", "hpreg", "mpreg", "str", "con", "dex", "int", "wit", "men", "exp", "sp", "patk", "pdef", "matk",
-							"mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "armor", "enchant", "walkspd", "runspd",
-							"isUndead", "dropHerbGroup" })
+							"mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "enchant", "walkspd", "runspd",
+							"dropHerbGroup" })
 							+ " FROM npc WHERE id=?");
 			st.setInt(1, id);
 			ResultSet rs = st.executeQuery();
@@ -728,8 +725,8 @@ public class NpcTable
 						+ L2DatabaseFactory.getInstance().safetyString(new String[] { "id", "idTemplate", "name", "serverSideName",
 								"title", "serverSideTitle", "class", "collision_radius", "collision_height", "level", "sex", "type",
 								"attackrange", "hp", "mp", "hpreg", "mpreg", "str", "con", "dex", "int", "wit", "men", "exp", "sp", "patk",
-								"pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "armor", "enchant", "walkspd", "runspd",
-								"isUndead", "dropHerbGroup" }) + " FROM custom_npc WHERE id=?");
+								"pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "enchant", "walkspd", "runspd",
+								"dropHerbGroup" }) + " FROM custom_npc WHERE id=?");
 				st.setInt(1, id);
 				rs = st.executeQuery();
 				fillNpcTable(rs, true);

+ 212 - 3
L2_GameServer/java/com/l2jserver/gameserver/instancemanager/AntiFeedManager.java

@@ -14,6 +14,9 @@
  */
 package com.l2jserver.gameserver.instancemanager;
 
+import gnu.trove.TIntObjectHashMap;
+import gnu.trove.TObjectProcedure;
+
 import java.util.Map;
 
 import javolution.util.FastMap;
@@ -25,8 +28,13 @@ import com.l2jserver.gameserver.network.L2GameClient;
 
 public class AntiFeedManager
 {
+	public static final int GAME_ID = 0;
+	public static final int OLYMPIAD_ID = 1;
+	public static final int TVT_ID = 2;
+
 	private Map<Integer,Long> _lastDeathTimes;
-	
+	private TIntObjectHashMap<Map<Integer, Connections>> _eventIPs;
+
 	public static final AntiFeedManager getInstance()
 	{
 		return SingletonHolder._instance;
@@ -35,6 +43,7 @@ public class AntiFeedManager
 	private AntiFeedManager()
 	{
 		_lastDeathTimes = new FastMap<Integer,Long>().shared();
+		_eventIPs = new TIntObjectHashMap<Map<Integer, Connections>>();
 	}
 	
 	/**
@@ -83,7 +92,7 @@ public class AntiFeedManager
 					// unable to check ip address
 					return !Config.L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
 				
-				return !targetClient.getConnection().getInetAddress().equals(attackerClient.getConnection().getInetAddress());
+				return !targetClient.getConnectionAddress().equals(attackerClient.getConnectionAddress());
 			}
 			
 			return true;
@@ -96,7 +105,207 @@ public class AntiFeedManager
 	{
 		_lastDeathTimes.clear();
 	}
-	
+
+	/**
+	 * Register new event for dualbox check.
+	 * Should be called only once.
+	 * @param eventId
+	 */
+	public final void registerEvent(int eventId)
+	{
+		if (!_eventIPs.containsKey(eventId))
+			_eventIPs.put(eventId, new FastMap<Integer, Connections>());
+	}
+
+	/**
+	 * If number of all simultaneous connections from player's IP address lower than max
+	 * then increment connection count and return true.
+	 * Returns false if number of all simultaneous connections from player's IP address
+	 * higher than max.
+	 * @param eventId
+	 * @param player
+	 * @param max
+	 * @return
+	 */
+	public final boolean tryAddPlayer(int eventId, L2PcInstance player, int max)
+	{
+		return tryAddClient(eventId, player.getClient(), max);
+	}
+
+	/**
+	 * If number of all simultaneous connections from player's IP address lower than max
+	 * then increment connection count and return true.
+	 * Returns false if number of all simultaneous connections from player's IP address
+	 * higher than max.
+	 * @param eventId
+	 * @param player
+	 * @param max
+	 * @return
+	 */
+	public final boolean tryAddClient(int eventId, L2GameClient client, int max)
+	{
+		if (client == null)
+			return false; // unable to determine IP address
+
+		final Map<Integer, Connections> event = _eventIPs.get(eventId);
+		if (event == null)
+			return false; // no such event registered
+
+		final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
+		int limit = Config.L2JMOD_DUALBOX_CHECK_WHITELIST.get(addrHash);
+		limit = limit < 0 ? Integer.MAX_VALUE : limit + max;
+
+		Connections conns;
+		synchronized (event)
+		{
+			conns = event.get(addrHash);
+			if (conns == null)
+			{
+				conns = new Connections();
+				event.put(addrHash, conns);
+			}
+		}
+
+		return conns.testAndIncrement(limit);
+	}
+
+	/**
+	 * Decreasing number of active connection from player's IP address
+	 * Returns true if success and false if any problem detected.
+	 * @param eventId
+	 * @param player
+	 * @return
+	 */
+	public final boolean removePlayer(int eventId, L2PcInstance player)
+	{
+		final L2GameClient client = player.getClient();
+		if (client == null)
+			return false; // unable to determine IP address
+
+		final Map<Integer, Connections> event = _eventIPs.get(eventId);
+		if (event == null)
+			return false; // no such event registered
+
+		final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
+		Connections conns = event.get(addrHash);
+		if (conns == null)
+			return false; // address not registered
+
+		synchronized (event)
+		{
+			if (conns.testAndDecrement())
+				event.remove(addrHash);
+		}
+
+		return true;
+	}
+
+	/**
+	 * Remove player connection IP address from all registered events lists.
+	 * @param player
+	 */
+	public final void onDisconnect(L2GameClient client)
+	{
+		if (client == null)
+			return;
+
+		final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
+		_eventIPs.forEachValue(new DisconnectProcedure(addrHash));
+	}
+
+	/**
+	 * Clear all entries for this eventId.
+	 * @param eventId
+	 */
+	public final void clear(int eventId)
+	{
+		final Map<Integer, Connections> event = _eventIPs.get(eventId);
+		if (event != null)
+			event.clear();
+	}
+
+	/**
+	 * Returns maximum number of allowed connections (whitelist + max)
+	 * @param player
+	 * @param max
+	 * @return
+	 */
+	public final int getLimit(L2PcInstance player, int max)
+	{
+		return getLimit(player.getClient(), max);
+	}
+
+	/**
+	 * Returns maximum number of allowed connections (whitelist + max)
+	 * @param client
+	 * @param max
+	 * @return
+	 */
+	public final int getLimit(L2GameClient client, int max)
+	{
+		if (client == null)
+			return max;
+
+		final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
+		final int limit = Config.L2JMOD_DUALBOX_CHECK_WHITELIST.get(addrHash);
+		return limit < 0 ? 0 : limit + max;
+	}
+
+	private static final class Connections
+	{
+		private int _num = 0;
+
+		/**
+		 * Returns true if successfully incremented number of connections
+		 * and false if maximum number is reached.
+		 */
+		public final synchronized boolean testAndIncrement(int max)
+		{
+			if (_num < max)
+			{
+				_num++;
+				return true;
+			}
+			return false;
+		}
+
+		/**
+		 * Returns true if all connections are removed
+		 */
+		public final synchronized boolean testAndDecrement()
+		{
+			if (_num > 0)
+				_num--;
+
+			return _num == 0;
+		}
+	}
+
+	private static final class DisconnectProcedure implements TObjectProcedure<Map<Integer, Connections>>
+	{
+		private final Integer _addrHash;
+
+		public DisconnectProcedure(Integer addrHash)
+		{
+			_addrHash = addrHash;
+		}
+
+		@Override
+		public final boolean execute(Map<Integer, Connections> event)
+		{
+			final Connections conns = event.get(_addrHash);
+			if (conns != null)
+			{
+				synchronized (event)
+				{
+					if (conns.testAndDecrement())
+						event.remove(_addrHash);
+				}
+			}
+			return true;
+		}
+	}
+
 	@SuppressWarnings("synthetic-access")
 	private static class SingletonHolder
 	{

+ 9 - 0
L2_GameServer/java/com/l2jserver/gameserver/model/CharSelectInfoPackage.java

@@ -55,6 +55,7 @@ public class CharSelectInfoPackage
 	private int _x = 0;
 	private int _y = 0;
 	private int _z = 0;
+	private String _htmlPrefix = null;
 	
 	
 	/**
@@ -307,4 +308,12 @@ public class CharSelectInfoPackage
 	{
 		_z = z;
 	}
+	public String getHtmlPrefix()
+	{
+		return _htmlPrefix;
+	}
+	public void setHtmlPrefix(String s)
+	{
+		_htmlPrefix = s;
+	}
 }

+ 3 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/L2ItemInstance.java

@@ -48,6 +48,7 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
 import com.l2jserver.gameserver.skills.funcs.Func;
 import com.l2jserver.gameserver.templates.item.L2Armor;
 import com.l2jserver.gameserver.templates.item.L2EtcItem;
+import com.l2jserver.gameserver.templates.item.L2EtcItemType;
 import com.l2jserver.gameserver.templates.item.L2Item;
 import com.l2jserver.gameserver.templates.item.L2Weapon;
 import com.l2jserver.gameserver.util.GMAudit;
@@ -768,7 +769,8 @@ public final class L2ItemInstance extends L2Object
 				&& (allowAdena || getItemId() != 57) // Not adena
 				&& (player.getCurrentSkill() == null || player.getCurrentSkill().getSkill().getItemConsumeId() != getItemId())
 				&& (!player.isCastingSimultaneouslyNow() || player.getLastSimultaneousSkillCast() == null || player.getLastSimultaneousSkillCast().getItemConsumeId() != getItemId())
-				&& (allowNonTradeable || isTradeable())
+				&& (allowNonTradeable || isTradeable()
+				&& (!(getItem().getItemType() == L2EtcItemType.PET_COLLAR && player.havePetInvItems())))
 		);
 	}
 	

+ 89 - 57
L2_GameServer/java/com/l2jserver/gameserver/model/L2Manor.java

@@ -14,17 +14,18 @@
  */
 package com.l2jserver.gameserver.model;
 
-import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.LineNumberReader;
-import java.util.StringTokenizer;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.xml.parsers.DocumentBuilderFactory;
+
 import javolution.util.FastList;
 import javolution.util.FastMap;
 
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.datatables.ItemTable;
 import com.l2jserver.gameserver.templates.item.L2Item;
@@ -183,7 +184,7 @@ public class L2Manor
 		return -1;
 	}
 	
-	public synchronized int getRewardItem(int cropId, int type)
+	public int getRewardItem(int cropId, int type)
 	{
 		for (SeedData seed : _seeds.values())
 		{
@@ -198,7 +199,7 @@ public class L2Manor
 		return -1;
 	}
 	
-	public synchronized int getRewardItemBySeed(int seedId, int type)
+	public int getRewardItemBySeed(int seedId, int type)
 	{
 		SeedData seed = _seeds.get(seedId);
 		
@@ -298,7 +299,7 @@ public class L2Manor
 		private int _type1;
 		private int _type2;
 		private int _manorId; // id of manor (castle id) where seed can be farmed
-		private int _isAlternative;
+		private boolean _isAlternative;
 		private int _limitSeeds;
 		private int _limitCrops;
 		
@@ -309,7 +310,7 @@ public class L2Manor
 			this._mature = mature;
 		}
 		
-		public void setData(int id, int t1, int t2, int manorId, int isAlt, int lim1, int lim2)
+		public void setData(int id, int t1, int t2, int manorId, boolean isAlt, int lim1, int lim2)
 		{
 			this._id = id;
 			_type1 = t1;
@@ -352,7 +353,7 @@ public class L2Manor
 		
 		public boolean isAlternative()
 		{
-			return (_isAlternative == 1);
+			return _isAlternative;
 		}
 		
 		public int getSeedLimit()
@@ -364,73 +365,104 @@ public class L2Manor
 		{
 			return _limitCrops * Config.RATE_DROP_MANOR;
 		}
+
+		@Override
+		public String toString()
+		{
+			return "SeedData [_id=" + _id + ", _level=" + _level + ", _crop=" + _crop + ", _mature=" + _mature + ", _type1=" + _type1 + ", _type2=" + _type2 + ", _manorId=" + _manorId + ", _isAlternative=" + _isAlternative + ", _limitSeeds=" + _limitSeeds + ", _limitCrops=" + _limitCrops + "]";
+		}
 	}
 	
 	private void parseData()
 	{
-		LineNumberReader lnr = null;
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		factory.setValidating(false);
+		factory.setIgnoringComments(true);
+		File file = new File(Config.DATAPACK_ROOT, "/data/seeds.xml");
+		Document doc = null;
+		
 		try
 		{
-			File seedData = new File(Config.DATAPACK_ROOT, "data/seeds.csv");
-			lnr = new LineNumberReader(new BufferedReader(new FileReader(seedData)));
-			
-			String line = null;
-			while ((line = lnr.readLine()) != null)
-			{
-				if (line.trim().length() == 0 || line.startsWith("#"))
-				{
-					continue;
-				}
-				SeedData seed = parseList(line);
-				_seeds.put(seed.getId(), seed);
-			}
-			
-			_log.info("ManorManager: Loaded " + _seeds.size() + " seeds");
-		}
-		catch (FileNotFoundException e)
-		{
-			_log.info("seeds.csv is missing in data folder");
+			doc = factory.newDocumentBuilder().parse(file);
 		}
 		catch (Exception e)
 		{
-			_log.info("error while loading seeds: " + e.getMessage());
+			_log.log(Level.WARNING, "Could not parse seeds.xml file: " + e.getMessage(), e);
 		}
-		finally
+		
+		doc.getDocumentElement().normalize();
+		
+		//list
+		for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
 		{
-			try
-			{
-				lnr.close();
-			}
-			catch (Exception e1)
+			if ("list".equalsIgnoreCase(n.getNodeName()))
 			{
+				//castle
+				for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
+				{
+					if ("castle".equalsIgnoreCase(d.getNodeName()))
+					{
+						int castleId = Integer.parseInt(d.getAttributes().getNamedItem("id").getNodeValue());
+						//crop
+						for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling())
+						{
+							if ("crop".equalsIgnoreCase(c.getNodeName()))
+							{
+								int cropId = Integer.parseInt(c.getAttributes().getNamedItem("id").getNodeValue());
+								int seedId = 0;
+								int matureId = 0;
+								int type1R = 0;
+								int type2R = 0;
+								boolean isAlt = false;
+								int level = 0;
+								int limitSeeds = 0;
+								int limitCrops = 0;
+								
+								//attrib
+								for (Node a = c.getFirstChild(); a != null; a = a.getNextSibling())
+								{
+									if (a.getNodeName().equalsIgnoreCase("seed_id"))
+										seedId = Integer.parseInt(a.getAttributes().getNamedItem("val").getNodeValue());
+									else if (a.getNodeName().equalsIgnoreCase("mature_id"))
+										matureId = Integer.parseInt(a.getAttributes().getNamedItem("val").getNodeValue());
+									else if (a.getNodeName().equalsIgnoreCase("reward1"))
+										type1R = Integer.parseInt(a.getAttributes().getNamedItem("val").getNodeValue());
+									else if (a.getNodeName().equalsIgnoreCase("reward2"))
+										type2R = Integer.parseInt(a.getAttributes().getNamedItem("val").getNodeValue());
+									else if (a.getNodeName().equalsIgnoreCase("alternative"))
+										isAlt = Integer.parseInt(a.getAttributes().getNamedItem("val").getNodeValue()) == 1;
+									else if (a.getNodeName().equalsIgnoreCase("level"))
+										level = Integer.parseInt(a.getAttributes().getNamedItem("val").getNodeValue());
+									else if (a.getNodeName().equalsIgnoreCase("limit_seed"))
+										limitSeeds = Integer.parseInt(a.getAttributes().getNamedItem("val").getNodeValue());
+									else if (a.getNodeName().equalsIgnoreCase("limit_crops"))
+										limitCrops = Integer.parseInt(a.getAttributes().getNamedItem("val").getNodeValue());
+								}
+								
+								SeedData seed = new SeedData(level, cropId, matureId);
+								seed.setData(seedId, type1R, type2R, castleId, isAlt, limitSeeds, limitCrops);
+								_seeds.put(seed.getId(), seed);
+							}
+						}
+					}
+				}
 			}
+			_log.info(getClass().getSimpleName()+": Loaded "+_seeds.size()+ " Seeds.");
 		}
+
+
 	}
+
 	
-	private SeedData parseList(String line)
-	{
-		StringTokenizer st = new StringTokenizer(line, ";");
-		
-		int seedId = Integer.parseInt(st.nextToken()); // seed id
-		int level = Integer.parseInt(st.nextToken()); // seed level
-		int cropId = Integer.parseInt(st.nextToken()); // crop id
-		int matureId = Integer.parseInt(st.nextToken()); // mature crop id
-		int type1R = Integer.parseInt(st.nextToken()); // type I reward
-		int type2R = Integer.parseInt(st.nextToken()); // type II reward
-		int manorId = Integer.parseInt(st.nextToken()); // id of manor, where seed can be farmed
-		int isAlt = Integer.parseInt(st.nextToken()); // alternative seed
-		int limitSeeds = Integer.parseInt(st.nextToken()); // limit for seeds
-		int limitCrops = Integer.parseInt(st.nextToken()); // limit for crops
-		
-		SeedData seed = new SeedData(level, cropId, matureId);
-		seed.setData(seedId, type1R, type2R, manorId, isAlt, limitSeeds, limitCrops);
-		
-		return seed;
-	}
 	
 	@SuppressWarnings("synthetic-access")
 	private static class SingletonHolder
 	{
 		protected static final L2Manor _instance = new L2Manor();
 	}
+	
+	public static void main(String[] arg)
+	{
+		L2Manor.getInstance();
+	}
 }

+ 8 - 2
L2_GameServer/java/com/l2jserver/gameserver/model/L2Skill.java

@@ -2052,7 +2052,8 @@ public abstract class L2Skill implements IChanceSkillTrigger
 			}
 			case TARGET_CORPSE_MOB:
 			{
-				if (!(target instanceof L2Attackable) || !target.isDead())
+				final boolean isSummon = target instanceof L2SummonInstance;
+				if (!(isSummon || target instanceof L2Attackable) || !target.isDead())
 				{
 					activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
 					return _emptyTargetList;
@@ -2061,8 +2062,13 @@ public abstract class L2Skill implements IChanceSkillTrigger
 				// Corpse mob only available for half time
 				switch (getSkillType())
 				{
-					case DRAIN:
 					case SUMMON:
+					{
+						if (isSummon && ((L2SummonInstance)target).getOwner() != null
+								&& ((L2SummonInstance)target).getOwner().getObjectId() == activeChar.getObjectId())
+							return _emptyTargetList;
+					}
+					case DRAIN:
 					{
 						if (DecayTaskManager.getInstance().getTasks().containsKey(target)
 								&& (System.currentTimeMillis() - DecayTaskManager.getInstance().getTasks().get(target)) > DecayTaskManager.ATTACKABLE_DECAY_TIME / 2)

+ 6 - 0
L2_GameServer/java/com/l2jserver/gameserver/model/L2Transformation.java

@@ -196,4 +196,10 @@ public abstract class L2Transformation implements Cloneable, Runnable
 	{
 		return true;
 	}
+
+	@Override
+	public String toString()
+	{
+		return getClass().getSimpleName()+" [_id=" + _id + ", _graphicalId=" + _graphicalId + ", _collisionRadius=" + _collisionRadius + ", _collisionHeight=" + _collisionHeight + ", _isStance=" + _isStance + "]";
+	}
 }

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -2439,7 +2439,7 @@ public abstract class L2Character extends L2Object
 	public boolean isInvul(){return _isInvul  || _isTeleporting;}
 	public void setIsMortal(boolean b) { _isMortal = b; }
 	public boolean isMortal(){ return _isMortal; }
-	public boolean isUndead() { return _template.isUndead; }
+	public boolean isUndead() { return false; }
 	
 	public final boolean isFlying() { return _isFlying; }
 	public final void setIsFlying(boolean mode) { _isFlying = mode; }

+ 7 - 4
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Decoy.java

@@ -19,7 +19,7 @@ import java.util.Collection;
 
 import com.l2jserver.gameserver.model.L2ItemInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.serverpackets.AbstractNpcInfo;
+import com.l2jserver.gameserver.network.serverpackets.CharInfo;
 import com.l2jserver.gameserver.taskmanager.DecayTaskManager;
 import com.l2jserver.gameserver.templates.chars.L2CharTemplate;
 import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
@@ -43,7 +43,7 @@ public abstract class L2Decoy extends L2Character
 	public void onSpawn()
 	{
 		super.onSpawn();
-		this.getOwner().sendPacket(new AbstractNpcInfo.DecoyInfo(this));
+		this.getOwner().sendPacket(new CharInfo(this));
 	}
 	
 	@Override
@@ -53,7 +53,10 @@ public abstract class L2Decoy extends L2Character
 		//synchronized (getKnownList().getKnownPlayers())
 		{
 			for (L2PcInstance player : plrs)
-				player.sendPacket(new AbstractNpcInfo.DecoyInfo(this));
+			{
+				if (player != null)
+					player.sendPacket(new CharInfo(this));
+			}
 		}
 	}
 	
@@ -149,6 +152,6 @@ public abstract class L2Decoy extends L2Character
 	@Override
 	public void sendInfo(L2PcInstance activeChar)
 	{
-		activeChar.sendPacket(new AbstractNpcInfo.DecoyInfo(this));
+		activeChar.sendPacket(new CharInfo(this));
 	}
 }

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Npc.java

@@ -665,7 +665,7 @@ public class L2Npc extends L2Character
 	@Override
 	public boolean isUndead()
 	{
-		return getTemplate().isUndead;
+		return getTemplate().isUndead();
 	}
 	
 	/**

+ 15 - 6
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Summon.java

@@ -379,8 +379,15 @@ public abstract class L2Summon extends L2Playable
 				party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
 			}
 			
-			store();
-			giveAllToOwner();
+			if(getInventory() != null && getInventory().getSize() > 0)
+			{
+				getOwner().setPetInvItems(true);
+				getOwner().sendPacket(SystemMessageId.ITEMS_IN_PET_INVENTORY);
+			}
+			else
+				getOwner().setPetInvItems(false);
+			
+			store();			
 			owner.setPet(null);
 			
 			// Stop AI tasks
@@ -465,10 +472,6 @@ public abstract class L2Summon extends L2Playable
 	{
 	}
 	
-	public void giveAllToOwner()
-	{
-	}
-	
 	public void store()
 	{
 	}
@@ -908,4 +911,10 @@ public abstract class L2Summon extends L2Playable
 	{
 		return super.toString()+" Owner: "+getOwner();
 	}
+	
+	@Override
+	public boolean isUndead()
+	{
+		return getTemplate().isUndead();
+	}
 }

+ 42 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2DoorInstance.java

@@ -43,6 +43,7 @@ import com.l2jserver.gameserver.model.entity.ClanHall;
 import com.l2jserver.gameserver.model.entity.Fort;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.DoorStatusUpdate;
+import com.l2jserver.gameserver.network.serverpackets.OnEventTrigger;
 import com.l2jserver.gameserver.network.serverpackets.StaticObject;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
 import com.l2jserver.gameserver.templates.chars.L2CharTemplate;
@@ -85,6 +86,9 @@ public class L2DoorInstance extends L2Character
 	private boolean _isAttackableDoor = false;
 	private boolean _isWall = false; // is castle wall ?
 	private boolean _ShowHp = false;
+	private int _meshindex = 1;
+	private int _emitter = 0;
+	private boolean _targetable = true;
 	
 	private ClanHall _clanHall;
 	
@@ -497,7 +501,9 @@ public class L2DoorInstance extends L2Character
 		
 		StaticObject su = new StaticObject(this, false);
 		DoorStatusUpdate dsu = new DoorStatusUpdate(this);
-		
+		OnEventTrigger oe = null;
+		if (_emitter > 0)
+			oe = new OnEventTrigger(this, getOpen());
 		//synchronized (getKnownList().getKnownPlayers())
 		{
 			for (L2PcInstance player : knownPlayers)
@@ -507,6 +513,8 @@ public class L2DoorInstance extends L2Character
 				
 				player.sendPacket(su);
 				player.sendPacket(dsu);
+				if (oe != null)
+					player.sendPacket(oe);
 			}
 		}
 	}
@@ -652,6 +660,36 @@ public class L2DoorInstance extends L2Character
 		return _isWall;
 	}
 	
+	public void setMeshIndex(int mesh)
+	{
+		_meshindex = mesh;
+	}
+	
+	public int getMeshIndex()
+	{
+		return _meshindex;
+	}
+	
+	public void setEmitter(int emitter)
+	{
+		_emitter = emitter;
+	}
+	
+	public int getEmitter()
+	{
+		return _emitter;
+	}
+	
+	public void setTargetable(boolean targetable)
+	{
+		_targetable = targetable;
+	}
+	
+	public boolean getTargetable()
+	{
+		return _targetable;
+	}
+	
 	@Override
 	public void reduceCurrentHp(double damage, L2Character attacker, boolean awake, boolean isDOT, L2Skill skill)
 	{
@@ -684,6 +722,9 @@ public class L2DoorInstance extends L2Character
 	@Override
 	public void sendInfo(L2PcInstance activeChar)
 	{
+		if (_emitter > 0)
+			activeChar.sendPacket(new OnEventTrigger(this, getOpen()));
+		
 		activeChar.sendPacket(new StaticObject(this, false));
 	}
 }

+ 2630 - 2588
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -403,6 +403,7 @@ public final class L2PcInstance extends L2Playable
 	private int _curFeed;
 	protected Future<?> _mountFeedTask;
 	private ScheduledFuture<?> _dismountTask;
+	private boolean _petItems = false;
 	
 	/** The list of sub-classes this character has. */
 	private Map<Integer, SubClass> _subClasses;
@@ -3298,6 +3299,7 @@ public final class L2PcInstance extends L2Playable
 	/**
 	 * Return the Identifier of the L2PcInstance.<BR><BR>
 	 */
+	@Deprecated
 	public int getCharId()
 	{
 		return _charId;
@@ -7593,6 +7595,9 @@ public final class L2PcInstance extends L2Playable
 		
 		// Load Premium Item List
 		loadPremiumItemList();
+		
+		// Check for items in pet inventory
+		checkPetInvItems();
 	}
 	
 	/**
@@ -12518,2606 +12523,2643 @@ public final class L2PcInstance extends L2Playable
 	/**
 	 * @return Returns the mountNpcId.
 	 */
-	 public int getMountNpcId()
+	public int getMountNpcId()
 	{
 		return _mountNpcId;
 	}
-	 
-	 /**
-	  * @return Returns the mountLevel.
-	  */
-	 public int getMountLevel()
-	 {
-		 return _mountLevel;
-	 }
-	 
-	 public void setMountObjectID(int newID)
-	 {
-		 _mountObjectID = newID;
-	 }
-	 
-	 public int getMountObjectID()
-	 {
-		 return _mountObjectID;
-	 }
-	 
-	 private L2ItemInstance _lure = null;
-	 public int _shortBuffTaskSkillId = 0;
-	 
-	 /**
-	  * Get the current skill in use or return null.<BR><BR>
-	  *
-	  */
-	 public SkillDat getCurrentSkill()
-	 {
-		 return _currentSkill;
-	 }
-	 
-	 
-	 /**
-	  * Create a new SkillDat object and set the player _currentSkill.<BR><BR>
-	  *
-	  */
-	 public void setCurrentSkill(L2Skill currentSkill, boolean ctrlPressed,
-			 boolean shiftPressed)
-	 {
-		 if (currentSkill == null)
-		 {
-			 if (Config.DEBUG)
-				 _log.info("Setting current skill: NULL for " + getName() + ".");
-			 
-			 _currentSkill = null;
-			 return;
-		 }
-		 
-		 if (Config.DEBUG)
-			 _log.info("Setting current skill: " + currentSkill.getName() + " (ID: " + currentSkill.getId() + ") for " + getName() + ".");
-		 
-		 _currentSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed);
-	 }
-	 
-	 /**
-	  * Get the current pet skill in use or return null.<br><br>
-	  * 
-	  */
-	 public SkillDat getCurrentPetSkill()
-	 {
-		 return _currentPetSkill;
-	 }
-	 
-	 /**
-	  * Create a new SkillDat object and set the player _currentPetSkill.<br><br>
-	  * 
-	  */
-	 public void setCurrentPetSkill(L2Skill currentSkill, boolean ctrlPressed, boolean shiftPressed)
-	 {
-		 if (currentSkill == null)
-		 {
-			 if (Config.DEBUG)
-				 _log.info("Setting current pet skill: NULL for " + getName() + ".");
-			 
-			 _currentPetSkill = null;
-			 return;
-		 }
-		 
-		 if (Config.DEBUG)
-			 _log.info("Setting current Pet skill: " + currentSkill.getName() + " (ID: " + currentSkill.getId() + ") for " + getName() + ".");
-		 
-		 _currentPetSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed);
-	 }
-	 
-	 
-	 public SkillDat getQueuedSkill()
-	 {
-		 return _queuedSkill;
-	 }
-	 
-	 
-	 /**
-	  * Create a new SkillDat object and queue it in the player _queuedSkill.<BR><BR>
-	  *
-	  */
-	 public void setQueuedSkill(L2Skill queuedSkill, boolean ctrlPressed, boolean shiftPressed)
-	 {
-		 if (queuedSkill == null)
-		 {
-			 if (Config.DEBUG)
-				 _log.info("Setting queued skill: NULL for " + getName() + ".");
-			 
-			 _queuedSkill = null;
-			 return;
-		 }
-		 
-		 if (Config.DEBUG)
-			 _log.info("Setting queued skill: " + queuedSkill.getName() + " (ID: " + queuedSkill.getId() + ") for " + getName() + ".");
-		 
-		 _queuedSkill = new SkillDat(queuedSkill, ctrlPressed, shiftPressed);
-	 }
-	 
-	 /**
-	  * returns punishment level of player
-	  * @return
-	  */
-	 public PunishLevel getPunishLevel()
-	 {
-		 return _punishLevel;
-	 }
-	 
-	 /**
-	  * @return True if player is jailed
-	  */
-	 public boolean isInJail()
-	 {
-		 return _punishLevel == PunishLevel.JAIL;
-	 }
-	 
-	 /**
-	  * @return True if player is chat banned
-	  */
-	 public boolean isChatBanned()
-	 {
-		 return _punishLevel == PunishLevel.CHAT;
-	 }
-	 
-	 public void setPunishLevel(int state)
-	 {
-		 switch (state){
-			 case 0 :
-			 {
-				 _punishLevel = PunishLevel.NONE;
-				 break;
-			 }
-			 case 1 :
-			 {
-				 _punishLevel = PunishLevel.CHAT;
-				 break;
-			 }
-			 case 2 :
-			 {
-				 _punishLevel = PunishLevel.JAIL;
-				 break;
-			 }
-			 case 3 :
-			 {
-				 _punishLevel = PunishLevel.CHAR;
-				 break;
-			 }
-			 case 4 :
-			 {
-				 _punishLevel = PunishLevel.ACC;
-				 break;
-			 }
-		 }
-	 }
-	 
-	 /**
-	  * Sets punish level for player based on delay
-	  * @param state
-	  * @param delayInMinutes
-	  * 		0 - Indefinite
-	  */
-	 public void setPunishLevel(PunishLevel state, int delayInMinutes)
-	 {
-		 long delayInMilliseconds = delayInMinutes * 60000L;
-		 switch (state)
-		 {
-			 case NONE: // Remove Punishments
-			 {
-				 switch (_punishLevel)
-				 {
-					 case CHAT:
-					 {
-						 _punishLevel = state;
-						 stopPunishTask(true);
-						 sendPacket(new EtcStatusUpdate(this));
-						 sendMessage("Your Chat ban has been lifted");
-						 break;
-					 }
-					 case JAIL:
-					 {
-						 _punishLevel = state;
-						 // Open a Html message to inform the player
-						 NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
-						 String jailInfos = HtmCache.getInstance().getHtm(getHtmlPrefix(), "data/html/jail_out.htm");
-						 if (jailInfos != null)
-							 htmlMsg.setHtml(jailInfos);
-						 else
-							 htmlMsg.setHtml("<html><body>You are free for now, respect server rules!</body></html>");
-						 sendPacket(htmlMsg);
-						 stopPunishTask(true);
-						 teleToLocation(17836, 170178, -3507, true);  // Floran
-						 break;
-					 }
-				 }
-				 break;
-			 }
-			 case CHAT: // Chat Ban
-			 {
-				 // not allow player to escape jail using chat ban
-				 if (_punishLevel == PunishLevel.JAIL)
-					 break;
-				 _punishLevel = state;
-				 _punishTimer = 0;
-				 sendPacket(new EtcStatusUpdate(this));
-				 // Remove the task if any
-				 stopPunishTask(false);
-				 
-				 if (delayInMinutes > 0)
-				 {
-					 _punishTimer = delayInMilliseconds;
-					 
-					 // start the countdown
-					 _punishTask = ThreadPoolManager.getInstance().scheduleGeneral(new PunishTask(), _punishTimer);
-					 sendMessage("You are chat banned for "+delayInMinutes+" minutes.");
-				 }
-				 else
-					 sendMessage("You have been chat banned");
-				 break;
-				 
-			 }
-			 case JAIL: // Jail Player
-			 {
-				 _punishLevel = state;
-				 _punishTimer = 0;
-				 // Remove the task if any
-				 stopPunishTask(false);
-				 
-				 if (delayInMinutes > 0)
-				 {
-					 _punishTimer = delayInMilliseconds;
-					 
-					 // start the countdown
-					 _punishTask = ThreadPoolManager.getInstance().scheduleGeneral(new PunishTask(), _punishTimer);
-					 sendMessage("You are in jail for "+delayInMinutes+" minutes.");
-				 }
-				 
-				 if (!TvTEvent.isInactive() && TvTEvent.isPlayerParticipant(getObjectId()))
-					 TvTEvent.removeParticipant(getObjectId());
-				 if (Olympiad.getInstance().isRegisteredInComp(this))
-					 Olympiad.getInstance().removeDisconnectedCompetitor(this);
-				 
-				 // Open a Html message to inform the player
-				 NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
-				 String jailInfos = HtmCache.getInstance().getHtm(getHtmlPrefix(), "data/html/jail_in.htm");
-				 if (jailInfos != null)
-					 htmlMsg.setHtml(jailInfos);
-				 else
-					 htmlMsg.setHtml("<html><body>You have been put in jail by an admin.</body></html>");
-				 sendPacket(htmlMsg);
-				 setInstanceId(0);
-				 setIsIn7sDungeon(false);
-				 
-				 teleToLocation(-114356, -249645, -2984, false);  // Jail
-				 break;
-			 }
-			 case CHAR: // Ban Character
-			 {
-				 setAccessLevel(-100);
-				 logout();
-				 break;
-			 }
-			 case ACC: // Ban Account
-			 {
-				 setAccountAccesslevel(-100);
-				 logout();
-				 break;
-			 }
-			 default:
-			 {
-				 _punishLevel = state;
-				 break;
-			 }
-		 }
-		 
-		 // store in database
-		 storeCharBase();
-	 }
-	 
-	 public long getPunishTimer()
-	 {
-		 return _punishTimer;
-	 }
-	 
-	 public void setPunishTimer(long time)
-	 {
-		 _punishTimer = time;
-	 }
-	 
-	 private void updatePunishState()
-	 {
-		 if (getPunishLevel() != PunishLevel.NONE)
-		 {
-			 // If punish timer exists, restart punishtask.
-			 if (_punishTimer > 0)
-			 {
-				 _punishTask = ThreadPoolManager.getInstance().scheduleGeneral(new PunishTask(), _punishTimer);
-				 sendMessage("You are still "+getPunishLevel().string()+" for "+Math.round(_punishTimer/60000f)+" minutes.");
-			 }
-			 if (getPunishLevel() == PunishLevel.JAIL)
-			 {
-				 // If player escaped, put him back in jail
-				 if (!isInsideZone(ZONE_JAIL))
-					 teleToLocation(-114356,-249645,-2984, true);
-			 }
-		 }
-	 }
-	 
-	 public void stopPunishTask(boolean save)
-	 {
-		 if (_punishTask != null)
-		 {
-			 if (save)
-			 {
-				 long delay = _punishTask.getDelay(TimeUnit.MILLISECONDS);
-				 if (delay < 0)
-					 delay = 0;
-				 setPunishTimer(delay);
-			 }
-			 _punishTask.cancel(false);
-			 //ThreadPoolManager.getInstance().removeGeneral((Runnable)_punishTask);
-			 _punishTask = null;
-		 }
-	 }
-	 
-	 private class PunishTask implements Runnable
-	 {
-		 public void run()
-		 {
-			 L2PcInstance.this.setPunishLevel(PunishLevel.NONE, 0);
-		 }
-	 }
-	 public void startFameTask(long delay, int fameFixRate)
-	 {
-		 if (getLevel() < 40 || getClassId().level() < 2)
-			 return;
-		 if (_fameTask == null)
-			 _fameTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new FameTask(fameFixRate), delay, delay);
-	 }
-	 
-	 public void stopFameTask()
-	 {
-		 if (_fameTask != null)
-		 {
-			 _fameTask.cancel(false);
-			 //ThreadPoolManager.getInstance().removeGeneral((Runnable)_fameTask);
-			 _fameTask = null;
-		 }
-	 }
-	 
-	 private class FameTask implements Runnable
-	 {
-		 private final L2PcInstance _player;
-		 private final int _value;
-		 
-		 protected FameTask(int value)
-		 {
-			 _player = L2PcInstance.this;
-			 _value = value;
-		 }
-		 
-		 public void run()
-		 {
-			 if (_player == null || (_player.isDead() && !Config.FAME_FOR_DEAD_PLAYERS))
-				 return;
-			 if ((_player.getClient() == null || _player.getClient().isDetached()) && !Config.OFFLINE_FAME)
-				 return;
-			 _player.setFame(_player.getFame() + _value);
-			 SystemMessage sm = new SystemMessage(SystemMessageId.ACQUIRED_S1_REPUTATION_SCORE);
-			 sm.addNumber(_value);
-			 _player.sendPacket(sm);
-			 _player.sendPacket(new UserInfo(_player));
-		 }
-	 }
-	 
-	 public void startVitalityTask()
-	 {
-		 if (Config.ENABLE_VITALITY && _vitalityTask == null)
-		 {
-			 _vitalityTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new VitalityTask(this), 1000, 60000);
-		 }
-	 }
-	 
-	 public void stopVitalityTask()
-	 {
-		 if (_vitalityTask != null)
-		 {
-			 _vitalityTask.cancel(false);
-			 //ThreadPoolManager.getInstance().removeGeneral((Runnable)_vitalityTask);
-			 _vitalityTask = null;
-		 }
-	 }
-	 
-	 private class VitalityTask implements Runnable
-	 {
-		 private final L2PcInstance _player;
-		 
-		 protected VitalityTask(L2PcInstance player)
-		 {
-			 _player = player;
-		 }
-		 
-		 public void run()
-		 {
-			 if (!_player.isInsideZone(L2Character.ZONE_PEACE))
-				 return;
-			 
-			 if (_player.getVitalityPoints() >= PcStat.MAX_VITALITY_POINTS)
-				 return;
-			 
-			 _player.updateVitalityPoints(Config.RATE_RECOVERY_VITALITY_PEACE_ZONE, false, false);
-			 _player.sendPacket(new ExVitalityPointInfo(getVitalityPoints()));
-		 }
-	 }
-	 
-	 /**
-	  * @return
-	  */
-	 public int getPowerGrade()
-	 {
-		 return _powerGrade;
-	 }
-	 
-	 /**
-	  * @return
-	  */
-	 public void setPowerGrade(int power)
-	 {
-		 _powerGrade = power;
-	 }
-	 
-	 public boolean isCursedWeaponEquipped()
-	 {
-		 return _cursedWeaponEquippedId != 0;
-	 }
-	 
-	 public void setCursedWeaponEquippedId(int value)
-	 {
-		 _cursedWeaponEquippedId = value;
-	 }
-	 
-	 public int getCursedWeaponEquippedId()
-	 {
-		 return _cursedWeaponEquippedId;
-	 }
-	 
-	 @Override
-	 public boolean isAttackingDisabled()
-	 {
-		 return (super.isAttackingDisabled() || _combatFlagEquippedId);
-	 }
-	 
-	 public boolean isCombatFlagEquipped()
-	 {
-		 return _combatFlagEquippedId ;
-	 }
-	 
-	 public void setCombatFlagEquipped(boolean value)
-	 {
-		 _combatFlagEquippedId = value;
-	 }
-	 
-	 public boolean getCharmOfCourage()
-	 {
-		 return _charmOfCourage;
-	 }
-	 
-	 public void setCharmOfCourage(boolean val)
-	 {
-		 _charmOfCourage = val;
-		 sendPacket(new EtcStatusUpdate(this));
-	 }
-	 
-	 public final void setIsRidingStrider(boolean mode)
-	 {
-		 _isRidingStrider = mode;
-	 }
-	 
-	 /* not used anymore
-	public final void setIsRidingFenrirWolf(boolean mode)
+	
+	/**
+	 * @return Returns the mountLevel.
+	 */
+	public int getMountLevel()
 	{
-		_isRidingFenrirWolf = mode;
+		return _mountLevel;
 	}
-	public final void setIsRidingWFenrirWolf(boolean mode)
+	
+	public void setMountObjectID(int newID)
 	{
-		_isRidingWFenrirWolf = mode;
+		_mountObjectID = newID;
 	}
-	public final void setIsRidingGreatSnowWolf(boolean mode)
+	
+	public int getMountObjectID()
 	{
-		_isRidingGreatSnowWolf = mode;
+		return _mountObjectID;
 	}
-	public final boolean isRidingFenrirWolf()
+	
+	private L2ItemInstance _lure = null;
+	public int _shortBuffTaskSkillId = 0;
+	
+	/**
+	 * Get the current skill in use or return null.<BR><BR>
+	 *
+	 */
+	public SkillDat getCurrentSkill()
 	{
-		return _isRidingFenrirWolf;
+		return _currentSkill;
 	}
-	public final boolean isRidingWFenrirWolf()
+	
+	
+	/**
+	 * Create a new SkillDat object and set the player _currentSkill.<BR><BR>
+	 *
+	 */
+	public void setCurrentSkill(L2Skill currentSkill, boolean ctrlPressed,
+			boolean shiftPressed)
 	{
-		return _isRidingWFenrirWolf;
+		if (currentSkill == null)
+		{
+			if (Config.DEBUG)
+				_log.info("Setting current skill: NULL for " + getName() + ".");
+			
+			_currentSkill = null;
+			return;
+		}
+		
+		if (Config.DEBUG)
+			_log.info("Setting current skill: " + currentSkill.getName() + " (ID: " + currentSkill.getId() + ") for " + getName() + ".");
+		
+		_currentSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed);
 	}
-	public final boolean isRidingGreatSnowWolf()
+	
+	/**
+	 * Get the current pet skill in use or return null.<br><br>
+	 * 
+	 */
+	public SkillDat getCurrentPetSkill()
 	{
-		return _isRidingGreatSnowWolf;
-	}*/
-	 
-	 public final boolean isRidingStrider()
-	 {
-		 return _isRidingStrider;
-	 }
-	 
-	 /**
-	  * Returns the Number of Souls this L2PcInstance got.
-	  * @return
-	  */
-	 public int getSouls()
-	 {
-		 return _souls;
-	 }
-	 
-	 /**
-	  * Absorbs a Soul from a Npc.
-	  * @param skill
-	  * @param target
-	  */
-	 public void absorbSoul(L2Skill skill, L2Npc npc)
-	 {
-		 if (_souls >= skill.getNumSouls())
-		 {
-			 SystemMessage sm = new SystemMessage(SystemMessageId.SOUL_CANNOT_BE_INCREASED_ANYMORE);
-			 sendPacket(sm);
-			 return;
-		 }
-		 
-		 increaseSouls(1);
-		 
-		 if (npc != null)
-			 broadcastPacket(new ExSpawnEmitter(this, npc), 500);
-	 }
-	 
-	 /**
-	  * Increase Souls
-	  * @param count
-	  */
-	 public void increaseSouls(int count)
-	 {
-		 if (count < 0 || count > 45)
-			 return;
-		 
-		 _souls += count;
-		 
-		 if (getSouls() > 45)
-			 _souls = 45;
-		 
-		 SystemMessage sm = new SystemMessage(SystemMessageId.YOUR_SOUL_HAS_INCREASED_BY_S1_SO_IT_IS_NOW_AT_S2);
-		 sm.addNumber(count);
-		 sm.addNumber(_souls);
-		 sendPacket(sm);
-		 
-		 restartSoulTask();
-		 
-		 sendPacket(new EtcStatusUpdate(this));
-	 }
-	 
-	 /**
-	  * Decreases existing Souls.
-	  * @param count
-	  */
-	 public boolean decreaseSouls(int count, L2Skill skill)
-	 {
-		 if (getSouls() <= 0 && skill.getSoulConsumeCount() > 0)
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.THERE_IS_NOT_ENOUGH_SOUL));
-			 return false;
-		 }
-		 
-		 _souls -= count;
-		 
-		 if (getSouls() < 0)
-			 _souls = 0;
-		 
-		 if (getSouls() == 0)
-			 stopSoulTask();
-		 else
-			 restartSoulTask();
-		 
-		 sendPacket(new EtcStatusUpdate(this));
-		 return true;
-	 }
-	 
-	 /**
-	  * Clear out all Souls from this L2PcInstance
-	  */
-	 public void clearSouls()
-	 {
-		 _souls = 0;
-		 stopSoulTask();
-		 sendPacket(new EtcStatusUpdate(this));
-	 }
-	 
-	 /**
-	  * Starts/Restarts the SoulTask to Clear Souls after 10 Mins.
-	  */
-	 private void restartSoulTask()
-	 {
-		 synchronized(this)
-		 {
-			 if (_soulTask != null)
-			 {
-				 _soulTask.cancel(false);
-				 _soulTask = null;
-			 }
-			 _soulTask = ThreadPoolManager.getInstance().scheduleGeneral(new SoulTask(), 600000);
-		 }
-	 }
-	 
-	 /**
-	  * Stops the Clearing Task.
-	  */
-	 public void stopSoulTask()
-	 {
-		 if (_soulTask != null)
-		 {
-			 _soulTask.cancel(false);
-			 //ThreadPoolManager.getInstance().removeGeneral((Runnable)_soulTask);
-			 _soulTask = null;
-		 }
-	 }
-	 
-	 private class SoulTask implements Runnable
-	 {
-		 public void run()
-		 {
-			 L2PcInstance.this.clearSouls();
-		 }
-	 }
-	 
-	 /**
-	  *
-	  * @param magicId
-	  * @param level
-	  * @param time
-	  */
-	 public void shortBuffStatusUpdate(int magicId, int level, int time)
-	 {
-		 if (_shortBuffTask != null)
-		 {
-			 _shortBuffTask.cancel(false);
-			 _shortBuffTask = null;
-		 }
-		 _shortBuffTask = ThreadPoolManager.getInstance().scheduleGeneral(new ShortBuffTask(), time*1000);
-		 setShortBuffTaskSkillId(magicId);
-		 
-		 sendPacket(new ShortBuffStatusUpdate(magicId, level, time));
-	 }
-	 
-	 public void setShortBuffTaskSkillId(int id)
-	 {
-		 _shortBuffTaskSkillId = id;
-	 }
-	 public int getDeathPenaltyBuffLevel()
-	 {
-		 return _deathPenaltyBuffLevel;
-	 }
-	 
-	 public void setDeathPenaltyBuffLevel(int level)
-	 {
-		 _deathPenaltyBuffLevel = level;
-	 }
-	 
-	 public void calculateDeathPenaltyBuffLevel(L2Character killer)
-	 {
-		 if((getKarma() > 0 || Rnd.get(1,100) <= Config.DEATH_PENALTY_CHANCE)
-				 && !(killer instanceof L2PcInstance) && !(this.isGM())
-				 && !(this.getCharmOfLuck() && killer.isRaid())
-				 && !isPhoenixBlessed()
-				 && !(TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(getObjectId()))
-				 && !(this.isInsideZone(L2Character.ZONE_PVP)||this.isInsideZone(L2Character.ZONE_SIEGE)))
-			 
-			 increaseDeathPenaltyBuffLevel();
-	 }
-	 
-	 public void increaseDeathPenaltyBuffLevel()
-	 {
-		 if(getDeathPenaltyBuffLevel() >= 15) //maximum level reached
-			 return;
-		 
-		 if(getDeathPenaltyBuffLevel() != 0)
-		 {
-			 L2Skill skill = SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel());
-			 
-			 if(skill != null)
-				 removeSkill(skill, true);
-		 }
-		 
-		 _deathPenaltyBuffLevel++;
-		 
-		 addSkill(SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel()), false);
-		 sendPacket(new EtcStatusUpdate(this));
-		 SystemMessage sm = new SystemMessage(SystemMessageId.DEATH_PENALTY_LEVEL_S1_ADDED);
-		 sm.addNumber(getDeathPenaltyBuffLevel());
-		 sendPacket(sm);
-	 }
-	 
-	 public void reduceDeathPenaltyBuffLevel()
-	 {
-		 if(getDeathPenaltyBuffLevel() <= 0)
-			 return;
-		 
-		 L2Skill skill = SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel());
-		 
-		 if(skill != null)
-			 removeSkill(skill, true);
-		 
-		 _deathPenaltyBuffLevel--;
-		 
-		 if(getDeathPenaltyBuffLevel() > 0)
-		 {
-			 addSkill(SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel()), false);
-			 sendPacket(new EtcStatusUpdate(this));
-			 SystemMessage sm = new SystemMessage(SystemMessageId.DEATH_PENALTY_LEVEL_S1_ADDED);
-			 sm.addNumber(getDeathPenaltyBuffLevel());
-			 sendPacket(sm);
-		 }
-		 else
-		 {
-			 sendPacket(new EtcStatusUpdate(this));
-			 sendPacket(new SystemMessage(SystemMessageId.DEATH_PENALTY_LIFTED));
-		 }
-	 }
-	 
-	 public void restoreDeathPenaltyBuffLevel()
-	 {
-		 L2Skill skill = SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel());
-		 
-		 if(skill != null)
-			 removeSkill(skill, true);
-		 
-		 if(getDeathPenaltyBuffLevel() > 0)
-		 {
-			 addSkill(SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel()), false);
-		 }
-	 }
-	 
-	 private FastMap<Integer, TimeStamp> _reuseTimeStamps = new FastMap<Integer, TimeStamp>().shared();
-	 private boolean _canFeed;
-	 private int _eventEffectId = 0;
-	 private boolean _isInSiege;
-	 
-	 public Collection<TimeStamp> getReuseTimeStamps()
-	 {
-		 return _reuseTimeStamps.values();
-	 }
-	 
-	 public FastMap<Integer, TimeStamp> getReuseTimeStamp()
-	 {
-		 return _reuseTimeStamps;
-	 }
-	 
-	 /**
-	  * Simple class containing all neccessary information to maintain
-	  * valid timestamps and reuse for skills upon relog. Filter this
-	  * carefully as it becomes redundant to store reuse for small delays.
-	  * @author  Yesod
-	  */
-	 public static class TimeStamp
-	 {
-		 private final int _skillId;
-		 private final int _skillLvl;
-		 private final long _reuse;
-		 private final long _stamp;
-		 
-		 public TimeStamp(L2Skill skill, long reuse)
-		 {
-			 _skillId = skill.getId();
-			 _skillLvl = skill.getLevel();
-			 _reuse = reuse;
-			 _stamp = System.currentTimeMillis()+ reuse;
-		 }
-		 
-		 public TimeStamp(L2Skill skill, long reuse, long systime)
-		 {
-			 _skillId = skill.getId();
-			 _skillLvl = skill.getLevel();
-			 _reuse = reuse;
-			 _stamp = systime;
-		 }
-		 
-		 public long getStamp()
-		 {
-			 return _stamp;
-		 }
-		 
-		 public int getSkillId()
-		 {
-			 return _skillId;
-		 }
-		 
-		 public int getSkillLvl()
-		 {
-			 return _skillLvl;
-		 }
-		 
-		 public long getReuse()
-		 {
-			 return _reuse;
-		 }
-		 
-		 public long getRemaining()
-		 {
-			 return Math.max(_stamp - System.currentTimeMillis(), 0);
-		 }
-		 
-		 /* Check if the reuse delay has passed and
-		  * if it has not then update the stored reuse time
-		  * according to what is currently remaining on
-		  * the delay. */
-		 public boolean hasNotPassed()
-		 {
-			 return System.currentTimeMillis() < _stamp;
-		 }
-	 }
-	 
-	 /**
-	  * Index according to skill id the current
-	  * timestamp of use.
-	  * @param skillid
-	  * @param reuse delay
-	  */
-	 @Override
-	 public void addTimeStamp(L2Skill skill, long reuse)
-	 {
-		 _reuseTimeStamps.put(skill.getReuseHashCode(), new TimeStamp(skill, reuse));
-	 }
-	 
-	 /**
-	  * Index according to skill this TimeStamp
-	  * instance for restoration purposes only.
-	  * @param TimeStamp
-	  */
-	 public void addTimeStamp(L2Skill skill, long reuse, long systime)
-	 {
-		 _reuseTimeStamps.put(skill.getReuseHashCode(), new TimeStamp(skill, reuse, systime));
-	 }
-	 
-	 @Override
-	 public L2PcInstance getActingPlayer()
-	 {
-		 return this;
-	 }
-	 
-	 @Override
-	 public final void sendDamageMessage(L2Character target, int damage, boolean mcrit, boolean pcrit, boolean miss)
-	 {
-		 // Check if hit is missed
-		 if (miss)
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.C1_ATTACK_WENT_ASTRAY).addPcName(this));
-			 return;
-		 }
-		 
-		 // Check if hit is critical
-		 if (pcrit)
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.C1_HAD_CRITICAL_HIT).addPcName(this));
-			 if (target instanceof L2Npc && getSkillLevel(467) > 0)
-			 {
-				 L2Skill skill = SkillTable.getInstance().getInfo(467,getSkillLevel(467));
-				 if (Rnd.get(100) < skill.getCritChance())
-				 {
-					 absorbSoul(skill,((L2Npc)target));
-				 }
-			 }
-		 }
-		 if (mcrit)
-			 sendPacket(new SystemMessage(SystemMessageId.CRITICAL_HIT_MAGIC));
-		 
-		 if (isInOlympiadMode() &&
-				 target instanceof L2PcInstance &&
-				 ((L2PcInstance)target).isInOlympiadMode() &&
-				 ((L2PcInstance)target).getOlympiadGameId() == getOlympiadGameId())
-		 {
-			 Olympiad.getInstance().notifyCompetitorDamage(this, damage, getOlympiadGameId());
-		 }
-		 
-		 final SystemMessage sm;
-		 
-		 if (target.isInvul() && !(target instanceof L2NpcInstance))
-		 {
-			 sm = new SystemMessage(SystemMessageId.ATTACK_WAS_BLOCKED);
-		 }
-		 else if (target instanceof L2DoorInstance || target instanceof L2ControlTowerInstance)
-		 {
-			 sm = new SystemMessage(SystemMessageId.YOU_DID_S1_DMG);
-			 sm.addNumber(damage);
-		 }
-		 else
-		 {
-			 sm = new SystemMessage(SystemMessageId.C1_GAVE_C2_DAMAGE_OF_S3);
-			 sm.addPcName(this);
-			 sm.addCharName(target);
-			 sm.addNumber(damage);
-		 }
-		 
-		 sendPacket(sm);
-	 }
-	 
-	 
-	 /**
-	  * 
-	  * @param npcId
-	  */
-	 public void setAgathionId(int npcId)
-	 {
-		 _agathionId = npcId;
-	 }
-	 
-	 /**
-	  * 
-	  * @return
-	  */
-	 public int getAgathionId()
-	 {
-		 return _agathionId;
-	 }
-	 
-	 public int getVitalityPoints()
-	 {
-		 return getStat().getVitalityPoints();
-	 }
-	 
-	 /**
-	  * @return Vitality Level
-	  */
-	 public int getVitalityLevel()
-	 {
-		 return getStat().getVitalityLevel();
-	 }
-	 
-	 public void setVitalityPoints(int points, boolean quiet)
-	 {
-		 getStat().setVitalityPoints(points, quiet);
-	 }
-	 
-	 public void updateVitalityPoints(float points, boolean useRates, boolean quiet)
-	 {
-		 getStat().updateVitalityPoints(points, useRates, quiet);
-	 }
-	 
-	 /*
-	  * Function for skill summon friend or Gate Chant.
-	  */
-	 /** Request Teleport **/
-	 public boolean teleportRequest(L2PcInstance requester, L2Skill skill)
-	 {
-		 if (_summonRequest.getTarget() != null && requester != null)
-			 return false;
-		 _summonRequest.setTarget(requester, skill);
-		 return true;
-	 }
-	 
-	 /** Action teleport **/
-	 public void teleportAnswer(int answer, int requesterId)
-	 {
-		 if (_summonRequest.getTarget() == null)
-			 return;
-		 if (answer == 1 && _summonRequest.getTarget().getCharId() == requesterId)
-		 {
-			 teleToTarget(this, _summonRequest.getTarget(), _summonRequest.getSkill());
-		 }
-		 _summonRequest.setTarget(null, null);
-	 }
-	 
-	 public static void teleToTarget(L2PcInstance targetChar, L2PcInstance summonerChar, L2Skill summonSkill)
-	 {
-		 if (targetChar == null || summonerChar == null || summonSkill == null)
-			 return;
-		 
-		 if (!checkSummonerStatus(summonerChar))
-			 return;
-		 if (!checkSummonTargetStatus(targetChar, summonerChar))
-			 return;
-		 
-		 int itemConsumeId = summonSkill.getTargetConsumeId();
-		 int itemConsumeCount = summonSkill.getTargetConsume();
-		 if (itemConsumeId != 0 && itemConsumeCount != 0)
-		 {
-			 //Delete by rocknow
-			 if (targetChar.getInventory().getInventoryItemCount(itemConsumeId, 0) < itemConsumeCount)
-			 {
-				 SystemMessage sm = new SystemMessage(SystemMessageId.S1_REQUIRED_FOR_SUMMONING);
-				 sm.addItemName(summonSkill.getTargetConsumeId());
-				 targetChar.sendPacket(sm);
-				 return;
-			 }
-			 targetChar.getInventory().destroyItemByItemId("Consume", itemConsumeId, itemConsumeCount, summonerChar, targetChar);
-			 SystemMessage sm = new SystemMessage(SystemMessageId.S1_DISAPPEARED);
-			 sm.addItemName(summonSkill.getTargetConsumeId());
-			 targetChar.sendPacket(sm);
-		 }
-		 targetChar.teleToLocation(summonerChar.getX(), summonerChar.getY(), summonerChar.getZ(), true);
-	 }
-	 
-	 public static boolean checkSummonerStatus(L2PcInstance summonerChar)
-	 {
-		 if (summonerChar == null)
-			 return false;
-		 
-		 if (summonerChar.isInOlympiadMode())
-		 {
-			 summonerChar.sendPacket(new SystemMessage(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT));
-			 return false;
-		 }
-		 
-		 if (summonerChar.inObserverMode())
-		 {
-			 return false;
-		 }
-		 
-		 if (!TvTEvent.onEscapeUse(summonerChar.getObjectId()))
-		 {
-			 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
-			 return false;
-		 }
-		 
-		 if (summonerChar.isInsideZone(L2Character.ZONE_NOSUMMONFRIEND) || summonerChar.isFlyingMounted())
-		 {
-			 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
-			 return false;
-		 }
-		 return true;
-	 }
-	 
-	 public static boolean checkSummonTargetStatus(L2Object target, L2PcInstance summonerChar)
-	 {
-		 if (target == null || !(target instanceof L2PcInstance))
-			 return false;
-		 
-		 L2PcInstance targetChar = (L2PcInstance) target;
-		 
-		 if (targetChar.isAlikeDead())
-		 {
-			 SystemMessage sm = new SystemMessage(SystemMessageId.C1_IS_DEAD_AT_THE_MOMENT_AND_CANNOT_BE_SUMMONED);
-			 sm.addPcName(targetChar);
-			 summonerChar.sendPacket(sm);
-			 return false;
-		 }
-		 
-		 if (targetChar.isInStoreMode())
-		 {
-			 SystemMessage sm = new SystemMessage(SystemMessageId.C1_CURRENTLY_TRADING_OR_OPERATING_PRIVATE_STORE_AND_CANNOT_BE_SUMMONED);
-			 sm.addPcName(targetChar);
-			 summonerChar.sendPacket(sm);
-			 return false;
-		 }
-		 
-		 if (targetChar.isRooted() || targetChar.isInCombat())
-		 {
-			 SystemMessage sm = new SystemMessage(SystemMessageId.C1_IS_ENGAGED_IN_COMBAT_AND_CANNOT_BE_SUMMONED);
-			 sm.addPcName(targetChar);
-			 summonerChar.sendPacket(sm);
-			 return false;
-		 }
-		 
-		 if (targetChar.isInOlympiadMode())
-		 {
-			 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_SUMMON_PLAYERS_WHO_ARE_IN_OLYMPIAD));
-			 return false;
-		 }
-		 
-		 if (targetChar.isFestivalParticipant() || targetChar.isFlyingMounted())
-		 {
-			 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
-			 return false;
-		 }
-		 
-		 if (targetChar.inObserverMode())
-		 {
-			 summonerChar.sendPacket(new SystemMessage(SystemMessageId.C1_STATE_FORBIDS_SUMMONING).addCharName(targetChar));
-			 return false;
-		 }
-		 
-		 if (targetChar.isCombatFlagEquipped())
-		 {
-			 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
-			 return false;
-		 }
-		 
-		 if (!TvTEvent.onEscapeUse(targetChar.getObjectId()))
-		 {
-			 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
-			 return false;
-		 }
-		 
-		 if (targetChar.isInsideZone(L2Character.ZONE_NOSUMMONFRIEND))
-		 {
-			 SystemMessage sm = new SystemMessage(SystemMessageId.C1_IN_SUMMON_BLOCKING_AREA);
-			 sm.addString(targetChar.getName());
-			 summonerChar.sendPacket(sm);
-			 return false;
-		 }
-		 
-		 if (summonerChar.getInstanceId() > 0)
-		 {
-			 Instance summonerInstance = InstanceManager.getInstance().getInstance(summonerChar.getInstanceId());
-			 if (!Config.ALLOW_SUMMON_TO_INSTANCE || !summonerInstance.isSummonAllowed())
-			 {
-				 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION));
-				 return false;
-			 }
-		 }
-		 
-		 // on retail character can enter 7s dungeon with summon friend,
-		 // but will be teleported away by mobs
-		 // because currently this is not working in L2J we do not allowing summoning
-		 if (summonerChar.isIn7sDungeon())
-		 {
-			 int targetCabal = SevenSigns.getInstance().getPlayerCabal(targetChar.getObjectId());
-			 if (SevenSigns.getInstance().isSealValidationPeriod())
-			 {
-				 if (targetCabal != SevenSigns.getInstance().getCabalHighestScore())
-				 {
-					 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
-					 return false;
-				 }
-			 }
-			 else
-			 {
-				 if (targetCabal == SevenSigns.CABAL_NULL)
-				 {
-					 summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
-					 return false;
-				 }
-			 }
-		 }
-		 
-		 return true;
-	 }
-	 
-	 public void gatesRequest(L2DoorInstance door)
-	 {
-		 _gatesRequest.setTarget(door);
-	 }
-	 
-	 public void gatesAnswer(int answer, int type)
-	 {
-		 if (_gatesRequest.getDoor() == null)
-			 return;
-		 
-		 if (answer == 1 && getTarget() == _gatesRequest.getDoor() && type == 1)
-			 _gatesRequest.getDoor().openMe();
-		 else if (answer == 1 && getTarget() == _gatesRequest.getDoor() && type == 0)
-			 _gatesRequest.getDoor().closeMe();
-		 
-		 _gatesRequest.setTarget(null);
-	 }
-	 
-	 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, false)
-					 || (isInOlympiadMode() && equippedItem.isOlyRestrictedItem())))
-			 {
-				 getInventory().unEquipItemInSlotAndRecord(i);
-				 
-				 InventoryUpdate iu = new InventoryUpdate();
-				 iu.addModifiedItem(equippedItem);
-				 sendPacket(iu);
-				 
-				 if (equippedItem.isWear())
-					 continue;
-				 
-				 // prevent double message for two-hand weapons
-				 if (i == Inventory.PAPERDOLL_LRHAND)
-					 continue;
-				 
-				 SystemMessage sm = null;
-				 if (equippedItem.getItem().getBodyPart() == L2Item.SLOT_BACK)
-				 {
-					 sendPacket(new SystemMessage(SystemMessageId.CLOAK_REMOVED_BECAUSE_ARMOR_SET_REMOVED));
-					 return;
-				 }
-				 
-				 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);
-			 }
-		 }
-	 }
-	 
-	 public void setTransformAllowedSkills(int[] ids)
-	 {
-		 _transformAllowedSkills = ids;
-	 }
-	 
-	 public boolean containsAllowedTransformSkill(int id)
-	 {
-		 for (int i = 0; i < _transformAllowedSkills.length; i++)
-		 {
-			 if (_transformAllowedSkills[i] == id)
-			 {
-				 return true;
-			 }
-		 }
-		 return false;
-	 }
-	 
-	 /** Section for mounted pets */
-	 private class FeedTask implements Runnable
-	 {
-		 public void run()
-		 {
-			 try
-			 {
-				 if (!isMounted())
-				 {
-					 stopFeed();
-					 return;
-				 }
-				 
-				 if (getCurrentFeed() > getFeedConsume())
-				 {
-					 // eat
-					 setCurrentFeed(getCurrentFeed()-getFeedConsume());
-				 }
-				 else
-				 {
-					 // go back to pet control item, or simply said, unsummon it
-					 setCurrentFeed(0);
-					 stopFeed();
-					 dismount();
-					 sendPacket(new SystemMessage(SystemMessageId.OUT_OF_FEED_MOUNT_CANCELED));
-				 }
-				 
-				 int[] foodIds = PetDataTable.getFoodItemId(getMountNpcId());
-				 if (foodIds[0] == 0) return;
-				 L2ItemInstance food = null;
-				 food = getInventory().getItemByItemId(foodIds[0]);
-				 
-				 // use better strider food if exists
-				 if (PetDataTable.isStrider(getMountNpcId()))
-				 {
-					 if (getInventory().getItemByItemId(foodIds[1]) != null)
-						 food = getInventory().getItemByItemId(foodIds[1]);
-				 }
-				 if (food != null && isHungry())
-				 {
-					 IItemHandler handler = ItemHandler.getInstance().getItemHandler(food.getEtcItem());
-					 if (handler != null)
-					 {
-						 handler.useItem(L2PcInstance.this, food, false);
-						 SystemMessage sm = new SystemMessage(SystemMessageId.PET_TOOK_S1_BECAUSE_HE_WAS_HUNGRY);
-						 sm.addItemName(food.getItemId());
-						 sendPacket(sm);
-					 }
-				 }
-			 }
-			 catch (Exception e)
-			 {
-				 _log.log(Level.SEVERE, "Mounted Pet [NpcId: "+getMountNpcId()+"] a feed task error has occurred", e);
-			 }
-		 }
-	 }
-	 
-	 protected synchronized void startFeed(int npcId)
-	 {
-		 _canFeed = npcId > 0;
-		 if (!isMounted())
-			 return;
-		 if (getPet() != null)
-		 {
-			 setCurrentFeed(((L2PetInstance) getPet()).getCurrentFed());
-			 _controlItemId = getPet().getControlObjectId();
-			 sendPacket(new SetupGauge(3, getCurrentFeed()*10000/getFeedConsume(), getMaxFeed()*10000/getFeedConsume()));
-			 if (!isDead())
-			 {
-				 _mountFeedTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new FeedTask(), 10000, 10000);
-			 }
-		 }
-		 else if (_canFeed)
-		 {
-			 setCurrentFeed(getMaxFeed());
-			 SetupGauge sg = new SetupGauge(3, getCurrentFeed()*10000/getFeedConsume(), getMaxFeed()*10000/getFeedConsume());
-			 sendPacket(sg);
-			 if (!isDead())
-			 {
-				 _mountFeedTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new FeedTask(), 10000, 10000);
-			 }
-		 }
-	 }
-	 
-	 protected synchronized void stopFeed()
-	 {
-		 if (_mountFeedTask != null)
-		 {
-			 _mountFeedTask.cancel(false);
-			 //ThreadPoolManager.getInstance().removeGeneral((Runnable)_mountFeedTask);
-			 _mountFeedTask = null;
-			 if (Config.DEBUG) _log.fine("Pet [#"+_mountNpcId+"] feed task stop");
-		 }
-	 }
-	 
-	 protected final void clearPetData()
-	 {
-		 _data = null;
-	 }
-	 
-	 protected final L2PetData getPetData(int npcId)
-	 {
-		 if (_data == null && getPet() != null)
-			 _data = PetDataTable.getInstance().getPetData(getPet().getNpcId(), getPet().getLevel());
-		 else if (_data == null && npcId > 0)
-		 {
-			 _data = PetDataTable.getInstance().getPetData(npcId, getLevel());
-		 }
-		 
-		 return _data;
-	 }
-	 
-	 public int getCurrentFeed() { return _curFeed; }
-	 
-	 protected int getFeedConsume()
-	 {
-		 // if pet is attacking
-		 if (isAttackingNow())
-			 return getPetData(_mountNpcId).getPetFeedBattle();
-		 else
-			 return getPetData(_mountNpcId).getPetFeedNormal();
-	 }
-	 
-	 public void setCurrentFeed(int num)
-	 {
-		 _curFeed = num > getMaxFeed() ? getMaxFeed() : num;
-		 SetupGauge sg = new SetupGauge(3, getCurrentFeed()*10000/getFeedConsume(), getMaxFeed()*10000/getFeedConsume());
-		 sendPacket(sg);
-	 }
-	 
-	 protected int getMaxFeed()
-	 {
-		 return getPetData(_mountNpcId).getPetMaxFeed();
-	 }
-	 
-	 protected boolean isHungry()
-	 {
-		 return _canFeed ? (getCurrentFeed() < (0.55 * getPetData(getMountNpcId()).getPetMaxFeed())):false;
-	 }
-	 
-	 private class Dismount implements Runnable
-	 {
-		 public void run()
-		 {
-			 try
-			 {
-				 L2PcInstance.this.dismount();
-			 }
-			 catch (Exception e)
-			 {
-				 _log.log(Level.WARNING, "Exception on dismount(): " + e.getMessage(), e);
-			 }
-		 }
-	 }
-	 
-	 public void enteredNoLanding(int delay)
-	 {
-		 _dismountTask = ThreadPoolManager.getInstance().scheduleGeneral(new L2PcInstance.Dismount(), delay * 1000);
-	 }
-	 
-	 public void exitedNoLanding()
-	 {
-		 if (_dismountTask != null)
-		 {
-			 _dismountTask.cancel(true);
-			 _dismountTask = null;
-		 }
-	 }
-	 
-	 public void storePetFood(int petId)
-	 {
-		 if (_controlItemId != 0 && petId != 0)
-		 {
-			 String req;
-			 req = "UPDATE pets SET fed=? WHERE item_obj_id = ?";
-			 Connection con = null;
-			 try
-			 {
-				 con = L2DatabaseFactory.getInstance().getConnection();
-				 PreparedStatement statement = con.prepareStatement(req);
-				 statement.setInt(1, getCurrentFeed());
-				 statement.setInt(2, _controlItemId);
-				 statement.executeUpdate();
-				 statement.close();
-				 _controlItemId = 0;
-			 }
-			 catch (Exception e)
-			 {
-				 _log.log(Level.SEVERE, "Failed to store Pet [NpcId: "+petId+"] data", e);
-			 }
-			 finally
-			 {
-				 L2DatabaseFactory.close(con);
-			 }
-		 }
-	 }
-	 /** End of section for mounted pets */
-	 
-	 @Override
-	 public int getAttackElementValue(byte attribute)
-	 {
-		 int value = super.getAttackElementValue(attribute);
-		 
-		 // 20% if summon exist
-		 if (getPet() != null && getClassId().isSummoner() && (getPet() instanceof L2SummonInstance))
-			 return value / 5;
-		 
-		 return value;
-	 }
-	 
-	 /**
-	  * @return event effect id
-	  */
-	 public int getEventEffectId()
-	 {
-		 return _eventEffectId ;
-	 }
-	 
-	 public void startEventEffect(AbnormalEffect mask)
-	 {
-		 _eventEffectId |= mask.getMask();
-		 broadcastUserInfo();
-	 }
-	 
-	 public void stopEventEffect(AbnormalEffect mask)
-	 {
-		 _eventEffectId &= ~mask.getMask();
-		 broadcastUserInfo();
-	 }
-	 
-	 public void setIsInSiege(boolean b)
-	 {
-		 _isInSiege = b;
-	 }
-	 
-	 public boolean isInSiege()
-	 {
-		 return _isInSiege;
-	 }
-	 
-	 public FloodProtectors getFloodProtectors()
-	 {
-		 return getClient().getFloodProtectors();
-	 }
-	 
-	 public boolean isFlyingMounted()
-	 {
-		 return _isFlyingMounted;
-	 }
-	 
-	 public void setIsFlyingMounted(boolean val)
-	 {
-		 _isFlyingMounted = val;
-		 setIsFlying(val);
-	 }
-	 
-	 /**
-	  * Returns the Number of Charges this L2PcInstance got.
-	  * @return
-	  */
-	 public int getCharges()
-	 {
-		 return _charges.get();
-	 }
-	 
-	 public synchronized void increaseCharges(int count, int max)
-	 {
-		 if (_charges.get() >= max)
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.FORCE_MAXLEVEL_REACHED));
-			 return;
-		 }
-		 else
-		 {
-			 // if no charges - start clear task
-			 if (_charges.get() == 0)
-				 restartChargeTask();
-		 }
-		 
-		 if (_charges.addAndGet(count) >= max)
-		 {
-			 _charges.set(max);
-			 sendPacket(new SystemMessage(SystemMessageId.FORCE_MAXLEVEL_REACHED));
-		 }
-		 else
-		 {
-			 SystemMessage sm = new SystemMessage(SystemMessageId.FORCE_INCREASED_TO_S1);
-			 sm.addNumber(_charges.get());
-			 sendPacket(sm);
-		 }
-		 
-		 sendPacket(new EtcStatusUpdate(this));
-	 }
-	 
-	 public synchronized boolean decreaseCharges(int count)
-	 {
-		 if (_charges.get() < count)
-			 return false;
-		 
-		 if (_charges.addAndGet(-count) == 0)
-			 stopChargeTask();
-		 
-		 sendPacket(new EtcStatusUpdate(this));
-		 return true;
-	 }
-	 
-	 public void clearCharges()
-	 {
-		 _charges.set(0);
-		 sendPacket(new EtcStatusUpdate(this));
-	 }
-	 
-	 /**
-	  * Starts/Restarts the ChargeTask to Clear Charges after 10 Mins.
-	  */
-	 private void restartChargeTask()
-	 {
-		 if (_chargeTask != null)
-		 {
-			 _chargeTask.cancel(false);
-			 _chargeTask = null;
-		 }
-		 _chargeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChargeTask(), 600000);
-	 }
-	 
-	 /**
-	  * Stops the Charges Clearing Task.
-	  */
-	 public void stopChargeTask()
-	 {
-		 if (_chargeTask != null)
-		 {
-			 _chargeTask.cancel(false);
-			 //ThreadPoolManager.getInstance().removeGeneral((Runnable)_chargeTask);
-			 _chargeTask = null;
-		 }
-	 }
-	 
-	 private class ChargeTask implements Runnable
-	 {
-		 
-		 public void run()
-		 {
-			 L2PcInstance.this.clearCharges();
-		 }
-	 }
-	 
-	 public static class TeleportBookmark
-	 {
-		 public int _id,_x,_y,_z,_icon;
-		 public String _name,_tag;
-		 
-		 TeleportBookmark(int id, int x, int y, int z, int icon, String tag, String name)
-		 {
-			 _id = id;
-			 _x = x;
-			 _y = y;
-			 _z = z;
-			 _icon = icon;
-			 _name = name;
-			 _tag = tag;
-		 }
-		 
-	 }
-	 
-	 public void teleportBookmarkModify(int Id, int icon, String tag, String name)
-	 {
-		 int count = 0;
-		 int size = tpbookmark.size();
-		 while(size > count)
-		 {
-			 if(tpbookmark.get(count)._id==Id)
-			 {
-				 tpbookmark.get(count)._icon = icon;
-				 tpbookmark.get(count)._tag = tag;
-				 tpbookmark.get(count)._name = name;
-				 
-				 Connection con = null;
-				 
-				 try
-				 {
-					 
-					 con = L2DatabaseFactory.getInstance().getConnection();
-					 PreparedStatement statement = con.prepareStatement(UPDATE_TP_BOOKMARK);
-					 
-					 statement.setInt(1, icon);
-					 statement.setString(2, tag);
-					 statement.setString(3, name);
-					 statement.setInt(4, getObjectId());
-					 statement.setInt(5, Id);
-					 
-					 statement.execute();
-					 statement.close();
-				 }
-				 catch (Exception e)
-				 {
-					 _log.log(Level.WARNING, "Could not update character teleport bookmark data: " + e.getMessage(), e);
-				 }
-				 finally
-				 {
-					 L2DatabaseFactory.close(con);
-				 }
-				 
-			 }
-			 count++;
-		 }
-		 
-		 sendPacket(new ExGetBookMarkInfoPacket(this));
-		 
-	 }
-	 
-	 public void teleportBookmarkDelete(int Id)
-	 {
-		 Connection con = null;
-		 
-		 try
-		 {
-			 con = L2DatabaseFactory.getInstance().getConnection();
-			 PreparedStatement statement = con.prepareStatement(DELETE_TP_BOOKMARK);
-			 
-			 statement.setInt(1, getObjectId());
-			 statement.setInt(2, Id);
-			 
-			 statement.execute();
-			 statement.close();
-		 }
-		 catch (Exception e)
-		 {
-			 _log.log(Level.WARNING, "Could not delete character teleport bookmark data: " + e.getMessage(), e);
-		 }
-		 finally
-		 {
-			 L2DatabaseFactory.close(con);
-		 }
-		 
-		 int count = 0;
-		 int size = tpbookmark.size();
-		 
-		 while(size > count)
-		 {
-			 if(tpbookmark.get(count)._id == Id)
-			 {
-				 tpbookmark.remove(count);
-				 break;
-			 }
-			 count++;
-		 }
-		 
-		 sendPacket(new ExGetBookMarkInfoPacket(this));
-	 }
-	 
-	 public void teleportBookmarkGo(int Id)
-	 {
-		 if(!teleportBookmarkCondition(0) || this == null)
-			 return;
-		 if (getInventory().getInventoryItemCount(13016, 0) == 0)
-		 {
-			 sendPacket(new SystemMessage(2359));
-			 return;
-		 }
-		 SystemMessage sm = new SystemMessage(SystemMessageId.S1_DISAPPEARED);
-		 sm.addItemName(13016);
-		 sendPacket(sm);
-		 int count = 0;
-		 int size = tpbookmark.size();
-		 while(size > count)
-		 {
-			 if(tpbookmark.get(count)._id == Id)
-			 {
-				 destroyItem("Consume", getInventory().getItemByItemId(13016).getObjectId(), 1, null, false);
-				 this.teleToLocation(tpbookmark.get(count)._x, tpbookmark.get(count)._y, tpbookmark.get(count)._z);
-				 break;
-			 }
-			 count++;
-		 }
-		 sendPacket(new ExGetBookMarkInfoPacket(this));
-	 }
-	 
-	 public boolean teleportBookmarkCondition(int type)
-	 {
-		 if(this.isInCombat())
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_BATTLE));
-			 return false;
-		 }
-		 else if (this.isInSiege() || this.getSiegeState() != 0)
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING));
-			 return false;
-		 }
-		 else if (this.isInDuel())
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_DUEL));
-			 return false;
-		 }
-		 else if (this.isFlying())
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_FLYING));
-			 return false;
-		 }
-		 else if (this.isInOlympiadMode())
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING_IN_AN_OLYMPIAD_MATCH));
-			 return false;
-		 }
-		 else if (this.isParalyzed())
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_PARALYZED));
-			 return false;
-		 }
-		 else if (this.isDead())
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_DEAD));
-			 return false;
-		 }
-		 else if (type == 1 && (isIn7sDungeon() || (isInParty() && getParty().isInDimensionalRift())))
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
-			 return false;
-		 }
-		 else if (this.isInBoat() || this.isInAirShip() || this.isInJail() || this.isInsideZone(ZONE_NOSUMMONFRIEND))
-		 {
-			 if(type == 0)
-				 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_IN_THIS_AREA));
-			 else if (type == 1)
-				 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
-			 return false;
-		 }
-		 else if (this.isInWater())
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_UNDERWATER));
-			 return false;
-		 }
-		 else if (type == 1 && (this.isInsideZone(ZONE_SIEGE) || this.isInsideZone(ZONE_CLANHALL) || this.isInsideZone(ZONE_JAIL) || this.isInsideZone(ZONE_CASTLE) || this.isInsideZone(ZONE_NOSUMMONFRIEND) || this.isInsideZone(ZONE_FORT)))
-		 {
-			 sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
-			 return false;
-		 }
-		 /* TODO: Instant Zone still not implement
-    	else if (this.isInsideZone(ZONE_INSTANT))
-    	{
-    		sendPacket(new SystemMessage(2357));
-    		return;
-    	}
-		  */
-		 else
-			 return true;
-	 }
-	 
-	 public void teleportBookmarkAdd(int x,int y,int z,int icon, String tag, String name)
-	 {
-		 if(this == null)
-			 return;
-		 
-		 if(!teleportBookmarkCondition(1))
-			 return;
-		 
-		 if(tpbookmark.size() >= _bookmarkslot)
-		 {
-			 sendPacket(new SystemMessage(2358));
-			 return;
-		 }
-		 
-		 if(getInventory().getInventoryItemCount(20033, 0) == 0)
-		 {
-			 sendPacket(new SystemMessage(6501));
-			 return;
-		 }
-		 
-		 int count = 0;
-		 int id = 1;
-		 FastList<Integer> idlist = new FastList<Integer>();
-		 
-		 int size = tpbookmark.size();
-		 
-		 while(size > count)
-		 {
-			 idlist.add(tpbookmark.get(count)._id);
-			 count++;
-		 }
-		 
-		 for(int i=1; i<10; i++)
-		 {
-			 if(!idlist.contains(i))
-			 {
-				 id = i;
-				 break;
-			 }
-		 }
-		 
-		 TeleportBookmark tpadd = new TeleportBookmark(id, x, y, z, icon, tag, name);
-		 if(tpbookmark == null)
-			 tpbookmark = new FastList<TeleportBookmark>();
-		 
-		 tpbookmark.add(tpadd);
-		 
-		 destroyItem("Consume", getInventory().getItemByItemId(20033).getObjectId(), 1, null, false);
-		 
-		 SystemMessage sm = new SystemMessage(SystemMessageId.S1_DISAPPEARED);
-		 sm.addItemName(20033);
-		 sendPacket(sm);
-		 
-		 Connection con = null;
-		 
-		 try
-		 {
-			 
-			 con = L2DatabaseFactory.getInstance().getConnection();
-			 PreparedStatement statement = con.prepareStatement(INSERT_TP_BOOKMARK);
-			 
-			 statement.setInt(1, getObjectId());
-			 statement.setInt(2, id);
-			 statement.setInt(3, x);
-			 statement.setInt(4, y);
-			 statement.setInt(5, z);
-			 statement.setInt(6, icon);
-			 statement.setString(7, tag);
-			 statement.setString(8, name);
-			 
-			 
-			 statement.execute();
-			 statement.close();
-		 }
-		 catch (Exception e)
-		 {
-			 _log.log(Level.WARNING, "Could not insert character teleport bookmark data: " + e.getMessage(), e);
-		 }
-		 finally
-		 {
-			 L2DatabaseFactory.close(con);
-		 }
-		 
-		 sendPacket(new ExGetBookMarkInfoPacket(this));
-	 }
-	 
-	 public void restoreTeleportBookmark()
-	 {
-		 if(tpbookmark == null)
-			 tpbookmark = new FastList<TeleportBookmark>();
-		 Connection con = null;
-		 
-		 try
-		 {
-			 con = L2DatabaseFactory.getInstance().getConnection();
-			 PreparedStatement statement = con.prepareStatement(RESTORE_TP_BOOKMARK);
-			 statement.setInt(1, getObjectId());
-			 ResultSet rset = statement.executeQuery();
-			 
-			 while (rset.next())
-			 {
-				 tpbookmark.add(new TeleportBookmark(rset.getInt("Id"), rset.getInt("x"), rset.getInt("y"), rset.getInt("z"), rset.getInt("icon"), rset.getString("tag"), rset.getString("name")));
-			 }
-			 
-			 rset.close();
-			 statement.close();
-		 }
-		 catch (Exception e)
-		 {
-			 _log.log(Level.SEVERE, "Failed restoing character teleport bookmark.", e);
-		 }
-		 finally
-		 {
-			 L2DatabaseFactory.close(con);
-		 }
-	 }
-	 
-	 @Override
-	 public void sendInfo(L2PcInstance activeChar)
-	 {
-		 if(isInBoat())
-		 {
-			 getPosition().setWorldPosition(getBoat().getPosition().getWorldPosition());
-			 
-			 activeChar.sendPacket(new CharInfo(this));
-			 activeChar.sendPacket(new ExBrExtraUserInfo(this));
-			 int relation1 = getRelation(activeChar);
-			 int relation2 = activeChar.getRelation(this);
-			 Integer oldrelation = getKnownList().getKnownRelations().get(activeChar.getObjectId());
-			 if (oldrelation != null && oldrelation != relation1)
-			 {
-				 activeChar.sendPacket(new RelationChanged(this, relation1, isAutoAttackable(activeChar)));
-				 if (getPet() != null)
-					 activeChar.sendPacket(new RelationChanged(getPet(), relation1, isAutoAttackable(activeChar)));
-			 }
-			 oldrelation = activeChar.getKnownList().getKnownRelations().get(getObjectId());
-			 if (oldrelation != null && oldrelation != relation2)
-			 {
-				 sendPacket(new RelationChanged(activeChar, relation2, activeChar.isAutoAttackable(this)));
-				 if (activeChar.getPet() != null)
-					 sendPacket(new RelationChanged(activeChar.getPet(), relation2, activeChar.isAutoAttackable(this)));
-			 }
-			 activeChar.sendPacket(new GetOnVehicle(getObjectId(), getBoat().getObjectId(), getInVehiclePosition()));
-		 }
-		 else if(isInAirShip())
-		 {
-			 getPosition().setWorldPosition(getAirShip().getPosition().getWorldPosition());
-			 
-			 activeChar.sendPacket(new CharInfo(this));
-			 activeChar.sendPacket(new ExBrExtraUserInfo(this));
-			 int relation1 = getRelation(activeChar);
-			 int relation2 = activeChar.getRelation(this);
-			 Integer oldrelation = getKnownList().getKnownRelations().get(activeChar.getObjectId());
-			 if (oldrelation != null && oldrelation != relation1)
-			 {
-				 activeChar.sendPacket(new RelationChanged(this, relation1, isAutoAttackable(activeChar)));
-				 if (getPet() != null)
-					 activeChar.sendPacket(new RelationChanged(getPet(), relation1, isAutoAttackable(activeChar)));
-			 }
-			 oldrelation = activeChar.getKnownList().getKnownRelations().get(getObjectId());
-			 if (oldrelation != null && oldrelation != relation2)
-			 {
-				 sendPacket(new RelationChanged(activeChar, relation2, activeChar.isAutoAttackable(this)));
-				 if (activeChar.getPet() != null)
-					 sendPacket(new RelationChanged(activeChar.getPet(), relation2, activeChar.isAutoAttackable(this)));
-			 }
-			 activeChar.sendPacket(new ExGetOnAirShip(this, getAirShip()));
-		 }
-		 else
-		 {
-			 activeChar.sendPacket(new CharInfo(this));
-			 activeChar.sendPacket(new ExBrExtraUserInfo(this));
-			 int relation1 = getRelation(activeChar);
-			 int relation2 = activeChar.getRelation(this);
-			 Integer oldrelation = getKnownList().getKnownRelations().get(activeChar.getObjectId());
-			 if (oldrelation != null && oldrelation != relation1)
-			 {
-				 activeChar.sendPacket(new RelationChanged(this, relation1, isAutoAttackable(activeChar)));
-				 if (getPet() != null)
-					 activeChar.sendPacket(new RelationChanged(getPet(), relation1, isAutoAttackable(activeChar)));
-			 }
-			 oldrelation = activeChar.getKnownList().getKnownRelations().get(getObjectId());
-			 if (oldrelation != null && oldrelation != relation2)
-			 {
-				 sendPacket(new RelationChanged(activeChar, relation2, activeChar.isAutoAttackable(this)));
-				 if (activeChar.getPet() != null)
-					 sendPacket(new RelationChanged(activeChar.getPet(), relation2, activeChar.isAutoAttackable(this)));
-			 }
-		 }
-		 if (getMountType() == 4)
-		 {
-			 // TODO: Remove when horse mounts fixed
-			 activeChar.sendPacket(new Ride(this, false, 0));
-			 activeChar.sendPacket(new Ride(this, true, getMountNpcId()));
-		 }
-		 
-		 switch (getPrivateStoreType())
-		 {
-			 case L2PcInstance.STORE_PRIVATE_SELL:
-				 activeChar.sendPacket(new PrivateStoreMsgSell(this));
-				 break;
-			 case L2PcInstance.STORE_PRIVATE_PACKAGE_SELL:
-				 activeChar.sendPacket(new ExPrivateStoreSetWholeMsg(this));
-				 break;
-			 case L2PcInstance.STORE_PRIVATE_BUY:
-				 activeChar.sendPacket(new PrivateStoreMsgBuy(this));
-				 break;
-			 case L2PcInstance.STORE_PRIVATE_MANUFACTURE:
-				 activeChar.sendPacket(new RecipeShopMsg(this));
-				 break;
-		 }
-	 }
-	 
-	 public void showQuestMovie(int id)
-	 {
-		 if (_movieId > 0) //already in movie
-			 return;
-		 abortAttack();
-		 abortCast();
-		 stopMove(null);
-		 _movieId = id;
-		 sendPacket(new ExStartScenePlayer(id));
-	 }
-	 
-	 public boolean isAllowedToEnchantSkills()
-	 {
-		 if (isLocked())
-			 return false;
-		 if (isTransformed())
-			 return false;
-		 if (AttackStanceTaskManager.getInstance().getAttackStanceTask(this))
-			 return false;
-		 if (isCastingNow() || isCastingSimultaneouslyNow())
-			 return false;
-		 if (isInBoat() || isInAirShip())
-			 return false;
-		 return true;
-	 }
-	 
-	 /**
-	  * Set the _creationTime of the L2PcInstance.<BR><BR>
-	  */
-	 public void setCreateTime(long creationTime)
-	 {
-		 _creationTime = creationTime;
-	 }
-	 
-	 /**
-	  * Return the _creationTime of the L2PcInstance.<BR><BR>
-	  */
-	 public long getCreateTime()
-	 {
-		 return _creationTime;
-	 }
-	 
-	 /**
-	  * @return number of days to char birthday.<BR><BR>
-	  */
-	 public int checkBirthDay()
-	 {
-		 QuestState _state = getQuestState("CharacterBirthday");
-		 Calendar now = Calendar.getInstance();
-		 Calendar birth = Calendar.getInstance();
-		 now.setTimeInMillis(System.currentTimeMillis());
-		 birth.setTimeInMillis(_creationTime);
-		 
-		 if (_state != null && _state.getInt("Birthday") > now.get(Calendar.YEAR))
-			 return -1;
-		 
-		 // "Characters with a February 29 creation date will receive a gift on February 28."
-		 if (birth.get(Calendar.DAY_OF_MONTH) == 29 && birth.get(Calendar.MONTH) == 1)
-			 birth.add(Calendar.HOUR_OF_DAY, -24);
-		 
-		 if (now.get(Calendar.MONTH) == birth.get(Calendar.MONTH)
-				 && now.get(Calendar.DAY_OF_MONTH) == birth.get(Calendar.DAY_OF_MONTH)
-				 && now.get(Calendar.YEAR) != birth.get(Calendar.YEAR))
-		 {
-			 return 0;
-		 }
-		 else
-		 {
-			 int i;
-			 for (i = 1; i < 6; i++)
-			 {
-				 now.add(Calendar.HOUR_OF_DAY, 24);
-				 if (now.get(Calendar.MONTH) == birth.get(Calendar.MONTH)
-						 && now.get(Calendar.DAY_OF_MONTH) == birth.get(Calendar.DAY_OF_MONTH)
-						 && now.get(Calendar.YEAR) != birth.get(Calendar.YEAR))
-					 return i;
-			 }
-		 }
-		 return -1;
-	 }
-	 
-	 
-	 /**
-	  * list of character friends
-	  * 
-	  */
-	 private List<Integer> _friendList = new FastList<Integer>();
-	 
-	 public List<Integer> getFriendList()
-	 {
-		 return _friendList;
-	 }
-	 
-	 public void restoreFriendList()
-	 {
-		 _friendList.clear();
-		 
-		 Connection con = null;
-		 
-		 try
-		 {
-			 String sqlQuery = "SELECT friendId FROM character_friends WHERE charId=? AND relation=0";
-			 
-			 con = L2DatabaseFactory.getInstance().getConnection();
-			 PreparedStatement statement = con.prepareStatement(sqlQuery);
-			 statement.setInt(1, getObjectId());
-			 ResultSet rset = statement.executeQuery();
-			 
-			 int friendId;
-			 while (rset.next())
-			 {
-				 friendId = rset.getInt("friendId");
-				 if (friendId == getObjectId())
-					 continue;
-				 _friendList.add(friendId);
-			 }
-			 
-			 rset.close();
-			 statement.close();
-		 }
-		 catch (Exception e)
-		 {
-			 _log.log(Level.WARNING, "Error found in " + getName() + "'s FriendList: " + e.getMessage(), e);
-		 }
-		 finally
-		 {
-			 L2DatabaseFactory.close(con);
-		 }
-	 }
-	 
-	 /**
-	  * 
-	  */
-	 private void notifyFriends()
-	 {
-		 FriendStatusPacket pkt = new FriendStatusPacket(getObjectId());
-		 for(int id : _friendList)
-		 {
-			 L2PcInstance friend = L2World.getInstance().getPlayer(id);
-			 if (friend != null)
-				 friend.sendPacket(pkt);
-		 }
-	 }
-	 
-	 /**
-	  * @return the _silenceMode
-	  */
-	 public boolean isSilenceMode()
-	 {
-		 return _silenceMode;
-	 }
-	 
-	 /**
-	  * @param mode the _silenceMode to set
-	  */
-	 public void setSilenceMode(boolean mode)
-	 {
-		 _silenceMode = mode;
-		 sendPacket(new EtcStatusUpdate(this));
-	 }
-	 
-	 private void storeRecipeShopList()
-	 {
-		 Connection con = null;
-		 
-		 try
-		 {
-			 con = L2DatabaseFactory.getInstance().getConnection();
-			 PreparedStatement statement;
-			 L2ManufactureList list = getCreateList();
-			 
-			 if (list != null && list.size() > 0)
-			 {
-				 int _position = 1;
-				 statement = con.prepareStatement("DELETE FROM character_recipeshoplist WHERE charId=? ");
-				 statement.setInt(1, getObjectId());
-				 statement.execute();
-				 statement.close();
-				 
-				 PreparedStatement statement2 = con.prepareStatement("INSERT INTO character_recipeshoplist (charId, Recipeid, Price, Pos) VALUES (?, ?, ?, ?)");
-				 for (L2ManufactureItem item : list.getList())
-				 {
-					 statement2.setInt(1, getObjectId());
-					 statement2.setInt(2, item.getRecipeId());
-					 statement2.setLong(3, item.getCost());
-					 statement2.setInt(4, _position);
-					 statement2.execute();
-					 statement2.clearParameters();
-					 _position++;
-				 }
-				 statement2.close();
-			 }
-		 }
-		 catch (Exception e)
-		 {
-			 _log.log(Level.SEVERE, "Could not store recipe shop for playerID " + getObjectId() + ": ", e);
-		 }
-		 finally
-		 {
-			 L2DatabaseFactory.close(con);
-		 }
-	 }
-	 
-	 private void restoreRecipeShopList()
-	 {
-		 Connection con = null;
-		 
-		 try
-		 {
-			 con = L2DatabaseFactory.getInstance().getConnection();
-			 PreparedStatement statement = con.prepareStatement("SELECT Recipeid,Price FROM character_recipeshoplist WHERE charId=? ORDER BY Pos ASC");
-			 statement.setInt(1, getObjectId());
-			 ResultSet rset = statement.executeQuery();
-			 
-			 
-			 L2ManufactureList createList = new L2ManufactureList();
-			 while (rset.next())
-			 {
-				 createList.add(new L2ManufactureItem(rset.getInt("Recipeid"), rset.getLong("Price")));
-			 }
-			 setCreateList(createList);
-			 rset.close();
-			 statement.close();
-		 }
-		 catch (Exception e)
-		 {
-			 _log.log(Level.SEVERE, "Could not restore recipe shop list data for playerId: "+getObjectId(), e);
-		 }
-		 finally
-		 {
-			 L2DatabaseFactory.close(con);
-		 }
-	 }
-	 
-	 public double getCollisionRadius()
-	 {
-		 if (getAppearance().getSex())
-			 return getBaseTemplate().fCollisionRadius_female;
-		 else
-			 return getBaseTemplate().fCollisionRadius;
-	 }
-	 
-	 public double getCollisionHeight()
-	 {
-		 if (getAppearance().getSex())
-			 return getBaseTemplate().fCollisionHeight_female;
-		 else
-			 return getBaseTemplate().fCollisionHeight;
-	 }
-	 
-	 public final int getClientX()
-	 {
-		 return _clientX;
-	 }
-	 public final int getClientY()
-	 {
-		 return _clientY;
-	 }
-	 public final int getClientZ()
-	 {
-		 return _clientZ;
-	 }
-	 public final int getClientHeading()
-	 {
-		 return _clientHeading;
-	 }
-	 public final void setClientX(int val)
-	 {
-		 _clientX=val;
-	 }
-	 public final void setClientY(int val)
-	 {
-		 _clientY=val;
-	 }
-	 public final void setClientZ(int val)
-	 {
-		 _clientZ=val;
-	 }
-	 public final void setClientHeading(int val)
-	 {
-		 _clientHeading=val;
-	 }
-	 
-	 /**
-	  * Return true if character falling now
-	  * On the start of fall return false for correct coord sync !
-	  */
-	 public final boolean isFalling(int z)
-	 {
-		 if (isDead()
-				 || isFlying()
-				 || isFlyingMounted()
-				 || isInsideZone(ZONE_WATER))
-			 return false;
-		 
-		 if (System.currentTimeMillis() < _fallingTimestamp)
-			 return true;
-		 
-		 final int deltaZ = getZ() - z;
-		 if (deltaZ <= getBaseTemplate().getFallHeight())
-			 return false;
-		 
-		 final int damage = (int)Formulas.calcFallDam(this, deltaZ);
-		 if (damage > 0)
-		 {
-			 reduceCurrentHp(Math.min(damage, getCurrentHp() - 1), null, false, true, null);
-			 sendPacket(new SystemMessage(SystemMessageId.FALL_DAMAGE_S1).addNumber(damage));
-		 }
-		 
-		 setFalling();
-		 
-		 return false;
-	 }
-	 
-	 /**
-	  * Set falling timestamp
-	  */
-	 public final void setFalling()
-	 {
-		 _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
-	 }
-	 
-	 /**
-	  * @return the _movieId
-	  */
-	 public int getMovieId()
-	 {
-		 return _movieId;
-	 }
-	 
-	 public void setMovieId(int id)
-	 {
-		 _movieId = id;
-	 }
-	 
-	 /**
-	  * Update last item auction request timestamp to current
-	  */
-	 public void updateLastItemAuctionRequest()
-	 {
-		 _lastItemAuctionInfoRequest = System.currentTimeMillis();
-	 }
-	 
-	 /**
-	  * Returns true if receiving item auction requests
-	  * (last request was in 2 seconds before)
-	  */
-	 public boolean isItemAuctionPolling()
-	 {
-		 return System.currentTimeMillis() - _lastItemAuctionInfoRequest < 2000;
-	 }
-	 
-	 /* (non-Javadoc)
-	  * @see com.l2jserver.gameserver.model.actor.L2Character#isMovementDisabled()
-	  */
-	 @Override
-	 public boolean isMovementDisabled()
-	 {
-		 return super.isMovementDisabled() || _movieId > 0;
-	 }
-	 
-	 private void restoreUISettings()
-	 {
-		 _uiKeySettings = new L2UIKeysSettings(this);
-	 }
-	 
-	 private void storeUISettings()
-	 {
-		 if (_uiKeySettings == null)
-			 return;
-		 
-		 if (!_uiKeySettings.isSaved())
-			 _uiKeySettings.saveInDB();
-	 }
-	 
-	 public L2UIKeysSettings getUISettings()
-	 {
-		 return _uiKeySettings;
-	 }
-	 
-	 public String getHtmlPrefix()
-	 {
-		 if (!Config.L2JMOD_MULTILANG_ENABLE)
-			 return null;
-		 
-		 return _htmlPrefix;
-	 }
-	 
-	 public String getLang()
-	 {
-		 return _lang;
-	 }
-	 
-	 public boolean setLang(String lang)
-	 {
-		 boolean result = false;
-		 if (Config.L2JMOD_MULTILANG_ENABLE)
-		 {
-			 if (Config.L2JMOD_MULTILANG_ALLOWED.contains(lang))
-			 {
-				 _lang = lang;
-				 result = true;
-			 }
-			 else
-				 _lang = Config.L2JMOD_MULTILANG_DEFAULT;
-			 
-			 _htmlPrefix = "data/lang/" + _lang + "/";
-		 }
-		 else
-		 {
-			 _lang = null;
-			 _htmlPrefix = null;
-		 }
-		 
-		 return result;
-	 }
-	 
-	 public long getOfflineStartTime()
-	 {
-		 return _offlineShopStart;
-	 }
-	 
-	 public void setOfflineStartTime(long time)
-	 {
-		 _offlineShopStart = time;
-	 }
-	 
-	 /**
-	  * Remove player from BossZones (used on char logout/exit)
-	  */
-	 public void removeFromBossZone()
-	 {
-		 try
-		 {
-			 for (L2BossZone _zone : GrandBossManager.getInstance().getZones())
-			 {
-				 _zone.removePlayer(this);
-			 }
-		 }
-		 catch (Exception e)
-		 {
-			 _log.log(Level.WARNING, "Exception on removeFromBossZone(): " + e.getMessage(), e);
-		 }
-	 }
-	 
-	 /**
-	  * Check all player skills for skill level. If player level is lower than skill learn level - 9, skill level is decreased to next possible level.
-	  */
-	 public void checkPlayerSkills()
-	 {
-		 for (int id : _skills.keySet())
-		 {
-			 int level = getSkillLevel(id);
-			 if (level >= 100) // enchanted skill
-				 level = SkillTable.getInstance().getMaxLevel(id);
-			 L2SkillLearn learn = SkillTreeTable.getInstance().getSkillLearnBySkillIdLevel(getClassId(), id, level);
-			 // not found - not a learn skill?
-			 if (learn == null)
-			 {
-				 continue;
-			 }
-			 else
-			 {
-				 // player level is too low for such skill level
-				 if (getLevel() < (learn.getMinLevel() - 9))
-					 deacreaseSkillLevel(id);
-			 }
-		 }
-	 }
-	 
-	 private void deacreaseSkillLevel(int id)
-	 {
-		 int nextLevel = -1;
-		 for (L2SkillLearn sl : SkillTreeTable.getInstance().getAllowedSkills(getClassId()))
-		 {
-			 if (sl.getId() == id && nextLevel < sl.getLevel() && getLevel() >= (sl.getMinLevel() - 9))
-			 {
-				 // next possible skill level
-				 nextLevel = sl.getLevel();
-			 }
-		 }
-		 
-		 if (nextLevel == -1) // there is no lower skill
-		 {
-			 _log.info("Removing skill id "+id+ " level "+getSkillLevel(id)+" from player "+this);
-			 removeSkill(_skills.get(id), true);
-		 }
-		 else // replace with lower one
-		 {
-			 _log.info("Decreasing skill id "+id+" from "+getSkillLevel(id)+" to "+nextLevel+" for "+this);
-			 addSkill(SkillTable.getInstance().getInfo(id, nextLevel), true);
-		 }
-	 }
-	 
-	 public boolean canMakeSocialAction()
-	 {
-		 if (getPrivateStoreType() == 0 && getActiveRequester() == null
-				 && !isAlikeDead() && (!isAllSkillsDisabled() || isInDuel())
-				 && !isCastingNow() && !isCastingSimultaneouslyNow()
-				 && getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE
-				 && !AttackStanceTaskManager.getInstance().getAttackStanceTask(this)
-				 && !isInOlympiadMode())
-		 {
-			 return true;
-		 }
-		 else
-			 return false;
-	 }
-	 
-	 public void setMultiSocialAction(int id, int targetId)
-	 {
-		 _multiSociaAction = id;
-		 _multiSocialTarget = targetId;
-	 }
-	 
-	 public int getMultiSociaAction()
-	 {
-		 return _multiSociaAction;
-	 }
-	 
-	 public int getMultiSocialTarget()
-	 {
-		 return _multiSocialTarget;
-	 }
-	 
-	 public List<TeleportBookmark> getTpbookmark()
-	 {
-		 return tpbookmark;
-	 }
-	 
-	 public int getBookmarkslot()
-	 {
-		 return _bookmarkslot;
-	 }
-	 
-	 /**
-	  * @return
-	  */
-	 public int getQuestInventoryLimit()
-	 {
-		 return Config.INVENTORY_MAXIMUM_QUEST_ITEMS;
-	 }
-	 
-	 public boolean canAttackCharacter(L2Character cha)
-	 {
-		 if(cha instanceof L2Attackable)
-		 {
-			 return true;
-		 }
-		 else if(cha instanceof L2Playable)
-		 {
-			 if(cha.isInsideZone(L2Character.ZONE_PVP) && !cha.isInsideZone(L2Character.ZONE_SIEGE))
-				 return true;
-			 
-			 L2PcInstance target;
-			 if (cha instanceof L2Summon)
-				 target = ((L2Summon) cha).getOwner();
-			 else
-				 target = (L2PcInstance) cha;
-			 
-			 if (isInDuel() && target.isInDuel() && (target.getDuelId() == getDuelId()))
-			 {
-				 return true;
-			 }
-			 else if (isInParty() && target.isInParty())
-			 {
-				 if(getParty() == target.getParty())
-					 return false;
-				 if((getParty().getCommandChannel() != null || target.getParty().getCommandChannel() != null) && (getParty().getCommandChannel() == target.getParty().getCommandChannel()))
-					 return false;
-			 }
-			 else if (getClan() != null && target.getClan() != null)
-			 {
-				 if (getClanId() == target.getClanId())
-					 return false;
-				 if ((getAllyId() > 0 || target.getAllyId() > 0) && (getAllyId() == target.getAllyId()))
-					 return false;
-				 if(getClan().isAtWarWith(target.getClan().getClanId()) && target.getClan().isAtWarWith(getClan().getClanId()))
-					 return true;
-			 }
-			 else if (getClan() == null || target.getClan() == null)
-			 {
-				 if(target.getPvpFlag() == 0 && target.getKarma() == 0)
-					 return false;
-			 }
-		 }
-		 return true;
-	 }
-	 
-	 /**
-	  * Test if player inventory is under 80% capaity
-	  * @param includeQuestInv check also quest inventory
-	  * @return
-	  */
-	 public boolean isInventoryUnder80(boolean includeQuestInv)
-	 {
-		 if (getInventory().getSize(false) <= (getInventoryLimit() * 0.8))
-		 {
-			 if (includeQuestInv)
-			 {
-				 if (getInventory().getSize(true) <= (getQuestInventoryLimit() * 0.8))
-					 return true;
-			 }
-			 else
-				 return true;
-		 }
-		 return false;
-	 }
+		return _currentPetSkill;
+	}
+	
+	/**
+	 * Create a new SkillDat object and set the player _currentPetSkill.<br><br>
+	 * 
+	 */
+	public void setCurrentPetSkill(L2Skill currentSkill, boolean ctrlPressed, boolean shiftPressed)
+	{
+		if (currentSkill == null)
+		{
+			if (Config.DEBUG)
+				_log.info("Setting current pet skill: NULL for " + getName() + ".");
+			
+			_currentPetSkill = null;
+			return;
+		}
+		
+		if (Config.DEBUG)
+			_log.info("Setting current Pet skill: " + currentSkill.getName() + " (ID: " + currentSkill.getId() + ") for " + getName() + ".");
+		
+		_currentPetSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed);
+	}
+	
+	
+	public SkillDat getQueuedSkill()
+	{
+		return _queuedSkill;
+	}
+	
+	
+	/**
+	 * Create a new SkillDat object and queue it in the player _queuedSkill.<BR><BR>
+	 *
+	 */
+	public void setQueuedSkill(L2Skill queuedSkill, boolean ctrlPressed, boolean shiftPressed)
+	{
+		if (queuedSkill == null)
+		{
+			if (Config.DEBUG)
+				_log.info("Setting queued skill: NULL for " + getName() + ".");
+			
+			_queuedSkill = null;
+			return;
+		}
+		
+		if (Config.DEBUG)
+			_log.info("Setting queued skill: " + queuedSkill.getName() + " (ID: " + queuedSkill.getId() + ") for " + getName() + ".");
+		
+		_queuedSkill = new SkillDat(queuedSkill, ctrlPressed, shiftPressed);
+	}
+	
+	/**
+	 * returns punishment level of player
+	 * @return
+	 */
+	public PunishLevel getPunishLevel()
+	{
+		return _punishLevel;
+	}
+	
+	/**
+	 * @return True if player is jailed
+	 */
+	public boolean isInJail()
+	{
+		return _punishLevel == PunishLevel.JAIL;
+	}
+	
+	/**
+	 * @return True if player is chat banned
+	 */
+	public boolean isChatBanned()
+	{
+		return _punishLevel == PunishLevel.CHAT;
+	}
+	
+	public void setPunishLevel(int state)
+	{
+		switch (state){
+			case 0 :
+			{
+				_punishLevel = PunishLevel.NONE;
+				break;
+			}
+			case 1 :
+			{
+				_punishLevel = PunishLevel.CHAT;
+				break;
+			}
+			case 2 :
+			{
+				_punishLevel = PunishLevel.JAIL;
+				break;
+			}
+			case 3 :
+			{
+				_punishLevel = PunishLevel.CHAR;
+				break;
+			}
+			case 4 :
+			{
+				_punishLevel = PunishLevel.ACC;
+				break;
+			}
+		}
+	}
+	
+	/**
+	 * Sets punish level for player based on delay
+	 * @param state
+	 * @param delayInMinutes
+	 * 		0 - Indefinite
+	 */
+	public void setPunishLevel(PunishLevel state, int delayInMinutes)
+	{
+		long delayInMilliseconds = delayInMinutes * 60000L;
+		switch (state)
+		{
+			case NONE: // Remove Punishments
+			{
+				switch (_punishLevel)
+				{
+					case CHAT:
+					{
+						_punishLevel = state;
+						stopPunishTask(true);
+						sendPacket(new EtcStatusUpdate(this));
+						sendMessage("Your Chat ban has been lifted");
+						break;
+					}
+					case JAIL:
+					{
+						_punishLevel = state;
+						// Open a Html message to inform the player
+						NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
+						String jailInfos = HtmCache.getInstance().getHtm(getHtmlPrefix(), "data/html/jail_out.htm");
+						if (jailInfos != null)
+							htmlMsg.setHtml(jailInfos);
+						else
+							htmlMsg.setHtml("<html><body>You are free for now, respect server rules!</body></html>");
+						sendPacket(htmlMsg);
+						stopPunishTask(true);
+						teleToLocation(17836, 170178, -3507, true);  // Floran
+						break;
+					}
+				}
+				break;
+			}
+			case CHAT: // Chat Ban
+			{
+				// not allow player to escape jail using chat ban
+				if (_punishLevel == PunishLevel.JAIL)
+					break;
+				_punishLevel = state;
+				_punishTimer = 0;
+				sendPacket(new EtcStatusUpdate(this));
+				// Remove the task if any
+				stopPunishTask(false);
+				
+				if (delayInMinutes > 0)
+				{
+					_punishTimer = delayInMilliseconds;
+					
+					// start the countdown
+					_punishTask = ThreadPoolManager.getInstance().scheduleGeneral(new PunishTask(), _punishTimer);
+					sendMessage("You are chat banned for "+delayInMinutes+" minutes.");
+				}
+				else
+					sendMessage("You have been chat banned");
+				break;
+				
+			}
+			case JAIL: // Jail Player
+			{
+				_punishLevel = state;
+				_punishTimer = 0;
+				// Remove the task if any
+				stopPunishTask(false);
+				
+				if (delayInMinutes > 0)
+				{
+					_punishTimer = delayInMilliseconds;
+					
+					// start the countdown
+					_punishTask = ThreadPoolManager.getInstance().scheduleGeneral(new PunishTask(), _punishTimer);
+					sendMessage("You are in jail for "+delayInMinutes+" minutes.");
+				}
+				
+				if (!TvTEvent.isInactive() && TvTEvent.isPlayerParticipant(getObjectId()))
+					TvTEvent.removeParticipant(getObjectId());
+				if (Olympiad.getInstance().isRegisteredInComp(this))
+					Olympiad.getInstance().removeDisconnectedCompetitor(this);
+				
+				// Open a Html message to inform the player
+				NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
+				String jailInfos = HtmCache.getInstance().getHtm(getHtmlPrefix(), "data/html/jail_in.htm");
+				if (jailInfos != null)
+					htmlMsg.setHtml(jailInfos);
+				else
+					htmlMsg.setHtml("<html><body>You have been put in jail by an admin.</body></html>");
+				sendPacket(htmlMsg);
+				setInstanceId(0);
+				setIsIn7sDungeon(false);
+				
+				teleToLocation(-114356, -249645, -2984, false);  // Jail
+				break;
+			}
+			case CHAR: // Ban Character
+			{
+				setAccessLevel(-100);
+				logout();
+				break;
+			}
+			case ACC: // Ban Account
+			{
+				setAccountAccesslevel(-100);
+				logout();
+				break;
+			}
+			default:
+			{
+				_punishLevel = state;
+				break;
+			}
+		}
+		
+		// store in database
+		storeCharBase();
+	}
+	
+	public long getPunishTimer()
+	{
+		return _punishTimer;
+	}
+	
+	public void setPunishTimer(long time)
+	{
+		_punishTimer = time;
+	}
+	
+	private void updatePunishState()
+	{
+		if (getPunishLevel() != PunishLevel.NONE)
+		{
+			// If punish timer exists, restart punishtask.
+			if (_punishTimer > 0)
+			{
+				_punishTask = ThreadPoolManager.getInstance().scheduleGeneral(new PunishTask(), _punishTimer);
+				sendMessage("You are still "+getPunishLevel().string()+" for "+Math.round(_punishTimer/60000f)+" minutes.");
+			}
+			if (getPunishLevel() == PunishLevel.JAIL)
+			{
+				// If player escaped, put him back in jail
+				if (!isInsideZone(ZONE_JAIL))
+					teleToLocation(-114356,-249645,-2984, true);
+			}
+		}
+	}
+	
+	public void stopPunishTask(boolean save)
+	{
+		if (_punishTask != null)
+		{
+			if (save)
+			{
+				long delay = _punishTask.getDelay(TimeUnit.MILLISECONDS);
+				if (delay < 0)
+					delay = 0;
+				setPunishTimer(delay);
+			}
+			_punishTask.cancel(false);
+			//ThreadPoolManager.getInstance().removeGeneral((Runnable)_punishTask);
+			_punishTask = null;
+		}
+	}
+	
+	private class PunishTask implements Runnable
+	{
+		public void run()
+		{
+			L2PcInstance.this.setPunishLevel(PunishLevel.NONE, 0);
+		}
+	}
+	public void startFameTask(long delay, int fameFixRate)
+	{
+		if (getLevel() < 40 || getClassId().level() < 2)
+			return;
+		if (_fameTask == null)
+			_fameTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new FameTask(fameFixRate), delay, delay);
+	}
+	
+	public void stopFameTask()
+	{
+		if (_fameTask != null)
+		{
+			_fameTask.cancel(false);
+			//ThreadPoolManager.getInstance().removeGeneral((Runnable)_fameTask);
+			_fameTask = null;
+		}
+	}
+	
+	private class FameTask implements Runnable
+	{
+		private final L2PcInstance _player;
+		private final int _value;
+		
+		protected FameTask(int value)
+		{
+			_player = L2PcInstance.this;
+			_value = value;
+		}
+		
+		public void run()
+		{
+			if (_player == null || (_player.isDead() && !Config.FAME_FOR_DEAD_PLAYERS))
+				return;
+			if ((_player.getClient() == null || _player.getClient().isDetached()) && !Config.OFFLINE_FAME)
+				return;
+			_player.setFame(_player.getFame() + _value);
+			SystemMessage sm = new SystemMessage(SystemMessageId.ACQUIRED_S1_REPUTATION_SCORE);
+			sm.addNumber(_value);
+			_player.sendPacket(sm);
+			_player.sendPacket(new UserInfo(_player));
+		}
+	}
+	
+	public void startVitalityTask()
+	{
+		if (Config.ENABLE_VITALITY && _vitalityTask == null)
+		{
+			_vitalityTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new VitalityTask(this), 1000, 60000);
+		}
+	}
+	
+	public void stopVitalityTask()
+	{
+		if (_vitalityTask != null)
+		{
+			_vitalityTask.cancel(false);
+			//ThreadPoolManager.getInstance().removeGeneral((Runnable)_vitalityTask);
+			_vitalityTask = null;
+		}
+	}
+	
+	private class VitalityTask implements Runnable
+	{
+		private final L2PcInstance _player;
+		
+		protected VitalityTask(L2PcInstance player)
+		{
+			_player = player;
+		}
+		
+		public void run()
+		{
+			if (!_player.isInsideZone(L2Character.ZONE_PEACE))
+				return;
+			
+			if (_player.getVitalityPoints() >= PcStat.MAX_VITALITY_POINTS)
+				return;
+			
+			_player.updateVitalityPoints(Config.RATE_RECOVERY_VITALITY_PEACE_ZONE, false, false);
+			_player.sendPacket(new ExVitalityPointInfo(getVitalityPoints()));
+		}
+	}
+	
+	/**
+	 * @return
+	 */
+	public int getPowerGrade()
+	{
+		return _powerGrade;
+	}
+	
+	/**
+	 * @return
+	 */
+	public void setPowerGrade(int power)
+	{
+		_powerGrade = power;
+	}
+	
+	public boolean isCursedWeaponEquipped()
+	{
+		return _cursedWeaponEquippedId != 0;
+	}
+	
+	public void setCursedWeaponEquippedId(int value)
+	{
+		_cursedWeaponEquippedId = value;
+	}
+	
+	public int getCursedWeaponEquippedId()
+	{
+		return _cursedWeaponEquippedId;
+	}
+	
+	@Override
+	public boolean isAttackingDisabled()
+	{
+		return (super.isAttackingDisabled() || _combatFlagEquippedId);
+	}
+	
+	public boolean isCombatFlagEquipped()
+	{
+		return _combatFlagEquippedId ;
+	}
+	
+	public void setCombatFlagEquipped(boolean value)
+	{
+		_combatFlagEquippedId = value;
+	}
+	
+	public boolean getCharmOfCourage()
+	{
+		return _charmOfCourage;
+	}
+	
+	public void setCharmOfCourage(boolean val)
+	{
+		_charmOfCourage = val;
+		sendPacket(new EtcStatusUpdate(this));
+	}
+	
+	public final void setIsRidingStrider(boolean mode)
+	{
+		_isRidingStrider = mode;
+	}
+	
+	/* not used anymore
+	public final void setIsRidingFenrirWolf(boolean mode)
+	{
+		_isRidingFenrirWolf = mode;
+	}
+	public final void setIsRidingWFenrirWolf(boolean mode)
+	{
+		_isRidingWFenrirWolf = mode;
+	}
+	public final void setIsRidingGreatSnowWolf(boolean mode)
+	{
+		_isRidingGreatSnowWolf = mode;
+	}
+	public final boolean isRidingFenrirWolf()
+	{
+		return _isRidingFenrirWolf;
+	}
+	public final boolean isRidingWFenrirWolf()
+	{
+		return _isRidingWFenrirWolf;
+	}
+	public final boolean isRidingGreatSnowWolf()
+	{
+		return _isRidingGreatSnowWolf;
+	}*/
+	
+	public final boolean isRidingStrider()
+	{
+		return _isRidingStrider;
+	}
+	
+	/**
+	 * Returns the Number of Souls this L2PcInstance got.
+	 * @return
+	 */
+	public int getSouls()
+	{
+		return _souls;
+	}
+	
+	/**
+	 * Absorbs a Soul from a Npc.
+	 * @param skill
+	 * @param target
+	 */
+	public void absorbSoul(L2Skill skill, L2Npc npc)
+	{
+		if (_souls >= skill.getNumSouls())
+		{
+			SystemMessage sm = new SystemMessage(SystemMessageId.SOUL_CANNOT_BE_INCREASED_ANYMORE);
+			sendPacket(sm);
+			return;
+		}
+		
+		increaseSouls(1);
+		
+		if (npc != null)
+			broadcastPacket(new ExSpawnEmitter(this, npc), 500);
+	}
+	
+	/**
+	 * Increase Souls
+	 * @param count
+	 */
+	public void increaseSouls(int count)
+	{
+		if (count < 0 || count > 45)
+			return;
+		
+		_souls += count;
+		
+		if (getSouls() > 45)
+			_souls = 45;
+		
+		SystemMessage sm = new SystemMessage(SystemMessageId.YOUR_SOUL_HAS_INCREASED_BY_S1_SO_IT_IS_NOW_AT_S2);
+		sm.addNumber(count);
+		sm.addNumber(_souls);
+		sendPacket(sm);
+		
+		restartSoulTask();
+		
+		sendPacket(new EtcStatusUpdate(this));
+	}
+	
+	/**
+	 * Decreases existing Souls.
+	 * @param count
+	 */
+	public boolean decreaseSouls(int count, L2Skill skill)
+	{
+		if (getSouls() <= 0 && skill.getSoulConsumeCount() > 0)
+		{
+			sendPacket(new SystemMessage(SystemMessageId.THERE_IS_NOT_ENOUGH_SOUL));
+			return false;
+		}
+		
+		_souls -= count;
+		
+		if (getSouls() < 0)
+			_souls = 0;
+		
+		if (getSouls() == 0)
+			stopSoulTask();
+		else
+			restartSoulTask();
+		
+		sendPacket(new EtcStatusUpdate(this));
+		return true;
+	}
+	
+	/**
+	 * Clear out all Souls from this L2PcInstance
+	 */
+	public void clearSouls()
+	{
+		_souls = 0;
+		stopSoulTask();
+		sendPacket(new EtcStatusUpdate(this));
+	}
+	
+	/**
+	 * Starts/Restarts the SoulTask to Clear Souls after 10 Mins.
+	 */
+	private void restartSoulTask()
+	{
+		synchronized(this)
+		{
+			if (_soulTask != null)
+			{
+				_soulTask.cancel(false);
+				_soulTask = null;
+			}
+			_soulTask = ThreadPoolManager.getInstance().scheduleGeneral(new SoulTask(), 600000);
+		}
+	}
+	
+	/**
+	 * Stops the Clearing Task.
+	 */
+	public void stopSoulTask()
+	{
+		if (_soulTask != null)
+		{
+			_soulTask.cancel(false);
+			//ThreadPoolManager.getInstance().removeGeneral((Runnable)_soulTask);
+			_soulTask = null;
+		}
+	}
+	
+	private class SoulTask implements Runnable
+	{
+		public void run()
+		{
+			L2PcInstance.this.clearSouls();
+		}
+	}
+	
+	/**
+	 *
+	 * @param magicId
+	 * @param level
+	 * @param time
+	 */
+	public void shortBuffStatusUpdate(int magicId, int level, int time)
+	{
+		if (_shortBuffTask != null)
+		{
+			_shortBuffTask.cancel(false);
+			_shortBuffTask = null;
+		}
+		_shortBuffTask = ThreadPoolManager.getInstance().scheduleGeneral(new ShortBuffTask(), time*1000);
+		setShortBuffTaskSkillId(magicId);
+		
+		sendPacket(new ShortBuffStatusUpdate(magicId, level, time));
+	}
+	
+	public void setShortBuffTaskSkillId(int id)
+	{
+		_shortBuffTaskSkillId = id;
+	}
+	public int getDeathPenaltyBuffLevel()
+	{
+		return _deathPenaltyBuffLevel;
+	}
+	
+	public void setDeathPenaltyBuffLevel(int level)
+	{
+		_deathPenaltyBuffLevel = level;
+	}
+	
+	public void calculateDeathPenaltyBuffLevel(L2Character killer)
+	{
+		if((getKarma() > 0 || Rnd.get(1,100) <= Config.DEATH_PENALTY_CHANCE)
+				&& !(killer instanceof L2PcInstance) && !(this.isGM())
+				&& !(this.getCharmOfLuck() && killer.isRaid())
+				&& !isPhoenixBlessed()
+				&& !(TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(getObjectId()))
+				&& !(this.isInsideZone(L2Character.ZONE_PVP)||this.isInsideZone(L2Character.ZONE_SIEGE)))
+			
+			increaseDeathPenaltyBuffLevel();
+	}
+	
+	public void increaseDeathPenaltyBuffLevel()
+	{
+		if(getDeathPenaltyBuffLevel() >= 15) //maximum level reached
+			return;
+		
+		if(getDeathPenaltyBuffLevel() != 0)
+		{
+			L2Skill skill = SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel());
+			
+			if(skill != null)
+				removeSkill(skill, true);
+		}
+		
+		_deathPenaltyBuffLevel++;
+		
+		addSkill(SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel()), false);
+		sendPacket(new EtcStatusUpdate(this));
+		SystemMessage sm = new SystemMessage(SystemMessageId.DEATH_PENALTY_LEVEL_S1_ADDED);
+		sm.addNumber(getDeathPenaltyBuffLevel());
+		sendPacket(sm);
+	}
+	
+	public void reduceDeathPenaltyBuffLevel()
+	{
+		if(getDeathPenaltyBuffLevel() <= 0)
+			return;
+		
+		L2Skill skill = SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel());
+		
+		if(skill != null)
+			removeSkill(skill, true);
+		
+		_deathPenaltyBuffLevel--;
+		
+		if(getDeathPenaltyBuffLevel() > 0)
+		{
+			addSkill(SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel()), false);
+			sendPacket(new EtcStatusUpdate(this));
+			SystemMessage sm = new SystemMessage(SystemMessageId.DEATH_PENALTY_LEVEL_S1_ADDED);
+			sm.addNumber(getDeathPenaltyBuffLevel());
+			sendPacket(sm);
+		}
+		else
+		{
+			sendPacket(new EtcStatusUpdate(this));
+			sendPacket(new SystemMessage(SystemMessageId.DEATH_PENALTY_LIFTED));
+		}
+	}
+	
+	public void restoreDeathPenaltyBuffLevel()
+	{
+		L2Skill skill = SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel());
+		
+		if(skill != null)
+			removeSkill(skill, true);
+		
+		if(getDeathPenaltyBuffLevel() > 0)
+		{
+			addSkill(SkillTable.getInstance().getInfo(5076, getDeathPenaltyBuffLevel()), false);
+		}
+	}
+	
+	private FastMap<Integer, TimeStamp> _reuseTimeStamps = new FastMap<Integer, TimeStamp>().shared();
+	private boolean _canFeed;
+	private int _eventEffectId = 0;
+	private boolean _isInSiege;
+	
+	public Collection<TimeStamp> getReuseTimeStamps()
+	{
+		return _reuseTimeStamps.values();
+	}
+	
+	public FastMap<Integer, TimeStamp> getReuseTimeStamp()
+	{
+		return _reuseTimeStamps;
+	}
+	
+	/**
+	 * Simple class containing all neccessary information to maintain
+	 * valid timestamps and reuse for skills upon relog. Filter this
+	 * carefully as it becomes redundant to store reuse for small delays.
+	 * @author  Yesod
+	 */
+	public static class TimeStamp
+	{
+		private final int _skillId;
+		private final int _skillLvl;
+		private final long _reuse;
+		private final long _stamp;
+		
+		public TimeStamp(L2Skill skill, long reuse)
+		{
+			_skillId = skill.getId();
+			_skillLvl = skill.getLevel();
+			_reuse = reuse;
+			_stamp = System.currentTimeMillis()+ reuse;
+		}
+		
+		public TimeStamp(L2Skill skill, long reuse, long systime)
+		{
+			_skillId = skill.getId();
+			_skillLvl = skill.getLevel();
+			_reuse = reuse;
+			_stamp = systime;
+		}
+		
+		public long getStamp()
+		{
+			return _stamp;
+		}
+		
+		public int getSkillId()
+		{
+			return _skillId;
+		}
+		
+		public int getSkillLvl()
+		{
+			return _skillLvl;
+		}
+		
+		public long getReuse()
+		{
+			return _reuse;
+		}
+		
+		public long getRemaining()
+		{
+			return Math.max(_stamp - System.currentTimeMillis(), 0);
+		}
+		
+		/* Check if the reuse delay has passed and
+		 * if it has not then update the stored reuse time
+		 * according to what is currently remaining on
+		 * the delay. */
+		public boolean hasNotPassed()
+		{
+			return System.currentTimeMillis() < _stamp;
+		}
+	}
+	
+	/**
+	 * Index according to skill id the current
+	 * timestamp of use.
+	 * @param skillid
+	 * @param reuse delay
+	 */
+	@Override
+	public void addTimeStamp(L2Skill skill, long reuse)
+	{
+		_reuseTimeStamps.put(skill.getReuseHashCode(), new TimeStamp(skill, reuse));
+	}
+	
+	/**
+	 * Index according to skill this TimeStamp
+	 * instance for restoration purposes only.
+	 * @param TimeStamp
+	 */
+	public void addTimeStamp(L2Skill skill, long reuse, long systime)
+	{
+		_reuseTimeStamps.put(skill.getReuseHashCode(), new TimeStamp(skill, reuse, systime));
+	}
+	
+	@Override
+	public L2PcInstance getActingPlayer()
+	{
+		return this;
+	}
+	
+	@Override
+	public final void sendDamageMessage(L2Character target, int damage, boolean mcrit, boolean pcrit, boolean miss)
+	{
+		// Check if hit is missed
+		if (miss)
+		{
+			sendPacket(new SystemMessage(SystemMessageId.C1_ATTACK_WENT_ASTRAY).addPcName(this));
+			return;
+		}
+		
+		// Check if hit is critical
+		if (pcrit)
+		{
+			sendPacket(new SystemMessage(SystemMessageId.C1_HAD_CRITICAL_HIT).addPcName(this));
+			if (target instanceof L2Npc && getSkillLevel(467) > 0)
+			{
+				L2Skill skill = SkillTable.getInstance().getInfo(467,getSkillLevel(467));
+				if (Rnd.get(100) < skill.getCritChance())
+				{
+					absorbSoul(skill,((L2Npc)target));
+				}
+			}
+		}
+		if (mcrit)
+			sendPacket(new SystemMessage(SystemMessageId.CRITICAL_HIT_MAGIC));
+		
+		if (isInOlympiadMode() &&
+				target instanceof L2PcInstance &&
+				((L2PcInstance)target).isInOlympiadMode() &&
+				((L2PcInstance)target).getOlympiadGameId() == getOlympiadGameId())
+		{
+			Olympiad.getInstance().notifyCompetitorDamage(this, damage, getOlympiadGameId());
+		}
+		
+		final SystemMessage sm;
+		
+		if (target.isInvul() && !(target instanceof L2Npc))
+		{
+			sm = new SystemMessage(SystemMessageId.ATTACK_WAS_BLOCKED);
+		}
+		else if (target instanceof L2DoorInstance || target instanceof L2ControlTowerInstance)
+		{
+			sm = new SystemMessage(SystemMessageId.YOU_DID_S1_DMG);
+			sm.addNumber(damage);
+		}
+		else
+		{
+			sm = new SystemMessage(SystemMessageId.C1_GAVE_C2_DAMAGE_OF_S3);
+			sm.addPcName(this);
+			sm.addCharName(target);
+			sm.addNumber(damage);
+		}
+		
+		sendPacket(sm);
+	}
+	
+	
+	/**
+	 * 
+	 * @param npcId
+	 */
+	public void setAgathionId(int npcId)
+	{
+		_agathionId = npcId;
+	}
+	
+	/**
+	 * 
+	 * @return
+	 */
+	public int getAgathionId()
+	{
+		return _agathionId;
+	}
+	
+	public int getVitalityPoints()
+	{
+		return getStat().getVitalityPoints();
+	}
+	
+	/**
+	 * @return Vitality Level
+	 */
+	public int getVitalityLevel()
+	{
+		return getStat().getVitalityLevel();
+	}
+	
+	public void setVitalityPoints(int points, boolean quiet)
+	{
+		getStat().setVitalityPoints(points, quiet);
+	}
+	
+	public void updateVitalityPoints(float points, boolean useRates, boolean quiet)
+	{
+		getStat().updateVitalityPoints(points, useRates, quiet);
+	}
+	
+	/*
+	 * Function for skill summon friend or Gate Chant.
+	 */
+	/** Request Teleport **/
+	public boolean teleportRequest(L2PcInstance requester, L2Skill skill)
+	{
+		if (_summonRequest.getTarget() != null && requester != null)
+			return false;
+		_summonRequest.setTarget(requester, skill);
+		return true;
+	}
+	
+	/** Action teleport **/
+	public void teleportAnswer(int answer, int requesterId)
+	{
+		if (_summonRequest.getTarget() == null)
+			return;
+		if (answer == 1 && _summonRequest.getTarget().getObjectId() == requesterId)
+		{
+			teleToTarget(this, _summonRequest.getTarget(), _summonRequest.getSkill());
+		}
+		_summonRequest.setTarget(null, null);
+	}
+	
+	public static void teleToTarget(L2PcInstance targetChar, L2PcInstance summonerChar, L2Skill summonSkill)
+	{
+		if (targetChar == null || summonerChar == null || summonSkill == null)
+			return;
+		
+		if (!checkSummonerStatus(summonerChar))
+			return;
+		if (!checkSummonTargetStatus(targetChar, summonerChar))
+			return;
+		
+		int itemConsumeId = summonSkill.getTargetConsumeId();
+		int itemConsumeCount = summonSkill.getTargetConsume();
+		if (itemConsumeId != 0 && itemConsumeCount != 0)
+		{
+			//Delete by rocknow
+			if (targetChar.getInventory().getInventoryItemCount(itemConsumeId, 0) < itemConsumeCount)
+			{
+				SystemMessage sm = new SystemMessage(SystemMessageId.S1_REQUIRED_FOR_SUMMONING);
+				sm.addItemName(summonSkill.getTargetConsumeId());
+				targetChar.sendPacket(sm);
+				return;
+			}
+			targetChar.getInventory().destroyItemByItemId("Consume", itemConsumeId, itemConsumeCount, summonerChar, targetChar);
+			SystemMessage sm = new SystemMessage(SystemMessageId.S1_DISAPPEARED);
+			sm.addItemName(summonSkill.getTargetConsumeId());
+			targetChar.sendPacket(sm);
+		}
+		targetChar.teleToLocation(summonerChar.getX(), summonerChar.getY(), summonerChar.getZ(), true);
+	}
+	
+	public static boolean checkSummonerStatus(L2PcInstance summonerChar)
+	{
+		if (summonerChar == null)
+			return false;
+		
+		if (summonerChar.isInOlympiadMode())
+		{
+			summonerChar.sendPacket(new SystemMessage(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT));
+			return false;
+		}
+		
+		if (summonerChar.inObserverMode())
+		{
+			return false;
+		}
+		
+		if (!TvTEvent.onEscapeUse(summonerChar.getObjectId()))
+		{
+			summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
+			return false;
+		}
+		
+		if (summonerChar.isInsideZone(L2Character.ZONE_NOSUMMONFRIEND) || summonerChar.isFlyingMounted())
+		{
+			summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
+			return false;
+		}
+		return true;
+	}
+	
+	public static boolean checkSummonTargetStatus(L2Object target, L2PcInstance summonerChar)
+	{
+		if (target == null || !(target instanceof L2PcInstance))
+			return false;
+		
+		L2PcInstance targetChar = (L2PcInstance) target;
+		
+		if (targetChar.isAlikeDead())
+		{
+			SystemMessage sm = new SystemMessage(SystemMessageId.C1_IS_DEAD_AT_THE_MOMENT_AND_CANNOT_BE_SUMMONED);
+			sm.addPcName(targetChar);
+			summonerChar.sendPacket(sm);
+			return false;
+		}
+		
+		if (targetChar.isInStoreMode())
+		{
+			SystemMessage sm = new SystemMessage(SystemMessageId.C1_CURRENTLY_TRADING_OR_OPERATING_PRIVATE_STORE_AND_CANNOT_BE_SUMMONED);
+			sm.addPcName(targetChar);
+			summonerChar.sendPacket(sm);
+			return false;
+		}
+		
+		if (targetChar.isRooted() || targetChar.isInCombat())
+		{
+			SystemMessage sm = new SystemMessage(SystemMessageId.C1_IS_ENGAGED_IN_COMBAT_AND_CANNOT_BE_SUMMONED);
+			sm.addPcName(targetChar);
+			summonerChar.sendPacket(sm);
+			return false;
+		}
+		
+		if (targetChar.isInOlympiadMode())
+		{
+			summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_SUMMON_PLAYERS_WHO_ARE_IN_OLYMPIAD));
+			return false;
+		}
+		
+		if (targetChar.isFestivalParticipant() || targetChar.isFlyingMounted())
+		{
+			summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
+			return false;
+		}
+		
+		if (targetChar.inObserverMode())
+		{
+			summonerChar.sendPacket(new SystemMessage(SystemMessageId.C1_STATE_FORBIDS_SUMMONING).addCharName(targetChar));
+			return false;
+		}
+		
+		if (targetChar.isCombatFlagEquipped())
+		{
+			summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
+			return false;
+		}
+		
+		if (!TvTEvent.onEscapeUse(targetChar.getObjectId()))
+		{
+			summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
+			return false;
+		}
+		
+		if (targetChar.isInsideZone(L2Character.ZONE_NOSUMMONFRIEND))
+		{
+			SystemMessage sm = new SystemMessage(SystemMessageId.C1_IN_SUMMON_BLOCKING_AREA);
+			sm.addString(targetChar.getName());
+			summonerChar.sendPacket(sm);
+			return false;
+		}
+		
+		if (summonerChar.getInstanceId() > 0)
+		{
+			Instance summonerInstance = InstanceManager.getInstance().getInstance(summonerChar.getInstanceId());
+			if (!Config.ALLOW_SUMMON_TO_INSTANCE || !summonerInstance.isSummonAllowed())
+			{
+				summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION));
+				return false;
+			}
+		}
+		
+		// on retail character can enter 7s dungeon with summon friend,
+		// but will be teleported away by mobs
+		// because currently this is not working in L2J we do not allowing summoning
+		if (summonerChar.isIn7sDungeon())
+		{
+			int targetCabal = SevenSigns.getInstance().getPlayerCabal(targetChar.getObjectId());
+			if (SevenSigns.getInstance().isSealValidationPeriod())
+			{
+				if (targetCabal != SevenSigns.getInstance().getCabalHighestScore())
+				{
+					summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
+					return false;
+				}
+			}
+			else
+			{
+				if (targetCabal == SevenSigns.CABAL_NULL)
+				{
+					summonerChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
+					return false;
+				}
+			}
+		}
+		
+		return true;
+	}
+	
+	public void gatesRequest(L2DoorInstance door)
+	{
+		_gatesRequest.setTarget(door);
+	}
+	
+	public void gatesAnswer(int answer, int type)
+	{
+		if (_gatesRequest.getDoor() == null)
+			return;
+		
+		if (answer == 1 && getTarget() == _gatesRequest.getDoor() && type == 1)
+			_gatesRequest.getDoor().openMe();
+		else if (answer == 1 && getTarget() == _gatesRequest.getDoor() && type == 0)
+			_gatesRequest.getDoor().closeMe();
+		
+		_gatesRequest.setTarget(null);
+	}
+	
+	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, false)
+					|| (isInOlympiadMode() && equippedItem.isOlyRestrictedItem())))
+			{
+				getInventory().unEquipItemInSlotAndRecord(i);
+				
+				InventoryUpdate iu = new InventoryUpdate();
+				iu.addModifiedItem(equippedItem);
+				sendPacket(iu);
+				
+				if (equippedItem.isWear())
+					continue;
+				
+				// prevent double message for two-hand weapons
+				if (i == Inventory.PAPERDOLL_LRHAND)
+					continue;
+				
+				SystemMessage sm = null;
+				if (equippedItem.getItem().getBodyPart() == L2Item.SLOT_BACK)
+				{
+					sendPacket(new SystemMessage(SystemMessageId.CLOAK_REMOVED_BECAUSE_ARMOR_SET_REMOVED));
+					return;
+				}
+				
+				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);
+			}
+		}
+	}
+	
+	public void setTransformAllowedSkills(int[] ids)
+	{
+		_transformAllowedSkills = ids;
+	}
+	
+	public boolean containsAllowedTransformSkill(int id)
+	{
+		for (int i = 0; i < _transformAllowedSkills.length; i++)
+		{
+			if (_transformAllowedSkills[i] == id)
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	/** Section for mounted pets */
+	private class FeedTask implements Runnable
+	{
+		public void run()
+		{
+			try
+			{
+				if (!isMounted())
+				{
+					stopFeed();
+					return;
+				}
+				
+				if (getCurrentFeed() > getFeedConsume())
+				{
+					// eat
+					setCurrentFeed(getCurrentFeed()-getFeedConsume());
+				}
+				else
+				{
+					// go back to pet control item, or simply said, unsummon it
+					setCurrentFeed(0);
+					stopFeed();
+					dismount();
+					sendPacket(new SystemMessage(SystemMessageId.OUT_OF_FEED_MOUNT_CANCELED));
+				}
+				
+				int[] foodIds = PetDataTable.getFoodItemId(getMountNpcId());
+				if (foodIds[0] == 0) return;
+				L2ItemInstance food = null;
+				food = getInventory().getItemByItemId(foodIds[0]);
+				
+				// use better strider food if exists
+				if (PetDataTable.isStrider(getMountNpcId()))
+				{
+					if (getInventory().getItemByItemId(foodIds[1]) != null)
+						food = getInventory().getItemByItemId(foodIds[1]);
+				}
+				if (food != null && isHungry())
+				{
+					IItemHandler handler = ItemHandler.getInstance().getItemHandler(food.getEtcItem());
+					if (handler != null)
+					{
+						handler.useItem(L2PcInstance.this, food, false);
+						SystemMessage sm = new SystemMessage(SystemMessageId.PET_TOOK_S1_BECAUSE_HE_WAS_HUNGRY);
+						sm.addItemName(food.getItemId());
+						sendPacket(sm);
+					}
+				}
+			}
+			catch (Exception e)
+			{
+				_log.log(Level.SEVERE, "Mounted Pet [NpcId: "+getMountNpcId()+"] a feed task error has occurred", e);
+			}
+		}
+	}
+	
+	protected synchronized void startFeed(int npcId)
+	{
+		_canFeed = npcId > 0;
+		if (!isMounted())
+			return;
+		if (getPet() != null)
+		{
+			setCurrentFeed(((L2PetInstance) getPet()).getCurrentFed());
+			_controlItemId = getPet().getControlObjectId();
+			sendPacket(new SetupGauge(3, getCurrentFeed()*10000/getFeedConsume(), getMaxFeed()*10000/getFeedConsume()));
+			if (!isDead())
+			{
+				_mountFeedTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new FeedTask(), 10000, 10000);
+			}
+		}
+		else if (_canFeed)
+		{
+			setCurrentFeed(getMaxFeed());
+			SetupGauge sg = new SetupGauge(3, getCurrentFeed()*10000/getFeedConsume(), getMaxFeed()*10000/getFeedConsume());
+			sendPacket(sg);
+			if (!isDead())
+			{
+				_mountFeedTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new FeedTask(), 10000, 10000);
+			}
+		}
+	}
+	
+	protected synchronized void stopFeed()
+	{
+		if (_mountFeedTask != null)
+		{
+			_mountFeedTask.cancel(false);
+			//ThreadPoolManager.getInstance().removeGeneral((Runnable)_mountFeedTask);
+			_mountFeedTask = null;
+			if (Config.DEBUG) _log.fine("Pet [#"+_mountNpcId+"] feed task stop");
+		}
+	}
+	
+	protected final void clearPetData()
+	{
+		_data = null;
+	}
+	
+	protected final L2PetData getPetData(int npcId)
+	{
+		if (_data == null && getPet() != null)
+			_data = PetDataTable.getInstance().getPetData(getPet().getNpcId(), getPet().getLevel());
+		else if (_data == null && npcId > 0)
+		{
+			_data = PetDataTable.getInstance().getPetData(npcId, getLevel());
+		}
+		
+		return _data;
+	}
+	
+	public int getCurrentFeed() { return _curFeed; }
+	
+	protected int getFeedConsume()
+	{
+		// if pet is attacking
+		if (isAttackingNow())
+			return getPetData(_mountNpcId).getPetFeedBattle();
+		else
+			return getPetData(_mountNpcId).getPetFeedNormal();
+	}
+	
+	public void setCurrentFeed(int num)
+	{
+		_curFeed = num > getMaxFeed() ? getMaxFeed() : num;
+		SetupGauge sg = new SetupGauge(3, getCurrentFeed()*10000/getFeedConsume(), getMaxFeed()*10000/getFeedConsume());
+		sendPacket(sg);
+	}
+	
+	protected int getMaxFeed()
+	{
+		return getPetData(_mountNpcId).getPetMaxFeed();
+	}
+	
+	protected boolean isHungry()
+	{
+		return _canFeed ? (getCurrentFeed() < (0.55 * getPetData(getMountNpcId()).getPetMaxFeed())):false;
+	}
+	
+	private class Dismount implements Runnable
+	{
+		public void run()
+		{
+			try
+			{
+				L2PcInstance.this.dismount();
+			}
+			catch (Exception e)
+			{
+				_log.log(Level.WARNING, "Exception on dismount(): " + e.getMessage(), e);
+			}
+		}
+	}
+	
+	public void enteredNoLanding(int delay)
+	{
+		_dismountTask = ThreadPoolManager.getInstance().scheduleGeneral(new L2PcInstance.Dismount(), delay * 1000);
+	}
+	
+	public void exitedNoLanding()
+	{
+		if (_dismountTask != null)
+		{
+			_dismountTask.cancel(true);
+			_dismountTask = null;
+		}
+	}
+	
+	public void storePetFood(int petId)
+	{
+		if (_controlItemId != 0 && petId != 0)
+		{
+			String req;
+			req = "UPDATE pets SET fed=? WHERE item_obj_id = ?";
+			Connection con = null;
+			try
+			{
+				con = L2DatabaseFactory.getInstance().getConnection();
+				PreparedStatement statement = con.prepareStatement(req);
+				statement.setInt(1, getCurrentFeed());
+				statement.setInt(2, _controlItemId);
+				statement.executeUpdate();
+				statement.close();
+				_controlItemId = 0;
+			}
+			catch (Exception e)
+			{
+				_log.log(Level.SEVERE, "Failed to store Pet [NpcId: "+petId+"] data", e);
+			}
+			finally
+			{
+				L2DatabaseFactory.close(con);
+			}
+		}
+	}
+	/** End of section for mounted pets */
+	
+	@Override
+	public int getAttackElementValue(byte attribute)
+	{
+		int value = super.getAttackElementValue(attribute);
+		
+		// 20% if summon exist
+		if (getPet() != null && getClassId().isSummoner() && (getPet() instanceof L2SummonInstance))
+			return value / 5;
+		
+		return value;
+	}
+	
+	/**
+	 * @return event effect id
+	 */
+	public int getEventEffectId()
+	{
+		return _eventEffectId ;
+	}
+	
+	public void startEventEffect(AbnormalEffect mask)
+	{
+		_eventEffectId |= mask.getMask();
+		broadcastUserInfo();
+	}
+	
+	public void stopEventEffect(AbnormalEffect mask)
+	{
+		_eventEffectId &= ~mask.getMask();
+		broadcastUserInfo();
+	}
+	
+	public void setIsInSiege(boolean b)
+	{
+		_isInSiege = b;
+	}
+	
+	public boolean isInSiege()
+	{
+		return _isInSiege;
+	}
+	
+	public FloodProtectors getFloodProtectors()
+	{
+		return getClient().getFloodProtectors();
+	}
+	
+	public boolean isFlyingMounted()
+	{
+		return _isFlyingMounted;
+	}
+	
+	public void setIsFlyingMounted(boolean val)
+	{
+		_isFlyingMounted = val;
+		setIsFlying(val);
+	}
+	
+	/**
+	 * Returns the Number of Charges this L2PcInstance got.
+	 * @return
+	 */
+	public int getCharges()
+	{
+		return _charges.get();
+	}
+	
+	public synchronized void increaseCharges(int count, int max)
+	{
+		if (_charges.get() >= max)
+		{
+			sendPacket(new SystemMessage(SystemMessageId.FORCE_MAXLEVEL_REACHED));
+			return;
+		}
+		else
+		{
+			// if no charges - start clear task
+			if (_charges.get() == 0)
+				restartChargeTask();
+		}
+		
+		if (_charges.addAndGet(count) >= max)
+		{
+			_charges.set(max);
+			sendPacket(new SystemMessage(SystemMessageId.FORCE_MAXLEVEL_REACHED));
+		}
+		else
+		{
+			SystemMessage sm = new SystemMessage(SystemMessageId.FORCE_INCREASED_TO_S1);
+			sm.addNumber(_charges.get());
+			sendPacket(sm);
+		}
+		
+		sendPacket(new EtcStatusUpdate(this));
+	}
+	
+	public synchronized boolean decreaseCharges(int count)
+	{
+		if (_charges.get() < count)
+			return false;
+		
+		if (_charges.addAndGet(-count) == 0)
+			stopChargeTask();
+		
+		sendPacket(new EtcStatusUpdate(this));
+		return true;
+	}
+	
+	public void clearCharges()
+	{
+		_charges.set(0);
+		sendPacket(new EtcStatusUpdate(this));
+	}
+	
+	/**
+	 * Starts/Restarts the ChargeTask to Clear Charges after 10 Mins.
+	 */
+	private void restartChargeTask()
+	{
+		if (_chargeTask != null)
+		{
+			_chargeTask.cancel(false);
+			_chargeTask = null;
+		}
+		_chargeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChargeTask(), 600000);
+	}
+	
+	/**
+	 * Stops the Charges Clearing Task.
+	 */
+	public void stopChargeTask()
+	{
+		if (_chargeTask != null)
+		{
+			_chargeTask.cancel(false);
+			//ThreadPoolManager.getInstance().removeGeneral((Runnable)_chargeTask);
+			_chargeTask = null;
+		}
+	}
+	
+	private class ChargeTask implements Runnable
+	{
+		
+		public void run()
+		{
+			L2PcInstance.this.clearCharges();
+		}
+	}
+	
+	public static class TeleportBookmark
+	{
+		public int _id,_x,_y,_z,_icon;
+		public String _name,_tag;
+		
+		TeleportBookmark(int id, int x, int y, int z, int icon, String tag, String name)
+		{
+			_id = id;
+			_x = x;
+			_y = y;
+			_z = z;
+			_icon = icon;
+			_name = name;
+			_tag = tag;
+		}
+		
+	}
+	
+	public void teleportBookmarkModify(int Id, int icon, String tag, String name)
+	{
+		int count = 0;
+		int size = tpbookmark.size();
+		while(size > count)
+		{
+			if(tpbookmark.get(count)._id==Id)
+			{
+				tpbookmark.get(count)._icon = icon;
+				tpbookmark.get(count)._tag = tag;
+				tpbookmark.get(count)._name = name;
+				
+				Connection con = null;
+				
+				try
+				{
+					
+					con = L2DatabaseFactory.getInstance().getConnection();
+					PreparedStatement statement = con.prepareStatement(UPDATE_TP_BOOKMARK);
+					
+					statement.setInt(1, icon);
+					statement.setString(2, tag);
+					statement.setString(3, name);
+					statement.setInt(4, getObjectId());
+					statement.setInt(5, Id);
+					
+					statement.execute();
+					statement.close();
+				}
+				catch (Exception e)
+				{
+					_log.log(Level.WARNING, "Could not update character teleport bookmark data: " + e.getMessage(), e);
+				}
+				finally
+				{
+					L2DatabaseFactory.close(con);
+				}
+				
+			}
+			count++;
+		}
+		
+		sendPacket(new ExGetBookMarkInfoPacket(this));
+		
+	}
+	
+	public void teleportBookmarkDelete(int Id)
+	{
+		Connection con = null;
+		
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(DELETE_TP_BOOKMARK);
+			
+			statement.setInt(1, getObjectId());
+			statement.setInt(2, Id);
+			
+			statement.execute();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "Could not delete character teleport bookmark data: " + e.getMessage(), e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+		
+		int count = 0;
+		int size = tpbookmark.size();
+		
+		while(size > count)
+		{
+			if(tpbookmark.get(count)._id == Id)
+			{
+				tpbookmark.remove(count);
+				break;
+			}
+			count++;
+		}
+		
+		sendPacket(new ExGetBookMarkInfoPacket(this));
+	}
+	
+	public void teleportBookmarkGo(int Id)
+	{
+		if(!teleportBookmarkCondition(0) || this == null)
+			return;
+		if (getInventory().getInventoryItemCount(13016, 0) == 0)
+		{
+			sendPacket(new SystemMessage(2359));
+			return;
+		}
+		SystemMessage sm = new SystemMessage(SystemMessageId.S1_DISAPPEARED);
+		sm.addItemName(13016);
+		sendPacket(sm);
+		int count = 0;
+		int size = tpbookmark.size();
+		while(size > count)
+		{
+			if(tpbookmark.get(count)._id == Id)
+			{
+				destroyItem("Consume", getInventory().getItemByItemId(13016).getObjectId(), 1, null, false);
+				this.teleToLocation(tpbookmark.get(count)._x, tpbookmark.get(count)._y, tpbookmark.get(count)._z);
+				break;
+			}
+			count++;
+		}
+		sendPacket(new ExGetBookMarkInfoPacket(this));
+	}
+	
+	public boolean teleportBookmarkCondition(int type)
+	{
+		if(this.isInCombat())
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_BATTLE));
+			return false;
+		}
+		else if (this.isInSiege() || this.getSiegeState() != 0)
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING));
+			return false;
+		}
+		else if (this.isInDuel())
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_DUEL));
+			return false;
+		}
+		else if (this.isFlying())
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_FLYING));
+			return false;
+		}
+		else if (this.isInOlympiadMode())
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING_IN_AN_OLYMPIAD_MATCH));
+			return false;
+		}
+		else if (this.isParalyzed())
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_PARALYZED));
+			return false;
+		}
+		else if (this.isDead())
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_DEAD));
+			return false;
+		}
+		else if (type == 1 && (isIn7sDungeon() || (isInParty() && getParty().isInDimensionalRift())))
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
+			return false;
+		}
+		else if (this.isInBoat() || this.isInAirShip() || this.isInJail() || this.isInsideZone(ZONE_NOSUMMONFRIEND))
+		{
+			if(type == 0)
+				sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_IN_THIS_AREA));
+			else if (type == 1)
+				sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
+			return false;
+		}
+		else if (this.isInWater())
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_UNDERWATER));
+			return false;
+		}
+		else if (type == 1 && (this.isInsideZone(ZONE_SIEGE) || this.isInsideZone(ZONE_CLANHALL) || this.isInsideZone(ZONE_JAIL) || this.isInsideZone(ZONE_CASTLE) || this.isInsideZone(ZONE_NOSUMMONFRIEND) || this.isInsideZone(ZONE_FORT)))
+		{
+			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
+			return false;
+		}
+		/* TODO: Instant Zone still not implement
+    	else if (this.isInsideZone(ZONE_INSTANT))
+    	{
+    		sendPacket(new SystemMessage(2357));
+    		return;
+    	}
+		 */
+		else
+			return true;
+	}
+	
+	public void teleportBookmarkAdd(int x,int y,int z,int icon, String tag, String name)
+	{
+		if(this == null)
+			return;
+		
+		if(!teleportBookmarkCondition(1))
+			return;
+		
+		if(tpbookmark.size() >= _bookmarkslot)
+		{
+			sendPacket(new SystemMessage(2358));
+			return;
+		}
+		
+		if(getInventory().getInventoryItemCount(20033, 0) == 0)
+		{
+			sendPacket(new SystemMessage(6501));
+			return;
+		}
+		
+		int count = 0;
+		int id = 1;
+		FastList<Integer> idlist = new FastList<Integer>();
+		
+		int size = tpbookmark.size();
+		
+		while(size > count)
+		{
+			idlist.add(tpbookmark.get(count)._id);
+			count++;
+		}
+		
+		for(int i=1; i<10; i++)
+		{
+			if(!idlist.contains(i))
+			{
+				id = i;
+				break;
+			}
+		}
+		
+		TeleportBookmark tpadd = new TeleportBookmark(id, x, y, z, icon, tag, name);
+		if(tpbookmark == null)
+			tpbookmark = new FastList<TeleportBookmark>();
+		
+		tpbookmark.add(tpadd);
+		
+		destroyItem("Consume", getInventory().getItemByItemId(20033).getObjectId(), 1, null, false);
+		
+		SystemMessage sm = new SystemMessage(SystemMessageId.S1_DISAPPEARED);
+		sm.addItemName(20033);
+		sendPacket(sm);
+		
+		Connection con = null;
+		
+		try
+		{
+			
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(INSERT_TP_BOOKMARK);
+			
+			statement.setInt(1, getObjectId());
+			statement.setInt(2, id);
+			statement.setInt(3, x);
+			statement.setInt(4, y);
+			statement.setInt(5, z);
+			statement.setInt(6, icon);
+			statement.setString(7, tag);
+			statement.setString(8, name);
+			
+			
+			statement.execute();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "Could not insert character teleport bookmark data: " + e.getMessage(), e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+		
+		sendPacket(new ExGetBookMarkInfoPacket(this));
+	}
+	
+	public void restoreTeleportBookmark()
+	{
+		if(tpbookmark == null)
+			tpbookmark = new FastList<TeleportBookmark>();
+		Connection con = null;
+		
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(RESTORE_TP_BOOKMARK);
+			statement.setInt(1, getObjectId());
+			ResultSet rset = statement.executeQuery();
+			
+			while (rset.next())
+			{
+				tpbookmark.add(new TeleportBookmark(rset.getInt("Id"), rset.getInt("x"), rset.getInt("y"), rset.getInt("z"), rset.getInt("icon"), rset.getString("tag"), rset.getString("name")));
+			}
+			
+			rset.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "Failed restoing character teleport bookmark.", e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	@Override
+	public void sendInfo(L2PcInstance activeChar)
+	{
+		if(isInBoat())
+		{
+			getPosition().setWorldPosition(getBoat().getPosition().getWorldPosition());
+			
+			activeChar.sendPacket(new CharInfo(this));
+			activeChar.sendPacket(new ExBrExtraUserInfo(this));
+			int relation1 = getRelation(activeChar);
+			int relation2 = activeChar.getRelation(this);
+			Integer oldrelation = getKnownList().getKnownRelations().get(activeChar.getObjectId());
+			if (oldrelation != null && oldrelation != relation1)
+			{
+				activeChar.sendPacket(new RelationChanged(this, relation1, isAutoAttackable(activeChar)));
+				if (getPet() != null)
+					activeChar.sendPacket(new RelationChanged(getPet(), relation1, isAutoAttackable(activeChar)));
+			}
+			oldrelation = activeChar.getKnownList().getKnownRelations().get(getObjectId());
+			if (oldrelation != null && oldrelation != relation2)
+			{
+				sendPacket(new RelationChanged(activeChar, relation2, activeChar.isAutoAttackable(this)));
+				if (activeChar.getPet() != null)
+					sendPacket(new RelationChanged(activeChar.getPet(), relation2, activeChar.isAutoAttackable(this)));
+			}
+			activeChar.sendPacket(new GetOnVehicle(getObjectId(), getBoat().getObjectId(), getInVehiclePosition()));
+		}
+		else if(isInAirShip())
+		{
+			getPosition().setWorldPosition(getAirShip().getPosition().getWorldPosition());
+			
+			activeChar.sendPacket(new CharInfo(this));
+			activeChar.sendPacket(new ExBrExtraUserInfo(this));
+			int relation1 = getRelation(activeChar);
+			int relation2 = activeChar.getRelation(this);
+			Integer oldrelation = getKnownList().getKnownRelations().get(activeChar.getObjectId());
+			if (oldrelation != null && oldrelation != relation1)
+			{
+				activeChar.sendPacket(new RelationChanged(this, relation1, isAutoAttackable(activeChar)));
+				if (getPet() != null)
+					activeChar.sendPacket(new RelationChanged(getPet(), relation1, isAutoAttackable(activeChar)));
+			}
+			oldrelation = activeChar.getKnownList().getKnownRelations().get(getObjectId());
+			if (oldrelation != null && oldrelation != relation2)
+			{
+				sendPacket(new RelationChanged(activeChar, relation2, activeChar.isAutoAttackable(this)));
+				if (activeChar.getPet() != null)
+					sendPacket(new RelationChanged(activeChar.getPet(), relation2, activeChar.isAutoAttackable(this)));
+			}
+			activeChar.sendPacket(new ExGetOnAirShip(this, getAirShip()));
+		}
+		else
+		{
+			activeChar.sendPacket(new CharInfo(this));
+			activeChar.sendPacket(new ExBrExtraUserInfo(this));
+			int relation1 = getRelation(activeChar);
+			int relation2 = activeChar.getRelation(this);
+			Integer oldrelation = getKnownList().getKnownRelations().get(activeChar.getObjectId());
+			if (oldrelation != null && oldrelation != relation1)
+			{
+				activeChar.sendPacket(new RelationChanged(this, relation1, isAutoAttackable(activeChar)));
+				if (getPet() != null)
+					activeChar.sendPacket(new RelationChanged(getPet(), relation1, isAutoAttackable(activeChar)));
+			}
+			oldrelation = activeChar.getKnownList().getKnownRelations().get(getObjectId());
+			if (oldrelation != null && oldrelation != relation2)
+			{
+				sendPacket(new RelationChanged(activeChar, relation2, activeChar.isAutoAttackable(this)));
+				if (activeChar.getPet() != null)
+					sendPacket(new RelationChanged(activeChar.getPet(), relation2, activeChar.isAutoAttackable(this)));
+			}
+		}
+		if (getMountType() == 4)
+		{
+			// TODO: Remove when horse mounts fixed
+			activeChar.sendPacket(new Ride(this, false, 0));
+			activeChar.sendPacket(new Ride(this, true, getMountNpcId()));
+		}
+		
+		switch (getPrivateStoreType())
+		{
+			case L2PcInstance.STORE_PRIVATE_SELL:
+				activeChar.sendPacket(new PrivateStoreMsgSell(this));
+				break;
+			case L2PcInstance.STORE_PRIVATE_PACKAGE_SELL:
+				activeChar.sendPacket(new ExPrivateStoreSetWholeMsg(this));
+				break;
+			case L2PcInstance.STORE_PRIVATE_BUY:
+				activeChar.sendPacket(new PrivateStoreMsgBuy(this));
+				break;
+			case L2PcInstance.STORE_PRIVATE_MANUFACTURE:
+				activeChar.sendPacket(new RecipeShopMsg(this));
+				break;
+		}
+	}
+	
+	public void showQuestMovie(int id)
+	{
+		if (_movieId > 0) //already in movie
+			return;
+		abortAttack();
+		abortCast();
+		stopMove(null);
+		_movieId = id;
+		sendPacket(new ExStartScenePlayer(id));
+	}
+	
+	public boolean isAllowedToEnchantSkills()
+	{
+		if (isLocked())
+			return false;
+		if (isTransformed())
+			return false;
+		if (AttackStanceTaskManager.getInstance().getAttackStanceTask(this))
+			return false;
+		if (isCastingNow() || isCastingSimultaneouslyNow())
+			return false;
+		if (isInBoat() || isInAirShip())
+			return false;
+		return true;
+	}
+	
+	/**
+	 * Set the _creationTime of the L2PcInstance.<BR><BR>
+	 */
+	public void setCreateTime(long creationTime)
+	{
+		_creationTime = creationTime;
+	}
+	
+	/**
+	 * Return the _creationTime of the L2PcInstance.<BR><BR>
+	 */
+	public long getCreateTime()
+	{
+		return _creationTime;
+	}
+	
+	/**
+	 * @return number of days to char birthday.<BR><BR>
+	 */
+	public int checkBirthDay()
+	{
+		QuestState _state = getQuestState("CharacterBirthday");
+		Calendar now = Calendar.getInstance();
+		Calendar birth = Calendar.getInstance();
+		now.setTimeInMillis(System.currentTimeMillis());
+		birth.setTimeInMillis(_creationTime);
+		
+		if (_state != null && _state.getInt("Birthday") > now.get(Calendar.YEAR))
+			return -1;
+		
+		// "Characters with a February 29 creation date will receive a gift on February 28."
+		if (birth.get(Calendar.DAY_OF_MONTH) == 29 && birth.get(Calendar.MONTH) == 1)
+			birth.add(Calendar.HOUR_OF_DAY, -24);
+		
+		if (now.get(Calendar.MONTH) == birth.get(Calendar.MONTH)
+				&& now.get(Calendar.DAY_OF_MONTH) == birth.get(Calendar.DAY_OF_MONTH)
+				&& now.get(Calendar.YEAR) != birth.get(Calendar.YEAR))
+		{
+			return 0;
+		}
+		else
+		{
+			int i;
+			for (i = 1; i < 6; i++)
+			{
+				now.add(Calendar.HOUR_OF_DAY, 24);
+				if (now.get(Calendar.MONTH) == birth.get(Calendar.MONTH)
+						&& now.get(Calendar.DAY_OF_MONTH) == birth.get(Calendar.DAY_OF_MONTH)
+						&& now.get(Calendar.YEAR) != birth.get(Calendar.YEAR))
+					return i;
+			}
+		}
+		return -1;
+	}
+	
+	
+	/**
+	 * list of character friends
+	 * 
+	 */
+	private List<Integer> _friendList = new FastList<Integer>();
+	
+	public List<Integer> getFriendList()
+	{
+		return _friendList;
+	}
+	
+	public void restoreFriendList()
+	{
+		_friendList.clear();
+		
+		Connection con = null;
+		
+		try
+		{
+			String sqlQuery = "SELECT friendId FROM character_friends WHERE charId=? AND relation=0";
+			
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(sqlQuery);
+			statement.setInt(1, getObjectId());
+			ResultSet rset = statement.executeQuery();
+			
+			int friendId;
+			while (rset.next())
+			{
+				friendId = rset.getInt("friendId");
+				if (friendId == getObjectId())
+					continue;
+				_friendList.add(friendId);
+			}
+			
+			rset.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "Error found in " + getName() + "'s FriendList: " + e.getMessage(), e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	/**
+	 * 
+	 */
+	private void notifyFriends()
+	{
+		FriendStatusPacket pkt = new FriendStatusPacket(getObjectId());
+		for(int id : _friendList)
+		{
+			L2PcInstance friend = L2World.getInstance().getPlayer(id);
+			if (friend != null)
+				friend.sendPacket(pkt);
+		}
+	}
+	
+	/**
+	 * @return the _silenceMode
+	 */
+	public boolean isSilenceMode()
+	{
+		return _silenceMode;
+	}
+	
+	/**
+	 * @param mode the _silenceMode to set
+	 */
+	public void setSilenceMode(boolean mode)
+	{
+		_silenceMode = mode;
+		sendPacket(new EtcStatusUpdate(this));
+	}
+	
+	private void storeRecipeShopList()
+	{
+		Connection con = null;
+		
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement;
+			L2ManufactureList list = getCreateList();
+			
+			if (list != null && list.size() > 0)
+			{
+				int _position = 1;
+				statement = con.prepareStatement("DELETE FROM character_recipeshoplist WHERE charId=? ");
+				statement.setInt(1, getObjectId());
+				statement.execute();
+				statement.close();
+				
+				PreparedStatement statement2 = con.prepareStatement("INSERT INTO character_recipeshoplist (charId, Recipeid, Price, Pos) VALUES (?, ?, ?, ?)");
+				for (L2ManufactureItem item : list.getList())
+				{
+					statement2.setInt(1, getObjectId());
+					statement2.setInt(2, item.getRecipeId());
+					statement2.setLong(3, item.getCost());
+					statement2.setInt(4, _position);
+					statement2.execute();
+					statement2.clearParameters();
+					_position++;
+				}
+				statement2.close();
+			}
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "Could not store recipe shop for playerID " + getObjectId() + ": ", e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	private void restoreRecipeShopList()
+	{
+		Connection con = null;
+		
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement("SELECT Recipeid,Price FROM character_recipeshoplist WHERE charId=? ORDER BY Pos ASC");
+			statement.setInt(1, getObjectId());
+			ResultSet rset = statement.executeQuery();
+			
+			
+			L2ManufactureList createList = new L2ManufactureList();
+			while (rset.next())
+			{
+				createList.add(new L2ManufactureItem(rset.getInt("Recipeid"), rset.getLong("Price")));
+			}
+			setCreateList(createList);
+			rset.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "Could not restore recipe shop list data for playerId: "+getObjectId(), e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	public double getCollisionRadius()
+	{
+		if (getAppearance().getSex())
+			return getBaseTemplate().fCollisionRadius_female;
+		else
+			return getBaseTemplate().fCollisionRadius;
+	}
+	
+	public double getCollisionHeight()
+	{
+		if (getAppearance().getSex())
+			return getBaseTemplate().fCollisionHeight_female;
+		else
+			return getBaseTemplate().fCollisionHeight;
+	}
+	
+	public final int getClientX()
+	{
+		return _clientX;
+	}
+	public final int getClientY()
+	{
+		return _clientY;
+	}
+	public final int getClientZ()
+	{
+		return _clientZ;
+	}
+	public final int getClientHeading()
+	{
+		return _clientHeading;
+	}
+	public final void setClientX(int val)
+	{
+		_clientX=val;
+	}
+	public final void setClientY(int val)
+	{
+		_clientY=val;
+	}
+	public final void setClientZ(int val)
+	{
+		_clientZ=val;
+	}
+	public final void setClientHeading(int val)
+	{
+		_clientHeading=val;
+	}
+	
+	/**
+	 * Return true if character falling now
+	 * On the start of fall return false for correct coord sync !
+	 */
+	public final boolean isFalling(int z)
+	{
+		if (isDead()
+				|| isFlying()
+				|| isFlyingMounted()
+				|| isInsideZone(ZONE_WATER))
+			return false;
+		
+		if (System.currentTimeMillis() < _fallingTimestamp)
+			return true;
+		
+		final int deltaZ = getZ() - z;
+		if (deltaZ <= getBaseTemplate().getFallHeight())
+			return false;
+		
+		final int damage = (int)Formulas.calcFallDam(this, deltaZ);
+		if (damage > 0)
+		{
+			reduceCurrentHp(Math.min(damage, getCurrentHp() - 1), null, false, true, null);
+			sendPacket(new SystemMessage(SystemMessageId.FALL_DAMAGE_S1).addNumber(damage));
+		}
+		
+		setFalling();
+		
+		return false;
+	}
+	
+	/**
+	 * Set falling timestamp
+	 */
+	public final void setFalling()
+	{
+		_fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+	}
+	
+	/**
+	 * @return the _movieId
+	 */
+	public int getMovieId()
+	{
+		return _movieId;
+	}
+	
+	public void setMovieId(int id)
+	{
+		_movieId = id;
+	}
+	
+	/**
+	 * Update last item auction request timestamp to current
+	 */
+	public void updateLastItemAuctionRequest()
+	{
+		_lastItemAuctionInfoRequest = System.currentTimeMillis();
+	}
+	
+	/**
+	 * Returns true if receiving item auction requests
+	 * (last request was in 2 seconds before)
+	 */
+	public boolean isItemAuctionPolling()
+	{
+		return System.currentTimeMillis() - _lastItemAuctionInfoRequest < 2000;
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.l2jserver.gameserver.model.actor.L2Character#isMovementDisabled()
+	 */
+	@Override
+	public boolean isMovementDisabled()
+	{
+		return super.isMovementDisabled() || _movieId > 0;
+	}
+	
+	private void restoreUISettings()
+	{
+		_uiKeySettings = new L2UIKeysSettings(this);
+	}
+	
+	private void storeUISettings()
+	{
+		if (_uiKeySettings == null)
+			return;
+		
+		if (!_uiKeySettings.isSaved())
+			_uiKeySettings.saveInDB();
+	}
+	
+	public L2UIKeysSettings getUISettings()
+	{
+		return _uiKeySettings;
+	}
+	
+	public String getHtmlPrefix()
+	{
+		if (!Config.L2JMOD_MULTILANG_ENABLE)
+			return null;
+		
+		return _htmlPrefix;
+	}
+	
+	public String getLang()
+	{
+		return _lang;
+	}
+	
+	public boolean setLang(String lang)
+	{
+		boolean result = false;
+		if (Config.L2JMOD_MULTILANG_ENABLE)
+		{
+			if (Config.L2JMOD_MULTILANG_ALLOWED.contains(lang))
+			{
+				_lang = lang;
+				result = true;
+			}
+			else
+				_lang = Config.L2JMOD_MULTILANG_DEFAULT;
+			
+			_htmlPrefix = "data/lang/" + _lang + "/";
+		}
+		else
+		{
+			_lang = null;
+			_htmlPrefix = null;
+		}
+		
+		return result;
+	}
+	
+	public long getOfflineStartTime()
+	{
+		return _offlineShopStart;
+	}
+	
+	public void setOfflineStartTime(long time)
+	{
+		_offlineShopStart = time;
+	}
+	
+	/**
+	 * Remove player from BossZones (used on char logout/exit)
+	 */
+	public void removeFromBossZone()
+	{
+		try
+		{
+			for (L2BossZone _zone : GrandBossManager.getInstance().getZones())
+			{
+				_zone.removePlayer(this);
+			}
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "Exception on removeFromBossZone(): " + e.getMessage(), e);
+		}
+	}
+	
+	/**
+	 * Check all player skills for skill level. If player level is lower than skill learn level - 9, skill level is decreased to next possible level.
+	 */
+	public void checkPlayerSkills()
+	{
+		for (int id : _skills.keySet())
+		{
+			int level = getSkillLevel(id);
+			if (level >= 100) // enchanted skill
+				level = SkillTable.getInstance().getMaxLevel(id);
+			L2SkillLearn learn = SkillTreeTable.getInstance().getSkillLearnBySkillIdLevel(getClassId(), id, level);
+			// not found - not a learn skill?
+			if (learn == null)
+			{
+				continue;
+			}
+			else
+			{
+				// player level is too low for such skill level
+				if (getLevel() < (learn.getMinLevel() - 9))
+					deacreaseSkillLevel(id);
+			}
+		}
+	}
+	
+	private void deacreaseSkillLevel(int id)
+	{
+		int nextLevel = -1;
+		for (L2SkillLearn sl : SkillTreeTable.getInstance().getAllowedSkills(getClassId()))
+		{
+			if (sl.getId() == id && nextLevel < sl.getLevel() && getLevel() >= (sl.getMinLevel() - 9))
+			{
+				// next possible skill level
+				nextLevel = sl.getLevel();
+			}
+		}
+		
+		if (nextLevel == -1) // there is no lower skill
+		{
+			_log.info("Removing skill id "+id+ " level "+getSkillLevel(id)+" from player "+this);
+			removeSkill(_skills.get(id), true);
+		}
+		else // replace with lower one
+		{
+			_log.info("Decreasing skill id "+id+" from "+getSkillLevel(id)+" to "+nextLevel+" for "+this);
+			addSkill(SkillTable.getInstance().getInfo(id, nextLevel), true);
+		}
+	}
+	
+	public boolean canMakeSocialAction()
+	{
+		if (getPrivateStoreType() == 0 && getActiveRequester() == null
+				&& !isAlikeDead() && (!isAllSkillsDisabled() || isInDuel())
+				&& !isCastingNow() && !isCastingSimultaneouslyNow()
+				&& getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE
+				&& !AttackStanceTaskManager.getInstance().getAttackStanceTask(this)
+				&& !isInOlympiadMode())
+		{
+			return true;
+		}
+		else
+			return false;
+	}
+	
+	public void setMultiSocialAction(int id, int targetId)
+	{
+		_multiSociaAction = id;
+		_multiSocialTarget = targetId;
+	}
+	
+	public int getMultiSociaAction()
+	{
+		return _multiSociaAction;
+	}
+	
+	public int getMultiSocialTarget()
+	{
+		return _multiSocialTarget;
+	}
+	
+	public List<TeleportBookmark> getTpbookmark()
+	{
+		return tpbookmark;
+	}
+	
+	public int getBookmarkslot()
+	{
+		return _bookmarkslot;
+	}
+	
+	/**
+	 * @return
+	 */
+	public int getQuestInventoryLimit()
+	{
+		return Config.INVENTORY_MAXIMUM_QUEST_ITEMS;
+	}
+	
+	public boolean canAttackCharacter(L2Character cha)
+	{
+		if(cha instanceof L2Attackable)
+		{
+			return true;
+		}
+		else if(cha instanceof L2Playable)
+		{
+			if(cha.isInsideZone(L2Character.ZONE_PVP) && !cha.isInsideZone(L2Character.ZONE_SIEGE))
+				return true;
+			
+			L2PcInstance target;
+			if (cha instanceof L2Summon)
+				target = ((L2Summon) cha).getOwner();
+			else
+				target = (L2PcInstance) cha;
+			
+			if (isInDuel() && target.isInDuel() && (target.getDuelId() == getDuelId()))
+			{
+				return true;
+			}
+			else if (isInParty() && target.isInParty())
+			{
+				if(getParty() == target.getParty())
+					return false;
+				if((getParty().getCommandChannel() != null || target.getParty().getCommandChannel() != null) && (getParty().getCommandChannel() == target.getParty().getCommandChannel()))
+					return false;
+			}
+			else if (getClan() != null && target.getClan() != null)
+			{
+				if (getClanId() == target.getClanId())
+					return false;
+				if ((getAllyId() > 0 || target.getAllyId() > 0) && (getAllyId() == target.getAllyId()))
+					return false;
+				if(getClan().isAtWarWith(target.getClan().getClanId()) && target.getClan().isAtWarWith(getClan().getClanId()))
+					return true;
+			}
+			else if (getClan() == null || target.getClan() == null)
+			{
+				if(target.getPvpFlag() == 0 && target.getKarma() == 0)
+					return false;
+			}
+		}
+		return true;
+	}
+	
+	/**
+	 * Test if player inventory is under 80% capaity
+	 * @param includeQuestInv check also quest inventory
+	 * @return
+	 */
+	public boolean isInventoryUnder80(boolean includeQuestInv)
+	{
+		if (getInventory().getSize(false) <= (getInventoryLimit() * 0.8))
+		{
+			if (includeQuestInv)
+			{
+				if (getInventory().getSize(true) <= (getQuestInventoryLimit() * 0.8))
+					return true;
+			}
+			else
+				return true;
+		}
+		return false;
+	}
+	
+	public boolean havePetInvItems()
+	{
+		return _petItems;
+	}
+	
+	public void setPetInvItems(boolean haveit)
+	{
+		_petItems = haveit;
+	}
+	
+	private void checkPetInvItems()
+	{
+		Connection con = null;
+		
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement("SELECT object_id FROM `items` WHERE `owner_id`=? AND (`loc`='PET' OR `loc`='PET_EQUIP') LIMIT 1;");
+			statement.setInt(1, getObjectId());
+			ResultSet rset = statement.executeQuery();
+			if (rset.next() && rset.getInt("object_id") > 0)
+				setPetInvItems(true);
+			else
+				setPetInvItems(false);			 
+			rset.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "Could not check Items in Pet Inventory for playerId: "+getObjectId(), e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
 }

+ 0 - 28
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java

@@ -657,34 +657,6 @@ public class L2PetInstance extends L2Summon
 		return newItem;
 	}
 	
-	@Override
-	public void giveAllToOwner()
-	{
-		try
-		{
-			Inventory petInventory = getInventory();
-			for (L2ItemInstance giveit: petInventory.getItems())
-			{
-				if (((giveit.getItem().getWeight() * giveit.getCount())
-						+ getOwner().getInventory().getTotalWeight())
-						< getOwner().getMaxLoad())
-				{
-					// If the owner can carry it give it to them
-					giveItemToOwner(giveit);
-				}
-				else
-				{
-					// If they can't carry it, chuck it on the floor :)
-					dropItemHere(giveit);
-				}
-			}
-		}
-		catch(Exception e)
-		{
-			_logPet.log(Level.WARNING, "Give all items error: " + e.getMessage(), e);
-		}
-	}
-	
 	public void giveItemToOwner(L2ItemInstance item)
 	{
 		try

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/entity/Castle.java

@@ -847,7 +847,7 @@ public class Castle
 				_doorDefault.add(rs.getString("name") + ";" + rs.getInt("id") + ";" + rs.getInt("x") + ";" + rs.getInt("y") + ";"
 						+ rs.getInt("z") + ";" + rs.getInt("range_xmin") + ";" + rs.getInt("range_ymin") + ";" + rs.getInt("range_zmin")
 						+ ";" + rs.getInt("range_xmax") + ";" + rs.getInt("range_ymax") + ";" + rs.getInt("range_zmax") + ";"
-						+ rs.getInt("hp") + ";" + rs.getInt("pDef") + ";" + rs.getInt("mDef"));
+						+ rs.getInt("hp") + ";" + rs.getInt("pDef") + ";" + rs.getInt("mDef") + ";0");
 				
 				L2DoorInstance door = DoorTable.parseList(_doorDefault.get(_doorDefault.size() - 1), false);
 				door.setIsWall(rs.getBoolean("isWall"));

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/entity/Fort.java

@@ -775,7 +775,7 @@ public class Fort
 				_doorDefault.add(rs.getString("name") + ";" + rs.getInt("id") + ";" + rs.getInt("x") + ";" + rs.getInt("y") + ";"
 						+ rs.getInt("z") + ";" + rs.getInt("range_xmin") + ";" + rs.getInt("range_ymin") + ";" + rs.getInt("range_zmin")
 						+ ";" + rs.getInt("range_xmax") + ";" + rs.getInt("range_ymax") + ";" + rs.getInt("range_zmax") + ";"
-						+ rs.getInt("hp") + ";" + rs.getInt("pDef") + ";" + rs.getInt("mDef") + ";" + rs.getBoolean("openType") + ";"
+						+ rs.getInt("hp") + ";" + rs.getInt("pDef") + ";" + rs.getInt("mDef") + ";0;" + rs.getBoolean("openType") + ";"
 						+ rs.getBoolean("commanderDoor"));
 				L2DoorInstance door;
 				_doors.add(door = DoorTable.parseList(_doorDefault.get(_doorDefault.size() - 1), true));

+ 6 - 6
L2_GameServer/java/com/l2jserver/gameserver/model/entity/Hero.java

@@ -821,10 +821,10 @@ public class Hero
 				player.broadcastUserInfo();
 				
 				// Set Gained hero and reload data
-				setHeroGained(player.getCharId());
-				loadFights(player.getCharId());
-				loadDiary(player.getCharId());
-				_heroMessage.put(player.getCharId(), "");
+				setHeroGained(player.getObjectId());
+				loadFights(player.getObjectId());
+				loadDiary(player.getObjectId());
+				_heroMessage.put(player.getObjectId(), "");
 			}
 			else
 			{
@@ -1062,9 +1062,9 @@ public class Hero
 	 */
 	public void setHeroMessage(L2PcInstance player, String message)
 	{
-		_heroMessage.put(player.getCharId(), message);
+		_heroMessage.put(player.getObjectId(), message);
 		if (player.isDebug())
-			_log.info("Hero message for player: "+player.getName()+":["+player.getCharId()+"] set to: ["+message+"]");
+			_log.info("Hero message for player: "+player.getName()+":["+player.getObjectId()+"] set to: ["+message+"]");
 	}
 	
 	/**

+ 3 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/entity/Instance.java

@@ -258,7 +258,9 @@ public class Instance
 		newdoor.setOpen(open);
 		newdoor.getPosition().setXYZInvisible(temp.getX(), temp.getY(), temp.getZ());
 		newdoor.spawnMe(newdoor.getX(), newdoor.getY(), newdoor.getZ());
-		
+		newdoor.setEmitter(temp.getEmitter());
+		newdoor.setTargetable(temp.getTargetable());
+		newdoor.setMeshIndex(temp.getMeshIndex());
 		_doors.add(newdoor);
 	}
 	

+ 16 - 0
L2_GameServer/java/com/l2jserver/gameserver/model/entity/TvTEvent.java

@@ -28,6 +28,7 @@ import com.l2jserver.gameserver.datatables.ItemTable;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.datatables.SkillTable;
 import com.l2jserver.gameserver.datatables.SpawnTable;
+import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
 import com.l2jserver.gameserver.instancemanager.InstanceManager;
 import com.l2jserver.gameserver.model.L2Skill;
 import com.l2jserver.gameserver.model.L2Spawn;
@@ -92,6 +93,7 @@ public class TvTEvent
 	 */
 	public static void init()
 	{
+		AntiFeedManager.getInstance().registerEvent(AntiFeedManager.TVT_ID);
 		_teams[0] = new TvTEventTeam(Config.TVT_EVENT_TEAM_1_NAME, Config.TVT_EVENT_TEAM_1_COORDINATES);
 		_teams[1] = new TvTEventTeam(Config.TVT_EVENT_TEAM_2_NAME, Config.TVT_EVENT_TEAM_2_COORDINATES);
 	}
@@ -214,6 +216,7 @@ public class TvTEvent
 			_teams[1].cleanMe();
 			// Unspawn the event NPC
 			unSpawnNpc();
+			AntiFeedManager.getInstance().clear(AntiFeedManager.TVT_ID);
 			return false;
 		}
 		
@@ -398,6 +401,7 @@ public class TvTEvent
 		_teams[1].cleanMe();
 		// Set state INACTIVE
 		setState(EventState.INACTIVE);
+		AntiFeedManager.getInstance().clear(AntiFeedManager.TVT_ID);
 	}
 	
 	/**
@@ -646,6 +650,16 @@ public class TvTEvent
 					npcHtmlMessage.replace("%max%", String.valueOf(Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS));
 				}
 			}
+			else if (Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP > 0
+					&& !AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.TVT_ID, playerInstance, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP))
+			{
+				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath+"IPRestriction.htm");
+				if (htmContent != null)
+				{
+					npcHtmlMessage.setHtml(htmContent);
+					npcHtmlMessage.replace("%max%", String.valueOf(AntiFeedManager.getInstance().getLimit(playerInstance, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP)));
+				}
+			}
 			else if (!payParticipationFee(playerInstance))
 			{
 				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath+"ParticipationFee.htm");
@@ -665,6 +679,8 @@ public class TvTEvent
 		else if (command.equals("tvt_event_remove_participation"))
 		{
 			removeParticipant(playerInstance.getObjectId());
+			if (Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP > 0)
+				AntiFeedManager.getInstance().removePlayer(AntiFeedManager.TVT_ID, playerInstance);
 			
 			NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);
 			

+ 15 - 0
L2_GameServer/java/com/l2jserver/gameserver/model/olympiad/Olympiad.java

@@ -43,6 +43,7 @@ import com.l2jserver.Config;
 import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.Announcements;
 import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
 import com.l2jserver.gameserver.instancemanager.ZoneManager;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Hero;
@@ -165,6 +166,7 @@ public class Olympiad
 	private Olympiad()
 	{
 		load();
+		AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
 		
 		if (_period == 0)
 			init();
@@ -513,6 +515,15 @@ public class Olympiad
 			noble.sendMessage("You can't join olympiad while participating on TvT Event.");
 			return false;
 		}
+		if (Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP > 0
+				&& !AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.OLYMPIAD_ID, noble, Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP))
+		{
+			NpcHtmlMessage message = new NpcHtmlMessage(0);
+			message.setFile(noble.getHtmlPrefix(), "data/html/mods/OlympiadIPRestriction.htm");
+			message.replace("%max%", String.valueOf(AntiFeedManager.getInstance().getLimit(noble, Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP)));
+			noble.sendPacket(message);
+			return false;
+		}
 		/** End Olympiad Restrictions */
 		
 		if (_classBasedRegisters.containsKey(noble.getClassId().getId()))
@@ -648,6 +659,7 @@ public class Olympiad
 	{
 		_nonClassBasedRegisters.clear();
 		_classBasedRegisters.clear();
+		AntiFeedManager.getInstance().clear(AntiFeedManager.OLYMPIAD_ID);
 	}
 	
 	public boolean isRegistered(L2PcInstance noble)
@@ -721,6 +733,9 @@ public class Olympiad
 			_classBasedRegisters.put(noble.getClassId().getId(), classed);
 		}
 		
+		if (Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP > 0)
+			AntiFeedManager.getInstance().removePlayer(AntiFeedManager.OLYMPIAD_ID, noble);
+		
 		sm = new SystemMessage(SystemMessageId.YOU_HAVE_BEEN_DELETED_FROM_THE_WAITING_LIST_OF_A_GAME);
 		noble.sendPacket(sm);
 		

+ 4 - 0
L2_GameServer/java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java

@@ -26,6 +26,7 @@ import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.datatables.HeroSkillTable;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.datatables.SpawnTable;
+import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.FortManager;
 import com.l2jserver.gameserver.model.L2ItemInstance;
@@ -450,6 +451,9 @@ class OlympiadGame
 						player.addSkill(skill, false);
 				}
 				player.sendSkillList();
+
+				if (Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP > 0)
+					AntiFeedManager.getInstance().removePlayer(AntiFeedManager.OLYMPIAD_ID, player);
 			}
 			catch (Exception e)
 			{

+ 2 - 2
L2_GameServer/java/com/l2jserver/gameserver/model/quest/Quest.java

@@ -1624,9 +1624,9 @@ public class Quest extends ManagedScript
 		
 		if (content == null)
 		{
-			content = HtmCache.getInstance().getHtm(prefix, "data/scripts/quests/" + getName() + "/" + fileName);
+			content = HtmCache.getInstance().getHtm(prefix, "data/scripts/quests/Q" + getName() + "/" + fileName);
 			if (content == null)
-				content = HtmCache.getInstance().getHtmForce(prefix, "data/scripts/quests/Q" + getName() + "/" + fileName);
+				content = HtmCache.getInstance().getHtmForce(prefix, "data/scripts/quests/" + getName() + "/" + fileName);				
 		}
 		
 		return content;

+ 41 - 17
L2_GameServer/java/com/l2jserver/gameserver/network/L2GameClient.java

@@ -15,11 +15,11 @@
 package com.l2jserver.gameserver.network;
 
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
-import java.util.List;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.Future;
 import java.util.concurrent.RejectedExecutionException;
@@ -29,8 +29,6 @@ import java.util.logging.Level;
 import java.util.logging.LogRecord;
 import java.util.logging.Logger;
 
-import javolution.util.FastList;
-
 import org.mmocore.network.MMOClient;
 import org.mmocore.network.MMOConnection;
 import org.mmocore.network.ReceivablePacket;
@@ -42,6 +40,7 @@ import com.l2jserver.gameserver.LoginServerThread.SessionKey;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.datatables.CharNameTable;
 import com.l2jserver.gameserver.datatables.ClanTable;
+import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
 import com.l2jserver.gameserver.model.CharSelectInfoPackage;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2World;
@@ -73,8 +72,9 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 	public static enum GameClientState { CONNECTED, AUTHED, IN_GAME }
 	
 	private GameClientState _state;
-	
+
 	// Info
+	private final InetAddress _addr;
 	private String _accountName;
 	private SessionKey _sessionId;
 	private L2PcInstance _activeChar;
@@ -82,7 +82,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 	
 	private boolean _isAuthedGG;
 	private long _connectionStartTime;
-	private List<Integer> _charSlotMapping = new FastList<Integer>();
+	private CharSelectInfoPackage[] _charSlotMapping = null;
 	
 	// floodprotectors
 	private final FloodProtectors _floodProtectors = new FloodProtectors(this);
@@ -127,6 +127,15 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 		{
 			_autoSaveInDB = null;
 		}
+
+		try
+		{
+			_addr = con != null ? con.getInetAddress() : InetAddress.getLocalHost();
+		}
+		catch (UnknownHostException e)
+		{
+			throw new Error("Unable to determine localhost address.");
+		}
 	}
 	
 	public byte[] enableCrypt()
@@ -154,7 +163,16 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 	{
 		return _stats;
 	}
-	
+
+	/**
+	 * Returns cached connection IP address, for checking detached clients.
+	 * For loaded offline traders returns localhost address.
+	 */
+	public InetAddress getConnectionAddress()
+	{
+		return _addr;
+	}
+
 	public long getConnectionStartTime()
 	{
 		return _connectionStartTime;
@@ -525,6 +543,9 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 	public L2PcInstance loadCharFromDisk(int charslot)
 	{
 		final int objId = getObjectIdForSlot(charslot);
+		if (objId < 0)
+			return null;
+
 		L2PcInstance character = L2World.getInstance().getPlayer(objId);
 		if (character != null)
 		{
@@ -565,15 +586,16 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 	 */
 	public void setCharSelection(CharSelectInfoPackage[] chars)
 	{
-		_charSlotMapping.clear();
-		
-		for (int i = 0; i < chars.length; i++)
-		{
-			int objectId = chars[i].getObjectId();
-			_charSlotMapping.add(Integer.valueOf(objectId));
-		}
+		_charSlotMapping = chars;
 	}
 	
+	public CharSelectInfoPackage getCharSelection(int charslot)
+	{
+		if (_charSlotMapping == null || charslot < 0 || charslot >= _charSlotMapping.length)
+			return null;
+		return _charSlotMapping[charslot];
+	}
+
 	public void close(L2GameServerPacket gsp)
 	{
 		if (getConnection() == null)
@@ -590,20 +612,20 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 			return; // ofline shop
 		getConnection().close(gspArray);
 	}
-	
+
 	/**
 	 * @param charslot
 	 * @return
 	 */
 	private int getObjectIdForSlot(int charslot)
 	{
-		if (charslot < 0 || charslot >= _charSlotMapping.size())
+		final CharSelectInfoPackage info = getCharSelection(charslot);
+		if (info == null)
 		{
 			_log.warning(toString()+" tried to delete Character in slot "+charslot+" but no characters exits at that slot.");
 			return -1;
 		}
-		Integer objectId = _charSlotMapping.get(charslot);
-		return objectId.intValue();
+		return info.getObjectId();
 	}
 	
 	@Override
@@ -770,12 +792,14 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 								player.eventSitForced);
 						L2Event.connectionLossData.put(player.getName(), data);
 					}
+
 					// prevent closing again
 					player.setClient(null);
 					
 					if (player.isOnline())
 					{
 						player.deleteMe();
+						AntiFeedManager.getInstance().onDisconnect(L2GameClient.this);
 					}
 				}
 				L2GameClient.this.setActiveChar(null);

+ 0 - 297
L2_GameServer/java/com/l2jserver/gameserver/network/SystemMessageId.java

@@ -248,24 +248,6 @@ public enum SystemMessageId
 	 */
 	C1_GAVE_YOU_S2_DMG2(37),
 	
-	/**
-	 * ID: 38<br>
-	 * Message: The TGS2002 event begins!
-	 */
-	TGS2002_BEGINS(38),
-	
-	/**
-	 * ID: 39<br>
-	 * Message: The TGS2002 event is over. Thank you very much.
-	 */
-	TGS2002_ENDS(39),
-	
-	/**
-	 * ID: 40<br>
-	 * Message: This is the TGS demo: the character will immediately be restored.
-	 */
-	TGS_DEMO(40),
-	
 	/**
 	 * ID: 41<br>
 	 * Message: You carefully nock an arrow.
@@ -1269,30 +1251,6 @@ public enum SystemMessageId
 	 */
 	S2_OF_THE_CLAN_S1_REQUESTS_WAR(207),
 	
-	/**
-	 * ID: 208<br>
-	 * Message: Please include file type when entering file path.
-	 */
-	INCLUDE_FILE_TYPE_WHEN_ENTERING_FILE_PATH(208),
-	
-	/**
-	 * ID: 209<br>
-	 * Message: The size of the image file is inappropriate. Please adjust to 16*12
-	 */
-	IMAGE_SIZE_INAPPROPRIATE(209),
-	
-	/**
-	 * ID: 210<br>
-	 * Message: Cannot find file. Please enter precise path.
-	 */
-	CANNOT_FIND_FILE_ENTER_PRECISE_PATH(210),
-	
-	/**
-	 * ID: 211<br>
-	 * Message: You may only register a 16 x 12 pixel, 256-color BMP.
-	 */
-	YOU_MAY_ONLY_REGISTER_A_16_BY_12_PIXEL_256_COLOR_BMP(211),
-	
 	/**
 	 * ID: 212<br>
 	 * Message: You are not a clan member and cannot perform this action.
@@ -2469,12 +2427,6 @@ public enum SystemMessageId
 	 */
 	S1_DISARMED(417),
 	
-	/**
-	 * ID: 418<br>
-	 * Message: There is a significant difference between the item's price and its standard price. Please check again.
-	 */
-	PRICE_DIFFERECE(418),
-	
 	/**
 	 * ID: 419<br>
 	 * Message: $s1 minute(s) of usage time left.
@@ -2517,133 +2469,12 @@ public enum SystemMessageId
 	 */
 	CREATE_LVL_TOO_LOW_TO_REGISTER2(425),
 	
-	/**
-	 * ID: 426<br>
-	 * Message: Your account has been reported for intentionally not paying the cyber cafe fees.
-	 */
-	ACCOUNT_REPORTED_NOT_PAYING(426),
-	
-	/**
-	 * ID: 427<br>
-	 * Message: Please contact us.
-	 */
-	PLEASE_CONTACT_US(427),
-	
-	/**
-	 * ID: 428<br>
-	 * Message: In accordance with company policy, your account has been suspended due to  ...
-	 */
-	ILLEGAL_USE1(428),
-	
-	/**
-	 * ID: 429<br>
-	 * Message: In accordance with company policy, your account has been suspended due to  ...
-	 */
-	ILLEGAL_USE2(429),
-	
-	/**
-	 * ID: 430<br>
-	 * Message: (Doesn't need to translate.)
-	 */
-	NO_NEED_TO_TRANSLATE(430),
-	
-	/**
-	 * ID: 431<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE3(431),
-	
-	/**
-	 * ID: 432<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE4(432),
-	
-	/**
-	 * ID: 433<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE5(433),
-	
-	/**
-	 * ID: 434<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE6(434),
-	
-	/**
-	 * ID: 435<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE7(435),
-	
-	/**
-	 * ID: 436<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE8(436),
-	
-	/**
-	 * ID: 437<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE9(437),
-	
-	/**
-	 * ID: 438<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE10(438),
-	
-	/**
-	 * ID: 439<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE11(439),
-	
-	/**
-	 * ID: 440<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE12(440),
-	
-	/**
-	 * ID: 441<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE13(441),
-	
-	/**
-	 * ID: 442<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE14(442),
-	
-	/**
-	 * ID: 443<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE15(443),
-	
-	/**
-	 * ID: 444<br>
-	 * Message: Your account has been suspended ...
-	 */
-	ILLEGAL_USE16(444),
-	
 	/**
 	 * ID: 445<br>
 	 * Message: (Reference Number Regarding Membership Withdrawal Request: $s1)
 	 */
 	REFERENCE_MEMBERSHIP_WITHDRAWAL_S1(445),
 	
-	/**
-	 * ID: 446<br>
-	 * Message: For more information, please visit the Support Center on the PlayNC website
-	 * (http://www.plaync.com/us/support/).
-	 */
-	NCSOFT_SUPPOR(446),
-	
 	/**
 	 * ID: 447<br>
 	 * Message: .
@@ -2686,12 +2517,6 @@ public enum SystemMessageId
 	 */
 	ACCOUNT_INFORMATION_INCORRECT(453),
 	
-	/**
-	 * ID: 454<br>
-	 * Message: For more details, please contact our customer service center at http://support.plaync.com.
-	 */
-	DETAILS_NCSUPPORT(454),
-	
 	/**
 	 * ID: 455<br>
 	 * Message: Account is already in use. Unable to log in.
@@ -2716,12 +2541,6 @@ public enum SystemMessageId
 	 */
 	USAGE_TERM_EXPIRED(458),
 	
-	/**
-	 * ID: 459<br>
-	 * Message: PlayNC website (http://www.plaync.com/us/support/)
-	 */
-	PLAYNC_WEBSITE(459),
-	
 	/**
 	 * ID: 460<br>
 	 * Message: to reactivate your account.
@@ -2740,12 +2559,6 @@ public enum SystemMessageId
 	 */
 	PLEASE_TRY_AGAIN_LATER(462),
 	
-	/**
-	 * ID: 463<br>
-	 * Message: .
-	 */
-	DOT2(463),
-	
 	/**
 	 * ID: 464<br>
 	 * Message: This feature is only available alliance leaders.
@@ -3054,12 +2867,6 @@ public enum SystemMessageId
 	 */
 	DO_YOU_WISH_TO_DISOLVE(514),
 	
-	/**
-	 * ID: 515<br>
-	 * Messages: Enter a file name for the alliance crest.
-	 */
-	ENTER_FILE_NAME_CREST(515),
-	
 	/**
 	 * ID: 516<br>
 	 * Message: $s1 has invited you to be their friend.
@@ -3132,18 +2939,6 @@ public enum SystemMessageId
 	 */
 	S2_ALLIANCE_LEADER_OF_S1_REQUESTED_ALLIANCE(527),
 	
-	/**
-	 * ID: 528<br>
-	 * Message: Unable to find file at target location.
-	 */
-	FILE_NOT_FOUND(528),
-	
-	/**
-	 * ID: 529<br>
-	 * Message: You may only register an 8 x 12 pixel, 256-color BMP.
-	 */
-	YOU_MAY_ONLY_REGISTER_AN_8_BY_12_PIXEL_256_COLOR_BMP(529),
-	
 	/**
 	 * ID: 530<br>
 	 * Message: The Spiritshot does not match the weapon's grade.
@@ -3174,12 +2969,6 @@ public enum SystemMessageId
 	 */
 	DISABLED_SPIRITSHOT(534),
 	
-	/**
-	 * ID: 535<br>
-	 * Message: Enter a name for your pet.
-	 */
-	NAMING_NAME_PET(535),
-	
 	/**
 	 * ID: 536<br>
 	 * Message: How much adena do you wish to transfer to your Inventory?
@@ -3378,24 +3167,6 @@ public enum SystemMessageId
 	 */
 	CUBIC_SUMMONING_FAILED(568),
 	
-	/**
-	 * ID: 569<br>
-	 * Message: Caution -- this item's price greatly differs from non-player run shops. Do you wish to continue?
-	 */
-	GREATLY_DIFF_ITEM_PRICE(569),
-	
-	/**
-	 * ID: 570<br>
-	 * Message: How many $s1(s) do you want to purchase?
-	 */
-	HOW_MANY_S1_S_PURCHASE1(570),
-	
-	/**
-	 * ID: 571<br>
-	 * Message: How many $s1(s) do you want to purchase?
-	 */
-	HOW_MANY_S1_S_PURCHASE2(571),
-	
 	/**
 	 * ID: 572<br>
 	 * Message: Do you accept $c1's party invitation? (Item Distribution: Finders Keepers.)
@@ -3486,12 +3257,6 @@ public enum SystemMessageId
 	 */
 	PET_NO_SHORTCUT(586),
 	
-	/**
-	 * ID: 587<br>
-	 * Message: Irregular system speed.
-	 */
-	IRREGULAR_SYSTEM_SPEED(587),
-	
 	/**
 	 * ID: 588<br>
 	 * Message: Your pet's inventory is full.
@@ -4113,12 +3878,6 @@ public enum SystemMessageId
 	 */
 	NAMING_YOU_CANNOT_SET_NAME_OF_THE_PET(695),
 	
-	/**
-	 * ID: 696<br>
-	 * Message: Your account is restricted for not paying your PC room usage fees.
-	 */
-	ACCOUNT_RESTRICTED_NOT_PAYING(696),
-	
 	/**
 	 * ID: 697<br>
 	 * Message: The item enchant value is strange
@@ -4428,13 +4187,6 @@ public enum SystemMessageId
 	 */
 	CURRENTLY_NO_PETITION(746),
 	
-	/**
-	 * ID: 747<br>
-	 * Message: If you need help, please visit the Support Center on the PlayNC website
-	 * (http://www.plaync.com/us/support/).
-	 */
-	PLAYNC_SUPPORT_CENTER(747),
-	
 	/**
 	 * ID: 748<br>
 	 * Message: The distance is too far and so the casting has been stopped.
@@ -4538,61 +4290,12 @@ public enum SystemMessageId
 	 */
 	PLAYING_FOR_LONG_TIME(764),
 	
-	/**
-	 * ID: 765<br>
-	 * Message: GameGuard is already running. Please try running it again after rebooting.
-	 */
-	GG_ALREADY_RUNNING(765),
-	
-	/**
-	 * ID: 766<br>
-	 * Message: There is a GameGuard initialization error. Please try running it again after rebooting.
-	 */
-	GG_INITIALIZATION_ERROR(766),
-	
-	/**
-	 * ID: 767<br>
-	 * Message: The GameGuard file is damaged. Please reinstall GameGuard.
-	 */
-	GG_DAMAGED(767),
-	
-	/**
-	 * ID: 768<br>
-	 * Message: A Windows system file is damaged. Please reinstall Internet Explorer.
-	 */
-	WINDOWS_FILE_DAMAGED(768),
-	
 	/**
 	 * ID: 769<br>
 	 * Message: A hacking tool has been discovered. Please try again after closing unnecessary programs.
 	 */
 	HACKING_TOOL(769),
 	
-	/**
-	 * ID: 770<br>
-	 * Message: The GameGuard update was canceled. Please check your network connection status or firewall.
-	 */
-	GG_UPDATE_CANCELED1(770),
-	
-	/**
-	 * ID: 771<br>
-	 * Message: The GameGuard update was canceled. Please try running it again after
-	 * doing a virus scan or changing the settings in your PC management program.
-	 */
-	GG_UPDATE_CANCELED2(771),
-	
-	/**
-	 * ID: 772<br>
-	 * Message: There was a problem when running GameGuard.
-	 */
-	GG_PROBLEM(772),
-	
-	/**
-	 * ID: 773<br>
-	 * Message: The game or GameGuard files are damaged.
-	 */
-	GG_FILES_DAMAGED(773),
-	
 	/**
 	 * ID: 774<br>
 	 * Message: Play time is no longer accumulating.

+ 3 - 3
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/AbstractEnchantPacket.java

@@ -310,9 +310,6 @@ public abstract class AbstractEnchantPacket extends L2GameClientPacket
 		// rods
 		if (item.getItem().getItemType() == L2WeaponType.ROD)
 			return false;
-		// apprentice and travelers weapons
-		if (item.getItemId() >= 7816 && item.getItemId() <= 7831)
-			return false;
 		// bracelets
 		if (item.getItem().getBodyPart() == L2Item.SLOT_L_BRACELET)
 			return false;
@@ -320,6 +317,9 @@ public abstract class AbstractEnchantPacket extends L2GameClientPacket
 			return false;
 		if (item.getItem().getBodyPart() == L2Item.SLOT_BACK)
 			return false;
+		// blacklist check
+		if (Arrays.binarySearch(Config.ENCHANT_BLACKLIST, item.getItemId()) >= 0)
+			return false;		
 		// only items in inventory and equipped can be enchanted
 		if (item.getLocation() != L2ItemInstance.ItemLocation.INVENTORY
 				&& item.getLocation() != L2ItemInstance.ItemLocation.PAPERDOLL)

+ 17 - 0
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/CharacterSelect.java

@@ -21,9 +21,12 @@ import java.util.logging.Logger;
 
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.datatables.CharNameTable;
+import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
+import com.l2jserver.gameserver.model.CharSelectInfoPackage;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.L2GameClient.GameClientState;
 import com.l2jserver.gameserver.network.serverpackets.CharSelected;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
 import com.l2jserver.gameserver.network.serverpackets.SSQInfo;
 
 
@@ -76,6 +79,20 @@ public class CharacterSelect extends L2GameClientPacket
 				// but if not then this is repeated packet and nothing should be done here
 				if (this.getClient().getActiveChar() == null)
 				{
+					if (Config.L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP > 0
+							&& !AntiFeedManager.getInstance().tryAddClient(AntiFeedManager.GAME_ID, getClient(), Config.L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP))
+					{
+						final CharSelectInfoPackage info = getClient().getCharSelection(_charSlot);
+						if (info == null)
+							return;
+
+						final NpcHtmlMessage msg = new NpcHtmlMessage(0);
+						msg.setFile(info.getHtmlPrefix(), "data/html/mods/IPRestriction.htm");
+						msg.replace("%max%", String.valueOf(AntiFeedManager.getInstance().getLimit(getClient(), Config.L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP)));
+						getClient().sendPacket(msg);
+						return;
+					}
+
 					// The L2PcInstance must be created here, so that it can be attached to the L2GameClient
 					if (Config.DEBUG)
 					{

+ 11 - 5
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestActionUse.java

@@ -43,6 +43,7 @@ import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
 import com.l2jserver.gameserver.network.serverpackets.ChairSit;
 import com.l2jserver.gameserver.network.serverpackets.ExAskCoupleAction;
+import com.l2jserver.gameserver.network.serverpackets.ExBasicActionList;
 import com.l2jserver.gameserver.network.serverpackets.RecipeShopManageList;
 import com.l2jserver.gameserver.network.serverpackets.SocialAction;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
@@ -98,10 +99,11 @@ public final class RequestActionUse extends L2GameClientPacket
 		// don't allow to do some action if player is transformed
 		if (activeChar.isTransformed())
 		{
-			int[] notAllowedActions = {0, 10, 28, 37, 51, 61};
-			if (Arrays.binarySearch(notAllowedActions,_actionId) >= 0)
+			int[] allowedActions = activeChar.isTransformed() ? ExBasicActionList._actionsOnTransform : ExBasicActionList._defaultActionList;
+			if (!(Arrays.binarySearch(allowedActions, _actionId) >= 0))
 			{
 				getClient().sendPacket(ActionFailed.STATIC_PACKET);
+				_log.info("Player "+activeChar+" used action which he does not have! id = "+ _actionId + " transform: "+activeChar.getTransformation());
 				return;
 			}
 		}
@@ -631,11 +633,15 @@ public final class RequestActionUse extends L2GameClientPacket
 				break;
 			case 1089: // TODO Deinonychus - Tail Strike
 				break;
-			case 1090: // TODO Guardian's Strider - Strider Bite
+			case 1090: // Guardian's Strider - Strider Bite
+				if(activeChar.isRidingStrider())
+					useSkill(6205);
 				break;
-			case 1091: // TODO Guardian's Strider - Strider Fear
+			case 1091: // Guardian's Strider - Strider Fear
+				useSkill(6206);
 				break;
-			case 1092: // TODO Guardian's Strider - Strider Dash
+			case 1092: // Guardian's Strider - Strider Dash
+				useSkill(6207);
 				break;
 			case 5000: // TODO Baby Rudolph - Reindeer Scratch
 				break;

+ 2 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java

@@ -72,7 +72,8 @@ public final class RequestDropItem extends L2GameClientPacket
 				|| _count == 0
 				|| !activeChar.validateItemManipulation(_objectId, "drop")
 				|| (!Config.ALLOW_DISCARDITEM && !activeChar.isGM())
-				|| (!item.isDropable() && !(activeChar.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS)))
+				|| (!item.isDropable() && !(activeChar.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS))
+				|| (item.getItemType() == L2EtcItemType.PET_COLLAR && activeChar.havePetInvItems()))
 		{
 			activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM));
 			return;

+ 7 - 6
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestExChangeName.java

@@ -24,8 +24,9 @@ import com.l2jserver.gameserver.network.serverpackets.ExNeedToChangeName;
  */
 public class RequestExChangeName extends L2GameClientPacket
 {
-	private String newName;
-	private int type;
+	private String _newName;
+	private int _type;
+	private int _charSlot;
 	
 	/* (non-Javadoc)
 	 * @see com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket#readImpl()
@@ -33,9 +34,9 @@ public class RequestExChangeName extends L2GameClientPacket
 	@Override
 	protected void readImpl()
 	{
-		type = readD();
-		newName = readS();
-		//readD(); //unk
+		_type = readD();
+		_newName = readS();
+		_charSlot = readD();
 	}
 	
 	/* (non-Javadoc)
@@ -44,7 +45,7 @@ public class RequestExChangeName extends L2GameClientPacket
 	@Override
 	protected void runImpl()
 	{
-		_log.info("Recieved "+getType()+" name: "+newName+" type: "+type);
+		_log.info("Recieved " + getType() + " name: " + _newName + " type: " + _type + " CharSlot: " + _charSlot);
 		
 	}
 	

+ 3 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java

@@ -20,6 +20,7 @@ import java.util.logging.Logger;
 
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.SevenSignsFestival;
+import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
 import com.l2jserver.gameserver.model.L2Party;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.L2GameClient;
@@ -123,7 +124,8 @@ public final class RequestRestart extends L2GameClientPacket
 		
 		player.deleteMe();
 		
-		getClient().setActiveChar(null);
+		client.setActiveChar(null);
+		AntiFeedManager.getInstance().onDisconnect(client);
 		
 		// return the client to the authed status
 		client.setState(GameClientState.AUTHED);

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestWithDrawPremiumItem.java

@@ -51,7 +51,7 @@ public final class RequestWithDrawPremiumItem extends L2GameClientPacket
 		if (_itemcount <= 0)
 			return;
 		
-		if (activeChar.getCharId() != _charId)
+		if (activeChar.getObjectId() != _charId)
 		{
 			Util.handleIllegalPlayerAction(activeChar, "[RequestWithDrawPremiumItem] Incorrect owner, Player: " + activeChar.getName(), Config.DEFAULT_PUNISH);
 			return;

+ 0 - 209
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java

@@ -16,19 +16,15 @@ package com.l2jserver.gameserver.network.serverpackets;
 
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.datatables.ClanTable;
-import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
 import com.l2jserver.gameserver.instancemanager.TownManager;
 import com.l2jserver.gameserver.model.L2Clan;
-import com.l2jserver.gameserver.model.L2Transformation;
 import com.l2jserver.gameserver.model.actor.L2Character;
-import com.l2jserver.gameserver.model.actor.L2Decoy;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.L2Summon;
 import com.l2jserver.gameserver.model.actor.L2Trap;
 import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2NpcInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 import com.l2jserver.gameserver.skills.AbnormalEffect;
 
 /**
@@ -288,211 +284,6 @@ public abstract class AbstractNpcInfo extends L2GameServerPacket
 		}
 	}
 	
-	/**
-	 * Packet for Decoys
-	 */
-	public static class DecoyInfo extends AbstractNpcInfo
-	{
-		private L2Decoy _decoy;
-		
-		public DecoyInfo(L2Decoy cha)
-		{
-			super(cha);
-			
-			_idTemplate = cha.getTemplate().idTemplate;
-			_decoy = cha;
-			
-			_heading = cha.getOwner().getHeading();
-			// _mAtkSpd = cha.getMAtkSpd(); on abstract constructor
-			_pAtkSpd = cha.getOwner().getPAtkSpd();
-			_runSpd = cha.getOwner().getRunSpeed();
-			_walkSpd = cha.getOwner().getWalkSpeed();
-			
-			assert _idTemplate >= 13071 && _idTemplate <= 13076;
-			
-			if (_idTemplate < 13071 || _idTemplate > 13076)
-			{
-				throw new IllegalArgumentException("Using DecoyInfo packet with an unsupported decoy template: " + _idTemplate);
-			}
-			
-		}
-		
-		@Override
-		protected void writeImpl()
-		{
-			writeC(0x31);
-			writeD(_x);
-			writeD(_y);
-			writeD(_z);
-			writeD(_heading);
-			writeD(_decoy.getObjectId());
-			writeS(_decoy.getOwner().getAppearance().getVisibleName());
-			writeD(_decoy.getOwner().getRace().ordinal());
-			writeD(_decoy.getOwner().getAppearance().getSex() ? 1 : 0);
-			
-			writeD(_decoy.getOwner().getClassIndex() == 0 ? _decoy.getOwner().getClassId().getId() : _decoy.getOwner().getBaseClass());
-			
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_UNDER));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LRHAND));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR2));
-			
-			// T1 new d's
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RBRACELET));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LBRACELET));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO1));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO2));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO3));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO4));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO5));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO6));
-			writeD(_decoy.getOwner().getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BELT));
-			// end of t1 new d's
-			
-			// c6 new h's
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_UNDER));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_HEAD));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LHAND));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_GLOVES));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_CHEST));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LEGS));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_FEET));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_BACK));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LRHAND));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_HAIR));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_HAIR2));
-			
-			// T1 new h's
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RBRACELET));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LBRACELET));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO1));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO2));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO3));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO4));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO5));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO6));
-			writeD(_decoy.getOwner().getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_BELT));
-			// end of t1 new h's
-			
-			writeD(0x00);
-			writeD(0x01);
-			
-			writeD(_decoy.getOwner().getPvpFlag());
-			writeD(_decoy.getOwner().getKarma());
-			
-			writeD(_mAtkSpd);
-			writeD(_pAtkSpd);
-			
-			writeD(0x00);
-			
-			writeD(_runSpd);
-			writeD(_walkSpd);
-			writeD(50); // swim run speed
-			writeD(50); // swim walk speed
-			writeD(_runSpd); // fly run speed
-			writeD(_walkSpd); // fly walk speed
-			writeD(_runSpd); // fly run speed
-			writeD(_walkSpd); // fly walk speed
-			writeF(_decoy.getOwner().getMovementSpeedMultiplier()); // _activeChar.getProperMultiplier()
-			writeF(_decoy.getOwner().getAttackSpeedMultiplier()); // _activeChar.getAttackSpeedMultiplier()
-			L2Summon pet = _decoy.getPet();
-			L2Transformation trans;
-			if (_decoy.getOwner().getMountType() != 0 && pet != null)
-			{
-				writeF(pet.getTemplate().fCollisionRadius);
-				writeF(pet.getTemplate().fCollisionHeight);
-			}
-			else if ((trans = _decoy.getOwner().getTransformation()) != null)
-			{
-				writeF(trans.getCollisionRadius());
-				writeF(trans.getCollisionHeight());
-			}
-			else
-			{
-				writeF(_decoy.getOwner().getBaseTemplate().fCollisionRadius);
-				writeF(_decoy.getOwner().getBaseTemplate().fCollisionHeight);
-			}
-			
-			writeD(_decoy.getOwner().getAppearance().getHairStyle());
-			writeD(_decoy.getOwner().getAppearance().getHairColor());
-			writeD(_decoy.getOwner().getAppearance().getFace());
-			
-			writeS(_decoy.getOwner().getAppearance().getVisibleTitle());
-			
-			writeD(_decoy.getOwner().getClanId());
-			writeD(_decoy.getOwner().getClanCrestId());
-			writeD(_decoy.getOwner().getAllyId());
-			writeD(_decoy.getOwner().getAllyCrestId());
-			
-			writeC(_decoy.getOwner().isSitting() ? 0 : 1); // standing = 1  sitting = 0
-			writeC(_decoy.getOwner().isRunning() ? 1 : 0); // running = 1   walking = 0
-			writeC(_decoy.getOwner().isInCombat() ? 1 : 0);
-			writeC(_decoy.getOwner().isAlikeDead() ? 1 : 0);
-			
-			writeC(_decoy.getOwner().getAppearance().getInvisible() ? 1 : 0); // invisible = 1  visible =0
-			
-			writeC(_decoy.getOwner().getMountType()); // 1 on strider   2 on wyvern  3 on Great Wolf  0 no mount
-			writeC(_decoy.getOwner().getPrivateStoreType()); //  1 - sellshop
-			
-			writeH(_decoy.getOwner().getCubics().size());
-			for (int id : _decoy.getOwner().getCubics().keySet())
-				writeH(id);
-			
-			writeC(0x00); // find party members
-			
-			writeD(_decoy.getOwner().getAbnormalEffect());
-			writeC(_decoy.getOwner().isFlyingMounted() ? 2 : 0);
-			writeH(_decoy.getOwner().getRecomHave());
-			writeD(_decoy.getOwner().getMountNpcId() + 1000000);
-			writeD(_decoy.getOwner().getClassId().getId());
-			writeD(0x00);
-			writeC(_decoy.getOwner().isMounted() ? 0 : _decoy.getOwner().getEnchantEffect());
-			
-			if (_decoy.getOwner().getTeam() == 1)
-				writeC(0x01); //team circle around feet 1= Blue, 2 = red
-			else if (_decoy.getOwner().getTeam() == 2)
-				writeC(0x02); //team circle around feet 1= Blue, 2 = red
-			else
-				writeC(0x00); //team circle around feet 1= Blue, 2 = red
-			
-			writeD(_decoy.getOwner().getClanCrestLargeId());
-			writeC(_decoy.getOwner().isNoble() ? 1 : 0); // Symbol on char menu ctrl+I
-			writeC(_decoy.getOwner().isHero() ? 1 : 0); // Hero Aura
-			
-			writeC(_decoy.getOwner().isFishing() ? 1 : 0); //0x01: Fishing Mode (Cant be undone by setting back to 0)
-			writeD(_decoy.getOwner().getFishx());
-			writeD(_decoy.getOwner().getFishy());
-			writeD(_decoy.getOwner().getFishz());
-			
-			writeD(_decoy.getOwner().getAppearance().getNameColor());
-			
-			writeD(_heading);
-			
-			writeD(_decoy.getOwner().getPledgeClass());
-			writeD(_decoy.getOwner().getPledgeType());
-			
-			writeD(_decoy.getOwner().getAppearance().getTitleColor());
-			
-			writeD(_decoy.getOwner().isCursedWeaponEquipped() ? CursedWeaponsManager.getInstance().getLevel(_decoy.getOwner().getCursedWeaponEquippedId()) : 0x00);
-			// T1
-			writeD(0x00);
-			
-			writeD(_decoy.getOwner().getTransformationId());
-			writeD(_decoy.getOwner().getAgathionId());
-			writeD(0x01);
-			writeD(_decoy.getOwner().getSpecialEffect());
-		}
-	}
-	
 	/**
 	 * Packet for summons
 	 */

+ 17 - 5
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/CharInfo.java

@@ -19,6 +19,7 @@ import java.util.logging.Logger;
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
+import com.l2jserver.gameserver.model.actor.L2Decoy;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 import com.l2jserver.gameserver.skills.AbnormalEffect;
@@ -55,6 +56,7 @@ public class CharInfo extends L2GameServerPacket
 	private static final String _S__03_CHARINFO = "[S] 31 CharInfo";
 	private L2PcInstance _activeChar;
 	private Inventory _inv;
+	private int _objId;
 	private int _x, _y, _z, _heading;
 	private int _mAtkSpd, _pAtkSpd;
 	
@@ -78,6 +80,7 @@ public class CharInfo extends L2GameServerPacket
 	public CharInfo(L2PcInstance cha)
 	{
 		_activeChar = cha;
+		_objId = cha.getObjectId();
 		_inv = cha.getInventory();
 		if (_activeChar.getVehicle() != null && _activeChar.getInVehiclePosition() != null)
 		{
@@ -110,6 +113,18 @@ public class CharInfo extends L2GameServerPacket
 		//_isDisguised = TerritoryWarManager.getInstance().isDisguised(cha.getObjectId());
 	}
 	
+	public CharInfo(L2Decoy decoy)
+	{
+		this(decoy.getActingPlayer()); // init
+		_vehicleId = 0;
+		_airShipHelm = 0;
+		_objId = decoy.getObjectId();
+		_x = decoy.getX();
+		_y = decoy.getY();
+		_z = decoy.getZ();
+		_heading = decoy.getHeading();
+	}
+	
 	@Override
 	protected final void writeImpl()
 	{
@@ -129,7 +144,7 @@ public class CharInfo extends L2GameServerPacket
 			if (template != null)
 			{
 				writeC(0x0c);
-				writeD(_activeChar.getObjectId());
+				writeD(_objId);
 				writeD(_activeChar.getPoly().getPolyId()+1000000);  // npctype id
 				writeD(_activeChar.getKarma() > 0 ? 1 : 0);
 				writeD(_x);
@@ -220,7 +235,7 @@ public class CharInfo extends L2GameServerPacket
 			writeD(_y);
 			writeD(_z);
 			writeD(_vehicleId);
-			writeD(_activeChar.getObjectId());
+			writeD(_objId);
 			writeS(_activeChar.getAppearance().getVisibleName());
 			writeD(_activeChar.getRace().ordinal());
 			writeD(_activeChar.getAppearance().getSex() ? 1 : 0);
@@ -449,9 +464,6 @@ public class CharInfo extends L2GameServerPacket
 			
 			// T2.3
 			writeD(_activeChar.getSpecialEffect());
-			/*writeD(_territoryId); // territory Id
-			writeD((_isDisguised ? 0x01: 0x00)); // is Disguised
-			writeD(_territoryId); // territory Id*/
 		}
 	}
 	

+ 1 - 0
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/CharSelected.java

@@ -36,6 +36,7 @@ public class CharSelected extends L2GameServerPacket
 		_sessionId = sessionId;
 	}
 	
+	@SuppressWarnings("deprecation")
 	@Override
 	protected final void writeImpl()
 	{

+ 17 - 7
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/CharSelectionInfo.java

@@ -23,6 +23,7 @@ import java.util.logging.Logger;
 
 import javolution.util.FastList;
 
+import com.l2jserver.Config;
 import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.datatables.ClanTable;
 import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
@@ -53,7 +54,7 @@ public class CharSelectionInfo extends L2GameServerPacket
 	{
 		_sessionId = sessionId;
 		_loginName = loginName;
-		_characterPackages = loadCharacterSelectInfo();
+		_characterPackages = loadCharacterSelectInfo(_loginName);
 		_activeId = -1;
 	}
 	
@@ -61,7 +62,7 @@ public class CharSelectionInfo extends L2GameServerPacket
 	{
 		_sessionId = sessionId;
 		_loginName = loginName;
-		_characterPackages = loadCharacterSelectInfo();
+		_characterPackages = loadCharacterSelectInfo(_loginName);
 		_activeId = activeId;
 	}
 	
@@ -206,7 +207,7 @@ public class CharSelectionInfo extends L2GameServerPacket
 		}
 	}
 	
-	private CharSelectInfoPackage[] loadCharacterSelectInfo()
+	private static CharSelectInfoPackage[] loadCharacterSelectInfo(String loginName)
 	{
 		CharSelectInfoPackage charInfopackage;
 		List<CharSelectInfoPackage> characterList = new FastList<CharSelectInfoPackage>();
@@ -216,8 +217,8 @@ public class CharSelectionInfo extends L2GameServerPacket
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT account_name, charId, char_name, level, maxHp, curHp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, base_class, transform_id FROM characters WHERE account_name=?");
-			statement.setString(1, _loginName);
+			PreparedStatement statement = con.prepareStatement("SELECT account_name, charId, char_name, level, maxHp, curHp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, base_class, transform_id, language FROM characters WHERE account_name=?");
+			statement.setString(1, loginName);
 			ResultSet charList = statement.executeQuery();
 			
 			while (charList.next())// fills the package
@@ -244,7 +245,7 @@ public class CharSelectionInfo extends L2GameServerPacket
 		return new CharSelectInfoPackage[0];
 	}
 	
-	private void loadCharacterSubclassInfo(CharSelectInfoPackage charInfopackage, int ObjectId, int activeClassId)
+	private static void loadCharacterSubclassInfo(CharSelectInfoPackage charInfopackage, int ObjectId, int activeClassId)
 	{
 		Connection con = null;
 		
@@ -279,7 +280,7 @@ public class CharSelectionInfo extends L2GameServerPacket
 	}
 	
 	
-	private CharSelectInfoPackage restoreChar(ResultSet chardata) throws Exception
+	private static CharSelectInfoPackage restoreChar(ResultSet chardata) throws Exception
 	{
 		int objectId = chardata.getInt("charId");
 		String name = chardata.getString("char_name");
@@ -325,6 +326,15 @@ public class CharSelectionInfo extends L2GameServerPacket
 		charInfopackage.setX(chardata.getInt("x"));
 		charInfopackage.setY(chardata.getInt("y"));
 		charInfopackage.setZ(chardata.getInt("z"));
+
+		if (Config.L2JMOD_MULTILANG_ENABLE)
+		{
+			String lang = chardata.getString("language");
+			if (!Config.L2JMOD_MULTILANG_ALLOWED.contains(lang))
+				lang = Config.L2JMOD_MULTILANG_DEFAULT;
+			charInfopackage.setHtmlPrefix("data/lang/" + lang + "/");
+		}
+
 		// if is in subclass, load subclass exp, sp, lvl info
 		if(baseClassId != activeClassId)
 			loadCharacterSubclassInfo(charInfopackage, objectId, activeClassId);

+ 2 - 2
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExBasicActionList.java

@@ -24,8 +24,8 @@ public final class ExBasicActionList extends L2GameServerPacket
 {
 	private static final String _S__FE_5E_EXBASICACTIONLIST = "[S] FE:5F ExBasicActionList";
 	
-	private static final int[] _actionsOnTransform = { 2, 3, 4, 5, 6, 7, 8, 9, 11, 40, 50, 55, 56, 63, 64, 65 };
-	private static final int[] _defaultActionList;
+	public static final int[] _actionsOnTransform = {1,2,3,4,5,6,7,8,9,11,15,16,17,18,19,21,22,23,32,36,39,40,41,42,43,44,45,46,47,48,50,52,53,54,55,56,57,63,64,65,70,1000,1001,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098};
+	public static final int[] _defaultActionList;
 	
 	static
 	{

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExGetPremiumItemList.java

@@ -51,7 +51,7 @@ public class ExGetPremiumItemList extends L2GameServerPacket
 				L2PremiumItem item = _list.get(num);
 				
 				writeD(num);
-				writeD(_activeChar.getCharId());
+				writeD(_activeChar.getObjectId());
 				writeD(item.getItemId());
 				writeQ(item.getCount());
 				writeD(0);

+ 54 - 0
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/OnEventTrigger.java

@@ -0,0 +1,54 @@
+/*
+ * 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.network.serverpackets;
+
+import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
+import com.l2jserver.gameserver.util.Util;
+
+/**
+ ** @author Gnacik
+ **
+ */
+public class OnEventTrigger extends L2GameServerPacket
+{
+	private final int _emitterId;
+	private final boolean _opened;
+	
+	private static final int[] _reverse_doors = { 16200023, 16200024, 16200025 };
+	
+	public OnEventTrigger(L2DoorInstance door, boolean opened)
+	{
+		_emitterId = door.getEmitter();
+		
+		if(Util.contains(_reverse_doors, door.getDoorId()))
+			_opened = !opened;
+		else
+			_opened = opened;
+	}
+
+	@Override
+	protected final void writeImpl()
+	{
+		writeC(0xCF);
+		writeD(_emitterId);
+		writeD(_opened ? 0 : 1);
+	}
+	
+	@Override
+	public String getType()
+	{
+		return "[S] CF OnEventTrigger".intern();
+	}
+}

+ 2 - 2
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/StaticObject.java

@@ -56,8 +56,8 @@ public class StaticObject extends L2GameServerPacket
 		_staticObjectId = door.getDoorId();
 		_objectId = door.getObjectId();
 		_type = 1;
-		_isTargetable = true;
-		_meshIndex = 1;
+		_isTargetable = door.getTargetable();
+		_meshIndex = door.getMeshIndex();
 		_isClosed = !door.getOpen();
 		_isEnemy = door.isEnemy();
 		_maxHp = door.getMaxVisibleHp();

+ 1 - 5
L2_GameServer/java/com/l2jserver/gameserver/templates/chars/L2CharTemplate.java

@@ -86,9 +86,7 @@ public class L2CharTemplate
 	public double baseHolyRes;
 	public double baseDarkRes;
 	public final double baseCritVuln;
-	
-	public final boolean isUndead;
-	
+		
 	//C4 Stats
 	public final int baseMpConsumeRate;
 	public final int baseHpConsumeRate;
@@ -171,8 +169,6 @@ public class L2CharTemplate
 		baseDarkRes = set.getInteger("baseDarkRes", 0);
 		baseCritVuln = set.getInteger("baseCritVuln", 1);
 		
-		isUndead = (set.getInteger("isUndead", 0) == 1);
-		
 		//C4 Stats
 		baseMpConsumeRate = set.getInteger("baseMpConsumeRate", 0);
 		baseHpConsumeRate = set.getInteger("baseHpConsumeRate", 0);

+ 6 - 3
L2_GameServer/java/com/l2jserver/gameserver/templates/chars/L2NpcTemplate.java

@@ -39,7 +39,7 @@ import com.l2jserver.gameserver.templates.StatsSet;
  * <li>npcId, type, name, sex</li>
  * <li>rewardExp, rewardSp</li>
  * <li>aggroRange, factionId, factionRange</li>
- * <li>rhand, lhand, armor</li>
+ * <li>rhand, lhand</li>
  * <li>isUndead</li>
  * <li>_drops</li>
  * <li>_minions</li>
@@ -67,7 +67,6 @@ public final class L2NpcTemplate extends L2CharTemplate
 	public final int aggroRange;
 	public final int rhand;
 	public final int lhand;
-	public final int armor;
 	public final int enchantEffect;
 	public Race race;
 	public final String jClass;
@@ -202,7 +201,6 @@ public final class L2NpcTemplate extends L2CharTemplate
 		aggroRange = set.getInteger("aggroRange");
 		rhand = set.getInteger("rhand");
 		lhand = set.getInteger("lhand");
-		armor = set.getInteger("armor");
 		enchantEffect = set.getInteger("enchant");
 		race = null;
 		int herbGroup = set.getInteger("dropHerbGroup");
@@ -957,4 +955,9 @@ public final class L2NpcTemplate extends L2CharTemplate
 	{
 		return npcId == L2XmassTreeInstance.SPECIAL_TREE_ID;
 	}
+	
+	public boolean isUndead()
+	{
+		return (race == Race.UNDEAD);
+	}
 }

+ 2 - 0
L2_GameServer/java/com/l2jserver/gameserver/templates/skills/L2SkillType.java

@@ -200,6 +200,8 @@ public enum L2SkillType
 	
 	// Refuel airship
 	REFUEL,
+	// Nornil's Power (Nornil's Garden instance)
+	NORNILS_POWER,
 	
 	// unimplemented
 	NOTDONE, BALLISTA;

+ 17 - 0
L2_GameServer/java/com/l2jserver/gameserver/util/Util.java

@@ -299,6 +299,23 @@ public final class Util
 		return (Math.round(val * exponent) / exponent);
 	}
 	
+	public static boolean isDigit(String text)
+	{
+		if (text == null)
+			return false;
+		boolean result = true;
+		char[] chars = text.toCharArray();
+		for (int i = 0; i < chars.length; i++)
+		{
+			if (!Character.isDigit(chars[i]))
+			{
+				result = false;
+				break;
+			}
+		}
+		return result;
+	}
+	
 	public static boolean isAlphaNumeric(String text)
 	{
 		if (text == null)

+ 6 - 2
L2_GameServer/java/config/Character.properties

@@ -257,8 +257,8 @@ MaxPAtkSpeed = 1500
 MaxMAtkSpeed = 1999
 
 # Maximum character Evasion.
-# Default: 200
-MaxEvasion = 200
+# Default: 250
+MaxEvasion = 250
 
 # Maximum number of allowed subclasses for every player.
 # Default: 3
@@ -330,6 +330,10 @@ EnchantMaxJewelry = 0
 EnchantSafeMax = 3
 EnchantSafeMaxFull = 4
 
+# List of non-enchantable items.
+# Currently apprentice, travelers weapons and Pailaka items
+# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296
+EnchantBlackList = 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296
 
 # ---------------------------------------------------------------------------
 # Augmenting

+ 12 - 12
L2_GameServer/java/config/Grandboss.properties

@@ -5,10 +5,10 @@
 AntharasWaitTime = 30
 
 # Interval time of Antharas. Value is hour. Range 1-480
-IntervalOfAntharasSpawn = 192
+IntervalOfAntharasSpawn = 264
 
 # Random interval. Range 1-192
-RandomOfAntharasSpawn = 145
+RandomOfAntharasSpawn = 72
 
 # ---------------------------------------------------------------------------
 # Valakas
@@ -17,46 +17,46 @@ RandomOfAntharasSpawn = 145
 ValakasWaitTime = 30
 
 # Interval time of Valakas. Value is hour. Range 1-480
-IntervalOfValakasSpawn = 192
+IntervalOfValakasSpawn = 264
 
 # Random interval. Range 1-192
-RandomOfValakasSpawn = 145
+RandomOfValakasSpawn = 72
 
 # ---------------------------------------------------------------------------
 # Baium
 # ---------------------------------------------------------------------------
 # Interval time of Baium. Value is hour. Range 1-480
-IntervalOfBaiumSpawn = 121
+IntervalOfBaiumSpawn = 168
 
 # Random interval. Range 1-192
-RandomOfBaiumSpawn = 8
+RandomOfBaiumSpawn = 48
 
 # ---------------------------------------------------------------------------
 # Core
 # ---------------------------------------------------------------------------
 # Interval time of Core. Value is hour. Range 1-480
-IntervalOfCoreSpawn = 27
+IntervalOfCoreSpawn = 60
 
 # Random interval. Range 1-192
-RandomOfCoreSpawn = 47
+RandomOfCoreSpawn = 24
 
 # ---------------------------------------------------------------------------
 # Orfen
 # ---------------------------------------------------------------------------
 # Interval time of Orfen. Value is hour. Range 1-480
-IntervalOfOrfenSpawn = 28
+IntervalOfOrfenSpawn = 48
 
 # Random interval. Range 1-192
-RandomOfOrfenSpawn = 41
+RandomOfOrfenSpawn = 20
 
 # ---------------------------------------------------------------------------
 # Queen Ant
 # ---------------------------------------------------------------------------
 # Interval time of QueenAnt. Value is hour. Range 1-480
-IntervalOfQueenAntSpawn = 19
+IntervalOfQueenAntSpawn = 36
 
 # Random interval. Range 1-192
-RandomOfQueenAntSpawn = 35
+RandomOfQueenAntSpawn = 17
 
 # ---------------------------------------------------------------------------
 # Zaken

+ 28 - 0
L2_GameServer/java/config/l2jmods.properties

@@ -211,9 +211,15 @@ TvTEventFighterBuffs =
 # Format: skill1Id,skill1Level;skill2Id,skill2Level...
 # Example: 1504,1;1500,1;1501,1;1085,3
 TvTEventMageBuffs =
+
+# Maximum number of allowed participants per IP address (dualbox check)
+# Default: 0 (no limits)
+TvTEventMaxParticipantsPerIP = 0
+
 # Voiced command (.tvt) working during TVT event to get information about event status
 TvTAllowVoicedInfoCommand = false
 
+
 # ---------------------------------------------------------------------------
 # L2J Banking System
 # ---------------------------------------------------------------------------
@@ -390,3 +396,25 @@ L2WalkerProtection = False
 # Use admin_command_access_rights table for defining access rights.
 # Default: False
 DebugVoiceCommand = False
+
+
+# ---------------------------------------------------------------------------
+# Dualbox Check
+# ---------------------------------------------------------------------------
+# Maximum number of players per IP address allowed to enter game.
+# Default: 0 (unlimited)
+DualboxCheckMaxPlayersPerIP = 0
+
+# Maximum number of players per IP address allowed to participate in olympiad.
+# Default: 0 (unlimited)
+DualboxCheckMaxOlympiadParticipantsPerIP = 0
+
+# Whitelist of the addresses for dualbox checks.
+# Format: Address1,Number1;Address2,Number2...
+# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
+# Additional connection number added to the global limits for this address.
+# For example, if number of TvT event participants per IP address set to the 1 (no dualbox)
+# and whitelist contains "l2jserver.com,2" then number of allowed participants from l2jserver.com
+# will be 1+2=3. Use 0 or negative value for unlimited number of connections.
+# Default: 127.0.0.1,0 (no limits from localhost)
+DualboxCheckWhitelist = 127.0.0.1,0