Explorar o código

Gracia Final support 1/6

GodKratos %!s(int64=16) %!d(string=hai) anos
pai
achega
01f9540e62
Modificáronse 69 ficheiros con 866 adicións e 279 borrados
  1. 1 1
      L2_GameServer/.classpath
  2. 14 14
      L2_GameServer/dist/GameServer_loop.sh
  3. 12 12
      L2_GameServer/dist/LoginServer_loop.sh
  4. 2 2
      L2_GameServer/dist/RegisterGameServer.sh
  5. 6 6
      L2_GameServer/dist/startLoginServer.sh
  6. 2 2
      L2_GameServer/dist/startSQLAccountManager.sh
  7. 3 3
      L2_GameServer/java/config/Character.properties
  8. 7 1
      L2_GameServer/java/config/Feature.properties
  9. 9 5
      L2_GameServer/java/config/General.properties
  10. 1 1
      L2_GameServer/java/config/NPC.properties
  11. 1 0
      L2_GameServer/java/config/floodprotector.properties
  12. 1 1
      L2_GameServer/java/config/fortsiege.properties
  13. 1 1
      L2_GameServer/java/config/idfactory.properties
  14. 1 1
      L2_GameServer/java/config/l2jmods.properties
  15. 4 1
      L2_GameServer/java/config/loginserver.properties
  16. 1 2
      L2_GameServer/java/config/olympiad.properties
  17. 1 1
      L2_GameServer/java/config/pvp.properties
  18. 15 2
      L2_GameServer/java/config/rates.properties
  19. 5 3
      L2_GameServer/java/config/server.properties
  20. 1 1
      L2_GameServer/java/config/siege.properties
  21. 1 1
      L2_GameServer/java/config/telnet.properties
  22. 47 1
      L2_GameServer/java/net/sf/l2j/Config.java
  23. 2 2
      L2_GameServer/java/net/sf/l2j/L2DatabaseFactory.java
  24. 8 6
      L2_GameServer/java/net/sf/l2j/accountmanager/SQLAccountManager.java
  25. 12 4
      L2_GameServer/java/net/sf/l2j/gameserver/FortUpdater.java
  26. 4 0
      L2_GameServer/java/net/sf/l2j/gameserver/GameServer.java
  27. 2 2
      L2_GameServer/java/net/sf/l2j/gameserver/GeoEngine.java
  28. 4 4
      L2_GameServer/java/net/sf/l2j/gameserver/RecipeController.java
  29. 8 8
      L2_GameServer/java/net/sf/l2j/gameserver/SevenSigns.java
  30. 7 10
      L2_GameServer/java/net/sf/l2j/gameserver/SevenSignsFestival.java
  31. 2 2
      L2_GameServer/java/net/sf/l2j/gameserver/TradeController.java
  32. 33 0
      L2_GameServer/java/net/sf/l2j/gameserver/ai/AbstractAI.java
  33. 3 1
      L2_GameServer/java/net/sf/l2j/gameserver/ai/CtrlIntention.java
  34. 70 1
      L2_GameServer/java/net/sf/l2j/gameserver/ai/L2CharacterAI.java
  35. 6 2
      L2_GameServer/java/net/sf/l2j/gameserver/ai/L2PlayerAI.java
  36. 21 0
      L2_GameServer/java/net/sf/l2j/gameserver/ai/L2SummonAI.java
  37. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/cache/CrestCache.java
  38. 4 3
      L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/BB/Forum.java
  39. 5 4
      L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/BB/Post.java
  40. 3 2
      L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/BB/Topic.java
  41. 4 0
      L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/CommunityBoard.java
  42. 121 3
      L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/Manager/ClanBBSManager.java
  43. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/Manager/ForumsBBSManager.java
  44. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/AccessLevels.java
  45. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/AdminCommandAccessRights.java
  46. 14 4
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/ArmorSetsTable.java
  47. 3 2
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/CharNameTable.java
  48. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/CharTemplateTable.java
  49. 14 17
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/ClanTable.java
  50. 29 32
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/DoorTable.java
  51. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/FishTable.java
  52. 24 32
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/HelperBuffTable.java
  53. 13 16
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/HennaTable.java
  54. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/HennaTreeTable.java
  55. 16 9
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/ItemTable.java
  56. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/LevelUpData.java
  57. 55 13
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/MapRegionTable.java
  58. 4 3
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/NpcTable.java
  59. 2 3
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/NpcWalkerRoutesTable.java
  60. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/PetNameTable.java
  61. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/PetSkillsTable.java
  62. 102 0
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/ResidentialSkillTable.java
  63. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/SkillSpellbookTable.java
  64. 1 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/SkillTable.java
  65. 94 6
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/SkillTreeTable.java
  66. 4 3
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/SpawnTable.java
  67. 2 1
      L2_GameServer/java/net/sf/l2j/gameserver/datatables/TeleportLocationTable.java
  68. 8 7
      L2_GameServer/java/net/sf/l2j/gameserver/instancemanager/games/Lottery.java
  69. 4 3
      L2_GameServer/java/net/sf/l2j/gameserver/lib/SqlUtils.java

+ 1 - 1
L2_GameServer/.classpath

@@ -13,6 +13,6 @@
 	<classpathentry kind="lib" path="lib/jython-engine.jar"/>
 	<classpathentry kind="lib" path="lib/bsh-2.0b5.jar"/>
 	<classpathentry kind="lib" path="lib/mysql-connector-java-5.1.7-bin.jar"/>
-	<classpathentry kind="lib" path="lib/javolution.jar"/>
+	<classpathentry kind="lib" path="lib/javolution-5.3.1.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

+ 14 - 14
L2_GameServer/dist/GameServer_loop.sh

@@ -1,14 +1,14 @@
-#!/bin/bash
-
-# exit codes of GameServer:
-#  0 normal shutdown
-#  2 reboot attempt
-
-while :; do
-	[ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
-	[ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
-	java -Xms1024m -Xmx1024m -cp ./../libs/*:l2jserver.jar net.sf.l2j.gameserver.GameServer > log/stdout.log 2>&1
-	[ $? -ne 2 ] && break
-#	/etc/init.d/mysql restart
-	sleep 10
-done
+#!/bin/bash
+
+# exit codes of GameServer:
+#  0 normal shutdown
+#  2 reboot attempt
+
+while :; do
+	[ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
+	[ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
+	java -Xms1024m -Xmx1024m -cp ./../libs/*:l2jserver.jar net.sf.l2j.gameserver.GameServer > log/stdout.log 2>&1
+	[ $? -ne 2 ] && break
+#	/etc/init.d/mysql restart
+	sleep 10
+done

+ 12 - 12
L2_GameServer/dist/LoginServer_loop.sh

@@ -1,12 +1,12 @@
-#!/bin/bash
-
-err=1
-until [ $err == 0 ]; 
-do
-	[ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
-	[ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
-	nice -n -2 java -Xmx128m -cp ./../libs/*:l2jserver.jar net.sf.l2j.loginserver.L2LoginServer > log/stdout.log 2>&1
-	err=$?
-#	/etc/init.d/mysql restart
-	sleep 10;
-done
+#!/bin/bash
+
+err=1
+until [ $err == 0 ]; 
+do
+	[ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
+	[ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
+	nice -n -2 java -Xmx128m -cp ./../libs/*:l2jserver.jar net.sf.l2j.loginserver.L2LoginServer > log/stdout.log 2>&1
+	err=$?
+#	/etc/init.d/mysql restart
+	sleep 10;
+done

+ 2 - 2
L2_GameServer/dist/RegisterGameServer.sh

@@ -1,2 +1,2 @@
-#!/bin/sh
-java -Djava.util.logging.config.file=console.cfg -cp ./../libs/*:l2jserver.jar net.sf.l2j.gsregistering.GameServerRegister
+#!/bin/sh
+java -Djava.util.logging.config.file=console.cfg -cp ./../libs/*:l2jserver.jar net.sf.l2j.gsregistering.GameServerRegister

+ 6 - 6
L2_GameServer/dist/startLoginServer.sh

@@ -1,6 +1,6 @@
-#!/bin/bash
-
-./LoginServer_loop.sh &
-
-
-
+#!/bin/bash
+
+./LoginServer_loop.sh &
+
+
+

+ 2 - 2
L2_GameServer/dist/startSQLAccountManager.sh

@@ -1,2 +1,2 @@
-#!/bin/sh
-java -Djava.util.logging.config.file=console.cfg -cp ./../libs/*:l2jserver.jar net.sf.l2j.accountmanager.SQLAccountManager
+#!/bin/sh
+java -Djava.util.logging.config.file=console.cfg -cp ./../libs/*:l2jserver.jar net.sf.l2j.accountmanager.SQLAccountManager

+ 3 - 3
L2_GameServer/java/config/Character.properties

@@ -146,8 +146,8 @@ AllowClassMasters = False
 LifeCrystalNeeded = True
 
 # Require spell book needed to learn skills.
-# Default: True
-SpBookNeeded = True
+# Default: False
+SpBookNeeded = False
 
 # Require book needed to enchant skills.
 # Default: True
@@ -535,4 +535,4 @@ PartyXpCutoffPercent = 3.0
 
 # This option takes effect when "level" method is chosen. Don't use low values for this!
 # Default: 30
-PartyXpCutoffLevel = 30
+PartyXpCutoffLevel = 30

+ 7 - 1
L2_GameServer/java/config/Feature.properties

@@ -170,6 +170,11 @@ FortressExpRegenerationFunctionFeeRatio = 86400000
 FortressExpRegenerationFeeLvl1 = 9000
 FortressExpRegenerationFeeLvl2 = 10000
 
+# In independence state how many and how frequently Fort owner get Blood Oath
+# Default: 1, 360 min 
+FortressBloodOathCount = 1
+FortressBloodOathFrequency = 360
+
 
 # ---------------------------------------------------------------------------
 # Seven Signs
@@ -235,6 +240,7 @@ AltDuskGatesPdefMult = 0.8
 AltDawnGatesMdefMult = 1.1
 AltDuskGatesMdefMult = 0.8
 
+
 # ---------------------------------------------------------------------------
 # Clan Reputation Points
 # ---------------------------------------------------------------------------
@@ -281,7 +287,7 @@ UpTo100thRaidRankingPoints = 12
 ReputationScorePerKill = 1
 
 # Reputation score reduced by loosing Fortress in battle.
-LooseFortPoints = 400
+LooseFortPoints = 0
 
 # Reputation score reduced by loosing Castle in battle.
 LooseCastlePoints = 3000

+ 9 - 5
L2_GameServer/java/config/General.properties

@@ -456,8 +456,8 @@ AltOlyClassedParticipants = 5
 AltOlyNonClassedParticipants = 9
 
 # Olympiad battle winner reward for class and non-class games.
-# Default: 6651
-AltOlyBattleRewItem = 6651
+# Default: 13722
+AltOlyBattleRewItem = 13722
 
 # Default: 50
 AltOlyClassedRewItemCount = 50
@@ -470,8 +470,8 @@ AltOlyNonClassedRewItemCount = 30
 AltOlyMinPointForExchange = 50
 
 # ItemId for this reward.
-# Default: 6651
-AltOlyCompRewItem = 6651
+# Default: 13722
+AltOlyCompRewItem = 13722
 
 # Rate to exchange points to reward item.
 # Default: 1000
@@ -481,6 +481,10 @@ AltOlyGPPerPoint = 1000
 # Default: 300
 AltOlyHeroPoints = 300
 
+# Olympiad tokens awarded to Heros.
+# Default: 180000
+AltOlyHeroTokens = 180000
+
 # Hero tables show last month's winners or current status.
 # Default: True
 AltOlyShowMonthlyWinners = True
@@ -732,4 +736,4 @@ AltDevNoQuests = False
 
 # Don't load spawntable.
 # Default: False
-AltDevNoSpawns = False
+AltDevNoSpawns = False

+ 1 - 1
L2_GameServer/java/config/NPC.properties

@@ -92,4 +92,4 @@ RaidMaxRespawnMultiplier = 1.0
 # Configure the interval at which raid boss minions will re-spawn.
 # This time is in milliseconds, 1 minute is 60000 milliseconds.
 # Default: 300000
-RaidMinionRespawnTime = 300000
+RaidMinionRespawnTime = 300000

+ 1 - 0
L2_GameServer/java/config/floodprotector.properties

@@ -23,6 +23,7 @@
 # PunishmentTime - for how many minutes should be the player/account punished,
 #                  player is punished in case of 'jail', account is punished
 #                  in case of 'ban' (0 = forever)
+
 FloodProtectorUseItemInterval = 4
 FloodProtectorUseItemLogFlooding = False
 FloodProtectorUseItemPunishmentLimit = 0

+ 1 - 1
L2_GameServer/java/config/fortsiege.properties

@@ -230,4 +230,4 @@ MonasticCommander2 = 70189,-93935,-1400,61576,36379
 MonasticCommander3 = 73831,-94119,-1400,45536,36382
 MonasticFlag1 = 72174,-94437,-1271,9819
 MonasticFlag2 = 72294,-94481,-1271,9819
-MonasticFlag3 = 72401,-94526,-1271,9819
+MonasticFlag3 = 72401,-94526,-1271,9819

+ 1 - 1
L2_GameServer/java/config/idfactory.properties

@@ -26,4 +26,4 @@ IDFactory = BitSet
 # Check for bad ids in the database on server boot up.
 # Much faster load time without it, but may cause problems.
 # Default: True
-BadIdChecking = True
+BadIdChecking = True

+ 1 - 1
L2_GameServer/java/config/l2jmods.properties

@@ -203,4 +203,4 @@ EnableWarehouseSortingFreight = False
 # Mana Drug (item ID 726), using skill ID 9007.
 # Mana Potion (item ID 728), using skill ID 9008.
 
-EnableManaPotionSupport = False
+EnableManaPotionSupport = False

+ 4 - 1
L2_GameServer/java/config/loginserver.properties

@@ -107,6 +107,9 @@ Password =
 # Default: 10
 MaximumDbConnections = 10
 
+# Default: 0
+MaximumDbIdleTime = 0
+
 
 # ---------------------------------------------------------------------------
 # Misc.
@@ -129,4 +132,4 @@ Debug = False
 Assert = False
 
 # Default: False
-Developer = False
+Developer = False

+ 1 - 2
L2_GameServer/java/config/olympiad.properties

@@ -6,7 +6,6 @@
 # Please take extreme caution when changing anything. Also please understand what you are changing before you do so on a live server.
 # ---------------------------------------------------------------------------
 
-
 # Default: 1
 CurrentCycle = 1
 
@@ -20,4 +19,4 @@ OlympiadEnd = 0
 ValidationEnd = 0
 
 # Default: 0
-NextWeeklyChange = 0
+NextWeeklyChange = 0

+ 1 - 1
L2_GameServer/java/config/pvp.properties

@@ -58,4 +58,4 @@ PvPVsNormalTime = 120000
 
 # Length one stays in PvP mode after hitting a purple player (in ms)
 # Default: 60000
-PvPVsPvPTime = 60000
+PvPVsPvPTime = 60000

+ 15 - 2
L2_GameServer/java/config/rates.properties

@@ -36,6 +36,19 @@ PlayerRateDropItem = 0
 PlayerRateDropEquip = 0
 PlayerRateDropEquipWeapon = 0
 
+# ---------------------------------------------------------------------------
+# Player XP % lost on death.
+# ---------------------------------------------------------------------------
+# Must be defined an interval per each % following this:
+# [limit1m,limit1M]val1;[limit2m,limit2M]val2;...
+# For non defined intervals, default value is 1.0 .
+# Example (Default settings):
+# 0,39-7.0;40,75-4.0;76,76-2.5;77,77-2.0;78,78-1.5
+# This will set 7.0 from 0 to 39 (included), 4.00 from 40 to 75 (included),
+# 2.5 to 76, 2.0 to 77 and 1.5 to 78
+# XP lost is affected by clan luck in core
+PlayerXPPercentLost = 0,39-7.0;40,75-4.0;76,76-2.5;77,77-2.0;78,78-1.5
+
 # Default: 10
 KarmaDropLimit = 10
 
@@ -57,7 +70,7 @@ KarmaRateDropEquipWeapon = 10
 # ---------------------------------------------------------------------------
 PetXpRate = 1
 PetFoodRate = 1
-SinEaterXpRate = 1 
+SinEaterXpRate = 1
 
 
 # ---------------------------------------------------------------------------
@@ -81,4 +94,4 @@ RateSuperiorHerbs = 0.8
 
 # Herb of Warrior, Herb of Mystic, Herb of Recovery
 # Default: 0.2
-RateSpecialHerbs = 0.2
+RateSpecialHerbs = 0.2

+ 5 - 3
L2_GameServer/java/config/server.properties

@@ -62,6 +62,8 @@ Password =
 # Default: 100
 MaximumDbConnections = 100
 
+# Default: 0
+MaximumDbIdleTime = 0
 
 # ---------------------------------------------------------------------------
 # Misc Server Settings
@@ -86,10 +88,10 @@ MaximumOnlineUsers = 100
 # Minimum and maximum protocol revision that server allow to connect.
 # Warning: You must make sure that the minimum revision is always less than or equal to the maximum revision.
 # Default: 12
-MinProtocolRevision = 12
+MinProtocolRevision = 83
 
 # Default: 17
-MaxProtocolRevision = 17
+MaxProtocolRevision = 83
 
 
 # ---------------------------------------------------------------------------
@@ -106,4 +108,4 @@ PetNameTemplate = .*
 
 # Maximum number of characters per account.
 # Default: 7 (client limit)
-CharMaxNumber = 7
+CharMaxNumber = 7

+ 1 - 1
L2_GameServer/java/config/siege.properties

@@ -126,4 +126,4 @@ SchuttgartControlTower2=80306,-152257,-12,13002,6000
 SchuttgartControlTower3=74862,-152162,-12,13002,6000
 SchuttgartControlTower4=77568,-152541,1226,13002,6000
 SchuttgartArtefact1=76668,-154520,226,0,35515
-SchuttgartArtefact2=78446,-154524,227,0,35514
+SchuttgartArtefact2=78446,-154524,227,0,35514

+ 1 - 1
L2_GameServer/java/config/telnet.properties

@@ -19,4 +19,4 @@ StatusPort = 12345
 # This list can contain IPs or Hosts of clients you wish to allow. Hosts must be resolvable to an IP.
 # Example: 0.0.0.0,host,0.0.0.1,host2,host3,host4,0.0.0.3
 # Default: 127.0.0.1,localhost
-ListOfHosts = 127.0.0.1,localhost
+ListOfHosts = 127.0.0.1,localhost

+ 47 - 1
L2_GameServer/java/net/sf/l2j/Config.java

@@ -274,6 +274,8 @@ public final class Config
 	public static long FS_SUPPORT_FEE_RATIO;
 	public static int FS_SUPPORT1_FEE;
 	public static int FS_SUPPORT2_FEE;
+	public static int FS_BLOOD_OATH_COUNT;
+	public static int FS_BLOOD_OATH_FRQ;
 
 
 	//--------------------------------------------------
@@ -446,6 +448,7 @@ public final class Config
 	public static int ALT_OLY_GP_PER_POINT;
 	public static int ALT_OLY_MIN_POINT_FOR_EXCH;
 	public static int ALT_OLY_HERO_POINTS;
+	public static int ALT_OLY_HERO_TOKENS;
 	public static boolean ALT_OLY_LOG_FIGHTS;
 	public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
 	public static boolean ALT_OLY_ANNOUNCE_GAMES;
@@ -634,6 +637,7 @@ public final class Config
 	public static int KARMA_RATE_DROP_ITEM;
 	public static int KARMA_RATE_DROP_EQUIP;
 	public static int KARMA_RATE_DROP_EQUIP_WEAPON;
+	public static double[] PLAYER_XP_PERCENT_LOST;
 
 
 	//--------------------------------------------------
@@ -672,6 +676,7 @@ public final class Config
 	public static String DATABASE_LOGIN;
 	public static String DATABASE_PASSWORD;
 	public static int DATABASE_MAX_CONNECTIONS;
+	public static int DATABASE_MAX_IDLE_TIME;
 	public static int MAXIMUM_ONLINE_USERS;
 	public static String CNAME_TEMPLATE;
 	public static String PET_NAME_TEMPLATE;
@@ -805,6 +810,7 @@ public final class Config
 					DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
 					DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
 					DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
+					DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
 
 					DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
 
@@ -972,6 +978,8 @@ public final class Config
 					FS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressExpRegenerationFunctionFeeRatio", "86400000"));
 					FS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl1", "9000"));
 					FS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl2", "10000"));
+					FS_BLOOD_OATH_COUNT = Integer.parseInt(Feature.getProperty("FortressBloodOathCount", "1"));
+					FS_BLOOD_OATH_FRQ = Integer.parseInt(Feature.getProperty("FortressBloodOathFrequency", "360"));
 
 					ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltCastleForDawn", "True"));
 					ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(Feature.getProperty("AltCastleForDusk", "True"));
@@ -1414,10 +1422,11 @@ public final class Config
 					ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(General.getProperty("AltOlyBattleRewItem","6651"));
 					ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(General.getProperty("AltOlyClassedRewItemCount","50"));
 					ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(General.getProperty("AltOlyNonClassedRewItemCount","30"));
-					ALT_OLY_COMP_RITEM = Integer.parseInt(General.getProperty("AltOlyCompRewItem","6651"));
+					ALT_OLY_COMP_RITEM = Integer.parseInt(General.getProperty("AltOlyCompRewItem","13722"));
 					ALT_OLY_GP_PER_POINT = Integer.parseInt(General.getProperty("AltOlyGPPerPoint","1000"));
 					ALT_OLY_MIN_POINT_FOR_EXCH = Integer.parseInt(General.getProperty("AltOlyMinPointForExchange","50"));
 					ALT_OLY_HERO_POINTS = Integer.parseInt(General.getProperty("AltOlyHeroPoints","300"));
+					ALT_OLY_HERO_TOKENS = Integer.parseInt(General.getProperty("AltOlyHeroTokens","180000"));
 					ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(General.getProperty("AlyOlyLogFights","false"));
 					ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(General.getProperty("AltOlyShowMonthlyWinners","true"));
 					ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(General.getProperty("AltOlyAnnounceGames","true"));
@@ -1581,6 +1590,42 @@ public final class Config
 					KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
 					KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
 					KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
+					
+					// Initializing table
+					PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE+1];
+					
+					// Default value
+					for (int i = 0; i <= Byte.MAX_VALUE; i++)
+						PLAYER_XP_PERCENT_LOST[i] = 1.;
+					
+					// Now loading into table parsed values
+					try
+					{
+						String[] values = ratesSettings.getProperty("PlayerXPPercentLost", "0,39-7.0;40,75-4.0;76,76-2.5;77,77-2.0;78,78-1.5").split(";");
+						
+						for (String s : values)
+						{
+							int min;
+							int max;
+							double val;
+							
+							String[] vals = s.split("-");
+							String[] mM = vals[0].split(",");
+							
+							min = Integer.parseInt(mM[0]);
+							max = Integer.parseInt(mM[1]);
+							val = Double.parseDouble(vals[1]);
+							
+							for (int i = min; i <= max; i++)
+								PLAYER_XP_PERCENT_LOST[i] = val;
+						}
+					}
+					catch (Exception e)
+					{
+						_log.warning("Error while loading Player XP percent lost");
+						e.printStackTrace();
+					}
+					
 				}
 				catch (Exception e)
 				{
@@ -1855,6 +1900,7 @@ public final class Config
 					DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
 					DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
 					DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
+					DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
 
 					SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
 					IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));

+ 2 - 2
L2_GameServer/java/net/sf/l2j/L2DatabaseFactory.java

@@ -54,7 +54,7 @@ public class L2DatabaseFactory
 
 			_source.setInitialPoolSize(10);
 			_source.setMinPoolSize(10);
-			_source.setMaxPoolSize(Config.DATABASE_MAX_CONNECTIONS);
+			_source.setMaxPoolSize(Math.max(10, Config.DATABASE_MAX_CONNECTIONS));
 
 
 			_source.setAcquireRetryAttempts(0); // try to obtain connections indefinitely (0 = never quit)
@@ -73,7 +73,7 @@ public class L2DatabaseFactory
 			// testing OnCheckin used with IdleConnectionTestPeriod is faster than  testing on checkout
 
 			_source.setIdleConnectionTestPeriod(3600); // test idle connection every 60 sec
-			_source.setMaxIdleTime(0); // 0 = idle connections never expire
+			_source.setMaxIdleTime(Config.DATABASE_MAX_IDLE_TIME); // 0 = idle connections never expire
 			// *THANKS* to connection testing configured above
 			// but I prefer to disconnect all connections not used
 			// for more than 1 hour

+ 8 - 6
L2_GameServer/java/net/sf/l2j/accountmanager/SQLAccountManager.java

@@ -19,6 +19,7 @@ import java.io.InputStreamReader;
 import java.io.LineNumberReader;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -130,7 +131,7 @@ public class SQLAccountManager
     private static void printAccInfo(String m) throws SQLException
     {
         int count = 0;
-        java.sql.Connection con = null;
+        Connection con = null;
         con = L2DatabaseFactory.getInstance().getConnection();
         String q = "SELECT login, accessLevel FROM accounts ";
         if (m.equals("1"))
@@ -150,6 +151,7 @@ public class SQLAccountManager
         }
         rset.close();
         statement.close();
+        con.close();
         System.out.println("Displayed accounts: " + count + ".");
     }
     
@@ -162,7 +164,7 @@ public class SQLAccountManager
         newpass = md.digest(newpass);
         
         // Add to Base
-        java.sql.Connection con = null;
+        Connection con = null;
         con = L2DatabaseFactory.getInstance().getConnection();
         PreparedStatement statement = con.prepareStatement("REPLACE	accounts (login, password, accessLevel) VALUES (?,?,?)");
         statement.setString(1, account);
@@ -170,11 +172,12 @@ public class SQLAccountManager
         statement.setString(3, level);
         statement.executeUpdate();
         statement.close();
+        con.close();
     }
     
     private static void changeAccountLevel(String account, String level) throws SQLException
     {
-        java.sql.Connection con = null;
+        Connection con = null;
         con = L2DatabaseFactory.getInstance().getConnection();
         
         // Check Account Exist
@@ -201,14 +204,13 @@ public class SQLAccountManager
             System.out.println("Account " + account + " does not exist.");
         }
         rset.close();
-        
-        // Close Connection
         statement.close();
+        con.close();
     }
     
     private static void deleteAccount(String account) throws SQLException
     {
-        java.sql.Connection con = null;
+        Connection con = null;
         con = L2DatabaseFactory.getInstance().getConnection();
         
         // Check Account Exist

+ 12 - 4
L2_GameServer/java/net/sf/l2j/gameserver/FortUpdater.java

@@ -16,7 +16,9 @@ package net.sf.l2j.gameserver;
 
 import java.util.logging.Logger;
 
+import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.model.L2Clan;
+import net.sf.l2j.gameserver.model.entity.Fort;
 
 /**
  *
@@ -27,13 +29,13 @@ import net.sf.l2j.gameserver.model.L2Clan;
 public class FortUpdater implements Runnable
 {
 	protected static Logger _log = Logger.getLogger(FortUpdater.class.getName());
-	@SuppressWarnings("unused")
 	private L2Clan _clan;
-	@SuppressWarnings("unused")
-	private int _runCount = 0;
+	private Fort _fort;
+	private int _runCount;
 	
-	public FortUpdater(L2Clan clan, int runCount)
+	public FortUpdater(Fort fort, L2Clan clan, int runCount)
 	{
+		_fort = fort;
 		_clan = clan;
 		_runCount = runCount;
 	}
@@ -42,6 +44,12 @@ public class FortUpdater implements Runnable
 	{
 		try
 		{
+			_runCount++;
+			if (_fort.getOwnerClan() == null || _fort.getOwnerClan() != _clan
+					|| (_runCount * Config.FS_BLOOD_OATH_FRQ * 60) > (_fort.getOwnedTime() + 60))
+				return;
+			
+			_fort.setBloodOathReward(_fort.getBloodOathReward() + Config.FS_BLOOD_OATH_COUNT);
 		}
 		catch (Exception e)
 		{

+ 4 - 0
L2_GameServer/java/net/sf/l2j/gameserver/GameServer.java

@@ -56,6 +56,7 @@ import net.sf.l2j.gameserver.datatables.NpcBufferTable;
 import net.sf.l2j.gameserver.datatables.NpcTable;
 import net.sf.l2j.gameserver.datatables.NpcWalkerRoutesTable;
 import net.sf.l2j.gameserver.datatables.PetSkillsTable;
+import net.sf.l2j.gameserver.datatables.ResidentialSkillTable;
 import net.sf.l2j.gameserver.datatables.SkillSpellbookTable;
 import net.sf.l2j.gameserver.datatables.SkillTable;
 import net.sf.l2j.gameserver.datatables.SkillTreeTable;
@@ -71,6 +72,7 @@ import net.sf.l2j.gameserver.handler.SkillHandler;
 import net.sf.l2j.gameserver.handler.UserCommandHandler;
 import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
 import net.sf.l2j.gameserver.idfactory.IdFactory;
+import net.sf.l2j.gameserver.instancemanager.AirShipManager;
 import net.sf.l2j.gameserver.instancemanager.AuctionManager;
 import net.sf.l2j.gameserver.instancemanager.BoatManager;
 import net.sf.l2j.gameserver.instancemanager.CastleManager;
@@ -246,6 +248,7 @@ public class GameServer
 		CharTemplateTable.getInstance();
 		NobleSkillTable.getInstance();
 		HeroSkillTable.getInstance();
+		ResidentialSkillTable.getInstance();
 		
 		// Call to load caches
 		HtmCache.getInstance();
@@ -319,6 +322,7 @@ public class GameServer
 		PetitionManager.getInstance();
 		QuestManager.getInstance();
 		TransformationManager.getInstance();
+		AirShipManager.getInstance();
 		
 		try
 		{

+ 2 - 2
L2_GameServer/java/net/sf/l2j/gameserver/GeoEngine.java

@@ -209,7 +209,7 @@ public class GeoEngine extends GeoData
     	int by = getBlock(gy);
     	int cx = getCell(gx);
     	int cy = getCell(gy);
-    	int rx = (gx >> 11) + 15;
+    	int rx = (gx >> 11) + 10;
 	    int ry = (gy >> 11) + 10;
     	String out = rx+";"+ry+";"+bx+";"+by+";"+cx+";"+cy+";"+gm.getZ()+";"+comment+"\n";
     	try
@@ -746,7 +746,7 @@ public class GeoEngine extends GeoData
 	{
 	    int rx = x >> 11; // =/(256 * 8)
 	    int ry = y >> 11;
-	    return (short)(((rx+15) << 5) + (ry+10));
+	    return (short)(((rx+10) << 5) + (ry+10));
 	}
 
 	/**

+ 4 - 4
L2_GameServer/java/net/sf/l2j/gameserver/RecipeController.java

@@ -388,7 +388,7 @@ public class RecipeController
 		protected int _itemGrab;
 		protected int _exp = -1;
 		protected int _sp = -1;
-		protected int _price;
+		protected long _price;
 		protected int _totalItems;
 		protected int _materialsRefPrice;
 		protected int _delay;
@@ -671,7 +671,7 @@ public class RecipeController
 				if (_target == _player)
 				{
 					SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2_EQUIPPED); // you equipped ...
-					sm.addNumber(count);
+					sm.addItemNumber(count);
 					sm.addItemName(item.getItemId());
 					_player.sendPacket(sm);
 				}
@@ -917,7 +917,7 @@ public class RecipeController
             {
     			sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
     			sm.addItemName(itemId);
-                sm.addNumber(itemCount);
+                sm.addItemNumber(itemCount);
     			_target.sendPacket(sm);
             } else
             {
@@ -930,7 +930,7 @@ public class RecipeController
 			{
 				// inform manufacturer of earned profit
 				sm = new SystemMessage(SystemMessageId.EARNED_ADENA);
-				sm.addNumber(_price);
+				sm.addItemNumber(_price);
 				_player.sendPacket(sm);
 			}
 

+ 8 - 8
L2_GameServer/java/net/sf/l2j/gameserver/SevenSigns.java

@@ -331,18 +331,18 @@ public class SevenSigns
 		return _instance;
 	}
 
-	public static int calcContributionScore(int blueCount, int greenCount, int redCount)
+	public static long calcContributionScore(long blueCount, long greenCount, long redCount)
 	{
-		int contrib = blueCount * BLUE_CONTRIB_POINTS;
+		long contrib = blueCount * BLUE_CONTRIB_POINTS;
 		contrib += greenCount * GREEN_CONTRIB_POINTS;
 		contrib += redCount * RED_CONTRIB_POINTS;
 
 		return contrib;
 	}
 
-	public static int calcAncientAdenaReward(int blueCount, int greenCount, int redCount)
+	public static long calcAncientAdenaReward(long blueCount, long greenCount, long redCount)
 	{
-		int reward = blueCount * SEAL_STONE_BLUE_VALUE;
+		long reward = blueCount * SEAL_STONE_BLUE_VALUE;
 		reward += greenCount * SEAL_STONE_GREEN_VALUE;
 		reward += redCount * SEAL_STONE_RED_VALUE;
 
@@ -1045,13 +1045,13 @@ public class SevenSigns
 	 * @param redCount
 	 * @return int contribScore
 	 */
-	public int addPlayerStoneContrib(L2PcInstance player, int blueCount, int greenCount, int redCount)
+	public long addPlayerStoneContrib(L2PcInstance player, long blueCount, long greenCount, long redCount)
 	{
 		StatsSet currPlayer = getPlayerData(player);
 
-		int contribScore = calcContributionScore(blueCount, greenCount, redCount);
-		int totalAncientAdena = currPlayer.getInteger("ancient_adena_amount") + calcAncientAdenaReward(blueCount, greenCount, redCount);
-		int totalContribScore = currPlayer.getInteger("contribution_score") + contribScore;
+		long contribScore = calcContributionScore(blueCount, greenCount, redCount);
+		long totalAncientAdena = currPlayer.getLong("ancient_adena_amount") + calcAncientAdenaReward(blueCount, greenCount, redCount);
+		long totalContribScore = currPlayer.getLong("contribution_score") + contribScore;
 
 		if (totalContribScore > Config.ALT_MAXIMUM_PLAYER_CONTRIB)
 			return -1;

+ 7 - 10
L2_GameServer/java/net/sf/l2j/gameserver/SevenSignsFestival.java

@@ -47,7 +47,6 @@ import net.sf.l2j.gameserver.model.base.Experience;
 import net.sf.l2j.gameserver.network.SystemMessageId;
 import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
 import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
-import net.sf.l2j.gameserver.network.serverpackets.PledgeShowInfoUpdate;
 import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
 import net.sf.l2j.gameserver.templates.StatsSet;
 import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
@@ -781,8 +780,8 @@ public class SevenSignsFestival implements SpawnListener
     protected Map<Integer, List<L2PcInstance>> _dawnPreviousParticipants;
     protected Map<Integer, List<L2PcInstance>> _duskPreviousParticipants;
 
-    private Map<Integer, Integer> _dawnFestivalScores;
-    private Map<Integer, Integer> _duskFestivalScores;
+    private Map<Integer, Long> _dawnFestivalScores;
+    private Map<Integer, Long> _duskFestivalScores;
 
     /**
      * _festivalData is essentially an instance of the seven_signs_festival table and
@@ -805,11 +804,11 @@ public class SevenSignsFestival implements SpawnListener
 
         _dawnFestivalParticipants = new FastMap<Integer, List<L2PcInstance>>();
         _dawnPreviousParticipants = new FastMap<Integer, List<L2PcInstance>>();
-        _dawnFestivalScores = new FastMap<Integer, Integer>();
+        _dawnFestivalScores = new FastMap<Integer, Long>();
 
         _duskFestivalParticipants = new FastMap<Integer, List<L2PcInstance>>();
         _duskPreviousParticipants = new FastMap<Integer, List<L2PcInstance>>();
-        _duskFestivalScores = new FastMap<Integer, Integer>();
+        _duskFestivalScores = new FastMap<Integer, Long>();
 
         _festivalData = new FastMap<Integer, Map<Integer, StatsSet>>();
 
@@ -1187,7 +1186,6 @@ public class SevenSignsFestival implements SpawnListener
       if (player.getClan() != null)
       {
         player.getClan().setReputationScore(player.getClan().getReputationScore()+Config.FESTIVAL_WIN_POINTS, true);
-        player.getClan().broadcastToOnlineMembers(new PledgeShowInfoUpdate(player.getClan()));
         SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_C1_WAS_IN_HIGHEST_RANKED_PARTY_IN_FESTIVAL_OF_DARKNESS_AND_GAINED_S2_REPUTATION);
                 sm.addString(partyMemberName);
                 sm.addNumber(Config.FESTIVAL_WIN_POINTS);
@@ -1196,7 +1194,7 @@ public class SevenSignsFestival implements SpawnListener
     }
     else
     {
-      java.sql.Connection con = null;
+      Connection con = null;
 
           try
           {
@@ -1213,7 +1211,6 @@ public class SevenSignsFestival implements SpawnListener
                 if (clan != null)
                 {
                   clan.setReputationScore(clan.getReputationScore()+Config.FESTIVAL_WIN_POINTS, true);
-                  clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
                   SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_C1_WAS_IN_HIGHEST_RANKED_PARTY_IN_FESTIVAL_OF_DARKNESS_AND_GAINED_S2_REPUTATION);
                           sm.addString(partyMemberName);
                           sm.addNumber(Config.FESTIVAL_WIN_POINTS);
@@ -1486,7 +1483,7 @@ public class SevenSignsFestival implements SpawnListener
         }
     }
 
-    public final int getFinalScore(int oracle, int festivalId)
+    public final long getFinalScore(int oracle, int festivalId)
     {
         if (oracle == SevenSigns.CABAL_DAWN)
             return _dawnFestivalScores.get(festivalId);
@@ -1578,7 +1575,7 @@ public class SevenSignsFestival implements SpawnListener
      * @param offeringScore
      * @return boolean isHighestScore
      */
-    public boolean setFinalScore(L2PcInstance player, int oracle, int festivalId, int offeringScore)
+    public boolean setFinalScore(L2PcInstance player, int oracle, int festivalId, long offeringScore)
     {
         List<String> partyMembers;
 

+ 2 - 2
L2_GameServer/java/net/sf/l2j/gameserver/TradeController.java

@@ -301,7 +301,7 @@ public class TradeController
     
     public void dataCountStore()
     {
-        java.sql.Connection con = null;
+        Connection con = null;
         PreparedStatement statement;
         
         try
@@ -320,7 +320,7 @@ public class TradeController
                         if (item.hasLimitedStock() && item.getCurrentCount() < item.getMaxCount()) //needed?
                         {
                             statement = con.prepareStatement("UPDATE merchant_buylists SET currentCount=? WHERE item_id=? AND shop_id=?");
-                            statement.setInt(1, item.getCurrentCount());
+                            statement.setLong(1, item.getCurrentCount());
                             statement.setInt(2, item.getItemId());
                             statement.setInt(3, listId);
                             statement.executeUpdate();

+ 33 - 0
L2_GameServer/java/net/sf/l2j/gameserver/ai/AbstractAI.java

@@ -34,6 +34,7 @@ import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
 import net.sf.l2j.gameserver.network.serverpackets.AutoAttackStart;
 import net.sf.l2j.gameserver.network.serverpackets.AutoAttackStop;
 import net.sf.l2j.gameserver.network.serverpackets.Die;
+import net.sf.l2j.gameserver.network.serverpackets.ExMoveToLocationInAirShip;
 import net.sf.l2j.gameserver.network.serverpackets.MoveToLocation;
 import net.sf.l2j.gameserver.network.serverpackets.MoveToLocationInVehicle;
 import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;
@@ -316,6 +317,9 @@ abstract class AbstractAI implements Ctrl
 			case AI_INTENTION_MOVE_TO_IN_A_BOAT:
 				onIntentionMoveToInABoat((L2CharPosition) arg0, (L2CharPosition) arg1);
 				break;
+			case AI_INTENTION_MOVE_TO_IN_AIR_SHIP:
+				onIntentionMoveToInAirShip((L2CharPosition) arg0, (L2CharPosition) arg1);
+				break;
 			case AI_INTENTION_FOLLOW:
 				onIntentionFollow((L2Character) arg0);
 				break;
@@ -489,6 +493,8 @@ abstract class AbstractAI implements Ctrl
 	
 	protected abstract void onIntentionMoveToInABoat(L2CharPosition destination, L2CharPosition origin);
 	
+	protected abstract void onIntentionMoveToInAirShip(L2CharPosition destination, L2CharPosition origin);
+	
 	protected abstract void onIntentionFollow(L2Character target);
 	
 	protected abstract void onIntentionPickUp(L2Object item);
@@ -672,6 +678,33 @@ abstract class AbstractAI implements Ctrl
 			_actor.sendPacket(ActionFailed.STATIC_PACKET);
 		}
 	}
+
+	protected void moveToInAirShip(L2CharPosition destination, L2CharPosition origin)
+	{
+		// Check if actor can move
+		if (!_actor.isMovementDisabled())
+		{
+			/*	// Set AI movement data
+			 _client_moving = true;
+			 _client_moving_to_pawn_offset = 0;
+
+			 // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController
+			 _accessor.moveTo(((L2PcInstance)_actor).getBoat().getX() - destination.x,((L2PcInstance)_actor).getBoat().getY()- destination.y,((L2PcInstance)_actor).getBoat().getZ() - destination.z);
+			 */
+			// Send a Server->Client packet CharMoveToLocation to the actor and all L2PcInstance in its _knownPlayers
+			//CharMoveToLocation msg = new CharMoveToLocation(_actor);
+			if (((L2PcInstance) _actor).getAirShip() != null)
+			{
+				ExMoveToLocationInAirShip msg = new ExMoveToLocationInAirShip(_actor, destination);
+				_actor.broadcastPacket(msg);
+			}
+			
+		}
+		else
+		{
+			_actor.sendPacket(ActionFailed.STATIC_PACKET);
+		}
+	}
 	
 	/**
 	 * Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation <I>(broadcast)</I>.<BR><BR>

+ 3 - 1
L2_GameServer/java/net/sf/l2j/gameserver/ai/CtrlIntention.java

@@ -39,5 +39,7 @@ public enum CtrlIntention
 	/** Move to target, then interact */
 	AI_INTENTION_INTERACT,
 	/** Move to another location in a boat */
-	AI_INTENTION_MOVE_TO_IN_A_BOAT;
+	AI_INTENTION_MOVE_TO_IN_A_BOAT,
+	/** Move to another location in an air ship */
+	AI_INTENTION_MOVE_TO_IN_AIR_SHIP;
 }

+ 70 - 1
L2_GameServer/java/net/sf/l2j/gameserver/ai/L2CharacterAI.java

@@ -14,7 +14,15 @@
  */
 package net.sf.l2j.gameserver.ai;
 
-import static net.sf.l2j.gameserver.ai.CtrlIntention.*;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_ACTIVE;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_ATTACK;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_CAST;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_FOLLOW;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_INTERACT;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_MOVE_TO;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_PICK_UP;
+import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_REST;
 
 import java.util.List;
 
@@ -29,10 +37,14 @@ import net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation;
 import net.sf.l2j.gameserver.model.actor.L2Attackable;
 import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.L2Npc;
+import net.sf.l2j.gameserver.model.actor.instance.L2AirShipInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2BoatInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
 import net.sf.l2j.gameserver.network.serverpackets.AutoAttackStop;
+import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
 import net.sf.l2j.gameserver.taskmanager.AttackStanceTaskManager;
 import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
 import net.sf.l2j.gameserver.templates.item.L2Weapon;
@@ -189,6 +201,9 @@ public class L2CharacterAI extends AbstractAI
 	@Override
 	protected void onIntentionAttack(L2Character target)
 	{
+		// stop invul effect if exist
+		if (_actor.getInvulEffect() != null)
+			_actor.getInvulEffect().exit();
 		if (target == null)
 		{
 			clientActionFailed();
@@ -257,6 +272,9 @@ public class L2CharacterAI extends AbstractAI
 	@Override
 	protected void onIntentionCast(L2Skill skill, L2Object target)
 	{
+		// stop invul effect if exist
+		if (_actor.getInvulEffect() != null)
+			_actor.getInvulEffect().exit();
 		if (getIntention() == AI_INTENTION_REST && skill.isMagic())
 		{
 			clientActionFailed();
@@ -360,6 +378,40 @@ public class L2CharacterAI extends AbstractAI
 		// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
 		moveToInABoat(destination, origin);
 	}
+
+	/* (non-Javadoc)
+	 * @see net.sf.l2j.gameserver.ai.AbstractAI#onIntentionMoveToInAirShip(net.sf.l2j.gameserver.model.L2CharPosition, net.sf.l2j.gameserver.model.L2CharPosition)
+	 */
+	@Override
+	protected void onIntentionMoveToInAirShip(L2CharPosition destination, L2CharPosition origin)
+	{
+		if (getIntention() == AI_INTENTION_REST)
+		{
+			// Cancel action client side by sending Server->Client packet ActionFailed to the L2PcInstance actor
+			clientActionFailed();
+			return;
+		}
+		
+		if (_actor.isAllSkillsDisabled() || _actor.isCastingNow())
+		{
+			// Cancel action client side by sending Server->Client packet ActionFailed to the L2PcInstance actor
+			clientActionFailed();
+			return;
+		}
+		
+		// Set the Intention of this AbstractAI to AI_INTENTION_MOVE_TO
+		//
+		//changeIntention(AI_INTENTION_MOVE_TO, new L2CharPosition(((L2PcInstance)_actor).getBoat().getX() - destination.x, ((L2PcInstance)_actor).getBoat().getY() - destination.y, ((L2PcInstance)_actor).getBoat().getZ() - destination.z, 0)  , null);
+		
+		// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
+		clientStopAutoAttack();
+		
+		// Abort the attack of the L2Character and send Server->Client ActionFailed packet
+		_actor.abortAttack();
+		
+		// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
+		moveToInAirShip(destination, origin);
+	}
 	
 	/**
 	 * Manage the Follow Intention : Stop current Attack and Launch a Follow Task.<BR><BR>
@@ -715,6 +767,10 @@ public class L2CharacterAI extends AbstractAI
 		{
 			((L2BoatInstance) _actor).evtArrived();
 		}
+		else if (_actor instanceof L2AirShipInstance)
+		{
+			((L2AirShipInstance) _actor).evtArrived();
+		}
 	}
 	
 	/**
@@ -1010,6 +1066,19 @@ public class L2CharacterAI extends AbstractAI
 			if (_actor.isMovementDisabled())
 				return true;
 			
+			// while flying there is no move to cast
+			if (_actor.getAI().getIntention() == CtrlIntention.AI_INTENTION_CAST && 
+					_actor instanceof L2PcInstance && ((L2PcInstance)_actor).isTransformed())
+			{
+				if (!((L2PcInstance)_actor).getTransformation().canStartFollowToCast())
+				{
+					((L2PcInstance)_actor).sendPacket(new SystemMessage(SystemMessageId.DIST_TOO_FAR_CASTING_STOPPED));
+					((L2PcInstance)_actor).sendPacket(ActionFailed.STATIC_PACKET);
+					
+					return true;
+				}
+			}
+			
 			// If not running, set the L2Character movement type to run and send Server->Client packet ChangeMoveType to all others L2PcInstance
 			if (!_actor.isRunning() && !(this instanceof L2PlayerAI) && !(this instanceof L2SummonAI))
 				_actor.setRunning();

+ 6 - 2
L2_GameServer/java/net/sf/l2j/gameserver/ai/L2PlayerAI.java

@@ -246,7 +246,9 @@ public class L2PlayerAI extends L2CharacterAI
 		}
 		if (maybeMoveToPawn(target, _actor.getPhysicalAttackRange()))
 			return;
-		
+		// stop invul effect if exist
+		if (_actor.getInvulEffect() != null)
+			_actor.getInvulEffect().exit();
 		_accessor.doAttack(target);
 	}
 	
@@ -285,7 +287,9 @@ public class L2PlayerAI extends L2CharacterAI
 		
 		if (_skill.getHitTime() > 50)
 			clientStopMoving(null);
-		
+		// stop invul effect if exist
+		if (_actor.getInvulEffect() != null)
+			_actor.getInvulEffect().exit();
 		L2Object oldTarget = _actor.getTarget();
 		if (oldTarget != null && target != null && oldTarget != target)
 		{

+ 21 - 0
L2_GameServer/java/net/sf/l2j/gameserver/ai/L2SummonAI.java

@@ -19,6 +19,7 @@ import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_FOLLOW;
 import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
 import net.sf.l2j.gameserver.model.actor.L2Summon;
 import net.sf.l2j.gameserver.model.actor.L2Character.AIAccessor;
+import net.sf.l2j.gameserver.model.actor.instance.L2MerchantSummonInstance;
 
 public class L2SummonAI extends L2CharacterAI
 {
@@ -34,6 +35,8 @@ public class L2SummonAI extends L2CharacterAI
 	@Override
 	protected void onIntentionIdle()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		stopFollow();
 		_startFollow = false;
 		onIntentionActive();
@@ -42,6 +45,8 @@ public class L2SummonAI extends L2CharacterAI
 	@Override
 	protected void onIntentionActive()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		L2Summon summon = (L2Summon) _actor;
 		if (_startFollow)
 			setIntention(AI_INTENTION_FOLLOW, summon.getOwner());
@@ -51,6 +56,8 @@ public class L2SummonAI extends L2CharacterAI
 	
 	private void thinkAttack()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		if (checkTargetLostOrDead(getAttackTarget()))
 		{
 			setAttackTarget(null);
@@ -64,6 +71,8 @@ public class L2SummonAI extends L2CharacterAI
 	
 	private void thinkCast()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		L2Summon summon = (L2Summon) _actor;
 		if (checkTargetLost(getCastTarget()))
 		{
@@ -82,6 +91,8 @@ public class L2SummonAI extends L2CharacterAI
 	
 	private void thinkPickUp()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		if (checkTargetLost(getTarget()))
 			return;
 		if (maybeMoveToPawn(getTarget(), 36))
@@ -92,6 +103,8 @@ public class L2SummonAI extends L2CharacterAI
 	
 	private void thinkInteract()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		if (checkTargetLost(getTarget()))
 			return;
 		if (maybeMoveToPawn(getTarget(), 36))
@@ -102,6 +115,8 @@ public class L2SummonAI extends L2CharacterAI
 	@Override
 	protected void onEvtThink()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		if (_thinking || _actor.isCastingNow() || _actor.isAllSkillsDisabled())
 			return;
 		_thinking = true;
@@ -132,12 +147,16 @@ public class L2SummonAI extends L2CharacterAI
 	@Override
 	protected void onEvtFinishCasting()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		if (_actor.getAI().getIntention() != AI_INTENTION_ATTACK)
 			((L2Summon) _actor).setFollowStatus(_startFollow);
 	}
 	
 	public void notifyFollowStatusChange()
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		_startFollow = !_startFollow;
 		switch (getIntention())
 		{
@@ -150,6 +169,8 @@ public class L2SummonAI extends L2CharacterAI
 	
 	public void setStartFollowController(boolean val)
 	{
+		if (_actor instanceof L2MerchantSummonInstance)
+			return;
 		_startFollow = val;
 	}
 }

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/cache/CrestCache.java

@@ -19,6 +19,7 @@ import java.io.FileFilter;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.RandomAccessFile;
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.logging.Level;
@@ -158,7 +159,7 @@ public class CrestCache
 				file.renameTo(new File(Config.DATAPACK_ROOT, "data/crests/Crest_" + newId + ".bmp"));
 				_log.info("Renamed Clan crest to new format: Crest_" + newId + ".bmp");
 				
-				java.sql.Connection con = null;
+				Connection con = null;
 				
 				try
 				{

+ 4 - 3
L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/BB/Forum.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.communitybbs.BB;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.List;
@@ -97,7 +98,7 @@ public class Forum
 	 */
 	private void load()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -173,7 +174,7 @@ public class Forum
 	 */
 	private void getChildren()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -306,7 +307,7 @@ public class Forum
 	 */
 	public void insertindb()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 5 - 4
L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/BB/Post.java

@@ -15,6 +15,7 @@
 package net.sf.l2j.gameserver.communitybbs.BB;
 
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.List;
@@ -64,7 +65,7 @@ public class Post
 	}
 	public void insertindb(CPost cp)
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -116,7 +117,7 @@ public class Post
 	public void deleteme(Topic t)
 	{
 		PostBBSManager.getInstance().delPostByTopic(t);
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -146,7 +147,7 @@ public class Post
 	 */
 	private void load(Topic t)
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -190,7 +191,7 @@ public class Post
 	 */
 	public void updatetxt(int i)
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			CPost cp = getCPost(i);

+ 3 - 2
L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/BB/Topic.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.communitybbs.BB;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.util.logging.Logger;
 
@@ -71,7 +72,7 @@ public class Topic
 	 */
 	public void insertindb()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -146,7 +147,7 @@ public class Topic
 	{
 		TopicBBSManager.getInstance().delTopic(this);
 		f.rmTopicByID(getID());
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 4 - 0
L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/CommunityBoard.java

@@ -129,6 +129,10 @@ public class CommunityBoard
 				{
 					RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar);
 				}
+				else if (url.equals("Notice"))
+				{
+					ClanBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar);
+				}
 				else
 				{
 					ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + url + " is not implemented yet</center><br><br></body></html>", "101");

+ 121 - 3
L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/Manager/ClanBBSManager.java

@@ -88,13 +88,127 @@ public class ClanBBSManager extends BaseBBSManager
 				clanhome(activeChar, index);
 			}
 		}
+		else if(command.startsWith("_bbsclan_clannotice_edit;"))
+		{
+			clanNotice(activeChar, activeChar.getClan().getClanId());
+		}
+		else if(command.startsWith("_bbsclan_clannotice_enable"))
+		{
+			activeChar.getClan().setNoticeEnabled(true);
+			clanNotice(activeChar, activeChar.getClan().getClanId());
+		}
+		else if(command.startsWith("_bbsclan_clannotice_disable"))
+		{
+			activeChar.getClan().setNoticeEnabled(false);
+			clanNotice(activeChar, activeChar.getClan().getClanId());
+		}
 		else
 		{
-			separateAndSend("<html><body><br><br><center>Commande : " + command + " pas encore implante</center><br><br></body></html>", activeChar);
+			separateAndSend("<html><body><br><br><center>Command : " + command + " needs core development</center><br><br></body></html>", activeChar);
 			
 		}
 	}
 	
+	private void clanNotice(L2PcInstance activeChar, int clanId)
+	{
+		L2Clan cl = ClanTable.getInstance().getClan(clanId);
+		if (cl != null)
+		{
+			if (cl.getLevel() < 2)
+			{
+				activeChar.sendPacket(new SystemMessage(SystemMessageId.NO_CB_IN_MY_CLAN));
+				parsecmd("_bbsclan_clanlist", activeChar);
+			}
+			else
+			{
+				final StringBuilder html = StringUtil.startAppend(2000,
+						"<html><body><br><br>" +
+						"<table border=0 width=610><tr><td width=10></td><td width=600 align=left>" +
+						"<a action=\"bypass _bbshome\">HOME</a> &gt; " +
+						"<a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a>  &gt; " +
+						"<a action=\"bypass _bbsclan_clanhome;",
+						String.valueOf(clanId),
+						"\"> &amp;$802; </a>" +
+						"</td></tr>" +
+						"</table>"
+						);
+				if(activeChar.isClanLeader())
+				{
+					StringUtil.append(html,
+							"<br><br><center>" +
+							"<table width=610 border=0 cellspacing=0 cellpadding=0>" +
+							"<tr><td fixwidth=610><font color=\"AAAAAA\">The Clan Notice function allows the clan leader to send messages through a pop-up window to clan members at login.</font> </td></tr>" +
+							"<tr><td height=20></td></tr>"
+							);
+					
+					if(activeChar.getClan().isNoticeEnabled())
+						StringUtil.append(html, "<tr><td fixwidth=610> Clan Notice Function:&nbsp;&nbsp;&nbsp;on&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;<a action=\"bypass _bbsclan_clannotice_disable\">off</a>");
+					else
+						StringUtil.append(html, "<tr><td fixwidth=610> Clan Notice Function:&nbsp;&nbsp;&nbsp;<a action=\"bypass _bbsclan_clannotice_enable\">on</a>&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;off");
+					
+					StringUtil.append(html,
+							"</td></tr>" +
+							"</table>" +
+							"<img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\">" +
+							"<br> <br>" +
+							"<table width=610 border=0 cellspacing=2 cellpadding=0>" +
+							"<tr><td>Edit Notice: </td></tr>" +
+							"<tr><td height=5></td></tr>" +
+							"<tr><td>" +
+							"<MultiEdit var =\"Content\" width=610 height=100>" +
+							"</td></tr>" +
+							"</table>" +
+							"<br>" +
+							"<table width=610 border=0 cellspacing=0 cellpadding=0>" +
+							"<tr><td height=5></td></tr>" +
+							"<tr>" +
+							"<td align=center FIXWIDTH=65><button value=\"&$140;\" action=\"Write Notice Set _ Content Content Content\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td>" +
+							"<td align=center FIXWIDTH=45></td>" +
+							"<td align=center FIXWIDTH=500></td>" +
+							"</tr>" +
+							"</table>" +
+							"</center>" +
+							"</body>" +
+							"</html>"
+							);
+					send1001(html.toString(), activeChar);
+					send1002(activeChar,activeChar.getClan().getNotice()," ","0");
+				}
+				else
+				{
+					StringUtil.append(html,
+							"<img src=\"L2UI.squareblank\" width=\"1\" height=\"10\">" +
+							"<center>" +
+							"<table border=0 cellspacing=0 cellpadding=0><tr>" +
+							"<td>You are not your clan's leader, and therefore cannot change the clan notice</td>" +
+							"</tr></table>"
+							);
+					if (activeChar.getClan().isNoticeEnabled())
+					{
+						StringUtil.append(html, 
+								"<table border=0 cellspacing=0 cellpadding=0>" +
+								"<tr>" +
+								"<td>The current clan notice:</td>" +
+								"</tr>" +
+								"<tr><td fixwidth=5></td>" +
+								"<td FIXWIDTH=600 align=left>" +
+								activeChar.getClan().getNotice() +
+								"</td>" +
+								"<td fixqqwidth=5></td>" +
+								"</tr>" +
+								"</table>"
+								);
+					}
+					StringUtil.append(html,
+							"</center>" +
+							"</body>" +
+							"</html>"
+							);
+					separateAndSend(html.toString(), activeChar);
+				}
+			}
+		}
+	}
 	/**
 	 * @param activeChar
 	 */
@@ -281,7 +395,7 @@ public class ClanBBSManager extends BaseBBSManager
                                     "<a action=\"bypass _bbsclan_clanhome;",
                                     String.valueOf(clanId),
                                     ";cmail\">[CLAN MAIL]</a>&nbsp;&nbsp;" +
-                                    "<a action=\"bypass _bbsclan_clanhome;",
+                                    "<a action=\"bypass _bbsclan_clannotice_edit;",
                                     String.valueOf(clanId),
                                     ";cnotice\">[CLAN NOTICE]</a>&nbsp;&nbsp;" +
                                     "</td>" +
@@ -367,7 +481,11 @@ public class ClanBBSManager extends BaseBBSManager
 	public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
 	{
 		// TODO Auto-generated method stub
-		
+		if (ar1.equals("Set"))
+		{
+			activeChar.getClan().setNotice(ar4);
+			parsecmd("_bbsclan_clanhome;" + activeChar.getClan().getClanId(),activeChar);
+		}
 	}
 	
 }

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/communitybbs/Manager/ForumsBBSManager.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.communitybbs.Manager;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.List;
@@ -71,7 +72,7 @@ public class ForumsBBSManager extends BaseBBSManager
 	 */
 	private void load()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/AccessLevels.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -70,7 +71,7 @@ public class AccessLevels
 	{
 		_accessLevels = new FastMap<Integer, L2AccessLevel>();
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/AdminCommandAccessRights.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -63,7 +64,7 @@ public class AdminCommandAccessRights
 	{
 		_adminCommandAccessRights = new FastMap<String, L2AdminCommandAccessRight>();
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{

+ 14 - 4
L2_GameServer/java/net/sf/l2j/gameserver/datatables/ArmorSetsTable.java

@@ -60,7 +60,7 @@ public class ArmorSetsTable
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill_id, skill_lvl, shield, shield_skill_id, enchant6skill FROM armorsets");
+			PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill_id, skill_lvl, shield, shield_skill_id, enchant6skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield FROM armorsets");
 			ResultSet rset = statement.executeQuery();
 			
 			while (rset.next())
@@ -75,7 +75,12 @@ public class ArmorSetsTable
 				int shield = rset.getInt("shield");
 				int shield_skill_id = rset.getInt("shield_skill_id");
 				int enchant6skill = rset.getInt("enchant6skill");
-				_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet, skill_id, skill_lvl, shield, shield_skill_id, enchant6skill));
+				int mw_legs = rset.getInt("mw_legs"); 
+				int mw_head = rset.getInt("mw_head"); 
+				int mw_gloves = rset.getInt("mw_gloves"); 
+				int mw_feet = rset.getInt("mw_feet"); 
+				int mw_shield = rset.getInt("mw_shield");
+				_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet, skill_id, skill_lvl, shield, shield_skill_id, enchant6skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield));
 			}
 			
 			_log.config("ArmorSetsTable: Loaded " + _armorSets.size() + " armor sets.");
@@ -103,7 +108,7 @@ public class ArmorSetsTable
 			{
 				int cSets = _armorSets.size();
 				con = L2DatabaseFactory.getInstance().getConnection();
-				PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill_id, skill_lvl, shield, shield_skill_id, enchant6skill FROM custom_armorsets");
+				PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill_id, skill_lvl, shield, shield_skill_id, enchant6skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield FROM custom_armorsets");
 				ResultSet rset = statement.executeQuery();
 				while (rset.next())
 				{
@@ -117,7 +122,12 @@ public class ArmorSetsTable
 					int shield = rset.getInt("shield");
 					int shield_skill_id = rset.getInt("shield_skill_id");
 					int enchant6skill = rset.getInt("enchant6skill");
-					_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet, skill_id, skill_lvl, shield, shield_skill_id, enchant6skill));
+					int mw_legs = rset.getInt("mw_legs"); 
+					int mw_head = rset.getInt("mw_head"); 
+					int mw_gloves = rset.getInt("mw_gloves"); 
+					int mw_feet = rset.getInt("mw_feet"); 
+					int mw_shield = rset.getInt("mw_shield");
+					_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet, skill_id, skill_lvl, shield, shield_skill_id, enchant6skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield));
 				}
 				_log.config("ArmorSetsTable: Loaded " + (_armorSets.size() - cSets) + " Custom armor sets.");
 				rset.close();

+ 3 - 2
L2_GameServer/java/net/sf/l2j/gameserver/datatables/CharNameTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -44,7 +45,7 @@ public class CharNameTable
 	public synchronized boolean doesCharNameExist(String name)
 	{
 		boolean result = true;
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{
@@ -75,7 +76,7 @@ public class CharNameTable
 	
 	public int accountCharNumber(String account)
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		int number = 0;
 		
 		try

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/CharTemplateTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -51,7 +52,7 @@ public class CharTemplateTable
 	
 	private CharTemplateTable()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{

+ 14 - 17
L2_GameServer/java/net/sf/l2j/gameserver/datatables/ClanTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.Map;
@@ -74,7 +75,7 @@ public class ClanTable
 	{
 		_clans = new FastMap<Integer, L2Clan>();
 		L2Clan clan;
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -89,16 +90,7 @@ public class ClanTable
 				_clans.put(Integer.parseInt(result.getString("clan_id")), new L2Clan(Integer.parseInt(result.getString("clan_id"))));
 				clan = getClan(Integer.parseInt(result.getString("clan_id")));
 				if (clan.getDissolvingExpiryTime() != 0)
-				{
-					if (clan.getDissolvingExpiryTime() < System.currentTimeMillis())
-					{
-						destroyClan(clan.getClanId());
-					}
-					else
-					{
-						scheduleRemoveClan(clan.getClanId());
-					}
-				}
+					scheduleRemoveClan(clan.getClanId());
 				clanCount++;
 			}
 			result.close();
@@ -262,7 +254,7 @@ public class ClanTable
 		_clans.remove(clanId);
 		IdFactory.getInstance().releaseId(clanId);
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -291,7 +283,12 @@ public class ClanTable
 			statement.setInt(2, clanId);
 			statement.execute();
 			statement.close();
-			
+
+			statement = con.prepareStatement("DELETE FROM clan_notices WHERE clan_id=?");
+			statement.setInt(1, clanId);
+			statement.execute();
+			statement.close();
+
 			if (castleId != 0)
 			{
 				statement = con.prepareStatement("UPDATE castle SET taxPercent = 0 WHERE id = ?");
@@ -342,7 +339,7 @@ public class ClanTable
 					destroyClan(clanId);
 				}
 			}
-		}, getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis());
+		}, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
 	}
 	
 	public boolean isAllyExists(String allyName)
@@ -365,7 +362,7 @@ public class ClanTable
 		clan2.setAttackerClan(clan1);
 		clan1.broadcastClanStatus();
 		clan2.broadcastClanStatus();
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -424,7 +421,7 @@ public class ClanTable
 		//    if(player.getPlayerInstance()!=null)
 		//			player.getPlayerInstance().setWantsPeace(0);
 		//}
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -484,7 +481,7 @@ public class ClanTable
 	
 	private void restorewars()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 29 - 32
L2_GameServer/java/net/sf/l2j/gameserver/datatables/DoorTable.java

@@ -126,28 +126,29 @@ public class DoorTable
 	public static L2DoorInstance parseList(String line)
 	{
 		StringTokenizer st = new StringTokenizer(line, ";");
-		
-		String name = st.nextToken();
-		int id = Integer.parseInt(st.nextToken());
-		int x = Integer.parseInt(st.nextToken());
-		int y = Integer.parseInt(st.nextToken());
-		int z = Integer.parseInt(st.nextToken());
-		int rangeXMin = Integer.parseInt(st.nextToken());
-		int rangeYMin = Integer.parseInt(st.nextToken());
-		int rangeZMin = Integer.parseInt(st.nextToken());
-		int rangeXMax = Integer.parseInt(st.nextToken());
-		int rangeYMax = Integer.parseInt(st.nextToken());
-		int rangeZMax = Integer.parseInt(st.nextToken());
-		int hp = Integer.parseInt(st.nextToken());
-		int pdef = Integer.parseInt(st.nextToken());
-		int mdef = 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());
-		
+		L2DoorInstance door = null;
+		try
+		{
+			String name = st.nextToken();
+			int id = Integer.parseInt(st.nextToken());
+			int x = Integer.parseInt(st.nextToken());
+			int y = Integer.parseInt(st.nextToken());
+			int z = Integer.parseInt(st.nextToken());
+			int rangeXMin = Integer.parseInt(st.nextToken());
+			int rangeYMin = Integer.parseInt(st.nextToken());
+			int rangeZMin = Integer.parseInt(st.nextToken());
+			int rangeXMax = Integer.parseInt(st.nextToken());
+			int rangeYMax = Integer.parseInt(st.nextToken());
+			int rangeZMax = Integer.parseInt(st.nextToken());
+			int hp = Integer.parseInt(st.nextToken());
+			int pdef = Integer.parseInt(st.nextToken());
+			int mdef = 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());
 		if (rangeXMin > rangeXMax)
 			_log.severe("Error in door data, ID:" + id);
 		if (rangeYMin > rangeYMax)
@@ -206,16 +207,8 @@ public class DoorTable
 		npcDat.set("baseMDef", mdef);
 		
 		L2CharTemplate template = new L2CharTemplate(npcDat);
-		L2DoorInstance door = new L2DoorInstance(IdFactory.getInstance().getNextId(), template, id, name, unlockable);
+		door = new L2DoorInstance(IdFactory.getInstance().getNextId(), template, id, name, unlockable);
 		door.setRange(rangeXMin, rangeYMin, rangeZMin, rangeXMax, rangeYMax, rangeZMax);
-		try
-		{
-			door.setMapRegion(MapRegionTable.getInstance().getMapRegion(x, y));
-		}
-		catch (Exception e)
-		{
-			_log.severe("Error in door data, ID:" + id);
-		}
 		door.setCurrentHpMp(door.getMaxHp(), door.getMaxMp());
 		door.setXYZInvisible(x, y, z);
 		
@@ -223,7 +216,11 @@ public class DoorTable
 			door.setIsCommanderDoor(startOpen);
 		else
 			door.setOpen(startOpen);
-		
+		}
+		catch (Exception e)
+		{
+			_log.severe("Error in door data at line: " +line);
+		}
 		return door;
 	}
 	

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/FishTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.List;
@@ -46,7 +47,7 @@ public class FishTable
 	{
 		//Create table that contains all fish datas
 		int count = 0;
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 24 - 32
L2_GameServer/java/net/sf/l2j/gameserver/datatables/HelperBuffTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.List;
@@ -52,6 +53,10 @@ public class HelperBuffTable
 	 *  Used to generate message : "Only novice character of level ... or less can receive my support magic.") */
 	private int _magicClassHighestLevel = 1;
 	private int _physicClassHighestLevel = 1;
+
+	private int _servitorLowestLevel = 100;
+
+	private int _servitorHighestLevel = 1;
 	
 	public static HelperBuffTable getInstance()
 	{
@@ -77,7 +82,7 @@ public class HelperBuffTable
 	 */
 	private void restoreHelperBuffData()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			try
@@ -126,6 +131,7 @@ public class HelperBuffTable
 			helperBuffDat.set("lowerLevel", HelperBuffData.getInt("lower_level"));
 			helperBuffDat.set("upperLevel", HelperBuffData.getInt("upper_level"));
 			helperBuffDat.set("isMagicClass", HelperBuffData.getString("is_magic_class"));
+			helperBuffDat.set("forSummon", HelperBuffData.getString("forSummon"));
 			
 			// Calulate the range level in wich player must be to obtain buff from Newbie Helper
 			if ("false".equals(HelperBuffData.getString("is_magic_class")))
@@ -144,7 +150,14 @@ public class HelperBuffTable
 				if (HelperBuffData.getInt("upper_level") > _magicClassHighestLevel)
 					_magicClassHighestLevel = HelperBuffData.getInt("upper_level");
 			}
-			
+			if ("true".equals(HelperBuffData.getString("forSummon")))
+			{
+				if (HelperBuffData.getInt("lower_level") < _servitorLowestLevel)
+					_servitorLowestLevel = HelperBuffData.getInt("lower_level");
+				
+				if (HelperBuffData.getInt("upper_level") > _servitorHighestLevel)
+					_servitorHighestLevel = HelperBuffData.getInt("upper_level");
+			}
 			// Add this Helper Buff to the Helper Buff List
 			L2HelperBuff template = new L2HelperBuff(helperBuffDat);
 			_helperBuff.add(template);
@@ -159,11 +172,6 @@ public class HelperBuffTable
 		return _initialized;
 	}
 	
-	public L2HelperBuff getHelperBuffTableItem(int id)
-	{
-		return _helperBuff.get(id);
-	}
-	
 	/**
 	 * Return the Helper Buff List
 	 */
@@ -180,13 +188,6 @@ public class HelperBuffTable
 		return _magicClassHighestLevel;
 	}
 	
-	/**
-	 * @param magicClassHighestLevel The magicClassHighestLevel to set.
-	 */
-	public void setMagicClassHighestLevel(int magicClassHighestLevel)
-	{
-		_magicClassHighestLevel = magicClassHighestLevel;
-	}
 	
 	/**
 	 * @return Returns the magicClassLowestLevel.
@@ -196,14 +197,6 @@ public class HelperBuffTable
 		return _magicClassLowestLevel;
 	}
 	
-	/**
-	 * @param magicClassLowestLevel The magicClassLowestLevel to set.
-	 */
-	public void setMagicClassLowestLevel(int magicClassLowestLevel)
-	{
-		_magicClassLowestLevel = magicClassLowestLevel;
-	}
-	
 	/**
 	 * @return Returns the physicClassHighestLevel.
 	 */
@@ -213,27 +206,26 @@ public class HelperBuffTable
 	}
 	
 	/**
-	 * @param physicClassHighestLevel The physicClassHighestLevel to set.
+	 * @return Returns the physicClassLowestLevel.
 	 */
-	public void setPhysicClassHighestLevel(int physicClassHighestLevel)
+	public int getPhysicClassLowestLevel()
 	{
-		_physicClassHighestLevel = physicClassHighestLevel;
+		return _physicClassLowestLevel;
 	}
 	
 	/**
-	 * @return Returns the physicClassLowestLevel.
+	 * @return Returns the servitorLowestLevel.
 	 */
-	public int getPhysicClassLowestLevel()
+	public int getServitorLowestLevel()
 	{
-		return _physicClassLowestLevel;
+		return _servitorLowestLevel;
 	}
 	
 	/**
-	 * @param physicClassLowestLevel The physicClassLowestLevel to set.
+	  @return Returns the servitorHighestLevel.
 	 */
-	public void setPhysicClassLowestLevel(int physicClassLowestLevel)
+	public int getServitorHighestLevel()
 	{
-		_physicClassLowestLevel = physicClassLowestLevel;
+		return _servitorHighestLevel;
 	}
-	
 }

+ 13 - 16
L2_GameServer/java/net/sf/l2j/gameserver/datatables/HennaTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.Map;
@@ -59,25 +60,21 @@ public class HennaTable
 	 */
 	private void restoreHennaData()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
-			try
-			{
-				con = L2DatabaseFactory.getInstance().getConnection();
-				PreparedStatement statement = con.prepareStatement("SELECT symbol_id, symbol_name, dye_id, dye_amount, price, stat_INT, stat_STR, stat_CON, stat_MEM, stat_DEX, stat_WIT FROM henna");
-				ResultSet hennadata = statement.executeQuery();
-				
-				fillHennaTable(hennadata);
-				hennadata.close();
-				statement.close();
-			}
-			catch (Exception e)
-			{
-				_log.severe("error while creating henna table " + e);
-				e.printStackTrace();
-			}
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement("SELECT symbol_id, symbol_name, dye_id, dye_amount, price, stat_INT, stat_STR, stat_CON, stat_MEM, stat_DEX, stat_WIT FROM henna");
+			ResultSet hennadata = statement.executeQuery();
 			
+			fillHennaTable(hennadata);
+			hennadata.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.severe("error while creating henna table " + e);
+			e.printStackTrace();
 		}
 		finally
 		{

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/HennaTreeTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.List;
@@ -50,7 +51,7 @@ public class HennaTreeTable
 		_hennaTrees = new FastMap<ClassId, List<L2HennaInstance>>();
 		int classId = 0;
 		int count = 0;
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 16 - 9
L2_GameServer/java/net/sf/l2j/gameserver/datatables/ItemTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -99,6 +100,7 @@ public class ItemTable
 		_materials.put("cobweb", L2Item.MATERIAL_COBWEB);
 		_materials.put("seed", L2Item.MATERIAL_SEED);
 		
+		_crystalTypes.put("s84", L2Item.CRYSTAL_S84);
 		_crystalTypes.put("s80", L2Item.CRYSTAL_S80);
 		_crystalTypes.put("s", L2Item.CRYSTAL_S);
 		_crystalTypes.put("a", L2Item.CRYSTAL_A);
@@ -124,6 +126,7 @@ public class ItemTable
 		_weaponTypes.put("crossbow", L2WeaponType.CROSSBOW);
 		_weaponTypes.put("rapier", L2WeaponType.RAPIER);
 		_weaponTypes.put("ancient", L2WeaponType.ANCIENT_SWORD);
+		_weaponTypes.put("dualdagger", L2WeaponType.DUAL_DAGGER);
 		
 		_armorTypes.put("none", L2ArmorType.NONE);
 		_armorTypes.put("light", L2ArmorType.LIGHT);
@@ -151,6 +154,7 @@ public class ItemTable
 		_slots.put("feet", L2Item.SLOT_FEET);
 		_slots.put("gloves", L2Item.SLOT_GLOVES);
 		_slots.put("chest,legs", L2Item.SLOT_CHEST | L2Item.SLOT_LEGS);
+		_slots.put("belt", L2Item.SLOT_BELT);
 		_slots.put("rhand", L2Item.SLOT_R_HAND);
 		_slots.put("lhand", L2Item.SLOT_L_HAND);
 		_slots.put("lrhand", L2Item.SLOT_LR_HAND);
@@ -170,25 +174,25 @@ public class ItemTable
 	/** Table of SQL request in order to obtain items from tables [etcitem], [armor], [weapon] */
 	private static final String[] SQL_ITEM_SELECTS =
 	{
-		"SELECT item_id, name, crystallizable, item_type, weight, consume_type, material," + " crystal_type, duration, price, crystal_count, sellable, dropable, destroyable, tradeable FROM etcitem",
+		"SELECT item_id, name, crystallizable, item_type, weight, consume_type, material," + " crystal_type, duration, time, price, crystal_count, sellable, dropable, destroyable, tradeable FROM etcitem",
 		
-		"SELECT item_id, name, bodypart, crystallizable, armor_type, weight," + " material, crystal_type, avoid_modify, duration, p_def, m_def, mp_bonus,"
+		"SELECT item_id, name, bodypart, crystallizable, armor_type, weight," + " material, crystal_type, avoid_modify, duration, time, p_def, m_def, mp_bonus,"
 				+ " price, crystal_count, sellable, dropable, destroyable, tradeable, skill FROM armor",
 		
 		"SELECT item_id, name, bodypart, crystallizable, weight, soulshots, spiritshots," + " material, crystal_type, p_dam, rnd_dam, weaponType, critical, hit_modify, avoid_modify,"
-				+ " shield_def, shield_def_rate, atk_speed, mp_consume, m_dam, duration, price, crystal_count," + " sellable, dropable, destroyable, tradeable, skill,enchant4_skill_id,enchant4_skill_lvl, onCast_skill_id, onCast_skill_lvl,"
+				+ " shield_def, shield_def_rate, atk_speed, mp_consume, m_dam, duration, time, price, crystal_count," + " sellable, dropable, destroyable, tradeable, skill,enchant4_skill_id,enchant4_skill_lvl, onCast_skill_id, onCast_skill_lvl,"
 				+ " onCast_skill_chance, onCrit_skill_id, onCrit_skill_lvl, onCrit_skill_chance, change_weaponId FROM weapon"
 	};
 	
 	private static final String[] SQL_CUSTOM_ITEM_SELECTS =
 	{
-		"SELECT item_id, name, crystallizable, item_type, weight, consume_type, material," + " crystal_type, duration, price, crystal_count, sellable, dropable, destroyable, tradeable FROM custom_etcitem",
+		"SELECT item_id, name, crystallizable, item_type, weight, consume_type, material," + " crystal_type, duration, time, price, crystal_count, sellable, dropable, destroyable, tradeable FROM custom_etcitem",
 		
-		"SELECT item_id, name, bodypart, crystallizable, armor_type, weight," + " material, crystal_type, avoid_modify, duration, p_def, m_def, mp_bonus,"
+		"SELECT item_id, name, bodypart, crystallizable, armor_type, weight," + " material, crystal_type, avoid_modify, duration, time, p_def, m_def, mp_bonus,"
 				+ " price, crystal_count, sellable, dropable, destroyable, tradeable, skill FROM custom_armor",
 		
 		"SELECT item_id, name, bodypart, crystallizable, weight, soulshots, spiritshots," + " material, crystal_type, p_dam, rnd_dam, weaponType, critical, hit_modify, avoid_modify,"
-				+ " shield_def, shield_def_rate, atk_speed, mp_consume, m_dam, duration, price, crystal_count," + " sellable, dropable, destroyable, tradeable, skill,enchant4_skill_id,enchant4_skill_lvl, onCast_skill_id, onCast_skill_lvl,"
+				+ " shield_def, shield_def_rate, atk_speed, mp_consume, m_dam, duration, time, price, crystal_count," + " sellable, dropable, destroyable, tradeable, skill,enchant4_skill_id,enchant4_skill_lvl, onCast_skill_id, onCast_skill_lvl,"
 				+ " onCast_skill_chance, onCrit_skill_id, onCrit_skill_lvl, onCrit_skill_chance, change_weaponId FROM custom_weapon"
 	};
 	
@@ -230,7 +234,7 @@ public class ItemTable
 		_armors = new FastMap<Integer, L2Armor>();
 		_weapons = new FastMap<Integer, L2Weapon>();
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -410,6 +414,7 @@ public class ItemTable
 		item.set.set("mp_consume", rset.getInt("mp_consume"));
 		item.set.set("m_dam", rset.getInt("m_dam"));
 		item.set.set("duration", rset.getInt("duration"));
+		item.set.set("time", rset.getInt("time"));
 		item.set.set("price", rset.getInt("price"));
 		item.set.set("crystal_count", rset.getInt("crystal_count"));
 		item.set.set("sellable", Boolean.valueOf(rset.getString("sellable")));
@@ -493,6 +498,7 @@ public class ItemTable
 		item.set.set("crystal_type", _crystalTypes.get(rset.getString("crystal_type")));
 		item.set.set("avoid_modify", rset.getInt("avoid_modify"));
 		item.set.set("duration", rset.getInt("duration"));
+		item.set.set("time", rset.getInt("time"));
 		item.set.set("p_def", rset.getInt("p_def"));
 		item.set.set("m_def", rset.getInt("m_def"));
 		item.set.set("mp_bonus", rset.getInt("mp_bonus"));
@@ -633,6 +639,7 @@ public class ItemTable
 		item.set.set("name", item.name);
 		
 		item.set.set("duration", rset.getInt("duration"));
+		item.set.set("time", rset.getInt("time"));
 		item.set.set("price", rset.getInt("price"));
 		
 		return item;
@@ -774,7 +781,7 @@ public class ItemTable
 	 * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
 	 * @return L2ItemInstance corresponding to the new item
 	 */
-	public L2ItemInstance createItem(String process, int itemId, int count, L2PcInstance actor, L2Object reference)
+	public L2ItemInstance createItem(String process, int itemId, long count, L2PcInstance actor, L2Object reference)
 	{
 		// Create and Init the L2ItemInstance corresponding to the Item Identifier
 		L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
@@ -935,7 +942,7 @@ public class ItemTable
 			// if it's a pet control item, delete the pet as well
 			if (L2PetDataTable.isPetItem(item.getItemId()))
 			{
-				java.sql.Connection con = null;
+				Connection con = null;
 				try
 				{
 					// Delete the pet in db

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/LevelUpData.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.Map;
@@ -64,7 +65,7 @@ public class LevelUpData
 	private LevelUpData()
 	{
 		_lvlTable = new FastMap<Integer, L2LvlupData>();
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 55 - 13
L2_GameServer/java/net/sf/l2j/gameserver/datatables/MapRegionTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.List;
@@ -48,7 +49,7 @@ public class MapRegionTable
 	
 	private static MapRegionTable _instance;
 	
-	private final int[][] _regions = new int[19][21];
+	private final int[][] _regions = new int[16][18];
 	
 	private final int[][] _pointsWithKarmas;
 	
@@ -75,18 +76,18 @@ public class MapRegionTable
 		int count2 = 0;
 		
 		//LineNumberReader lnr = null;
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT region, sec0, sec1, sec2, sec3, sec4, sec5, sec6, sec7, sec8, sec9, sec10 FROM mapregion");
+			PreparedStatement statement = con.prepareStatement("SELECT region, sec0, sec1, sec2, sec3, sec4, sec5, sec6, sec7, sec8, sec9, sec10,sec11,sec12,sec13,sec14,sec15 FROM mapregion");
 			ResultSet rset = statement.executeQuery();
 			int region;
 			while (rset.next())
 			{
 				region = rset.getInt(1);
 				
-				for (int j = 0; j < 11; j++)
+				for (int j = 0; j < 16; j++)
 				{
 					_regions[j][region] = rset.getInt(j + 2);
 					count2++;
@@ -206,7 +207,7 @@ public class MapRegionTable
 	
 	public final int getMapRegionX(int posX)
 	{
-		return (posX >> 15) + 4;// + centerTileX;
+		return (posX >> 15) + 9;// + centerTileX;
 	}
 	
 	public final int getMapRegionY(int posY)
@@ -355,7 +356,7 @@ public class MapRegionTable
 				break;
 			case 16:
 				nearestTown = "Town of Shuttgart";
-				break; ////TODO@ (Check mapregion table)[Luno]
+				break;
 			case 18:
 				nearestTown = "Primeval Isle";
 				break;
@@ -368,6 +369,48 @@ public class MapRegionTable
 			case 21:
 				nearestTown = "Fantasy Island";
 				break;
+			case 22:
+				nearestTown = "Neutral Zone";
+				break;
+			case 23:
+				nearestTown = "Coliseum";
+				break;
+			case 24:
+				nearestTown = "GM Consultation service";
+				break;
+			case 25:
+				nearestTown = "Dimensional Gap";
+				break;
+			case 26:
+				nearestTown = "Cemetery of the Empire";
+				break;
+			case 27:
+				nearestTown = "inside the Steel Citadel";
+				break;
+			case 28:
+				nearestTown = "Steel Citadel Resistance";
+				break;
+			case 29:
+				nearestTown = "Inside Kamaloka";
+				break;
+			case 30:
+				nearestTown = "Inside Nia Kamaloka";
+				break;
+			case 31:
+				nearestTown = "Inside Rim Kamaloka";
+				break;
+			case 32:
+				nearestTown = "Keucereus clan association";
+				break;
+			case 33:
+				nearestTown = "inside the Seed of Infinity";
+				break;
+			case 34:
+				nearestTown = "outside the Seed of Infinity";
+				break;
+			case 35:
+				nearestTown = "Aerial Cleft";
+				break;
 			default:
 				nearestTown = "Town of Aden";
 				break;
@@ -392,8 +435,8 @@ public class MapRegionTable
 			Castle castle = null;
 			Fort fort = null;
 			ClanHall clanhall = null;
-			
-			if (player.getClan() != null)
+		
+			if (player.getClan() != null && !player.isFlyingMounted()) // flying players in gracia cant use teleports to aden continent
 			{
 				// If teleport to clan hall
 				if (teleportWhere == TeleportWhereType.ClanHall)
@@ -403,13 +446,13 @@ public class MapRegionTable
 					if (clanhall != null)
 					{
 						L2ClanHallZone zone = clanhall.getZone();
-						if (zone != null)
+						if (zone != null && !player.isFlyingMounted())
 						{
 							return zone.getSpawn();
 						}
 					}
 				}
-				
+
 				// If teleport to castle
 				if (teleportWhere == TeleportWhereType.Castle)
 				{
@@ -491,15 +534,14 @@ public class MapRegionTable
 				}
 			}
 			
-			// teleport RED PK 5+ to Floran Village
-			if (player.getPkKills() > 5 && player.getKarma() > 1)
-				return new Location(17817, 170079, -3530);
 			//Karma player land out of city
 			if (player.getKarma() > 1)
 			{
 				int closest = getMapRegion(activeChar.getX(), activeChar.getY());
 				if (closest >= 0 && closest < _pointsWithKarmas.length)
 					return new Location(_pointsWithKarmas[closest][0], _pointsWithKarmas[closest][1], _pointsWithKarmas[closest][2]);
+				else if (player.isFlyingMounted()) // prevent flying players to teleport outside of gracia
+					return new Location(-186330, 242944, 2544);
 				else
 					return new Location(17817, 170079, -3530);
 			}

+ 4 - 3
L2_GameServer/java/net/sf/l2j/gameserver/datatables/NpcTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -67,7 +68,7 @@ public class NpcTable
 	
 	private void restoreNpcData()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{
@@ -409,7 +410,7 @@ public class NpcTable
 	
 	public void reloadNpc(int id)
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{
@@ -499,7 +500,7 @@ public class NpcTable
 	
 	public void saveNpc(StatsSet npc)
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 2 - 3
L2_GameServer/java/net/sf/l2j/gameserver/datatables/NpcWalkerRoutesTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.logging.Logger;
@@ -56,7 +57,7 @@ public class NpcWalkerRoutesTable
 	public void load()
 	{
 		_routes.clear();
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -84,8 +85,6 @@ public class NpcWalkerRoutesTable
 			statement.close();
 			
 			_log.info("WalkerRoutesTable: Loaded " + _routes.size() + " Npc Walker Routes.");
-			rset.close();
-			statement.close();
 		}
 		catch (Exception e)
 		{

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/PetNameTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -44,7 +45,7 @@ public class PetNameTable
 	public boolean doesPetNameExist(String name, int petNpcId)
 	{
 		boolean result = true;
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/PetSkillsTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.Collection;
@@ -51,7 +52,7 @@ public class PetSkillsTable
 		int npcId = 0;
 		int count = 0;
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 102 - 0
L2_GameServer/java/net/sf/l2j/gameserver/datatables/ResidentialSkillTable.java

@@ -0,0 +1,102 @@
+package net.sf.l2j.gameserver.datatables;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.logging.Logger;
+
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
+import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.datatables.SkillTable;
+import net.sf.l2j.gameserver.model.L2Skill;
+
+/**
+ * Warning: must be loaded after loading SkillTable
+ *
+ * @author  DrHouse
+ */
+public class ResidentialSkillTable
+{
+	private static Logger _log = Logger.getLogger(ArmorSetsTable.class.getName());
+
+	private static ResidentialSkillTable _instance = null;
+	private static FastMap<Integer, FastList<L2Skill>> _list;
+
+	ResidentialSkillTable()
+	{
+		load();
+	}
+
+	private void load()
+	{
+		_list = new FastMap<Integer, FastList<L2Skill>>();
+		Connection con = null;
+
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement("SELECT * FROM skill_residential ORDER BY entityId");
+			ResultSet rs = statement.executeQuery();
+
+			while (rs.next())
+			{
+				int entityId = rs.getInt("entityId");
+				int skillId = rs.getInt("skillId");
+				int skillLvl = rs.getInt("skillLevel");
+
+				L2Skill sk = SkillTable.getInstance().getInfo(skillId, skillLvl);
+
+				if (sk == null)
+				{
+					_log.warning("ResidentialSkillTable: SkillTable has returned null for ID/level: " +skillId+"/"+skillLvl);
+					continue;
+				}
+				if (!_list.containsKey(entityId))
+				{
+					FastList<L2Skill> aux = new FastList<L2Skill>();
+					aux.add(sk);
+					_list.put(entityId, aux);
+				}
+				else
+					_list.get(entityId).add(sk);
+			}
+			statement.close();
+			rs.close();
+		}
+		catch (Exception e)
+		{
+			_log.warning("ResidentialSkillTable: a problem occured while loading skills!");
+			e.printStackTrace();
+		}
+		finally
+		{
+			try
+			{
+				con.close();
+			}
+			catch(Exception e)
+			{
+
+			}
+			_log.info("ResidentialSkillTable: Loaded " + _list.size() + " entities with associated skills.");
+		}
+	}
+
+	public FastList<L2Skill> getSkills(int entityId)
+	{
+		if (_list.containsKey(entityId))
+			return _list.get(entityId);
+
+		else return null;
+	}
+
+	public static ResidentialSkillTable getInstance()
+	{
+		if (_instance == null) 
+			_instance = new ResidentialSkillTable();
+
+		return _instance;
+	}
+}

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/SkillSpellbookTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.Map;
@@ -41,7 +42,7 @@ public class SkillSpellbookTable
 	private SkillSpellbookTable()
 	{
 		_skillSpellbooks = new FastMap<Integer, Integer>();
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{

+ 1 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/SkillTable.java

@@ -76,7 +76,7 @@ public class SkillTable
 	 */
 	public static int getSkillHashCode(int skillId, int skillLevel)
 	{
-		return skillId * 256 + skillLevel;
+		return skillId * 255 + skillLevel;
 	}
 	
 	public L2Skill getInfo(int skillId, int level)

+ 94 - 6
L2_GameServer/java/net/sf/l2j/gameserver/datatables/SkillTreeTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.Collection;
@@ -58,6 +59,7 @@ public class SkillTreeTable
 	private List<L2PledgeSkillLearn> _pledgeSkillTrees; //pledge skill list
 	private Map<Integer, L2EnchantSkillLearn> _enchantSkillTrees; //enchant skill list
 	private List<L2TransformSkillLearn> _TransformSkillTrees; // Transform Skills (Test)
+	private FastList<L2SkillLearn> _specialSkillTrees;
 	
 	public static SkillTreeTable getInstance()
 	{
@@ -137,7 +139,8 @@ public class SkillTreeTable
 		int count4 = 0;
 		int count5 = 0;
 		int count6 = 0;
-		java.sql.Connection con = null;
+		int count7 = 0;
+		Connection con = null;
 		
 		try
 		{
@@ -249,7 +252,7 @@ public class SkillTreeTable
 			{
 				_enchantSkillTrees = new FastMap<Integer, L2EnchantSkillLearn>();
 				
-				PreparedStatement statement = con.prepareStatement("SELECT skill_id, level, name, base_lvl, sp, min_skill_lvl, exp, success_rate76, success_rate77, success_rate78 FROM enchant_skill_trees ORDER BY skill_id, level");
+				PreparedStatement statement = con.prepareStatement("SELECT skill_id, level, base_lvl, sp, min_skill_lvl, exp, success_rate76, success_rate77, success_rate78, success_rate79, success_rate80, success_rate81, success_rate82, success_rate83, success_rate84, success_rate85 FROM enchant_skill_trees ORDER BY skill_id, level");
 				ResultSet skilltree3 = statement.executeQuery();
 				
 				int prevSkillId = -1;
@@ -258,7 +261,6 @@ public class SkillTreeTable
 				{
 					int id = skilltree3.getInt("skill_id");
 					int lvl = skilltree3.getInt("level");
-					String name = skilltree3.getString("name");
 					int baseLvl = skilltree3.getInt("base_lvl");
 					int minSkillLvl = skilltree3.getInt("min_skill_lvl");
 					int sp = skilltree3.getInt("sp");
@@ -266,6 +268,13 @@ public class SkillTreeTable
 					byte rate76 = skilltree3.getByte("success_rate76");
 					byte rate77 = skilltree3.getByte("success_rate77");
 					byte rate78 = skilltree3.getByte("success_rate78");
+					byte rate79 = skilltree3.getByte("success_rate79");
+					byte rate80 = skilltree3.getByte("success_rate80");
+					byte rate81 = skilltree3.getByte("success_rate81");
+					byte rate82 = skilltree3.getByte("success_rate82");
+					byte rate83 = skilltree3.getByte("success_rate83");
+					byte rate84 = skilltree3.getByte("success_rate84");
+					byte rate85 = skilltree3.getByte("success_rate85");
 					
 					if (prevSkillId != id)
 						prevSkillId = id;
@@ -276,7 +285,7 @@ public class SkillTreeTable
 						skill = new L2EnchantSkillLearn(id, baseLvl);
 						_enchantSkillTrees.put(id, skill);
 					}
-					EnchantSkillDetail esd = new EnchantSkillDetail(lvl, minSkillLvl, name, sp, exp, rate76, rate77, rate78);
+					EnchantSkillDetail esd = new EnchantSkillDetail(lvl, minSkillLvl, sp, exp, rate76, rate77, rate78, rate79, rate80, rate81, rate82, rate83, rate84, rate85);
 					skill.addEnchantDetail(esd);
 				}
 				
@@ -294,7 +303,7 @@ public class SkillTreeTable
 			{
 				_pledgeSkillTrees = new FastList<L2PledgeSkillLearn>();
 				
-				PreparedStatement statement = con.prepareStatement("SELECT skill_id, level, name, clan_lvl, repCost, itemId FROM pledge_skill_trees ORDER BY skill_id, level");
+				PreparedStatement statement = con.prepareStatement("SELECT skill_id, level, name, clan_lvl, repCost, itemId, itemCount FROM pledge_skill_trees ORDER BY skill_id, level");
 				ResultSet skilltree4 = statement.executeQuery();
 				
 				int prevSkillId = -1;
@@ -307,11 +316,12 @@ public class SkillTreeTable
 					int baseLvl = skilltree4.getInt("clan_lvl");
 					int sp = skilltree4.getInt("repCost");
 					int itemId = skilltree4.getInt("itemId");
+					int itemCount = skilltree4.getInt("itemCount");
 					
 					if (prevSkillId != id)
 						prevSkillId = id;
 					
-					L2PledgeSkillLearn skill = new L2PledgeSkillLearn(id, lvl, baseLvl, name, sp, itemId);
+					L2PledgeSkillLearn skill = new L2PledgeSkillLearn(id, lvl, baseLvl, name, sp, itemId, itemCount);
 					
 					_pledgeSkillTrees.add(skill);
 				}
@@ -361,6 +371,40 @@ public class SkillTreeTable
 			{
 				_log.log(Level.SEVERE, "Error while creating Transformation skill table ", e);
 			}
+			try
+			{
+				_specialSkillTrees = new FastList<L2SkillLearn>();
+				
+				PreparedStatement statement = con.prepareStatement("SELECT skill_id, level, name, costid, cost FROM special_skill_trees ORDER BY skill_id, level");
+				ResultSet skilltree6 = statement.executeQuery();
+				
+				int prevSkillId = -1;
+				
+				while (skilltree6.next())
+				{
+					int id = skilltree6.getInt("skill_id");
+					int lvl = skilltree6.getInt("level");
+					String name = skilltree6.getString("name");
+					int costId = skilltree6.getInt("costid");
+					int costCount = skilltree6.getInt("cost");
+					
+					if (prevSkillId != id)
+						prevSkillId = id;
+					
+					L2SkillLearn skill = new L2SkillLearn(id, lvl, 0, name, 0, costId, costCount);
+					
+					_specialSkillTrees.add(skill);
+				}
+				
+				skilltree6.close();
+				statement.close();
+				
+				count7 = _specialSkillTrees.size();
+			}
+			catch (Exception e)
+			{
+				_log.severe("Error while creating special skill table: " + e);
+			}
 		}
 		catch (Exception e)
 		{
@@ -382,6 +426,7 @@ public class SkillTreeTable
 		_log.config("EnchantSkillTreeTable: Loaded " + count4 + " enchant skills.");
 		_log.config("PledgeSkillTreeTable: Loaded " + count5 + " pledge skills");
 		_log.config("TransformSkillTreeTable: Loaded " + count6 + " transform skills");
+		_log.config("SpecialSkillTreeTable: Loaded " + count7 + " special skills");
 	}
 	
 	private Map<ClassId, Map<Integer, L2SkillLearn>> getSkillTrees()
@@ -489,6 +534,49 @@ public class SkillTreeTable
 		return result.toArray(new L2SkillLearn[result.size()]);
 	}
 	
+	public L2SkillLearn[] getAvailableSpecialSkills(L2PcInstance cha)
+	{
+		List<L2SkillLearn> result = new FastList<L2SkillLearn>();
+		List<L2SkillLearn> skills = new FastList<L2SkillLearn>();
+		
+		skills.addAll(_specialSkillTrees);
+		
+		if (skills == null)
+		{
+			// the skilltree for this class is undefined, so we give an empty list
+			_log.warning("Skilltree for special is not defined !");
+			return new L2SkillLearn[0];
+		}
+		
+		L2Skill[] oldSkills = cha.getAllSkills();
+		
+		for (L2SkillLearn temp : skills)
+		{
+			boolean knownSkill = false;
+				
+			for (int j = 0; j < oldSkills.length && !knownSkill; j++)
+			{
+				if (oldSkills[j].getId() == temp.getId())
+				{
+					knownSkill = true;
+						
+					if (oldSkills[j].getLevel() == temp.getLevel() - 1)
+					{
+						// this is the next level of a skill that we know
+						result.add(temp);
+					}
+				}
+			}
+				
+			if (!knownSkill && temp.getLevel() == 1)
+			{
+				// this is a new skill
+				result.add(temp);
+			}
+		}
+		
+		return result.toArray(new L2SkillLearn[result.size()]);
+	}
 	public L2EnchantSkillLearn getSkillEnchantmentForSkill(L2Skill skill)
 	{
 		L2EnchantSkillLearn esl = this.getSkillEnchantmentBySkillId(skill.getId());

+ 4 - 3
L2_GameServer/java/net/sf/l2j/gameserver/datatables/SpawnTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.Map;
@@ -63,7 +64,7 @@ public class SpawnTable
 	
 	private void fillSpawnTable()
 	{
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{
@@ -273,7 +274,7 @@ public class SpawnTable
 		
 		if (storeInDb)
 		{
-			java.sql.Connection con = null;
+			Connection con = null;
 			String spawnTable;
 			if (spawn.isCustom() && Config.CUSTOM_SPAWNLIST_TABLE)
 				spawnTable = "custom_spawnlist";
@@ -322,7 +323,7 @@ public class SpawnTable
 		
 		if (updateDb)
 		{
-			java.sql.Connection con = null;
+			Connection con = null;
 			if (Config.DELETE_GMSPAWN_ON_CUSTOM)
 			{
 				try

+ 2 - 1
L2_GameServer/java/net/sf/l2j/gameserver/datatables/TeleportLocationTable.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.datatables;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.Map;
@@ -56,7 +57,7 @@ public class TeleportLocationTable
 	{
 		_teleports = new FastMap<Integer, L2TeleportLocation>();
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 8 - 7
L2_GameServer/java/net/sf/l2j/gameserver/instancemanager/games/Lottery.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.instancemanager.games;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -88,7 +89,7 @@ public class Lottery
 	public void increasePrize(int count)
 	{
 		_prize += count;
-		java.sql.Connection con = null;
+		Connection con = null;
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -135,7 +136,7 @@ public class Lottery
 		
 		public void run()
 		{
-			java.sql.Connection con = null;
+			Connection con = null;
 			PreparedStatement statement;
 			try
 			{
@@ -326,7 +327,7 @@ public class Lottery
 			int count3 = 0;
 			int count4 = 0;
 			
-			java.sql.Connection con = null;
+			Connection con = null;
 			PreparedStatement statement;
 			try
 			{
@@ -420,8 +421,8 @@ public class Lottery
 				// There are winners.
 				sm = new SystemMessage(SystemMessageId.AMOUNT_FOR_WINNER_S1_IS_S2_ADENA_WE_HAVE_S3_PRIZE_WINNER);
 				sm.addNumber(getId());
-				sm.addNumber(getPrize());
-				sm.addNumber(count1);
+				sm.addItemNumber(getPrize());
+				sm.addItemNumber(count1);
 				Announcements.getInstance().announceToAll(sm);
 			}
 			else
@@ -429,7 +430,7 @@ public class Lottery
 				// There are no winners.
 				sm = new SystemMessage(SystemMessageId.AMOUNT_FOR_LOTTERY_S1_IS_S2_ADENA_NO_WINNER);
 				sm.addNumber(getId());
-				sm.addNumber(getPrize());
+				sm.addItemNumber(getPrize());
 				Announcements.getInstance().announceToAll(sm);
 			}
 			
@@ -515,7 +516,7 @@ public class Lottery
 			0, 0
 		};
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		PreparedStatement statement;
 		
 		try

+ 4 - 3
L2_GameServer/java/net/sf/l2j/gameserver/lib/SqlUtils.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.lib;
 
+import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.logging.Logger;
@@ -44,7 +45,7 @@ public class SqlUtils
 		String query = "";
 		Integer res = null;
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{
@@ -87,7 +88,7 @@ public class SqlUtils
 		String query = "";
 		Integer[] res = null;
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		try
 		{
@@ -144,7 +145,7 @@ public class SqlUtils
 		
 		String query = "";
 		
-		java.sql.Connection con = null;
+		Connection con = null;
 		
 		Integer res[][] = null;