BiggBoss 13 жил өмнө
parent
commit
ce026b011a
100 өөрчлөгдсөн 2617 нэмэгдсэн , 106 устгасан
  1. 106 106
      L2J_DataPack_BETA/data/door.csv
  2. 4 0
      L2J_DataPack_BETA/data/html/admin/castles.htm
  3. 35 0
      L2J_DataPack_BETA/data/html/admin/siegablehall.htm
  4. 8 0
      L2J_DataPack_BETA/data/html/clanHallManager/manage_siegable.htm
  5. 9 0
      L2J_DataPack_BETA/data/html/clanHallManager/vault-chs.htm
  6. 2 0
      L2J_DataPack_BETA/data/html/doormen/30596-busy.htm
  7. 1 0
      L2J_DataPack_BETA/data/html/doormen/30596-no.htm
  8. 6 0
      L2J_DataPack_BETA/data/html/doormen/30596.htm
  9. 2 0
      L2J_DataPack_BETA/data/html/doormen/35417-busy.htm
  10. 3 0
      L2J_DataPack_BETA/data/html/doormen/35417-no.htm
  11. 6 0
      L2J_DataPack_BETA/data/html/doormen/35417.htm
  12. 2 0
      L2J_DataPack_BETA/data/html/doormen/35418-busy.htm
  13. 3 0
      L2J_DataPack_BETA/data/html/doormen/35418-no.htm
  14. 6 0
      L2J_DataPack_BETA/data/html/doormen/35418.htm
  15. 2 0
      L2J_DataPack_BETA/data/html/doormen/35433-busy.htm
  16. 3 0
      L2J_DataPack_BETA/data/html/doormen/35433-no.htm
  17. 6 0
      L2J_DataPack_BETA/data/html/doormen/35433.htm
  18. 2 0
      L2J_DataPack_BETA/data/html/doormen/35434-busy.htm
  19. 3 0
      L2J_DataPack_BETA/data/html/doormen/35434-no.htm
  20. 6 0
      L2J_DataPack_BETA/data/html/doormen/35434.htm
  21. 2 0
      L2J_DataPack_BETA/data/html/doormen/35435-busy.htm
  22. 3 0
      L2J_DataPack_BETA/data/html/doormen/35435-no.htm
  23. 6 0
      L2J_DataPack_BETA/data/html/doormen/35435.htm
  24. 2 0
      L2J_DataPack_BETA/data/html/doormen/35436-busy.htm
  25. 3 0
      L2J_DataPack_BETA/data/html/doormen/35436-no.htm
  26. 6 0
      L2J_DataPack_BETA/data/html/doormen/35436.htm
  27. 2 0
      L2J_DataPack_BETA/data/html/doormen/35601-busy.htm
  28. 3 0
      L2J_DataPack_BETA/data/html/doormen/35601-no.htm
  29. 6 0
      L2J_DataPack_BETA/data/html/doormen/35601.htm
  30. 2 0
      L2J_DataPack_BETA/data/html/doormen/35602-busy.htm
  31. 3 0
      L2J_DataPack_BETA/data/html/doormen/35602-no.htm
  32. 6 0
      L2J_DataPack_BETA/data/html/doormen/35602.htm
  33. 2 0
      L2J_DataPack_BETA/data/html/doormen/35641-busy.htm
  34. 2 0
      L2J_DataPack_BETA/data/html/doormen/35641-no.htm
  35. 9 0
      L2J_DataPack_BETA/data/html/doormen/35641.htm
  36. 2 0
      L2J_DataPack_BETA/data/html/doormen/35642-busy.htm
  37. 2 0
      L2J_DataPack_BETA/data/html/doormen/35642-no.htm
  38. 9 0
      L2J_DataPack_BETA/data/html/doormen/35642.htm
  39. 2 0
      L2J_DataPack_BETA/data/html/siege/35420-busy.htm
  40. 2 0
      L2J_DataPack_BETA/data/html/siege/35639-busy.htm
  41. 8 0
      L2J_DataPack_BETA/data/scripts.cfg
  42. 694 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/BanditStrongHold.java
  43. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_1.htm
  44. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_10.htm
  45. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_11.htm
  46. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_12.htm
  47. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_13.htm
  48. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_14.htm
  49. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_15.htm
  50. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_16.htm
  51. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_17.htm
  52. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_18.htm
  53. 5 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_19.htm
  54. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_2.htm
  55. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_20.htm
  56. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_21.htm
  57. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_22.htm
  58. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_23.htm
  59. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_24.htm
  60. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_25.htm
  61. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_26.htm
  62. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_3.htm
  63. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4a.htm
  64. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4b.htm
  65. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4c.htm
  66. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4d.htm
  67. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4e.htm
  68. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_5.htm
  69. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_6.htm
  70. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_7.htm
  71. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_8.htm
  72. 1 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_9.htm
  73. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/azit_messenger_q0504_09.htm
  74. 126 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/DevastatedCastle/DevastatedCastle.java
  75. 167 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/FortressOfResistance/FortressOfResistance.java
  76. 4 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/FortressOfResistance/partisan_ordery_brakel001.htm
  77. 147 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java
  78. 782 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java
  79. 4 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/caretaker_main.htm
  80. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/caretaker_no_party.htm
  81. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/caretaker_not_allowed.htm
  82. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_alredy_registered.htm
  83. 7 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_explanation_1.htm
  84. 4 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_explanation_2.htm
  85. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_explanation_3.htm
  86. 8 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_main.htm
  87. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_no_level.htm
  88. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_notinlist.htm
  89. 5 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_nowardecrees.htm
  90. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_registered.htm
  91. 5 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_retrive_wardecrees.htm
  92. 6 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_unregister_confirmation.htm
  93. 6 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_unregister_confirmation_no_retrive.htm
  94. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/no_clan_leader.htm
  95. 4 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/yeti_cannot_exchange.htm
  96. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/yeti_item_exchange.htm
  97. 5 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/yeti_main.htm
  98. 3 0
      L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/yeti_passage_used.htm
  99. 2 0
      L2J_DataPack_BETA/data/scripts/handlers/MasterHandler.java
  100. 271 0
      L2J_DataPack_BETA/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java

+ 106 - 106
L2J_DataPack_BETA/data/door.csv

@@ -467,20 +467,20 @@ Automatic_Door;17170101;-87116;-16990;-8352;0;0;0;0;0;0;158250;644;518;0;False;F
 Automatic_Door;17170102;-86625;-16400;-8352;0;0;0;0;0;0;158250;644;518;0;False;False
 Automatic_Door;17170103;-87116;-15810;-8352;0;0;0;0;0;0;158250;644;518;0;False;False
 Red_Gate;17190001;-85056;47903;-3864;-85171;47895;-3864;-84941;47915;-3858;158250;644;518;17190012;False;False
-Clan_Hall_Door;17220001;-84495;155209;-3150;-84497;155208;-3192;-84494;155246;-2742;158250;644;518;0;False;False
-Clan_Hall_Door;17220002;-84495;155286;-3150;-84496;155248;-3192;-84494;155286;-2742;158250;644;518;0;False;False
-Clan_Hall_Door;17220003;-83961;155258;-3150;-83962;155218;-3191;-83960;155257;-2741;158250;644;518;0;False;False
-Clan_Hall_Door;17220004;-83961;155180;-3150;-83962;155180;-3191;-83960;155219;-2741;158250;644;518;0;False;False
-Clan_Hall_Door;17220005;-83879;153064;-3149;-83917;153062;-3149;-83878;153064;-2699;158250;644;518;0;False;False
-Clan_Hall_Door;17220006;-83956;153064;-3149;-83955;153061;-3149;-83916;153065;-2699;158250;644;518;0;False;False
-Clan_Hall_Door;17220007;-83927;153598;-3149;-83927;153597;-3190;-83889;153599;-2740;158250;644;518;0;False;False
-Clan_Hall_Door;17220008;-83850;153598;-3149;-83889;153597;-3190;-83850;153599;-2740;158250;644;518;0;False;False
-Clan_Hall_Door;17220009;-83971;151880;-3112;-84009;151879;-3152;-83971;151882;-2702;158250;644;518;0;False;False
-Clan_Hall_Door;17220010;-84047;151880;-3112;-84046;151879;-3152;-84008;151881;-2702;158250;644;518;0;False;False
-Clan_Hall_Door;17220011;-79737;150063;-3027;-79737;150062;-3067;-79735;150100;-2617;158250;644;518;0;False;False
-Clan_Hall_Door;17220012;-79737;150138;-3027;-79737;150099;-3067;-79735;150138;-2617;158250;644;518;0;False;False
-Clan_Hall_Door;17220013;-79740;151522;-3027;-79740;151522;-3068;-79738;151561;-2618;158250;644;518;0;False;False
-Clan_Hall_Door;17220014;-79740;151598;-3027;-79740;151558;-3068;-79738;151597;-2618;158250;644;518;0;False;False
+Clan_Hall_Door;17220001;-84495;155209;-3150;-84497;155208;-3192;-84494;155246;-2742;158250;644;518;0;False;False;True;28
+Clan_Hall_Door;17220002;-84495;155286;-3150;-84496;155248;-3192;-84494;155286;-2742;158250;644;518;0;False;False;True;28
+Clan_Hall_Door;17220003;-83961;155258;-3150;-83962;155218;-3191;-83960;155257;-2741;158250;644;518;0;False;False;True;28
+Clan_Hall_Door;17220004;-83961;155180;-3150;-83962;155180;-3191;-83960;155219;-2741;158250;644;518;0;False;False;True;28
+Clan_Hall_Door;17220005;-83879;153064;-3149;-83917;153062;-3149;-83878;153064;-2699;158250;644;518;0;False;False;True;27
+Clan_Hall_Door;17220006;-83956;153064;-3149;-83955;153061;-3149;-83916;153065;-2699;158250;644;518;0;False;False;True;27
+Clan_Hall_Door;17220007;-83927;153598;-3149;-83927;153597;-3190;-83889;153599;-2740;158250;644;518;0;False;False;True;27
+Clan_Hall_Door;17220008;-83850;153598;-3149;-83889;153597;-3190;-83850;153599;-2740;158250;644;518;0;False;False;True;27
+Clan_Hall_Door;17220009;-83971;151880;-3112;-84009;151879;-3152;-83971;151882;-2702;158250;644;518;0;False;False;True;26
+Clan_Hall_Door;17220010;-84047;151880;-3112;-84046;151879;-3152;-84008;151881;-2702;158250;644;518;0;False;False;True;26
+Clan_Hall_Door;17220011;-79737;150063;-3027;-79737;150062;-3067;-79735;150100;-2617;158250;644;518;0;False;False;True;29
+Clan_Hall_Door;17220012;-79737;150138;-3027;-79737;150099;-3067;-79735;150138;-2617;158250;644;518;0;False;False;True;29
+Clan_Hall_Door;17220013;-79740;151522;-3027;-79740;151522;-3068;-79738;151561;-2618;158250;644;518;0;False;False;True;30
+Clan_Hall_Door;17220014;-79740;151598;-3027;-79740;151558;-3068;-79738;151597;-2618;158250;644;518;0;False;False;True;30
 Secret_Oracle_of_Dawn_Gate;17240001;-75606;213414;-7154;0;0;0;0;0;0;158250;644;518;0;False;False
 Secret_Oracle_of_Dawn_Gate;17240002;-75606;213414;-7154;0;0;0;0;0;0;158250;644;518;0;False;False
 Secret_Oracle_of_Dawn_Gate;17240003;-78455;205854;-7920;0;0;0;0;0;0;158250;644;518;0;False;False
@@ -646,14 +646,14 @@ Altar_Entrance;19160016;-15363;-54862;-10402;-15388;-55020;-10487;-15339;-54697;
 Altar_Entrance;19160017;-17424;-54862;-10403;-17449;-55020;-10487;-17400;-54696;-10325;158250;644;518;0;False;False
 Olympiad_Gate;19170001;-21667;-21072;-3037;0;0;0;0;0;0;158250;644;518;0;False;False
 Olympiad_Gate;19170002;-20027;-21072;-3037;0;0;0;0;0;0;158250;644;518;0;False;False
-Clan_Hall_Door;19210011;-14790;125633;-3123;-14791;125595;-3158;-14789;125632;-2708;158250;644;518;0;False;False
-Clan_Hall_Door;19210012;-14790;125557;-3123;-14791;125557;-3158;-14789;125594;-2708;158250;644;518;0;False;False
-Clan_Hall_Door;19210013;-14116;125602;-3122;-14117;125602;-3157;-14115;125639;-2707;158250;644;518;0;False;False
-Clan_Hall_Door;19210014;-14116;125677;-3122;-14117;125640;-3157;-14115;125677;-2707;158250;644;518;0;False;False
-Clan_Hall_Door;19210015;-12601;123885;-3096;-12637;123884;-3131;-12600;123886;-2681;158250;644;518;0;False;False
-Clan_Hall_Door;19210016;-12676;123885;-3096;-12676;123884;-3131;-12639;123886;-2681;158250;644;518;0;False;False
-Clan_Hall_Door;19210017;-15981;123747;-3096;-15981;123734;-3131;-15945;123747;-2681;158250;644;518;0;False;False
-Clan_Hall_Door;19210018;-15909;123725;-3096;-15945;123723;-3131;-15909;123736;-2681;158250;644;518;0;False;False
+Clan_Hall_Door;19210011;-14790;125633;-3123;-14791;125595;-3158;-14789;125632;-2708;158250;644;518;0;False;False;True;23
+Clan_Hall_Door;19210012;-14790;125557;-3123;-14791;125557;-3158;-14789;125594;-2708;158250;644;518;0;False;False;True;23
+Clan_Hall_Door;19210013;-14116;125602;-3122;-14117;125602;-3157;-14115;125639;-2707;158250;644;518;0;False;False;True;24
+Clan_Hall_Door;19210014;-14116;125677;-3122;-14117;125640;-3157;-14115;125677;-2707;158250;644;518;0;False;False;True;24
+Clan_Hall_Door;19210015;-12601;123885;-3096;-12637;123884;-3131;-12600;123886;-2681;158250;644;518;0;False;False;True;25
+Clan_Hall_Door;19210016;-12676;123885;-3096;-12676;123884;-3131;-12639;123886;-2681;158250;644;518;0;False;False;True;25
+Clan_Hall_Door;19210017;-15981;123747;-3096;-15981;123734;-3131;-15945;123747;-2681;158250;644;518;0;False;False;True;22
+Clan_Hall_Door;19210018;-15909;123725;-3096;-15945;123723;-3131;-15909;123736;-2681;158250;644;518;0;False;False;True;22
 Gate;19250001;-28564;249888;-3505;-28569;249877;-3505;-28499;249904;-3505;158250;644;518;0;False;False
 Gate;19250002;-28438;249888;-3505;-28515;249873;-3505;-28416;249904;-3505;158250;644;518;0;False;False
 Old_Gate;19250003;-27410;252390;-3550;-27429;252382;-3550;-27390;252459;-3550;158250;644;518;0;False;False
@@ -688,12 +688,12 @@ Tullys_Gate;19260054;-13307;274610;-15216;0;0;0;0;0;0;158250;644;518;0;False;Fal
 System_Control_Room;20210001;17624;112427;-6456;17506;112402;-6625;17741;112452;-6287;150000;476;383;0;True;False
 System_Control_Room;20210002;17820;112427;-6456;17705;112402;-6627;17938;112452;-6289;150000;476;383;0;True;False
 System_Control_Room;20210003;17721;112427;-6579;17623;112396;-6628;17819;112459;-6530;150000;476;383;0;True;False
-Clan_Hall_Door;20220011;18879;143353;-2998;18874;143315;-3039;18880;143353;-2589;158250;644;518;0;False;False
-Clan_Hall_Door;20220012;18872;143278;-2998;18871;143278;-3039;18877;143316;-2589;158250;644;518;0;False;False
-Clan_Hall_Door;20220013;17616;145185;-3025;17616;145183;-3066;17648;145206;-2616;158250;644;518;0;False;False
-Clan_Hall_Door;20220014;17679;145226;-3025;17646;145204;-3066;17679;145227;-2616;158250;644;518;0;False;False
-Clan_Hall_Door;20220015;20118;145995;-3099;20118;145992;-3140;20155;145996;-2690;158250;644;518;0;False;False
-Clan_Hall_Door;20220016;20193;145995;-3099;20156;145993;-3140;20193;145995;-2690;158250;644;518;0;False;False
+Clan_Hall_Door;20220011;18879;143353;-2998;18874;143315;-3039;18880;143353;-2589;158250;644;518;0;False;False;True;32
+Clan_Hall_Door;20220012;18872;143278;-2998;18871;143278;-3039;18877;143316;-2589;158250;644;518;0;False;False;True;32
+Clan_Hall_Door;20220013;17616;145185;-3025;17616;145183;-3066;17648;145206;-2616;158250;644;518;0;False;False;True;31
+Clan_Hall_Door;20220014;17679;145226;-3025;17646;145204;-3066;17679;145227;-2616;158250;644;518;0;False;False;True;31
+Clan_Hall_Door;20220015;20118;145995;-3099;20118;145992;-3140;20155;145996;-2690;158250;644;518;0;False;False;True;33
+Clan_Hall_Door;20220016;20193;145995;-3099;20156;145993;-3140;20193;145995;-2690;158250;644;518;0;False;False;True;33
 Gate;20240001;16326;210714;-9399;0;0;0;0;0;0;158250;644;518;0;False;False
 Gate;20240002;14032;213143;-9399;0;0;0;0;0;0;158250;644;518;0;False;False
 Gate;20240003;12472;214696;-9384;0;0;0;0;0;0;158250;644;518;0;False;False
@@ -722,28 +722,28 @@ Fence;21150006;56863;-93651;-1383;56697;-93815;-1394;57010;-93497;-1372;158250;6
 Fence;21150007;56629;-91998;-1380;56516;-92178;-1391;56731;-91807;-1369;158250;644;518;0;False;False
 Fence;21150008;58173;-91247;-1380;57979;-91316;-1391;58373;-91198;-1369;158250;644;518;0;False;False
 Fence;21150009;59320;-92518;-1380;59264;-92718;-1391;59368;-92322;-1369;158250;644;518;0;False;False
-Clan_Hall_Door;21160001;37708;-50424;910;37681;-50451;900;37735;-50397;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160002;37743;-50424;910;37716;-50451;900;37770;-50397;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160003;38550;-50140;910;38523;-50167;900;38577;-50113;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160004;38585;-50123;910;38558;-50150;900;38612;-50096;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160005;39130;-49515;910;39103;-49542;900;39157;-49488;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160006;39148;-49482;910;39121;-49509;900;39175;-49455;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160007;39338;-48266;908;39311;-48293;898;39365;-48239;1348;158250;644;518;0;False;False
-Clan_Hall_Door;21160008;39338;-48222;908;39311;-48249;898;39365;-48195;1348;158250;644;518;0;False;False
-Clan_Hall_Door;21160009;39161;-47001;910;39134;-47028;900;39188;-46974;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160010;39140;-46969;910;39113;-46996;900;39167;-46942;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160011;38601;-46360;910;38574;-46387;900;38628;-46333;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160012;38562;-46347;910;38535;-46374;900;38589;-46320;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160013;37762;-46049;910;37735;-46076;900;37789;-46022;1350;158250;644;518;0;False;False
-Clan_Hall_Door;21160014;37718;-46046;910;37691;-46073;900;37745;-46019;1350;158250;644;518;0;False;False
-Outer_Gate;21170001;57857;-29480;707;57849;-29498;543;57969;-29465;869;158250;644;518;0;False;False
-Outer_Gate;21170002;58061;-29479;707;57954;-29498;543;58071;-29465;869;158250;644;518;0;False;False
-Door;21170003;56977;-27193;639;56972;-27259;550;56982;-27188;728;158250;644;518;0;False;False
-Door;21170004;56977;-27318;639;56971;-27323;550;56981;-27251;726;158250;644;518;0;False;False
-Door;21170005;57902;-26392;654;57893;-26401;563;57976;-26382;743;158250;644;518;0;False;False
-Door;21170006;58024;-26391;654;57953;-26400;563;58037;-26383;743;158250;644;518;0;False;False
-Gate;21210001;43643;108908;-1970;43643;108840;-2015;43651;108915;-1565;158250;644;518;0;False;False
-Gate;21210002;43643;108783;-1970;43643;108778;-2015;43651;108853;-1565;158250;644;518;0;False;False
+Clan_Hall_Door;21160001;37708;-50424;910;37681;-50451;900;37735;-50397;1350;158250;644;518;0;False;False;True;51
+Clan_Hall_Door;21160002;37743;-50424;910;37716;-50451;900;37770;-50397;1350;158250;644;518;0;False;False;True;51
+Clan_Hall_Door;21160003;38550;-50140;910;38523;-50167;900;38577;-50113;1350;158250;644;518;0;False;False;True;52
+Clan_Hall_Door;21160004;38585;-50123;910;38558;-50150;900;38612;-50096;1350;158250;644;518;0;False;False;True;52
+Clan_Hall_Door;21160005;39130;-49515;910;39103;-49542;900;39157;-49488;1350;158250;644;518;0;False;False;True;53
+Clan_Hall_Door;21160006;39148;-49482;910;39121;-49509;900;39175;-49455;1350;158250;644;518;0;False;False;True;53
+Clan_Hall_Door;21160007;39338;-48266;908;39311;-48293;898;39365;-48239;1348;158250;644;518;0;False;False;True;54
+Clan_Hall_Door;21160008;39338;-48222;908;39311;-48249;898;39365;-48195;1348;158250;644;518;0;False;False;True;54
+Clan_Hall_Door;21160009;39161;-47001;910;39134;-47028;900;39188;-46974;1350;158250;644;518;0;False;False;True;55
+Clan_Hall_Door;21160010;39140;-46969;910;39113;-46996;900;39167;-46942;1350;158250;644;518;0;False;False;True;55
+Clan_Hall_Door;21160011;38601;-46360;910;38574;-46387;900;38628;-46333;1350;158250;644;518;0;False;False;True;56
+Clan_Hall_Door;21160012;38562;-46347;910;38535;-46374;900;38589;-46320;1350;158250;644;518;0;False;False;True;56
+Clan_Hall_Door;21160013;37762;-46049;910;37735;-46076;900;37789;-46022;1350;158250;644;518;0;False;False;True;57
+Clan_Hall_Door;21160014;37718;-46046;910;37691;-46073;900;37745;-46019;1350;158250;644;518;0;False;False;True;57
+Outer_Gate;21170001;57857;-29480;707;57849;-29498;543;57969;-29465;869;158250;644;518;0;False;False;True;64
+Outer_Gate;21170002;58061;-29479;707;57954;-29498;543;58071;-29465;869;158250;644;518;0;False;False;True;64
+Door;21170003;56977;-27193;639;56972;-27259;550;56982;-27188;728;158250;644;518;0;False;False;True;64
+Door;21170004;56977;-27318;639;56971;-27323;550;56981;-27251;726;158250;644;518;0;False;False;True;64
+Door;21170005;57902;-26392;654;57893;-26401;563;57976;-26382;743;158250;644;518;0;False;False;True;64
+Door;21170006;58024;-26391;654;57953;-26400;563;58037;-26383;743;158250;644;518;0;False;False;True;64
+Gate;21210001;43643;108908;-1970;43643;108840;-2015;43651;108915;-1565;158250;644;518;0;False;False;True;21
+Gate;21210002;43643;108783;-1970;43643;108778;-2015;43651;108853;-1565;158250;644;518;0;False;False;True;21
 Gate;21240001;42001;208378;-3666;41864;208287;-3785;42006;208383;-3540;187500;100000;10000;0;True;False
 Gate;21240002;43745;212594;-3623;43741;212433;-3742;43749;212600;-3497;187500;100000;10000;0;True;False
 Gate;21240003;42167;213285;-3643;42085;213285;-3760;42247;213286;-3515;187500;476;383;0;True;False
@@ -756,28 +756,28 @@ Gate;22110102;76503;-213542;-3624;76487;-213565;-3751;76521;-213372;-3551;158250
 Gate;22110103;85650;-219265;-3695;85635;-219352;-3817;85663;-219181;-3617;158250;644;518;0;False;False
 Gate;22110104;74935;-212702;-3639;74844;-212712;-3761;75024;-212687;-3561;158250;644;518;0;False;False
 Gate;22110105;85195;-206881;-3215;0;0;0;0;0;0;158250;644;518;0;False;False
-Clan_Hall_Door;22130017;86104;-143237;-1352;86098;-143241;-1353;86114;-143190;-903;158250;644;518;0;False;False
-Clan_Hall_Door;22130018;86115;-143148;-1352;86104;-143196;-1352;86120;-143144;-902;158250;644;518;0;False;False
-Clan_Hall_Door;22130019;86730;-142226;-1352;86725;-142232;-1352;86775;-142199;-902;158250;644;518;0;False;False
-Clan_Hall_Door;22130020;86809;-142184;-1352;86765;-142211;-1352;86814;-142177;-902;158250;644;518;0;False;False
-Clan_Hall_Door;22130021;87920;-142192;-1352;87915;-142218;-1352;87964;-142186;-902;158250;644;518;0;False;False
-Clan_Hall_Door;22130022;87999;-142234;-1352;87955;-142239;-1352;88004;-142207;-902;158250;644;518;0;False;False
-Clan_Hall_Door;22130023;88621;-143156;-1352;88615;-143205;-1352;88633;-143153;-902;158250;644;518;0;False;False
-Clan_Hall_Door;22130024;88633;-143246;-1352;88621;-143249;-1353;88639;-143197;-903;158250;644;518;0;False;False
-Iron_Gate;22170001;85621;-18127;-1670;85411;-18299;-1821;85633;-18118;-1471;158250;644;518;0;False;False
-Iron_Gate;22170002;85213;-18458;-1670;85206;-18466;-1821;85425;-18288;-1471;158250;644;518;0;False;False
-Gate;22170003;80818;-15357;-1762;80815;-15445;-1829;80821;-15349;-1379;158250;644;518;0;False;False
-Gate;22170004;80818;-15518;-1762;80815;-15525;-1829;80820;-15431;-1379;158250;644;518;0;False;False
-Clan_Hall_Door;22220003;81873;151944;-3488;81870;151892;-3545;81877;151944;-3095;126600;644;518;0;False;False
-Clan_Hall_Door;22220004;81873;151843;-3488;81870;151842;-3545;81877;151894;-3095;126600;644;518;0;False;False
-Clan_Hall_Door;22220005;81197;151657;-3491;81192;151605;-3546;81200;151658;-3096;158250;644;518;0;False;False
-Clan_Hall_Door;22220006;81197;151556;-3491;81192;151555;-3546;81200;151607;-3096;158250;644;518;0;False;False
-Clan_Hall_Door;22220007;78622;148328;-3554;78570;148323;-3614;78623;148331;-3164;158250;644;518;0;False;False
-Clan_Hall_Door;22220008;78522;148328;-3554;78520;148323;-3614;78572;148331;-3164;158250;644;518;0;False;False
-Clan_Hall_Door;22220009;81832;145368;-3490;81827;145316;-3546;81835;145369;-3096;158250;644;518;0;False;False
-Clan_Hall_Door;22220010;81832;145267;-3490;81828;145265;-3546;81835;145319;-3096;158250;644;518;0;False;False
-Clan_Hall_Door;22220011;83619;145383;-3360;83614;145330;-3417;83623;145383;-2967;158250;644;518;0;False;False
-Clan_Hall_Door;22220012;83619;145282;-3360;83614;145280;-3417;83622;145332;-2967;158250;644;518;0;False;False
+Clan_Hall_Door;22130017;86104;-143237;-1352;86098;-143241;-1353;86114;-143190;-903;158250;644;518;0;False;False;True;58
+Clan_Hall_Door;22130018;86115;-143148;-1352;86104;-143196;-1352;86120;-143144;-902;158250;644;518;0;False;False;True;58
+Clan_Hall_Door;22130019;86730;-142226;-1352;86725;-142232;-1352;86775;-142199;-902;158250;644;518;0;False;False;True;59
+Clan_Hall_Door;22130020;86809;-142184;-1352;86765;-142211;-1352;86814;-142177;-902;158250;644;518;0;False;False;True;59
+Clan_Hall_Door;22130021;87920;-142192;-1352;87915;-142218;-1352;87964;-142186;-902;158250;644;518;0;False;False;True;60
+Clan_Hall_Door;22130022;87999;-142234;-1352;87955;-142239;-1352;88004;-142207;-902;158250;644;518;0;False;False;True;60
+Clan_Hall_Door;22130023;88621;-143156;-1352;88615;-143205;-1352;88633;-143153;-902;158250;644;518;0;False;False;True;61
+Clan_Hall_Door;22130024;88633;-143246;-1352;88621;-143249;-1353;88639;-143197;-903;158250;644;518;0;False;False;True;61
+Iron_Gate;22170001;85621;-18127;-1670;85411;-18299;-1821;85633;-18118;-1471;158250;644;518;0;False;False;True;35
+Iron_Gate;22170002;85213;-18458;-1670;85206;-18466;-1821;85425;-18288;-1471;158250;644;518;0;False;False;True;35
+Gate;22170003;80818;-15357;-1762;80815;-15445;-1829;80821;-15349;-1379;158250;644;518;0;False;False;True;35
+Gate;22170004;80818;-15518;-1762;80815;-15525;-1829;80820;-15431;-1379;158250;644;518;0;False;False;True;35
+Clan_Hall_Door;22220003;81873;151944;-3488;81870;151892;-3545;81877;151944;-3095;126600;644;518;0;False;False;True;46
+Clan_Hall_Door;22220004;81873;151843;-3488;81870;151842;-3545;81877;151894;-3095;126600;644;518;0;False;False;True;46
+Clan_Hall_Door;22220005;81197;151657;-3491;81192;151605;-3546;81200;151658;-3096;158250;644;518;0;False;False;True;45
+Clan_Hall_Door;22220006;81197;151556;-3491;81192;151555;-3546;81200;151607;-3096;158250;644;518;0;False;False;True;45
+Clan_Hall_Door;22220007;78622;148328;-3554;78570;148323;-3614;78623;148331;-3164;158250;644;518;0;False;False;True;42
+Clan_Hall_Door;22220008;78522;148328;-3554;78520;148323;-3614;78572;148331;-3164;158250;644;518;0;False;False;True;42
+Clan_Hall_Door;22220009;81832;145368;-3490;81827;145316;-3546;81835;145369;-3096;158250;644;518;0;False;False;True;43
+Clan_Hall_Door;22220010;81832;145267;-3490;81828;145265;-3546;81835;145319;-3096;158250;644;518;0;False;False;True;43
+Clan_Hall_Door;22220011;83619;145383;-3360;83614;145330;-3417;83623;145383;-2967;158250;644;518;0;False;False;True;44
+Clan_Hall_Door;22220012;83619;145282;-3360;83614;145280;-3417;83622;145332;-2967;158250;644;518;0;False;False;True;44
 goe_Water_Wall;22250001;86226;247063;-8584;86085;246961;-8845;86364;247162;-8333;187500;476;383;0;False;False
 goe_Water_Wall;22250002;88491;253871;-8584;88436;253707;-8845;88546;254031;-8333;187500;476;383;0;False;False
 goe_Water_Wall;22250003;76873;253954;-8584;76816;253788;-8856;76928;254118;-8344;187500;476;383;0;False;False
@@ -820,35 +820,35 @@ aden_tower_Gate;23180003;113253;15914;4115;113178;15874;3937;113326;15954;4292;1
 aden_tower_Gate;23180004;113117;15970;4115;113043;15930;3938;113191;16010;4293;187500;476;383;0;False;True
 aden_tower_Gate;23180005;113264;15765;7146;113201;15703;6968;113325;15826;7323;187500;476;383;0;False;True
 aden_tower_Gate;23180006;113368;15869;7146;113305;15806;6968;113429;15930;7323;187500;476;383;0;False;True
-Clan_Hall_Door;24140001;140728;-124477;-1894;140725;-124478;-1913;140754;-124437;-1463;158250;644;518;0;False;False
-Clan_Hall_Door;24140002;140778;-124402;-1894;140750;-124440;-1923;140779;-124399;-1473;158250;644;518;0;False;False
-Clan_Hall_Door;24140003;141149;-124310;-1894;141146;-124336;-1921;141187;-124306;-1471;158250;644;518;0;False;False
-Clan_Hall_Door;24140004;141224;-124360;-1894;141184;-124361;-1920;141225;-124332;-1470;158250;644;518;0;False;False
-Clan_Hall_Door;24140005;141281;-124738;-1894;141253;-124777;-1949;141282;-124735;-1499;158250;644;518;0;False;False
-Clan_Hall_Door;24140006;141231;-124813;-1894;141228;-124814;-1947;141258;-124772;-1497;158250;644;518;0;False;False
-Door;24140007;140702;-123836;-1932;140700;-123886;-1942;140715;-123835;-1492;158250;644;518;0;False;False
-Door;24140008;140722;-123934;-1932;140709;-123935;-1941;140723;-123884;-1491;158250;644;518;0;False;False
-Clan_Hall_Door;24160001;146439;-55458;-2792;146432;-55506;-2821;146450;-55453;-2371;158250;644;518;0;False;False
-Clan_Hall_Door;24160002;146450;-55548;-2792;146437;-55552;-2819;146455;-55497;-2369;158250;644;518;0;False;False
-Clan_Hall_Door;24160003;147072;-56472;-2792;147065;-56500;-2815;147117;-56465;-2365;158250;644;518;0;False;False
-Clan_Hall_Door;24160004;147151;-56514;-2792;147105;-56522;-2818;147158;-56486;-2368;158250;644;518;0;False;False
-Clan_Hall_Door;24160005;148263;-56520;-2792;148255;-56529;-2823;148310;-56490;-2373;158250;644;518;0;False;False
-Clan_Hall_Door;24160006;148342;-56478;-2792;148296;-56508;-2824;148348;-56470;-2374;158250;644;518;0;False;False
-Clan_Hall_Door;24160007;148971;-55558;-2792;148965;-55561;-2812;148982;-55509;-2362;158250;644;518;0;False;False
-Clan_Hall_Door;24160008;148982;-55468;-2792;148970;-55520;-2821;148988;-55464;-2371;158250;644;518;0;False;False
+Clan_Hall_Door;24140001;140728;-124477;-1894;140725;-124478;-1913;140754;-124437;-1463;158250;644;518;0;False;False;True;62
+Clan_Hall_Door;24140002;140778;-124402;-1894;140750;-124440;-1923;140779;-124399;-1473;158250;644;518;0;False;False;True;62
+Clan_Hall_Door;24140003;141149;-124310;-1894;141146;-124336;-1921;141187;-124306;-1471;158250;644;518;0;False;False;True;62
+Clan_Hall_Door;24140004;141224;-124360;-1894;141184;-124361;-1920;141225;-124332;-1470;158250;644;518;0;False;False;True;62
+Clan_Hall_Door;24140005;141281;-124738;-1894;141253;-124777;-1949;141282;-124735;-1499;158250;644;518;0;False;False;True;62
+Clan_Hall_Door;24140006;141231;-124813;-1894;141228;-124814;-1947;141258;-124772;-1497;158250;644;518;0;False;False;True;62
+Door;24140007;140702;-123836;-1932;140700;-123886;-1942;140715;-123835;-1492;158250;644;518;0;False;False;True;62
+Door;24140008;140722;-123934;-1932;140709;-123935;-1941;140723;-123884;-1491;158250;644;518;0;False;False;True;62
+Clan_Hall_Door;24160001;146439;-55458;-2792;146432;-55506;-2821;146450;-55453;-2371;158250;644;518;0;False;False;True;47
+Clan_Hall_Door;24160002;146450;-55548;-2792;146437;-55552;-2819;146455;-55497;-2369;158250;644;518;0;False;False;True;47
+Clan_Hall_Door;24160003;147072;-56472;-2792;147065;-56500;-2815;147117;-56465;-2365;158250;644;518;0;False;False;True;48
+Clan_Hall_Door;24160004;147151;-56514;-2792;147105;-56522;-2818;147158;-56486;-2368;158250;644;518;0;False;False;True;48
+Clan_Hall_Door;24160005;148263;-56520;-2792;148255;-56529;-2823;148310;-56490;-2373;158250;644;518;0;False;False;True;49
+Clan_Hall_Door;24160006;148342;-56478;-2792;148296;-56508;-2824;148348;-56470;-2374;158250;644;518;0;False;False;True;49
+Clan_Hall_Door;24160007;148971;-55558;-2792;148965;-55561;-2812;148982;-55509;-2362;158250;644;518;0;False;False;True;50
+Clan_Hall_Door;24160008;148982;-55468;-2792;148970;-55520;-2821;148988;-55464;-2371;158250;644;518;0;False;False;True;50
 Gateway;24170001;157981;-25122;-1196;157859;-25172;-1344;158104;-25069;-1088;158250;644;518;0;False;False
-Clan_Hall_Door;24180022;145358;25385;-2090;145356;25343;-2142;145360;25385;-1692;158250;644;518;0;False;False
-Clan_Hall_Door;24180023;145358;25304;-2090;145356;25304;-2142;145360;25345;-1692;158250;644;518;0;False;False
-Clan_Hall_Door;24180024;149438;23177;-2100;149437;23135;-2152;149439;23176;-1702;158250;644;518;0;False;False
-Clan_Hall_Door;24180025;149438;23095;-2100;149437;23095;-2152;149439;23136;-1702;158250;644;518;0;False;False
-Clan_Hall_Door;24180026;150299;23695;-2090;150297;23653;-2141;150301;23695;-1691;158250;644;518;0;False;False
-Clan_Hall_Door;24180027;150299;23614;-2090;150297;23614;-2141;150301;23656;-1691;158250;644;518;0;False;False
-Clan_Hall_Door;24180028;150444;26584;-2226;150443;26542;-2278;150446;26583;-1828;158250;644;518;0;False;False
-Clan_Hall_Door;24180029;150444;26502;-2226;150443;26502;-2278;150445;26543;-1828;158250;644;518;0;False;False
-Clan_Hall_Door;24180030;144359;28239;-2218;144357;28197;-2270;144359;28238;-1820;158250;644;518;0;False;False
-Clan_Hall_Door;24180031;144359;28158;-2218;144357;28157;-2270;144359;28198;-1820;158250;644;518;0;False;False
-Clan_Hall_Door;24180032;144294;27131;-2228;144293;27089;-2280;144295;27130;-1830;158250;644;518;0;False;False
-Clan_Hall_Door;24180033;144294;27049;-2228;144293;27049;-2280;144295;27090;-1830;158250;644;518;0;False;False
+Clan_Hall_Door;24180022;145358;25385;-2090;145356;25343;-2142;145360;25385;-1692;158250;644;518;0;False;False;True;38
+Clan_Hall_Door;24180023;145358;25304;-2090;145356;25304;-2142;145360;25345;-1692;158250;644;518;0;False;False;True;38
+Clan_Hall_Door;24180024;149438;23177;-2100;149437;23135;-2152;149439;23176;-1702;158250;644;518;0;False;False;True;36
+Clan_Hall_Door;24180025;149438;23095;-2100;149437;23095;-2152;149439;23136;-1702;158250;644;518;0;False;False;True;36
+Clan_Hall_Door;24180026;150299;23695;-2090;150297;23653;-2141;150301;23695;-1691;158250;644;518;0;False;False;True;37
+Clan_Hall_Door;24180027;150299;23614;-2090;150297;23614;-2141;150301;23656;-1691;158250;644;518;0;False;False;True;37
+Clan_Hall_Door;24180028;150444;26584;-2226;150443;26542;-2278;150446;26583;-1828;158250;644;518;0;False;False;True;39
+Clan_Hall_Door;24180029;150444;26502;-2226;150443;26502;-2278;150445;26543;-1828;158250;644;518;0;False;False;True;39
+Clan_Hall_Door;24180030;144359;28239;-2218;144357;28197;-2270;144359;28238;-1820;158250;644;518;0;False;False;True;41
+Clan_Hall_Door;24180031;144359;28158;-2218;144357;28157;-2270;144359;28198;-1820;158250;644;518;0;False;False;True;41
+Clan_Hall_Door;24180032;144294;27131;-2228;144293;27089;-2280;144295;27130;-1830;158250;644;518;0;False;False;True;40
+Clan_Hall_Door;24180033;144294;27049;-2228;144293;27049;-2280;144295;27090;-1830;158250;644;518;0;False;False;True;40
 West_Gate;24190001;147086;46721;-3289;147075;46641;-3434;147099;46800;-3178;687500;644;518;0;False;True
 West_Gate;24190002;148045;46721;-3289;148034;46642;-3435;148057;46800;-3179;687500;644;518;0;False;True
 East_Gate;24190003;150951;46721;-3289;150939;46640;-3435;150961;46797;-3179;687500;644;518;0;False;True
@@ -942,9 +942,9 @@ Counts_Hall_Gate;25150033;173214;-82974;-7072;173034;-83033;-7259;173388;-82966;
 Marquis_Hall_Gate;25150034;173212;-81165;-7066;173034;-81221;-7254;173388;-81152;-6998;158250;644;518;0;False;False
 Dukes_Hall_Gate;25150035;173208;-79393;-7061;173035;-79450;-7253;173391;-79384;-6997;158250;644;518;0;False;False
 Emperors_Grave_Gate;25150036;173198;-77563;-7063;173019;-77621;-7253;173369;-77558;-6997;158250;644;518;0;False;False
-Outer_Castle_Gate;25170001;178212;-15038;-2135;178211;-15038;-2294;178342;-15017;-1976;158250;644;518;0;False;False
-Outer_Castle_Gate;25170002;178468;-15038;-2135;178339;-15038;-2295;178469;-15017;-1977;158250;644;518;0;False;False
-Gate;25170003;178119;-18220;-2210;178120;-18225;-2286;178183;-18211;-1836;79125;644;518;0;False;False
-Gate;25170004;178247;-18220;-2210;178182;-18225;-2286;178245;-18211;-1836;79125;644;518;0;False;False
-Gate;25170005;178298;-18573;-2233;178302;-18611;-2287;178309;-18573;-1837;79125;644;518;0;False;False
-Gate;25170006;178298;-18650;-2233;178302;-18648;-2287;178309;-18610;-1837;79125;644;518;0;False;False
+Outer_Castle_Gate;25170001;178212;-15038;-2135;178211;-15038;-2294;178342;-15017;-1976;158250;644;518;0;False;False;True;34
+Outer_Castle_Gate;25170002;178468;-15038;-2135;178339;-15038;-2295;178469;-15017;-1977;158250;644;518;0;False;False;True;34
+Gate;25170003;178119;-18220;-2210;178120;-18225;-2286;178183;-18211;-1836;79125;644;518;0;False;False;True;34
+Gate;25170004;178247;-18220;-2210;178182;-18225;-2286;178245;-18211;-1836;79125;644;518;0;False;False;True;34
+Gate;25170005;178298;-18573;-2233;178302;-18611;-2287;178309;-18573;-1837;79125;644;518;0;False;False;True;34
+Gate;25170006;178298;-18650;-2233;178302;-18648;-2287;178309;-18610;-1837;79125;644;518;0;False;False;True;34

+ 4 - 0
L2J_DataPack_BETA/data/html/admin/castles.htm

@@ -9,6 +9,10 @@
 <table width=270><tr>
 %castles%
 </tr></table>
+<br>Siegable Clan Halls:<br>
+<table width=270><tr>
+%siegableHalls%
+</tr></table>
 <br>Clan Halls:<br>
 <table width=270><tr>
 %clanhalls%

+ 35 - 0
L2J_DataPack_BETA/data/html/admin/siegablehall.htm

@@ -0,0 +1,35 @@
+<html><body>
+<table width=270><tr>
+<td width=45><button value="Main" action="bypass -h admin_admin" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+<td width=180><center>Siege Menu</center></td>
+<td width=45><button value="Back" action="bypass -h admin_siege" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+</tr></table><center>
+<br>ClanHall: %clanhallName%<br1>
+ClanHall Owner: %clanhallOwner%
+<br>
+<center>
+<edit var="box" width=120 height=15>
+</center>
+<br>
+<table><tr>
+<td><button value="Open Doors" action="bypass -h admin_clanhallopendoors %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+<td><button value="Close Doors" action="bypass -h admin_clanhallclosedoors %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+</tr><tr>
+<td><button value="Give ClanHall" action="bypass -h admin_clanhallset %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+<td><button value="Take ClanHall" action="bypass -h admin_clanhalldel %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+</tr><tr>
+<td><button value="Start Siege" action="bypass -h admin_chsiege_startSiege %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+<td><button value="End Siege" action="bypass -h admin_chsiege_endsSiege %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+</tr><tr>
+<td><button value="Add Attacker" action="bypass -h admin_chsiege_addAttacker %clanhallId% $box" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+<td><button value="Remove Attacker" action="bypass -h admin_chsiege_removeAttacker %clanhallId% $box" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+</tr><tr>
+<td><button value="List Attackers" action="bypass -h admin_chsiege_listAttackers %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+<td><button value="Clear Attackers" action="bypass -h admin_chsiege_clearAttackers %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+</tr><tr>
+<td><button value="Set Siege Date" action="bypass -h admin_chsiege_setSiegeDate %clanhallId% $box" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+<td><button value="Teleport self" action="bypass -h admin_clanhallteleportself %clanhallId%" width=135 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+</tr></table></center>
+<br><font color="FF0000">
+Note:</font> Use the box to enter the clan name to add/remove (can be done just by targetting a clan member) or the date to set the siege. Date must be on this format DD-MM-YYYY;HH:MM.
+</body></html>

+ 8 - 0
L2J_DataPack_BETA/data/html/clanHallManager/manage_siegable.htm

@@ -0,0 +1,8 @@
+<html><body><br>
+<font color="LEVEL">[Manage Clan Hall]</font><br><br>
+<CENTER>
+<button value="Recovery" action="bypass -h npc_%objectId%_manage recovery" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br>
+<button value="Other" action="bypass -h npc_%objectId%_manage other" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br>
+<button value="Main Screen" action="bypass -h npc_%objectId%_list_back" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF">
+</CENTER>
+</body></html>

+ 9 - 0
L2J_DataPack_BETA/data/html/clanHallManager/vault-chs.htm

@@ -0,0 +1,9 @@
+<html><body>
+This warehouse may only be used by clan members.<br>
+Please be mindful of your Adena balance remaining, as both the rental fee and usage fee for this clan hall will automatically withdrawn from this account.<br>
+<CENTER><br>
+<button value="Deposit" action="bypass -h npc_%objectId%_DepositC" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br>
+<button value="Withdraw" action="bypass -h npc_%objectId%_WithdrawC" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br>
+<button value="Initial Screen" action="bypass -h npc_%objectId%_list_back" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br>
+</CENTER>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/30596-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/html/doormen/30596-no.htm

@@ -0,0 +1 @@
+<html><body>Hey! Who's there? <br>Don't even think about bothering Harkel! Now be gone before I get angry!</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/30596.htm

@@ -0,0 +1,6 @@
+<html><body>Partisan Doorman:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 21210001, 21210002">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 21210001, 21210002">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35417-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/html/doormen/35417-no.htm

@@ -0,0 +1,3 @@
+<html><body>Who goes there?!<br>
+Stay back!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/35417.htm

@@ -0,0 +1,6 @@
+<html><body>Doorman of Hell:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 25170001, 25170002">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 25170001, 25170002">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35418-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/html/doormen/35418-no.htm

@@ -0,0 +1,3 @@
+<html><body>Who goes there?!<br>
+Stay back!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/35418.htm

@@ -0,0 +1,6 @@
+<html><body>Doorman of Hell:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 25170005, 25170006">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 25170005, 25170006">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35433-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/html/doormen/35433-no.htm

@@ -0,0 +1,3 @@
+<html><body>Who goes there?!<br>
+Stay back!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/35433.htm

@@ -0,0 +1,6 @@
+<html><body>Doorman of Hell:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 22170003, 221700004">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 22170003, 221700004">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35434-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/html/doormen/35434-no.htm

@@ -0,0 +1,3 @@
+<html><body>Who goes there?!<br>
+Stay back!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/35434.htm

@@ -0,0 +1,6 @@
+<html><body>Doorman of Hell:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 22170003, 221700004">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 22170003, 221700004">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35435-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/html/doormen/35435-no.htm

@@ -0,0 +1,3 @@
+<html><body>Who goes there?!<br>
+Stay back!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/35435.htm

@@ -0,0 +1,6 @@
+<html><body>Doorman of Hell:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 22170001, 221700002">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 22170001, 221700002">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35436-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/html/doormen/35436-no.htm

@@ -0,0 +1,3 @@
+<html><body>Who goes there?!<br>
+Stay back!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/35436.htm

@@ -0,0 +1,6 @@
+<html><body>Doorman of Hell:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 22170001, 22170002">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 22170001, 22170002">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35601-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/html/doormen/35601-no.htm

@@ -0,0 +1,3 @@
+<html><body>Who goes there?!<br>
+Stay back!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/35601.htm

@@ -0,0 +1,6 @@
+<html><body>Yetti Doorman:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 24140003">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 24140003">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35602-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/html/doormen/35602-no.htm

@@ -0,0 +1,3 @@
+<html><body>Who goes there?!<br>
+Stay back!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/html/doormen/35602.htm

@@ -0,0 +1,6 @@
+<html><body>Yetti Doorman:<br>
+Although the war is over, the dispute over the border has yet to be resolved. Keep your head down for now.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 24140008">Open the gate</a><br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 24140008">Close the gate</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35641-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35641-no.htm

@@ -0,0 +1,2 @@
+<html><body>Ha! Are you kidding? Get out of here quick or you'll regret it!
+</body></html>

+ 9 - 0
L2J_DataPack_BETA/data/html/doormen/35641.htm

@@ -0,0 +1,9 @@
+<html><body>Please, settle our clan's old scores! By the way, what was it you wanted?
+<center>
+<a action="bypass -h npc_%objectId%_open_doors 1, 21170001, 21170002">"Open the door."</a><br>
+<br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 21170001, 21170002">"Close the door."</a><br>
+<br><br>
+</center>
+</body>
+</html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35642-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/doormen/35642-no.htm

@@ -0,0 +1,2 @@
+<html><body>Ha! Are you kidding? Get out of here quick or you'll regret it!
+</body></html>

+ 9 - 0
L2J_DataPack_BETA/data/html/doormen/35642.htm

@@ -0,0 +1,9 @@
+<html><body>Please, settle our clan's old scores! By the way, what was it you wanted?
+<center>
+<a action="bypass -h npc_%objectId%_open_doors 1, 21170005, 21170006">"Open the door."</a><br>
+<br>
+<a action="bypass -h npc_%objectId%_close_doors 1, 21170005, 21170006">"Close the door."</a><br>
+<br><br>
+</center>
+</body>
+</html>

+ 2 - 0
L2J_DataPack_BETA/data/html/siege/35420-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.<br>
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/html/siege/35639-busy.htm

@@ -0,0 +1,2 @@
+<html><body>Oh! Our castle is being attacked and I can't do anything for you right now.<br>
+</body></html>

+ 8 - 0
L2J_DataPack_BETA/data/scripts.cfg

@@ -540,6 +540,7 @@ quests/Q452_FindingtheLostSoldiers/Q452_FindingtheLostSoldiers.java
 quests/Q463_IMustBeaGenius/Q463_IMustBeaGenius.java
 quests/501_ProofOfClanAlliance/__init__.py
 quests/503_PursuitClanAmbition/__init__.py
+quests/Q504_CompetitionfortheBanditStronghold/Q504_CompetitionfortheBanditStronghold.java
 quests/508_TheClansReputation/__init__.py
 quests/509_TheClansPrestige/__init__.py
 quests/510_AClansReputation/__init__.py
@@ -665,6 +666,13 @@ vehicles/KeucereusSouthController/KeucereusSouthController.java
 vehicles/SoIController/SoIController.java
 vehicles/SoDController/SoDController.java
 
+# Conquerable Clan Halls
+conquerablehalls/BanditStrongHold/BanditStrongHold.java
+conquerablehalls/DevastatedCastle/DevastatedCastle.java
+conquerablehalls/FortressOfResistance/FortressOfResistance.java
+conquerablehalls/FortressOfTheDead/FortressOfTheDead.java
+#conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java
+
 # Event Engine
 mods/eventmodElpies/eventmodElpies.java
 mods/eventmodRabbits/eventmodRabbits.java

+ 694 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/BanditStrongHold.java

@@ -0,0 +1,694 @@
+/**
+ * 
+ */
+package conquerablehalls.BanditStrongHold;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+
+import javolution.util.FastMap;
+
+import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.gameserver.Announcements;
+import com.l2jserver.gameserver.ai.CtrlIntention;
+import com.l2jserver.gameserver.ai.L2SpecialSiegeGuardAI;
+import com.l2jserver.gameserver.datatables.ClanTable;
+import com.l2jserver.gameserver.datatables.NpcTable;
+import com.l2jserver.gameserver.instancemanager.MapRegionManager.TeleportWhereType;
+import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.L2Clan;
+import com.l2jserver.gameserver.model.L2SiegeClan;
+import com.l2jserver.gameserver.model.L2Spawn;
+import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.L2SiegeClan.SiegeClanType;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.clanhall.ClanHallSiegeEngine;
+import com.l2jserver.gameserver.network.SystemMessageId;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
+
+/**
+ * @author BiggBoss
+ * Bandit Stronghold hall siege script
+ */
+public final class BanditStrongHold extends ClanHallSiegeEngine
+{
+	private class ClanData
+	{
+		private int flag = 0;
+		private int npc = 0;
+		private ArrayList<Integer> players = new ArrayList<Integer>(18);
+		private ArrayList<L2PcInstance> playersInstance = new ArrayList<L2PcInstance>(18);
+		private L2Spawn warrior = null;
+		private L2Spawn flagInstance = null;
+	}
+	
+	private static final String qn = "BanditStrongHold";
+	
+	private static final String SQL_LOAD_ATTACKERS			= "SELECT * FROM bandit_stronghold_attackers";
+	private static final String SQL_SAVE_ATTACKER 			= "INSERT INTO bandit_stronghold_attackers_members VALUES (?,?)";
+	private static final String SQL_LOAD_MEMEBERS			= "SELECT object_id FROM bandit_stronghold_attackers_members WHERE clan_id = ?";
+	private static final String SQL_SAVE_CLAN 				= "INSERT INTO bandit_stronghold_attackers VALUES(?,?,?)";
+	private static final String SQL_SAVE_NPC				= "UPDATE bandit_stronghold_attackers SET npc = ? WHERE clan_id = ?";
+	private static final String SQL_CLEAR_CLAN 				= "DELETE FROM bandit_stronghold_attackers";
+	private static final String SQL_CLEAR_CLAN_ATTACKERS 	= "DELETE FROM bandit_stronghold_attackers_members";
+	
+	private static final int RED_FLAG = 35423;
+	private static final int YELLOW_FLAG = 35424;
+	private static final int GREEN_FLAG = 35425;
+	private static final int BLUE_FLAG = 35426;
+	private static final int PURPLE_FLAG = 35427;
+	
+	private static final int OEL_MAHUM_BERSERKER = 35428;
+	private static final int OEL_MAHUM_SCOUT = 35429;
+	private static final int OEL_MAHUM_LEADER = 35430;
+	private static final int OEL_MAHUM_CLERIC = 35431;
+	private static final int OEL_MAHUM_THIEF = 35432;
+	
+	private static final int MESSENGER = 35437;
+	
+	// Custom values
+	private static final int[][] FLAGS_COORDS =
+	{
+		{83607,-17541,-1829},
+		{84095,-15478,-1829},
+		{81768,-17036,-1826},
+		{81287,-16025,-1843},
+		{83243,-15077,-1829}
+	};
+	
+	// Custom values
+	private static final int[][] MAHUM_COORDS =
+	{
+		{83658,-17337,-1829},
+		{84076,-15846,-1825},
+		{81990,-16900,-1839},
+		{81527,-15965,-1860},
+		{83168,-15319,-1848}
+	};
+	
+	// Custom values
+	private static final L2CharPosition CENTER = new L2CharPosition(82882,-16280,-1894,0);
+	
+	private FastMap<Integer, ClanData> _data;
+	private L2Clan _winner;
+	
+	public BanditStrongHold(int questId, String name, String descr, final int hallId)
+	{
+		super(questId, name, descr, hallId);
+		addStartNpc(MESSENGER);
+		addFirstTalkId(MESSENGER);
+		addTalkId(MESSENGER);
+		
+		addKillId(RED_FLAG);
+		addKillId(YELLOW_FLAG);
+		addKillId(GREEN_FLAG);
+		addKillId(BLUE_FLAG);
+		addKillId(PURPLE_FLAG);
+		
+		addAttackId(RED_FLAG);
+		addAttackId(YELLOW_FLAG);
+		addAttackId(GREEN_FLAG);
+		addAttackId(BLUE_FLAG);
+		addAttackId(PURPLE_FLAG);
+		
+		addSpawnId(OEL_MAHUM_BERSERKER);
+		addSpawnId(OEL_MAHUM_SCOUT);
+		addSpawnId(OEL_MAHUM_LEADER);
+		addSpawnId(OEL_MAHUM_CLERIC);
+		addSpawnId(OEL_MAHUM_THIEF);
+		
+		_data = new FastMap<Integer, ClanData>();
+		
+		// Load alredy registered attackers
+		loadAttackers();
+		
+		// If siege ends w/ more than 1 flag alive, winner is old owner
+		_winner = ClanTable.getInstance().getClan(_hall.getOwnerId());
+	}
+	
+	@Override
+	public String onFirstTalk(L2Npc npc, L2PcInstance player)
+	{
+		if(player.getQuestState(qn) == null)
+			newQuestState(player);
+		return "agit_oel_mahum_messenger_1.htm";
+	}
+	
+	@Override
+	public synchronized String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		String html = event;
+		L2Clan clan = player.getClan();
+				
+		// Register the clan for the siege
+		if(event.startsWith("register_clan"))
+		{
+			if(!_hall.isWaitingBattle())
+			{
+				NpcHtmlMessage msg = new NpcHtmlMessage(5);
+				msg.setFile(null, "data/scripts/conquerablehalls/BanditStrongHold/azit_messenger_q0504_09.htm");
+				msg.replace("%objectId%", String.valueOf(npc.getObjectId()));
+				msg.replace("%nextSiege%", _hall.getSiegeDate().getTime().toString());
+				player.sendPacket(msg);
+			}
+			else if(clan == null || !player.isClanLeader())
+				html = "agit_oel_mahum_messenger_2.htm";
+			else if(!_hall.isRegistering())
+				html = "agit_oel_mahum_messenger_3.htm";
+			else if((_hall.getOwnerId() > 0 && getAttackers().size() >= 4)
+					|| getAttackers().size() >= 5)
+				html = "agit_oel_mahum_messenger_21.htm";
+			else if(checkIsAttacker(clan))
+				html = "agit_oel_mahum_messenger_9.htm";
+			else if(_hall.getOwnerId() == clan.getClanId())
+				html = "agit_oel_mahum_messenger_22.htm";
+			else
+			{
+				String[] arg = event.split(" ");
+				if(arg.length >= 2)
+				{
+					// Register passing the quest
+					if(arg[1].equals("wQuest"))
+					{
+						if(player.destroyItemByItemId("BanditStrongHold Siege", 5009, 1, npc, true)) // Quest passed
+						{
+							registerClan(clan);
+							html = getFlagHtml(_data.get(clan.getClanId()).flag);
+						}
+						else // Quest not accoplished, try by paying
+							html = "agit_oel_mahum_messenger_24.htm";
+					}
+					// Register paying the fee
+					else if(arg[1].equals("wFee"))
+					{
+						if(player.reduceAdena("Bandit Stronghold registration", 200000, npc, true)) // Fee payed
+						{
+							registerClan(clan);
+							html = getFlagHtml(_data.get(clan.getClanId()).flag);
+						}
+						else // Fee couldnt be payed, try with quest
+							html = "agit_oel_mahum_messenger_26.htm";
+					}
+				}
+			}
+		}
+		// Select the flag to defend
+		else if(event.startsWith("select_clan_npc"))
+		{
+			if(!player.isClanLeader())
+				html = "agit_oel_mahum_messenger_2.htm";
+			else if(!_data.containsKey(clan.getClanId()))
+				html = "agit_oel_mahum_messenger_7.htm";
+			else
+			{
+				String[] var = event.split(" ");
+				if(var.length >= 2)
+				{
+					int id = 0;
+					try
+					{
+						id = Integer.parseInt(var[1]);
+					}
+					catch(Exception e)
+					{
+						_log.warning("BanditStronghold->select_clan_npc->Wrong mahum warrior id: "+var[1]);
+					}
+					if(id > 0 && (html = getMahumHtml(id)) != null)
+					{
+						_data.get(clan.getClanId()).npc = id;
+						saveNpc(id, clan.getClanId());
+					}
+				}
+			}
+		}
+		// View (and change ? ) the current selected mahum warrior
+		else if(event.startsWith("view_clan_npc"))
+		{
+			if(clan == null)
+				html = "agit_oel_mahum_messenger_2.htm";
+			ClanData cd = _data.get(clan.getClanId());
+			if(cd == null)
+				html = "agit_oel_mahum_messenger_7.htm";
+			else if(cd.npc == 0)
+				html = "agit_oel_mahum_messenger_10.htm";
+			else
+				html = getMahumHtml(cd.npc);
+		}
+		// Register a clan member for the fight
+		else if(event.equals("register_member"))
+		{
+			if(clan == null)
+				html = "agit_oel_mahm_messenger_5.htm";
+			else if(!_hall.isRegistering())
+				html = "agit_oel_mahum_messenger_3.htm";
+			else if(!_data.containsKey(clan.getClanId()))
+				html = "agit_oel_mahum_messenger_7.htm";
+			else if(_data.get(clan.getClanId()).players.size() >= 18)
+				html = "agit_oel_mahum_messenger_8.htm";
+			else
+			{
+				ClanData data = _data.get(clan.getClanId());
+				data.players.add(player.getObjectId());
+				saveMember(clan.getClanId(), player.getObjectId());
+				if(data.npc == 0)
+					html = "agit_oel_mahum_messenger_16.htm";
+				else
+					html = "agit_oel_mahum_messenger_9.htm";
+			}
+		}
+		
+		return html;
+	}
+	
+	@Override
+	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
+	{
+		if(_hall.isInSiege())
+		{
+			final int clan = attacker.getClan().getClanId();
+			// Attacking own flag or non-registered players
+			if((_data.containsKey(clan) && npc.getNpcId() == _data.get(clan).flag)
+					|| !_data.containsKey(clan))
+				npc.setCurrentHp(npc.getCurrentHp() + damage);
+		}
+		return null;
+	}
+	
+	@Override
+	public synchronized String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
+	{
+		if(_hall.isInSiege())
+		{
+			final int id = npc.getNpcId();
+			if(id == RED_FLAG || id == YELLOW_FLAG || id == GREEN_FLAG
+					|| id == BLUE_FLAG || id == PURPLE_FLAG)
+			{
+				final int index = id - 35423;
+				removeParticipant(index, true);
+				
+				synchronized(this)
+				{
+					// Siege ends if just 1 flag is alive
+					if(_data.size() == 1)
+					{
+						_winner = removeParticipant(0, false);
+						cancelSiegeTask();
+						endSiege();
+					}
+				}
+			}
+		}
+		return null;
+	}
+	
+	@Override
+	public String onSpawn(L2Npc npc)
+	{
+		npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, CENTER);
+		npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
+		return super.onSpawn(npc);
+	}
+		
+	@Override
+	public L2Clan getWinner()
+	{
+		return _winner;
+	}
+	
+	@Override
+	public void startSiege()
+	{
+		if(getAttackers().size() < 2)
+		{
+			onSiegeEnds();
+			getAttackers().clear();
+			_hall.updateNextSiege();
+			SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.SIEGE_OF_S1_HAS_BEEN_CANCELED_DUE_TO_LACK_OF_INTEREST);
+			sm.addString(_hall.getName());
+			Announcements.getInstance().announceToAll(sm);
+			return;
+		}
+		
+		super.startSiege();
+	}
+	
+	@Override
+	public void onSiegeStarts()
+	{
+		for(ClanData data : _data.values())
+		{
+			try
+			{
+				for(int objId : data.players)
+				{
+					L2PcInstance plr = L2World.getInstance().getPlayer(objId);
+					if(plr != null)
+						data.playersInstance.add(plr);
+					
+					data.flagInstance = new L2Spawn(NpcTable.getInstance().getTemplate(data.flag));
+					int index = 35423 - data.flag;
+					data.flagInstance.setLocx(FLAGS_COORDS[index][0]);
+					data.flagInstance.setLocy(FLAGS_COORDS[index][1]);
+					data.flagInstance.setLocz(FLAGS_COORDS[index][2]);
+					data.flagInstance.setRespawnDelay(10000);
+					data.flagInstance.setAmount(1);
+					data.flagInstance.init();
+					
+					data.warrior = new L2Spawn(NpcTable.getInstance().getTemplate(data.npc));
+					int indexx = 35428 - data.npc;
+					data.warrior.setLocx(MAHUM_COORDS[indexx][0]);
+					data.warrior.setLocy(MAHUM_COORDS[indexx][1]);
+					data.warrior.setLocz(MAHUM_COORDS[indexx][2]);
+					data.warrior.setRespawnDelay(10000);
+					data.warrior.setAmount(1);
+					data.warrior.init();
+					
+					((L2SpecialSiegeGuardAI)data.warrior.getLastSpawn().getAI()).getAlly().addAll(data.players);
+				}
+			}
+			catch(Exception e)
+			{
+				e.printStackTrace();
+			}
+		}	
+		
+		_hall.getDoor(22170001).closeMe();
+		_hall.getDoor(22170002).closeMe();
+	}
+	
+	@Override
+	public void onSiegeEnds()
+	{
+		if(_data.size() > 0)
+		{
+			for(int clanId : _data.keySet())
+			{
+				L2Clan clan = ClanTable.getInstance().getClan(clanId);
+				if(clan == null)
+					continue;
+				if(_hall.getOwnerId() == clan.getClanId())
+					removeParticipant(clan, false);
+				else
+					removeParticipant(clan, true);
+			}
+		}
+		clearTables();
+	}
+	
+	private void registerClan(L2Clan clan)
+	{
+		final int clanId = clan.getClanId();
+		
+		L2SiegeClan sc = new L2SiegeClan(clanId, SiegeClanType.ATTACKER);
+		getAttackers().put(clanId, sc);
+		
+		ClanData data = new ClanData();
+		_data.put(clanId, data);
+		data.flag = 35422 + _data.size();
+		data.players.add(clan.getLeaderId());
+		
+		saveClan(clanId, data.flag);
+		saveMember(clanId, clan.getLeaderId());
+	}
+	
+	private final L2Clan removeParticipant(int index, boolean teleport)
+	{
+		final L2Clan clan = (L2Clan)(_data.keySet().toArray()[index]);
+		return removeParticipant(clan, teleport);
+	}
+	
+	private final L2Clan removeParticipant(L2Clan clan, boolean teleport)
+	{
+		ClanData dat = _data.remove(clan);
+		
+		if(dat != null)
+		{	
+			// Destroy clan flag
+			if(dat.flagInstance != null)
+			{
+				dat.flagInstance.stopRespawn();
+				dat.flagInstance.getLastSpawn().deleteMe();
+			}
+		
+			if(dat.warrior != null)
+			{
+				// Destroy clan warrior
+				dat.warrior.stopRespawn();
+				dat.warrior.getLastSpawn().deleteMe();
+			}
+		
+			dat.players.clear();
+		}
+		
+		if(teleport)
+		{
+			// Teleport players outside
+			for(L2PcInstance pc : dat.playersInstance)
+				if(pc != null)
+					pc.teleToLocation(TeleportWhereType.Town);
+		}
+		
+		dat.playersInstance.clear();
+		
+		return clan;
+	}
+	
+	private String getFlagHtml(int flag)
+	{
+		String result = null;
+		
+		switch(flag)
+		{
+			case RED_FLAG:
+				result = "agit_oel_mahum_messenger_4a.htm";
+				break;
+			case YELLOW_FLAG:
+				result = "agit_oel_mahum_messenger_4b.htm";
+				break;
+			case GREEN_FLAG:
+				result = "agit_oel_mahum_messenger_4c.htm";
+				break;
+			case BLUE_FLAG:
+				result = "agit_oel_mahum_messenger_4d.htm";
+				break;
+			case PURPLE_FLAG:
+				result = "agit_oel_mahum_messenger_4e.htm";
+				break;
+				default:
+					result = "<html><body>Are you kidding me?</body></html>";
+		}
+		
+		return result;
+	}
+	
+	private String getMahumHtml(int mahum)
+	{
+		String result = null;
+		
+		switch(mahum)
+		{
+			case OEL_MAHUM_BERSERKER:
+				result = "agit_oel_mahum_messenger_17.htm";
+				break;
+			case OEL_MAHUM_SCOUT:
+				result = "agit_oel_mahum_messenger_18.htm";
+				break;
+			case OEL_MAHUM_LEADER:
+				result = "agit_oel_mahum_messenger_19.htm";
+				break;
+			case OEL_MAHUM_CLERIC:
+				result = "agit_oel_mahum_messenger_20.htm";
+				break;
+			case OEL_MAHUM_THIEF:
+				result = "agit_oel_mahum_messenger_23.htm";
+				break;
+				default:
+					result = "<html><body>Are you kidding me?</body></html>";
+		}
+		
+		return result;
+	}
+	
+	// =============================================
+	// Database access methods
+	// =============================================
+	private final void loadAttackers()
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(SQL_LOAD_ATTACKERS);
+			ResultSet rset = statement.executeQuery();
+			while(rset.next())
+			{
+				final int clanId = rset.getInt("clan_id");
+				
+				if(ClanTable.getInstance().getClan(clanId) == null)
+				{
+					_log.warning("BanditStronghold: Loaded an unexistent clan as attacker! Clan Id: "+clanId);
+					continue;
+				}
+				
+				ClanData data = new ClanData();
+				data.flag = rset.getInt("flag");;
+				data.npc = rset.getInt("npc");
+
+				_data.put(clanId, data);
+				loadAttackerMembers(clanId);
+			}
+			rset.close();
+			statement.close();
+		}
+		catch(Exception e)
+		{
+			_log.warning("BanditStrongHold.loadAttackers()->"+e.getMessage());
+			e.printStackTrace();
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	private final void loadAttackerMembers(int clanId)
+	{
+		Connection con = null;
+		try
+		{
+			ArrayList<Integer> listInstance = _data.get(clanId).players;
+			
+			if(listInstance == null)
+			{
+				_log.warning("BanditStronghold: Tried to load unregistered clan: "+clanId+"[clan Id]");
+				return;
+			}
+			
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(SQL_LOAD_MEMEBERS);
+			statement.setInt(1, clanId);
+			ResultSet rset = statement.executeQuery();
+			while(rset.next())
+			{
+				listInstance.add(rset.getInt("object_id"));
+				
+			}
+			rset.close();
+			statement.close();
+		}
+		catch(Exception e)
+		{
+			_log.warning("BanditStrongHold.loadAttackerMembers()->"+e.getMessage());
+			e.printStackTrace();
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	private final void saveClan(int clanId, int flag)
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(SQL_SAVE_CLAN);
+			statement.setInt(1, flag);
+			statement.setInt(2, 0);
+			statement.setInt(3, clanId);
+			statement.execute();
+			statement.close();
+		}
+		catch(Exception e)
+		{
+			_log.warning("BanditStrongHold.saveClan()->"+e.getMessage());
+			e.printStackTrace();
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	private final void saveNpc(int clanId, int npc)
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(SQL_SAVE_NPC);
+			statement.setInt(1, npc);
+			statement.setInt(2, clanId);
+			statement.execute();
+			statement.close();
+		}
+		catch(Exception e)
+		{
+			_log.warning("BanditStrongHold.saveNpc()->"+e.getMessage());
+			e.printStackTrace();
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	private final void saveMember(int clanId, int objectId)
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(SQL_SAVE_ATTACKER);
+			statement.setInt(1, clanId);
+			statement.setInt(2, objectId);
+			statement.execute();
+			statement.close();
+		}
+		catch(Exception e)
+		{
+			_log.warning("BanditStronghold.saveMember()->"+e.getMessage());
+			e.printStackTrace();
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	private void clearTables()
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			
+			PreparedStatement stat1 = con.prepareStatement(SQL_CLEAR_CLAN);
+			stat1.execute();
+			stat1.close();
+			
+			PreparedStatement stat2 = con.prepareStatement(SQL_CLEAR_CLAN_ATTACKERS);
+			stat2.execute();
+			stat2.close();
+		}
+		catch(Exception e)
+		{
+			_log.warning("BanditStrongHold.clearTables()->"+e.getMessage());
+			e.printStackTrace();
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	public static void main(String[] args)
+	{
+		new BanditStrongHold(-1, qn, "conquerablehalls", BANDIT_STRONGHOLD);
+	}
+}

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_1.htm

@@ -0,0 +1 @@
+<html><head><body>I'm just here to make sure the siege comes off without a hitch. I'll try to stay out of the way. Knock yourselves out!<br><a action="bypass -h Quest BanditStrongHold register_clan wQuest">Register a clan (must be a clan leader)</a><br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_11.htm">Select a Clan NPC (must be a clan leader)</a><br><a action="bypass -h Quest BanditStrongHold view_clan_npc">View a Clan NPC (any clan member)</a><br><a action="bypass -h Quest BanditStrongHold register_member">Register as a clan member. (Any clan member)</a><br><br><a action="bypass -h npc_%objectId%_Quest Q504_CompetitionfortheBanditStronghold">Quest</a></body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_10.htm

@@ -0,0 +1 @@
+<html><head><body>You clan leader is dithering on his selection of allies! Go and tell him to hurry up and decide!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_11.htm

@@ -0,0 +1 @@
+<html><head><body>Ol mahum berserkers live for the most appalling aspects of war. An alliance with them would be quite useful to you. They are superior examples of their kind, but their enthusiasm for battle often prevents their proper healing after injury. They are a challenge to handle but are worth the effort.<br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br><a action="bypass -h Quest BanditStrongHold select_clan_npc 35428">Form an alliance.</a></body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_12.htm

@@ -0,0 +1 @@
+<html><head><body>The ol mahum patrol may not appear to be anything special, but he is a slippery foe. I have never seen one captured by a knight!<br><a action="bypass -h Quest BanditStrongHold  agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br><a action="bypass -h Quest BanditStrongHold select_clan_npc 35429">Form an alliance.</a></body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_13.htm

@@ -0,0 +1 @@
+<html><head><body>The ol mahum prefects possess a powerful magic. They have been known to burn their enemies alive! Ah, yes, the infamous Aura Burn! They are also masters of their staffs, and are strong enough to withstand attack by swords or clubs. Their only weakness is a susceptibility to magic spells...<br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br><a action="bypass -h Quest BanditStrongHold select_clan_npc 35430">Form an alliance.</a></body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_14.htm

@@ -0,0 +1 @@
+<html><head><body>Let me tell you what my opinion is regarding the Oel Mahum Clerics... Ah, even Oel Mahums have a god they worship. It is not the same god called Ein... something that you guys believe in. But, having a god for themselves won't change their natural temperament, will it? They would rather kill than eat. Whenever they get into a fight, they fret themselves  to death while trying to blow their enemies' heads off. If an oel mahum feels threatened he will not hesitate to run away and heal himself.... They are the kind of people who always leave a bad taste in your mouth.<br>
+++<a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br><a action="bypass -h Quest BanditStrongHold select_clan_npc 35431">Form an alliance.</a></body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_15.htm

@@ -0,0 +1 @@
+<html><head><body>Ol mahum thieves are amusing little fellows. Shorter than the average ol mahum, they are exceptionally lithe. If they think they have the advantage, they will attack a target. But if they feel threatened they will evade direct conflict with the enemy while using a unique method to bind his legs.<br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br><a action="bypass -h Quest BanditStrongHold select_clan_npc 35432">Form an alliance.</a></body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_16.htm

@@ -0,0 +1 @@
+<html><head><body>
+++Your clan leader has not yet chosen who he will ally himself with! Go and tell him that his decision is required!
+++</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_17.htm

@@ -0,0 +1 @@
+<html><head><body>
+++Ol mahum berserkers live for the most appalling aspects of war. An alliance with them would be quite useful to you. They are superior examples of their kind, but their enthusiasm for battle often prevents their proper healing after injury. They are a challenge to handle but are worth the effort.<br>
+++<a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br>
+++<a action="bypass -h Quest BanditStrongHold select_clan_npc 35428">Form an alliance.</a>
+++</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_18.htm

@@ -0,0 +1 @@
+<html><head><body>
+++The ol mahum patrol may not appear to be anything special, but he is a slippery foe. I have never seen one captured by a knight!<br>
+++<a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br>
+++<a action="bypass -h Quest BanditStrongHold select_clan_npc 35429">Form an alliance.</a>
+++</body></html>

+ 5 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_19.htm

@@ -0,0 +1,5 @@
+<html><head><body>
+The ol mahum prefects possess a powerful magic. They have been known to burn their enemies alive! Ah, yes, the infamous Aura Burn! They are also masters of their staffs, and are strong enough to withstand attack by swords or clubs. Their only weakness is a susceptibility to magic spells...<br>
+<a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br>
+<a action="bypass -h Quest BanditStrongHold select_clan_npc 35430">Form an alliance.</a>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_2.htm

@@ -0,0 +1,3 @@
+<html><head><body>
+What a nerve! And not even a clan leader! When someone tries something like that in the ol mahum troops we eat him for dinner! (This option is only available to a clan leader.)
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_20.htm

@@ -0,0 +1,3 @@
+<html><head><body>
+Let me tell you what my opinion is regarding the Oel Mahum Clerics... Ah, even Oel Mahums have a god they worship. It is not the same god called Ein... something that you guys believe in. But, having a god for themselves won't change their natural temperament, will it? They would rather kill than eat. Whenever they get into a fight, they fret themselves  to death while trying to blow their enemies' heads off. If an oel mahum feels threatened he will not hesitate to run away and heal himself.... They are the kind of people who always leave a bad taste in your mouth.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_21.htm

@@ -0,0 +1,3 @@
+<html><head><body>
+You are too late! Five clans have already registered. Better luck next time!
+</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_22.htm

@@ -0,0 +1 @@
+<html><head><body>
+++Oh, sir, a master such as yourself need not prove himself! Leave such matters to the youngsters! Enjoy the show!
+++</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_23.htm

@@ -0,0 +1 @@
+<html><head><body>
+++Ol mahum thieves are amusing little fellows. Shorter than the average ol mahum, they are exceptionally lithe. If they think they have the advantage, they will attack a target. But if they feel threatened they will evade direct conflict with the enemy while using a unique strategy to bind his legs.
+++<br>
+++<a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_6.htm">Select another NPC.</a><br>
+++<a action="bypass -h Quest BanditStrongHold select_clan_npc 35432">Form an alliance.</a>
+++</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_24.htm

@@ -0,0 +1 @@
+<html><head><body>
+++What's that, you want to register without qualifying? Well, maybe we can work something out... 200,000 adena might get this conversation started...
+++<br><a action="bypass -h Quest BanditStrongHold register_clan wFee">Pay the adena and register a clan. (clan leader)</a>
+++</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_25.htm

@@ -0,0 +1 @@
+<html><head><body>
+++Haven't you learned anything? Surely you don't think you can just walk away from our agreement! See you on the battlefield!
+++</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_26.htm

@@ -0,0 +1 @@
+<html><head><body>
+++So you want to register for free, eh? There is a way... You can take a test if you can't afford the fee...<br>
+++<center>
+++<a action="bypass -h npc_%objectId%_Quest Q504_CompetitionfortheBanditStronghold">"I want to take the test."</a><br>
+++</center>
+++</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_3.htm

@@ -0,0 +1 @@
+<html><head><body>You are too late, registration is over. Maybe next time you should get here earlier!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4a.htm

@@ -0,0 +1 @@
+<html><head><body>It is very important that you understand that our team fights under the red flag. We will rally there and start the battle! Don't forget!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4b.htm

@@ -0,0 +1 @@
+<html><head><body>It is very important that you understand that our team fights under the yellow flag. We will rally there and start the battle! Don't forget!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4c.htm

@@ -0,0 +1 @@
+<html><head><body>Our team fights under the green flag. We will rally there and start the battle! Don't forget!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4d.htm

@@ -0,0 +1 @@
+<html><head><body>It is very important that you understand that our team fights under the blue flag. We will rally there and start the battle! Don't forget!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_4e.htm

@@ -0,0 +1 @@
+<html><head><body>It is very important that you understand that our team fights under the purple flag. We will rally there and start the battle! Don't forget!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_5.htm

@@ -0,0 +1 @@
+<html><head><body>You must be a clan member to register one. Your business is elsewhere! Go to it!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_6.htm

@@ -0,0 +1 @@
+<html><head><body>This siege requires that you ally with an ol mahum warrior for battle. All five of these have good reputations. Now choose!<br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_11.htm">ol mahum berserker</a><br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_12.htm">ol mahum patrol </a><br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_13.htm">ol mahum prefect</a><br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_14.htm">ol mahum cleric</a><br><a action="bypass -h Quest BanditStrongHold agit_oel_mahum_messenger_15.htm">ol mahum thief</a><br></body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_7.htm

@@ -0,0 +1 @@
+<html><head><body>What was the name of your clan again? What is this? You are not even registered for this siege! Do you think that you are above the rules? Or perhaps you are just an idiot!</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_8.htm

@@ -0,0 +1 @@
+<html><head><body>Oops, sorry, but your clan is already fully manned. 18 have already been registered! You are a privateer, aren't you?</body></html>

+ 1 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/agit_oel_mahum_messenger_9.htm

@@ -0,0 +1 @@
+<html><head><body>Ah, yes! Here is your registration! You are all set. Don't be late!</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/BanditStrongHold/azit_messenger_q0504_09.htm

@@ -0,0 +1,3 @@
+<html><head><body>Messenger:<br>I thought I made it clear that registration does not begin until one hour before the next siege at %nextSiege%.</body></html>
+
+ 

+ 126 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/DevastatedCastle/DevastatedCastle.java

@@ -0,0 +1,126 @@
+package conquerablehalls.DevastatedCastle;
+
+import gnu.trove.TIntIntHashMap;
+
+import com.l2jserver.gameserver.ai.CtrlIntention;
+import com.l2jserver.gameserver.datatables.ClanTable;
+import com.l2jserver.gameserver.datatables.NpcTable;
+import com.l2jserver.gameserver.datatables.SkillTable;
+import com.l2jserver.gameserver.model.L2Clan;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.clanhall.ClanHallSiegeEngine;
+import com.l2jserver.gameserver.network.clientpackets.Say2;
+
+/**
+ * @author BiggBoss
+ * Devastated Castle clan hall siege script
+ */
+public final class DevastatedCastle extends ClanHallSiegeEngine
+{		
+	private static final String qn = "DevastatedCastle";
+	
+	private static final int GUSTAV = 35410;
+	private static final int MIKHAIL = 35409;
+	private static final int DIETRICH = 35408;
+	private static final double GUSTAV_TRIGGER_HP = NpcTable.getInstance().getTemplate(GUSTAV).baseHpMax / 12;
+	
+	private static TIntIntHashMap _damageToGustav = new TIntIntHashMap();
+
+	public DevastatedCastle(int questId, String name, String descr, int hallId)
+	{
+		super(questId, name, descr, hallId);
+		addKillId(GUSTAV);
+		
+		addSpawnId(MIKHAIL);
+		addSpawnId(DIETRICH);
+		
+		addAttackId(GUSTAV);	
+	}
+	
+	@Override
+	public String onSpawn(L2Npc npc)
+	{
+		if(npc.getNpcId() == MIKHAIL)
+			broadcastNpcSay(npc, Say2.SHOUT, 1000276);
+		else if(npc.getNpcId() == DIETRICH)
+			broadcastNpcSay(npc, Say2.SHOUT, 1000277);
+		return null;
+	}
+	
+	@Override
+	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
+	{
+		if(!_hall.isInSiege())
+			return null;
+		
+		synchronized(this)
+		{
+			final L2Clan clan = attacker.getClan();
+				
+			if(clan != null && checkIsAttacker(clan))
+			{
+				final int id = clan.getClanId();
+				if(_damageToGustav.containsKey(id))
+				{
+					int newDamage = _damageToGustav.get(id);
+					newDamage += damage;
+					_damageToGustav.put(id, newDamage);
+				}
+				else
+					_damageToGustav.put(id, damage);
+			}
+			
+			if(npc.getCurrentHp() < GUSTAV_TRIGGER_HP
+					&& npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)
+			{
+				broadcastNpcSay(npc, Say2.ALL, 1000278);
+				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, SkillTable.getInstance().getInfo(4235, 1), npc);
+			}
+		}
+		return super.onAttack(npc, attacker, damage, isPet);
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
+	{
+		if(!_hall.isInSiege()) 
+			return null;
+		
+		_missionAccomplished = true;
+
+		if(npc.getNpcId() == GUSTAV)
+		{
+			synchronized(this)
+			{
+				cancelSiegeTask();
+				endSiege();
+			}
+		}
+			
+		return super.onKill(npc, killer, isPet);
+	}
+	
+	@Override
+	public L2Clan getWinner()
+	{
+		double counter = 0;
+		int damagest = 0;
+		for(int clan : _damageToGustav.keys())
+		{
+			final double damage = _damageToGustav.get(clan);
+			if(damage > counter)
+			{
+				counter = damage;
+				damagest = clan;
+			}
+		}
+		L2Clan winner = ClanTable.getInstance().getClan(damagest);
+		return winner;
+	}
+	
+	public static void main(String[] args)
+	{
+		new DevastatedCastle(-1, qn, "conquerablehalls", DEVASTATED_CASTLE);
+	}
+}

+ 167 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/FortressOfResistance/FortressOfResistance.java

@@ -0,0 +1,167 @@
+/**
+ * 
+ */
+package conquerablehalls.FortressOfResistance;
+
+import gnu.trove.TIntLongHashMap;
+
+import com.l2jserver.gameserver.cache.HtmCache;
+import com.l2jserver.gameserver.datatables.ClanTable;
+import com.l2jserver.gameserver.datatables.NpcTable;
+import com.l2jserver.gameserver.model.L2Clan;
+import com.l2jserver.gameserver.model.L2Spawn;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.clanhall.ClanHallSiegeEngine;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+
+/**
+ * @author BiggBoss
+ * Fortress of Resistance clan hall siege Script
+ */
+public final class FortressOfResistance extends ClanHallSiegeEngine
+{
+	private static final String qn = "FortressOfResistance";
+	
+	private final int MESSENGER = 35382;
+	private final int BLOODY_LORD_NURKA = 35375;
+	
+	private final int[][] NURKA_COORDS =
+	{
+		{45109,112124,-1900},	// 30%
+		{47653,110816,-2110},	// 40%
+		{47247,109396,-2000}	// 30%
+	};
+	
+	private L2Spawn _nurka; 
+	private TIntLongHashMap _damageToNurka = new TIntLongHashMap();
+	private NpcHtmlMessage _messengerMsg;
+	
+	/**
+	 * @param questId
+	 * @param name
+	 * @param descr
+	 */
+	public FortressOfResistance(int questId, String name, String descr, final int hallId)
+	{
+		super(questId, name, descr, hallId);
+		addFirstTalkId(MESSENGER);
+		addKillId(BLOODY_LORD_NURKA);
+		addAttackId(BLOODY_LORD_NURKA);
+		buildMessengerMessage();
+		
+		try
+		{
+			_nurka = new L2Spawn(NpcTable.getInstance().getTemplate(BLOODY_LORD_NURKA));
+			_nurka.setAmount(1);
+			_nurka.setRespawnDelay(10800);
+			
+			int[] coords = NURKA_COORDS[0];
+			/*
+			int chance = Rnd.get(100) + 1;
+			if(chance <= 30)
+				coords = NURKA_COORDS[0];
+			else if(chance > 30 && chance <= 70)
+				coords = NURKA_COORDS[1];
+			else
+				coords = NURKA_COORDS[2];
+			*/
+			
+			_nurka.setLocx(coords[0]);
+			_nurka.setLocy(coords[1]);
+			_nurka.setLocz(coords[2]);
+		}
+		catch(Exception e)
+		{
+			_log.warning(getName()+": Couldnt set the Bloody Lord Nurka spawn");
+			e.printStackTrace();
+		}
+	}
+	
+	private final void buildMessengerMessage()
+	{
+		String html = HtmCache.getInstance().getHtm(null, "data/scripts/conquerablehalls/FortressOfResistance/partisan_ordery_brakel001.htm");
+		if(html != null)
+		{
+			_messengerMsg = new NpcHtmlMessage(5);
+			_messengerMsg.setHtml(html);
+			_messengerMsg.replace("%nextSiege%", _hall.getSiegeDate().getTime().toString());
+		}
+	}
+	
+	@Override
+	public String onFirstTalk(L2Npc npc, L2PcInstance player)
+	{
+		player.sendPacket(_messengerMsg);
+		return null;
+	}
+	
+	@Override
+	public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isPet)
+	{
+		if(!_hall.isInSiege())
+			return null;
+		
+		int clanId = player.getClanId();
+		if(clanId > 0)
+		{
+			long clanDmg = _damageToNurka.get(clanId) + damage;
+			_damageToNurka.put(clanId, clanDmg);
+			
+		}
+		return null;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
+	{
+		if(!_hall.isInSiege())
+			return null;
+		
+		_missionAccomplished = true;
+		
+		synchronized(this)
+		{
+			npc.getSpawn().stopRespawn();
+			npc.deleteMe();
+			cancelSiegeTask();
+			endSiege();
+		}
+		return null;
+	}
+	
+	@Override
+	public L2Clan getWinner()
+	{
+		int winnerId = 0;
+		long counter = 0;
+		for(int i : _damageToNurka.keys())
+		{	
+			long dam = _damageToNurka.get(i);
+			if(dam > counter)
+			{
+				winnerId = i;
+				counter = dam;
+			}
+		}
+		return ClanTable.getInstance().getClan(winnerId);
+	}
+	
+	@Override
+	public void onSiegeStarts()
+	{
+		_nurka.init();
+	}
+	
+	@Override
+	public void onSiegeEnds()
+	{
+		buildMessengerMessage();
+	}
+		
+	public static void main(String[] args)
+	{
+		new FortressOfResistance(-1, qn, "conquerablehalls", FORTRESS_RESSISTANCE);
+	}
+
+}

+ 4 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/FortressOfResistance/partisan_ordery_brakel001.htm

@@ -0,0 +1,4 @@
+<html><body>
+I shouldn't be telling you this... but our master, Nurka, visits this clan hall on a regular basis.<br>
+I think his next visit will be around %nextSiege%...
+</body></html>

+ 147 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java

@@ -0,0 +1,147 @@
+package conquerablehalls.FortressOfTheDead;
+
+import gnu.trove.TIntIntHashMap;
+
+import com.l2jserver.gameserver.GameTimeController;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.datatables.ClanTable;
+import com.l2jserver.gameserver.model.L2Clan;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.clanhall.ClanHallSiegeEngine;
+import com.l2jserver.gameserver.network.clientpackets.Say2;
+
+/**
+ * @author BiggBoss
+ * Fortress of the Dead clan hall siege script
+ */
+public final class FortressOfTheDead extends ClanHallSiegeEngine
+{		
+	private static final String qn = "FortressOfTheDead";
+	
+	private static final int LIDIA = 35629;
+	private static final int ALFRED = 35630;
+	private static final int GISELLE = 35631;
+	
+	private static TIntIntHashMap _damageToLidia = new TIntIntHashMap();
+	
+	/**
+	 * @param questId
+	 * @param name
+	 * @param descr
+	 */
+	public FortressOfTheDead(int questId, String name, String descr, final int hallId)
+	{
+		super(questId, name, descr, hallId);
+		addKillId(LIDIA);
+		addKillId(ALFRED);
+		addKillId(GISELLE);
+		
+		addSpawnId(LIDIA);
+		addSpawnId(ALFRED);
+		addSpawnId(GISELLE);
+		
+		addAttackId(LIDIA);
+	}
+	
+	@Override
+	public String onSpawn(L2Npc npc)
+	{
+		if(npc.getNpcId() == LIDIA)
+			broadcastNpcSay(npc, Say2.SHOUT, 1010624);
+		else if(npc.getNpcId() == ALFRED)
+			broadcastNpcSay(npc, Say2.SHOUT, 1010636);
+		else if(npc.getNpcId() == GISELLE)
+			broadcastNpcSay(npc, Say2.SHOUT, 1010637);
+		return null;
+	}
+	
+	@Override
+	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
+	{
+		if(!_hall.isInSiege())
+			return null;
+		
+		synchronized(this)
+		{
+			final L2Clan clan = attacker.getClan();
+				
+			if(clan != null && checkIsAttacker(clan))
+			{
+				final int id = clan.getClanId();
+				if(id > 0 && _damageToLidia.containsKey(id))
+				{
+					int newDamage = _damageToLidia.get(id);
+					newDamage += damage;
+					_damageToLidia.put(id, newDamage);
+				}
+				else
+					_damageToLidia.put(id, damage);
+			}
+		}
+		return null;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
+	{
+		if(!_hall.isInSiege()) return null;
+		
+		final int npcId = npc.getNpcId();
+		
+		if(npcId == ALFRED || npcId == GISELLE)
+			broadcastNpcSay(npc, Say2.SHOUT, 1010625);
+		if(npcId == LIDIA)
+		{
+			broadcastNpcSay(npc, Say2.SHOUT, 1010639);
+			_missionAccomplished = true;
+			synchronized(this)
+			{
+				cancelSiegeTask();
+				endSiege();
+			}
+		}
+			
+		return null;
+	}
+			
+	@Override
+	public L2Clan getWinner()
+	{
+		int counter = 0;
+		int damagest = 0;
+		for(int clan : _damageToLidia.keys())
+		{
+			final int damage = _damageToLidia.get(clan);
+			if(damage > counter)
+			{
+				counter = damage;
+				damagest = clan;
+			}
+		}
+		return ClanTable.getInstance().getClan(damagest);
+	}
+	
+	@Override
+	public void startSiege()
+	{
+		/*
+		 * Siege must start at night
+		 */
+		int hoursLeft = (GameTimeController.getInstance().getGameTime() / 60) % 24;
+		
+		if(hoursLeft < 0 || hoursLeft > 6)
+		{
+			cancelSiegeTask();
+			long scheduleTime = (24 - hoursLeft) * 10 * 60000;
+			_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStarts(), scheduleTime);
+		}
+		else
+			super.startSiege();
+	}
+		
+	public static void main(String[] args)
+	{
+		new FortressOfTheDead(-1, qn, "conquerablehalls", FORTRESS_OF_DEAD);
+	}
+}

+ 782 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java

@@ -0,0 +1,782 @@
+package conquerablehalls.RainbowSpringsChateau;
+
+import gnu.trove.TIntLongHashMap;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ScheduledFuture;
+import java.util.logging.Logger;
+
+import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.gameserver.Announcements;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.datatables.ClanTable;
+import com.l2jserver.gameserver.datatables.NpcTable;
+import com.l2jserver.gameserver.datatables.SkillTable;
+import com.l2jserver.gameserver.datatables.SpawnTable;
+import com.l2jserver.gameserver.instancemanager.CHSiegeManager;
+import com.l2jserver.gameserver.instancemanager.MapRegionManager.TeleportWhereType;
+import com.l2jserver.gameserver.instancemanager.ZoneManager;
+import com.l2jserver.gameserver.model.L2Clan;
+import com.l2jserver.gameserver.model.L2ItemInstance;
+import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.L2Skill;
+import com.l2jserver.gameserver.model.L2Spawn;
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall;
+import com.l2jserver.gameserver.model.entity.clanhall.SiegeStatus;
+import com.l2jserver.gameserver.model.quest.Quest;
+import com.l2jserver.gameserver.model.quest.QuestState;
+import com.l2jserver.gameserver.model.quest.State;
+import com.l2jserver.gameserver.model.zone.L2ZoneType;
+import com.l2jserver.gameserver.network.clientpackets.Say2;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jserver.gameserver.network.serverpackets.NpcSay;
+import com.l2jserver.gameserver.templates.item.L2Item;
+import com.l2jserver.util.Rnd;
+
+/**
+ * @author BiggBoss
+ * Rainbow Springs Cheateau clan hall siege script
+ */
+public class RainbowSpringsChateau extends Quest
+{
+	private static final Logger _log = Logger.getLogger(RainbowSpringsChateau.class.getName());
+	
+	private static class SetFinalAttackers implements Runnable
+	{ 
+		@Override
+		public void run()
+		{
+			if(_rainbow == null)
+				_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
+			
+			int spotLeft = 4;
+			if(_rainbow.getOwnerId() > 0)
+			{
+				L2Clan owner = ClanTable.getInstance().getClan(_rainbow.getOwnerId());
+				if(owner != null)
+				{
+					_rainbow.free();
+					owner.setHasHideout(0);
+					_acceptedClans.add(owner);
+					--spotLeft;
+				}
+					
+				for(int i = 0; i < spotLeft; i++)
+				{
+					long counter = 0;
+					L2Clan clan = null;
+					for(int clanId : _warDecreesCount.keys())
+					{
+						L2Clan actingClan = ClanTable.getInstance().getClan(clanId);
+						if(actingClan == null || actingClan.getDissolvingExpiryTime() > 0)
+						{
+							_warDecreesCount.remove(clanId);
+							continue;
+						}
+						
+						final long count = _warDecreesCount.get(clanId);
+						if(count > counter)
+						{								counter = count;
+							clan = actingClan;
+						}
+					}
+					if(_acceptedClans.size() < 4)
+					{
+						_acceptedClans.add(clan);
+						L2PcInstance leader = clan.getLeader().getPlayerInstance();
+						if(leader != null)
+							leader.sendMessage("Your clan has been accepted to join the RainBow Srpings Chateau siege!");
+					}
+				}
+				if(_acceptedClans.size() >= 2)
+				{
+					_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStart(), 3600000);
+					_rainbow.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
+				}
+				else
+					Announcements.getInstance().announceToAll("Rainbow Springs Chateau siege aborted due lack of population");
+			}
+		}		
+	}
+	
+	private static class SiegeStart implements Runnable
+	{		
+		@Override
+		public void run()
+		{
+			if(_rainbow == null)
+				_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
+
+			//XXX _rainbow.siegeStarts();
+			
+			spawnGourds();
+			_siegeEnd = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeEnd(null), _rainbow.getSiegeLenght() - 120000);
+		}
+	}
+		
+	private static class SiegeEnd implements Runnable
+	{
+		private L2Clan _winner;
+		
+		private SiegeEnd(L2Clan winner)
+		{
+			_winner = winner;
+		}
+		
+		@Override
+		public void run()
+		{
+			if(_rainbow == null)
+				_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
+
+			unSpawnGourds();
+			
+			if(_winner != null)
+				_rainbow.setOwner(_winner);
+			
+			//XXX _rainbow.siegeEnds();
+			
+			ThreadPoolManager.getInstance().scheduleGeneral(new SetFinalAttackers(), _rainbow.getNextSiegeTime());
+			setRegistrationEndString(_rainbow.getNextSiegeTime() + System.currentTimeMillis() - 3600000);
+			// Teleport out of the arenas is made 2 mins after game ends
+			ThreadPoolManager.getInstance().scheduleGeneral(new TeleportBack(), 120000);
+		}
+	}
+	
+	private static class TeleportBack implements Runnable
+	{		
+		@Override
+		public void run()
+		{
+			for(int arenaId : ARENA_ZONES)
+			{
+				L2ZoneType zone = ZoneManager.getInstance().getZoneById(arenaId);
+				for(L2Character cha : (L2Character[])zone.getCharactersInside().getValues())
+					cha.teleToLocation(TeleportWhereType.Town);
+			}
+		}
+	}
+	
+	private static final String qn = "RainbowSpringsChateau";
+	
+	private static final int RAINBOW_SPRINGS = 62;
+	
+	private static final int WAR_DECREES = 8034;
+	private static final int RAINBOW_NECTAR= 8030;
+	private static final int RAINBOW_MWATER = 8031;
+	private static final int RAINBOW_WATER = 8032;
+	private static final int RAINBOW_SULFUR = 8033;
+	
+	private static final int MESSENGER = 35604;
+	private static final int CARETAKER = 35603;
+	private static final int CHEST = 35593;
+	
+	private static final int[] GOURDS = { 35588, 35589, 35590, 35591 };
+	private static L2Spawn[] _gourds = new L2Spawn[4];
+	
+	private static final int[] YETIS = { 35596, 35597, 35598, 35599 };
+	
+	private static final int[][] ARENAS =
+	{
+		{ 151562, -127080, -2214 }, // Arena 1
+		{ 153141, -125335, -2214 }, // Arena 2
+		{ 153892, -127530, -2214 }, // Arena 3
+		{ 155657, -125752, -2214 }, // Arena 4
+	};
+	
+	private static final int[] ARENA_ZONES = { 112081, 112082, 112083, 112084 };
+	
+	private static final String[] _textPassages =
+	{
+		"Text Passage 1",
+		"Passage Text 2",
+		"Im getting out of ideas",
+		"But i can write few more",
+		"Are five sentences",
+		"enough for this f*** siege?",
+		"i think ill add few more",
+		"like this one",
+		"Please, if you know the true passages",
+		"Contact me at L2JForum =)"
+	};
+	
+	private static final L2Skill[] DEBUFFS =
+	{
+		SkillTable.getInstance().getInfo(0, 1)
+	};
+		
+	private static TIntLongHashMap _warDecreesCount = new TIntLongHashMap();
+	private static List<L2Clan> _acceptedClans = new ArrayList<L2Clan>(4);
+	private static Map<String, ArrayList<L2Clan>> _usedTextPassages = new HashMap<String, ArrayList<L2Clan>>();
+	private static Map<L2Clan, Integer> _pendingItemToGet = new HashMap<L2Clan, Integer>();
+	
+	private static SiegableHall _rainbow;
+	private static ScheduledFuture<?> _nextSiege, _siegeEnd;
+	private static String _registrationEnds;
+	
+	
+	/**
+	 * @param questId
+	 * @param name
+	 * @param descr
+	 */
+	public RainbowSpringsChateau(int questId, String name, String descr)
+	{
+		super(questId, name, descr);
+		addFirstTalkId(MESSENGER);
+		addTalkId(MESSENGER);
+		addFirstTalkId(CARETAKER);
+		addTalkId(CARETAKER);
+		for(int npc : YETIS)
+		{
+			addFirstTalkId(npc);
+			addTalkId(npc);
+		}
+		
+		loadAttackers();
+		
+		_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
+		if(_rainbow != null)
+		{
+			long delay = _rainbow.getNextSiegeTime();
+			if(delay > -1)
+			{
+				setRegistrationEndString(delay - 3600000);
+				_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SetFinalAttackers(), delay);
+			}
+			else
+				_log.warning("CHSiegeManager: No Date setted for RainBow Springs Chateau Clan hall siege!. SIEGE CANCELED!");
+		}
+	}
+	
+	@Override
+	public String onFirstTalk(L2Npc npc, L2PcInstance player)
+	{
+		if(player.getQuestState(qn) == null)
+		{
+			QuestState state = newQuestState(player);
+			state.setState(State.STARTED);
+		}
+
+		int npcId = npc.getNpcId();
+		String html = "";
+		
+		if(npcId == MESSENGER)
+		{
+			sendMessengerMain(player);
+		}
+		else if(npcId == CARETAKER)
+		{
+			html = "caretaker_main.htm";
+		}
+		else if(_rainbow.isInSiege())
+		{
+			if(!player.isClanLeader())
+				html = "no_clan_leader.htm";	
+			else
+			{
+				L2Clan clan = player.getClan();
+				if(clan != null && _acceptedClans.contains(clan))
+				{
+					int index = _acceptedClans.indexOf(clan);
+					if(npcId == YETIS[index])
+						html = "yeti_main.htm";
+				}
+			}
+		}
+		player.setLastQuestNpcObject(npc.getObjectId());
+		return html;
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		if(!player.isClanLeader())
+			return "no_clan_leader.htm";
+
+		String html = event;
+		final L2Clan clan = player.getClan();		
+		final int clanId = clan.getClanId();
+		
+		if(event.equals("register"))
+		{
+			if(!_rainbow.isRegistering())
+				html = "messenger_not_registering.htm";
+			else if(_warDecreesCount.containsKey(clanId))
+				html = "messenger_alredy_registered.htm";
+			else if(clan.getLevel() < 3 || clan.getMembersCount() < 5)
+				html = "messenger_no_level.htm";
+			else
+			{
+				L2ItemInstance warDecrees = player.getInventory().getItemByItemId(WAR_DECREES);
+				if(warDecrees == null)
+					html = "messenger_nowardecrees.htm";
+				else
+				{
+					long count = warDecrees.getCount();
+					_warDecreesCount.put(clanId, count);
+					player.destroyItem("Rainbow Springs Registration", warDecrees, npc, true);
+					updateAttacker(clanId, count, false);
+					html = "messenger_registered.htm";
+				}
+			}
+		}
+		else if(event.equals("unregister"))
+		{
+			if(!_warDecreesCount.containsKey(clanId))
+				html = "messenger_notinlist.htm";
+			else if(_rainbow.isRegistering())
+			{
+				String[] split = event.split("_");
+				int step = Integer.parseInt(split[1]);
+				
+				switch(step)
+				{
+					case 0:
+						html = "messenger_unregister_confirmation.htm";
+						break;
+					case 1:
+						html = "messenger_retrive_wardecrees.htm";
+						updateAttacker(clanId, 0, true);
+						break;
+					case 2:
+						html = "messenger_unregistered.htm";
+						long toRetrive = _warDecreesCount.get(clanId) / 2;
+						player.addItem("Rainbow Spring unregister", WAR_DECREES, toRetrive, npc, true);
+						_warDecreesCount.remove(clanId);
+						break;
+						default:
+							html = "messenger_main.htm";
+				}
+			}
+			else if(_rainbow.isWaitingBattle())
+			{
+				if(!_acceptedClans.contains(clan))
+					return "messenger_notinlist.htm";
+				
+				String[] split = event.split("_");
+				int step = Integer.parseInt(split[1]);
+				
+				switch(step)
+				{
+					case 0:
+						html = "messenger_unregister_confirmation_no_retrive.htm";
+						break;
+					case 1:
+						html = "messenger_unregistered.htm";
+						_acceptedClans.remove(clan);
+						break;
+						default:
+							html = "messenger_main.htm";
+				}
+			}
+		}
+		else if(event.equals("portToArena"))
+		{
+			if(!_acceptedClans.contains(clan))
+				html = "caretaker_not_allowed.htm";
+			else if(player.getParty() == null)
+				html = "caretaker_no_party.htm";
+			else
+			{
+				int index = _acceptedClans.indexOf(clan);
+				portToArena(player, index);
+			}
+		}
+		else if(event.startsWith("enterText"))
+		{
+			// Shouldnt happen
+			if(!_acceptedClans.contains(clan))
+				return null;
+			
+			String[] split = event.split("_");
+			if(split.length < 2)
+				return null;
+			
+			final String passage = split[1];
+			
+			if(!isValidPassage(passage))
+				return null;
+			
+			if(_usedTextPassages.containsKey(passage))
+			{
+				ArrayList<L2Clan> list = _usedTextPassages.get(passage);
+				
+				if(list.contains(clan))
+					html = "yeti_passage_used.htm";
+				else
+				{
+					list.add(clan);
+					synchronized(_pendingItemToGet)
+					{
+						if(_pendingItemToGet.containsKey(clan))
+						{
+							int left = _pendingItemToGet.get(clan);
+							++left;
+							_pendingItemToGet.put(clan, left);
+						}
+						else
+							_pendingItemToGet.put(clan, 1);
+					}
+					html = "yeti_item_exchange.htm";
+				}
+			}
+		}
+		else if(event.startsWith("getItem"))
+		{
+			if(!_pendingItemToGet.containsKey(clanId))
+				html = "yeti_cannot_exchange.htm";
+				
+			int left = _pendingItemToGet.get(clan);
+			if(left > 0)
+			{
+				int itemId = Integer.parseInt(event.split("_")[1]);
+				player.addItem("Rainbow Spring Chateau Siege", itemId, 1, npc, true);
+				--left;
+				_pendingItemToGet.put(clan, left);
+				html = "yeti_main.htm";
+			}
+			else
+				html = "yeti_cannot_exchange.htm";
+		}
+		
+		return html;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
+	{
+		if(!_rainbow.isInSiege())
+			return null;
+		
+		final L2Clan clan = killer.getClan();
+		if(clan == null || !_acceptedClans.contains(clan))
+			return null;
+		
+		final int npcId = npc.getNpcId();
+		final int index = _acceptedClans.indexOf(clan);
+		
+		if(npcId == CHEST)
+		{
+			shoutRandomText(npc);
+		}
+		else if(npcId == GOURDS[index])
+		{
+			synchronized(this)
+			{
+				if(_siegeEnd != null)
+					_siegeEnd.cancel(false);
+				ThreadPoolManager.getInstance().executeTask(new SiegeEnd(clan));
+			}
+		}
+		
+		return null;
+	}
+	
+	@Override
+	public String onItemUse(L2Item item, L2PcInstance player)
+	{
+		if(!_rainbow.isInSiege())
+			return null;
+		
+		L2Object target = player.getTarget();
+		
+		if(target == null || !(target instanceof L2Npc))
+			return null;
+		
+		int yeti = ((L2Npc)target).getNpcId();
+		
+		if(!isYetiTarget(yeti))
+			return null;
+		
+		final L2Clan clan = player.getClan();
+		
+		if(clan == null || !_acceptedClans.contains(clan))
+			return null;
+		
+		final int itemId = item.getItemId();
+		
+		// Nectar must spawn the enraged yeti. Dunno if it makes any other thing
+		// Also, the items must execute:
+		// - Reduce gourd hpb ( reduceGourdHp(int, L2PcInstance) )
+		// - Cast debuffs on enemy clans ( castDebuffsOnEnemies(int) )
+		// - Change arena gourds ( moveGourds() )
+		// - Increase gourd hp ( increaseGourdHp(int) )
+		
+		if(itemId == RAINBOW_NECTAR)
+		{
+			// Spawn enraged (where?)
+			reduceGourdHp(_acceptedClans.indexOf(clan), player);
+		}
+		else if(itemId == RAINBOW_MWATER)
+		{
+			increaseGourdHp(_acceptedClans.indexOf(clan));
+		}
+		else if(itemId == RAINBOW_WATER)
+		{
+			moveGourds();
+		}
+		else if(itemId == RAINBOW_SULFUR)
+		{
+			castDebuffsOnEnemies(_acceptedClans.indexOf(clan));
+		}
+		return null;
+	}
+	
+	private static void portToArena(L2PcInstance leader, int arena)
+	{
+		if(arena < 0 || arena > 3)
+		{
+			_log.warning("RainbowSptringChateau siege: Wrong arena id passed: "+arena);
+			return;
+		}
+		for(L2PcInstance pc : leader.getParty().getPartyMembers())
+			if(pc != null)
+			{
+				pc.stopAllEffects();
+				if(pc.getPet() != null)
+					pc.getPet().unSummon(pc);
+				pc.teleToLocation(ARENAS[arena][0], ARENAS[arena][1], ARENAS[arena][2]);
+			}	
+	}
+	
+	private static void spawnGourds()
+	{
+		for(int i = 0; i < _acceptedClans.size(); i++)
+		{
+			if(_gourds[i] == null)
+			{
+				try
+				{
+					_gourds[i] = new L2Spawn(NpcTable.getInstance().getTemplate(GOURDS[i]));
+					_gourds[i].setLocx(ARENAS[i][0] + 150);
+					_gourds[i].setLocy(ARENAS[i][1] + 150);
+					_gourds[i].setLocz(ARENAS[i][2]);
+					_gourds[i].setHeading(1);
+					_gourds[i].setAmount(1);
+				}
+				catch(Exception e)
+				{
+					e.printStackTrace();
+				}
+			}
+			SpawnTable.getInstance().addNewSpawn(_gourds[i], false);
+			_gourds[i].init();
+		}
+	}
+	
+	private static void unSpawnGourds()
+	{
+		for(int i = 0; i < _acceptedClans.size(); i++)
+		{
+			_gourds[i].getLastSpawn().deleteMe();
+			SpawnTable.getInstance().deleteSpawn(_gourds[i], false);
+		}
+	}
+	
+	private static void moveGourds()
+	{
+		L2Spawn[] tempArray = _gourds;
+		int iterator = _acceptedClans.size();
+		for(int i = 0; i < iterator; i++)
+		{
+			L2Spawn oldSpawn = _gourds[(iterator-1)-i];
+			L2Spawn curSpawn = tempArray[i];
+			
+			_gourds[(iterator -1) - i] = curSpawn;
+			
+			int newX = oldSpawn.getLocx();
+			int newY = oldSpawn.getLocy();
+			int newZ = oldSpawn.getLocz();
+			
+			curSpawn.getLastSpawn().teleToLocation(newX, newY, newZ);
+		}
+	}
+	
+	private static void reduceGourdHp(int index, L2PcInstance player)
+	{
+		L2Spawn gourd = _gourds[index];
+		gourd.getLastSpawn().reduceCurrentHp(1000, player, null);
+	}
+	
+	private static void increaseGourdHp(int index)
+	{
+		L2Spawn gourd = _gourds[index];
+		L2Npc gourdNpc = gourd.getLastSpawn();
+		gourdNpc.setCurrentHp(gourdNpc.getCurrentHp() + 1000);
+	}
+	
+	private static void castDebuffsOnEnemies(int myArena)
+	{
+		for(int id : ARENA_ZONES)
+		{
+			if(id == myArena)
+				continue;
+			
+			for(L2Character plr : (L2Character[])ZoneManager.getInstance().getZoneById(id).getCharactersInside().getValues())
+			{
+				for(L2Skill sk : DEBUFFS)
+					sk.getEffects(plr, plr);
+			}
+		}
+	}
+	
+	private static void shoutRandomText(L2Npc npc)
+	{
+		int length = _textPassages.length;
+		
+		if(_usedTextPassages.size() >= length)
+			return;
+
+		int randomPos = Rnd.get(length);
+		String message = _textPassages[randomPos];
+		
+		if(_usedTextPassages.containsKey(message))
+			shoutRandomText(npc);
+		else
+		{
+			_usedTextPassages.put(message, new ArrayList<L2Clan>());
+			int shout = Say2.SHOUT;
+			int objId = npc.getObjectId();
+			NpcSay say = new NpcSay(objId, shout, npc.getNpcId(), message);
+			npc.broadcastPacket(say);
+		}
+	}
+	
+	private static boolean isValidPassage(String text)
+	{
+		for(String st : _textPassages)
+			if(st.equalsIgnoreCase(text))
+				return true;
+		return false;
+	}
+	
+	private static boolean isYetiTarget(int npcId)
+	{
+		for(int yeti : YETIS)
+			if(yeti == npcId)
+				return true;
+		return false;
+	}
+	
+	private static void updateAttacker(int clanId, long count, boolean remove)
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement;
+			if(remove)
+			{
+				statement = con.prepareStatement("DELETE FROM rainbowsprings_attacker_list WHERE clanId = ?");
+				statement.setInt(1, clanId);
+			}
+			else
+			{
+				statement = con.prepareStatement("INSERT INTO rainbowsprings_attacker_list VALUES (?,?)");
+				statement.setInt(1, clanId);
+				statement.setLong(2, count);
+			}
+			statement.execute();
+			statement.close();
+		}
+		catch(Exception e)
+		{
+			e.printStackTrace();
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	private static void loadAttackers()
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement("SELECT * FROM rainbowsprings_attacker_list");
+			ResultSet rset = statement.executeQuery();
+			while(rset.next())
+			{
+				int clanId = rset.getInt("clan_id");
+				long count = rset.getLong("decrees_count");
+				_warDecreesCount.put(clanId, count);
+			}
+			rset.close();
+			statement.close();
+		}
+		catch(Exception e)
+		{
+			e.printStackTrace();
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	private static void setRegistrationEndString(long time)
+	{
+		Calendar c = Calendar.getInstance();
+		c.setTime(new Date(time));
+		int year = c.get(Calendar.YEAR);
+		int month = c.get(Calendar.MONTH) + 1;
+		int day = c.get(Calendar.DAY_OF_MONTH);
+		int hour = c.get(Calendar.HOUR);
+		int mins = c.get(Calendar.MINUTE);
+		
+		_registrationEnds = year+"-"+month+"-"+day+" "+hour+":"+mins;
+	}
+	
+	private static void sendMessengerMain(L2PcInstance player)
+	{
+		NpcHtmlMessage message = new NpcHtmlMessage(5);
+		message.setFile(null, "data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_main.htm");
+		message.replace("%time%", _registrationEnds);
+		player.sendPacket(message);
+	}
+	
+	public static void launchSiege()
+	{
+		_nextSiege.cancel(false);
+		ThreadPoolManager.getInstance().executeTask(new SiegeStart());
+	}
+	
+	public static void endSiege()
+	{
+		if(_siegeEnd != null)
+			_siegeEnd.cancel(false);
+		ThreadPoolManager.getInstance().executeTask(new SiegeEnd(null));
+	}
+	
+	public static void updateAdminDate(long date)
+	{
+		if(_rainbow == null)
+			_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
+		
+		_rainbow.setNextSiegeDate(date);
+		if(_nextSiege != null)
+			_nextSiege.cancel(true);
+		date -= 3600000;
+		setRegistrationEndString(date);
+		_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SetFinalAttackers(), _rainbow.getNextSiegeTime());
+	}
+	
+	public static void main(String[] args)
+	{
+		new RainbowSpringsChateau(-1, qn, "conquerablehalls");
+	}
+}

+ 4 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/caretaker_main.htm

@@ -0,0 +1,4 @@
+<html><body>Caretaker:<br>
+Is everyone ready? Well, let's get moving! Whoever's late doesn't deserve to enjoy the game!<br>
+<a action="bypass -h Quest RainbowSpringsChateau portToArena">Enter the arena.</a>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/caretaker_no_party.htm

@@ -0,0 +1,3 @@
+<html><body>
+You must have a party in order to enter the arena.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/caretaker_not_allowed.htm

@@ -0,0 +1,3 @@
+<html><body>
+Your clan is not allowed to participe in this siege
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_alredy_registered.htm

@@ -0,0 +1,3 @@
+<html><body>
+Your clan is alredy registered for this siege
+</body></html>

+ 7 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_explanation_1.htm

@@ -0,0 +1,7 @@
+<html>
+<body>
+Messenger Yeti:<br> 
+Have you ever played a high stakes event? If so, you'll understand quickly. Once you enter the arena, my good friend, the Game Coordinator, will provide instructions on how the game is played. He will then call out some words, which you must spell by breaking the treasure boxes in the four circles. Combine the letters you find into words, and take them to the Coordinator! You will then get an item for use in the game!<br>You can use this item against the Coordinator, depending on the situation. You may hit a jackpot or impede others, or sometimes my jerk friend...ehh... Well, you'll find out soon enough.<br> 
+Oh, I almost forgot the most important thing! The only way to open the Treasure Boxes is by hitting them with your <font color="LEVEL">bare hands</font>. Don't forget!<br> 
+<a action="bypass -h Quest RainbowSpringsChateau messenger_explanation_2.htm">"How many people can participate in the game?"</a><br>
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_explanation_2.htm

@@ -0,0 +1,4 @@
+<html><head><body>
+Messenger Yeti:<br> You need many people to have a fun game. You need leaders and also players...<br> 
+(You must be a Clan Leader of a Clan composed of more than five members and be above Clan level 3 in order to apply.)<br>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_explanation_3.htm

@@ -0,0 +1,3 @@
+<html><head><body>
+Messenger Yeti:<br> It's not a game where you fight, but a game played for fun, so only like-minded people are allowed to participate. You need a fair amount of people... If you have more than five, it will work.<br>(You can participate if your party is composed of more than five members and your Clan level is 3 or above.) <br>
+</body></html>

+ 8 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_main.htm

@@ -0,0 +1,8 @@
+<html><head><body>
+Messenger Yetti:<br>Pettite~ the transparent and lively building behind me is called <font color="LEVEL">Rainbow Spring</font>.It's not your ordinary hideout. You won't see a horde of peasants spilling blood for it. This one is special. Very high class... <br> 
+Registration finished at: <font color="LEVEL">%time%</font><br><br> 
+<a action="bypass -h Quest RainbowSpringsChateau messenger_explanation_1.htm">Hideout battle game instruction</a><br> 
+<a action="bypass -h Quest RainbowSpringsChateau register">Hideout battle game registration</a><br>
+<a action="bypass -h Quest RainbowSpringsChateau unregister_0">Cancel Registration</a><br>
+<a action="bypass -h npc_%objectId%_Chat 0">Get a refund during game</a><br>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_no_level.htm

@@ -0,0 +1,3 @@
+<html><body>
+To participate in the siege your clan level must be 3 or higher and have 5 or more members
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_notinlist.htm

@@ -0,0 +1,3 @@
+<html><body>
+Your clan is not participating in this siege
+</html></body>

+ 5 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_nowardecrees.htm

@@ -0,0 +1,5 @@
+<html><head>
+<body>
+Messenger Yeti:<br>To register for a Clan Hall War, you must first go fishing in Goddard Territory and obtain Clan Hall War Decrees. They compare the number of decrees submitted and select the four finalists one hour before the game starts. Those selected determine the owner of the Clan Hall by playing the game.<br>Submit as many decrees as possible! There's only one opportunity for registration!<br> 
+<a action="bypass -h Quest RainbowSpringChateau messenger_explanation_1.htm">"How do I play the game?"</a><br>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_registered.htm

@@ -0,0 +1,3 @@
+<html><body>
+Your clan has been registered for this siege
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_retrive_wardecrees.htm

@@ -0,0 +1,5 @@
+<html><body>
+Messenger Yetti:<br>
+The game is cancelled? Okay, so you get all the applications back.<br> 
+<a action="bypass -h Quest RainbowSpringsChateau unregister_2">Receive it back</a><br>
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_unregister_confirmation.htm

@@ -0,0 +1,6 @@
+<html>
+<body>
+Messenger Yeti:<br> 
+Do you absolutely have to cancel? If you cancel your registration now, we can only return half the decrees you submitted to us.<br> 
+<a action="bypass -h Quest RainbowSpringsChateau unregister_1">Cancel</a><br>
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/messenger_unregister_confirmation_no_retrive.htm

@@ -0,0 +1,6 @@
+<html>
+<body>
+Messenger Yeti:<br> 
+Do you absolutely have to cancel? If you cancel your registration now, we can't return any of the decrees you submitted to us.<br> 
+<a action="bypass -h Quest RainbowSpringsChateau unregister_1">Cancel</a><br>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/no_clan_leader.htm

@@ -0,0 +1,3 @@
+<html><body>
+Im only authorized to talk with the clan leader
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/yeti_cannot_exchange.htm

@@ -0,0 +1,4 @@
+<html><body>
+Yeti:<br>
+I cannot exchange any item with you!
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/yeti_item_exchange.htm

@@ -0,0 +1,3 @@
+<html><body>
+No data for this html
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/yeti_main.htm

@@ -0,0 +1,5 @@
+<html><body>
+No data for this html<br>
+<edit var="passage" width = 60><br1>
+<a action="bypass -h Quest RainbowSpringsChateau enterText_ $passage">Register for Siege</a><br>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/conquerablehalls/RainbowSpringsChateau/yeti_passage_used.htm

@@ -0,0 +1,3 @@
+<html><body>
+That passage have been alredy used for your clan
+</body></html>

+ 2 - 0
L2J_DataPack_BETA/data/scripts/handlers/MasterHandler.java

@@ -35,6 +35,7 @@ import handlers.admincommandhandlers.AdminAnnouncements;
 import handlers.admincommandhandlers.AdminBBS;
 import handlers.admincommandhandlers.AdminBan;
 import handlers.admincommandhandlers.AdminBuffs;
+import handlers.admincommandhandlers.AdminCHSiege;
 import handlers.admincommandhandlers.AdminCache;
 import handlers.admincommandhandlers.AdminCamera;
 import handlers.admincommandhandlers.AdminChangeAccessLevel;
@@ -315,6 +316,7 @@ public class MasterHandler
 		ADMIN.registerAdminCommandHandler(new AdminCache());
 		ADMIN.registerAdminCommandHandler(new AdminCamera());
 		ADMIN.registerAdminCommandHandler(new AdminChangeAccessLevel());
+		ADMIN.registerAdminCommandHandler(new AdminCHSiege());
 		ADMIN.registerAdminCommandHandler(new AdminClan());
 		ADMIN.registerAdminCommandHandler(new AdminCreateItem());
 		ADMIN.registerAdminCommandHandler(new AdminCursedWeapons());

+ 271 - 0
L2J_DataPack_BETA/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java

@@ -0,0 +1,271 @@
+/**
+ * 
+ */
+package handlers.admincommandhandlers;
+
+import java.util.Calendar;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.datatables.ClanTable;
+import com.l2jserver.gameserver.handler.IAdminCommandHandler;
+import com.l2jserver.gameserver.instancemanager.CHSiegeManager;
+import com.l2jserver.gameserver.model.L2Clan;
+import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.clanhall.ClanHallSiegeEngine;
+import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jserver.gameserver.network.serverpackets.SiegeInfo;
+
+/**
+ * @author BiggBoss
+ */
+public final class AdminCHSiege implements IAdminCommandHandler
+{
+	private static final String[] COMMANDS =
+	{
+		"admin_chsiege_siegablehall",				
+		"admin_chsiege_startSiege",			
+		"admin_chsiege_endsSiege",			
+		"admin_chsiege_setSiegeDate",		
+		"admin_chsiege_addAttacker",
+		"admin_chsiege_removeAttacker",
+		"admin_chsiege_clearAttackers",
+		"admin_chsiege_listAttackers"
+	};
+	
+	@Override
+	public String[] getAdminCommandList()
+	{
+		return COMMANDS;
+	}
+	
+	@Override
+	public boolean useAdminCommand(String command, L2PcInstance activeChar)
+	{
+		final String[] split = command.split(" ");
+		SiegableHall hall = null;
+		if(Config.ALT_DEV_NO_QUESTS)
+			activeChar.sendMessage("AltDevNoQuests = true; Clan Hall Sieges are disabled!");
+		else if(split.length < 2)
+			activeChar.sendMessage("You have to specify the hall id at least");
+		else if((hall = getHall(split[1], activeChar)) == null)
+			activeChar.sendMessage("Couldnt find he desired siegable hall ("+split[1]+")");
+		else if(split[0].equals(COMMANDS[1]))
+		{
+			if(hall.isInSiege())
+				activeChar.sendMessage("The requested clan hall is alredy in siege!");
+			else
+			{
+				L2Clan owner = ClanTable.getInstance().getClan(hall.getOwnerId());
+				if(owner != null)
+				{
+					hall.free();
+					owner.setHasHideout(0);
+					hall.addAttacker(owner);
+				}
+				hall.getSiege().startSiege();
+			}
+		}	
+		else if(split[0].equals(COMMANDS[2]))
+		{
+			if(!hall.isInSiege())
+				activeChar.sendMessage("The requested clan hall isnt in siege!");
+			else 
+				hall.getSiege().endSiege();
+		}
+		else if(split[0].equals(COMMANDS[3]))
+		{
+			if(!hall.isRegistering())
+				activeChar.sendMessage("Cannot change siege date while hall is in siege");
+			else if(split.length < 3)
+				activeChar.sendMessage("The date format is incorrect. Try again.");
+			else
+			{
+				String[] rawDate = split[2].split(";");
+				if(rawDate.length < 2)
+					activeChar.sendMessage("You have to specify this format DD-MM-YYYY;HH:MM");
+				else
+				{
+					String[] day = rawDate[0].split("-");
+					String[] hour = rawDate[1].split(":");
+					if(day.length < 3 || hour.length < 2)
+						activeChar.sendMessage("Incomplete day, hour or both!");
+					else
+					{
+						int d = parseInt(day[0]);
+						int month = parseInt(day[1]) - 1;
+						int year = parseInt(day[2]);
+						int h = parseInt(hour[0]);
+						int min = parseInt(hour[1]);
+						if((month == 2 && d > 28) || d > 31 || d <= 0 
+								|| month <= 0 || month > 12
+								|| year < Calendar.getInstance().get(Calendar.YEAR))
+							activeChar.sendMessage("Wrong day/month/year gave!");
+						else if(h <= 0 || h > 24
+								|| min < 0 || min >= 60)
+							activeChar.sendMessage("Wrong hour/minutes gave!");
+						else
+						{
+							Calendar c = Calendar.getInstance();
+							c.set(Calendar.YEAR, year);
+							c.set(Calendar.MONTH, month);
+							c.set(Calendar.DAY_OF_MONTH, d);
+							c.set(Calendar.HOUR_OF_DAY, h);
+							c.set(Calendar.MINUTE, min);
+							c.set(Calendar.SECOND, 0);
+							
+							if(c.getTimeInMillis() > System.currentTimeMillis())
+							{
+								activeChar.sendMessage(hall.getName()+" siege: "+c.getTime().toString());
+								hall.setNextSiegeDate(c.getTimeInMillis());
+								hall.getSiege().updateSiege();
+								hall.updateDb();
+							}
+							else
+								activeChar.sendMessage("The given time is in the past!");
+						}
+					}
+					
+				}
+			}
+		}
+		else if(split[0].equals(COMMANDS[4]))
+		{
+			if(hall.isInSiege())
+			{
+				activeChar.sendMessage("The clan hall is in siege, cannot add attackers now.");
+				return false;
+			}
+		
+			L2Clan attacker = null;
+			if(split.length < 3)
+			{	
+				L2Object rawTarget = activeChar.getTarget();
+				L2PcInstance target = null;
+				if(rawTarget == null)
+					activeChar.sendMessage("You must target a clan member of the attacker!");
+				else if(!(rawTarget instanceof L2PcInstance))
+					activeChar.sendMessage("You must target a player with clan!");
+				else if((target = (L2PcInstance)rawTarget).getClan() == null)
+					activeChar.sendMessage("Your target does not have any clan!");
+				else if(hall.getSiege().checkIsAttacker(target.getClan()))
+					activeChar.sendMessage("Your target's clan is alredy participating!");
+				else
+					attacker = target.getClan();
+			}
+			else
+			{
+				L2Clan rawClan = ClanTable.getInstance().getClanByName(split[2]);
+				if(rawClan == null)
+					activeChar.sendMessage("The given clan does not exist!");
+				else if(hall.getSiege().checkIsAttacker(rawClan))
+					activeChar.sendMessage("The given clan is alredy participating!");
+				else
+					attacker = rawClan;
+			}
+			
+			if(attacker != null)
+				hall.addAttacker(attacker);
+		}
+		else if(split[0].equals(COMMANDS[5]))
+		{
+			if(hall.isInSiege())
+			{
+				activeChar.sendMessage("The clan hall is in siege, cannot remove attackers now.");
+				return false;
+			}
+			
+			if(split.length < 3)
+			{
+				L2Object rawTarget = activeChar.getTarget();
+				L2PcInstance target = null;
+				if(rawTarget == null)
+					activeChar.sendMessage("You must target a clan member of the attacker!");
+				else if(!(rawTarget instanceof L2PcInstance))
+					activeChar.sendMessage("You must target a player with clan!");
+				else if((target = (L2PcInstance)rawTarget).getClan() == null)
+					activeChar.sendMessage("Your target does not have any clan!");
+				else if(!hall.getSiege().checkIsAttacker(target.getClan()))
+					activeChar.sendMessage("Your target's clan is not participating!");
+				else
+					hall.removeAttacker(target.getClan());
+			}
+			else
+			{
+				L2Clan rawClan = ClanTable.getInstance().getClanByName(split[2]);
+				if(rawClan == null)
+					activeChar.sendMessage("The given clan does not exist!");
+				else if(!hall.getSiege().checkIsAttacker(rawClan))
+					activeChar.sendMessage("The given clan is not participating!");
+				else
+					hall.removeAttacker(rawClan);
+			}
+		}
+		else if(split[0].equals(COMMANDS[6]))
+		{
+			if(hall.isInSiege())
+				activeChar.sendMessage("The requested hall is in siege right now, cannot clear attacker list!");
+			else
+			{
+				ClanHallSiegeEngine siegable = hall.getSiege();
+				siegable.getAttackers().clear();
+			}
+		}
+		else if(split[0].equals(COMMANDS[7]))
+			activeChar.sendPacket(new SiegeInfo(hall));
+			
+		sendSiegableHallPage(activeChar, split[1], hall);
+		return false;
+	}
+	
+	private SiegableHall getHall(String id, L2PcInstance gm)
+	{
+		int ch = parseInt(id);
+		if(ch == 0)
+		{
+			gm.sendMessage("Wrong clan hall id, unparseable id!");
+			return null;
+		}
+		
+		SiegableHall hall = CHSiegeManager.getInstance().getSiegableHall(ch);
+		
+		if(hall == null)
+			gm.sendMessage("Couldnt find the clan hall.");
+		
+		return hall;
+	}
+	
+	private int parseInt(String st)
+	{
+		int val = 0;
+		try
+		{
+			val = Integer.parseInt(st);
+		}
+		catch(NumberFormatException e)
+		{
+			e.printStackTrace();
+		}
+		return val;
+	}
+	
+	private void sendSiegableHallPage(L2PcInstance activeChar, String hallId, SiegableHall hall)
+	{
+		NpcHtmlMessage msg = new NpcHtmlMessage(5);
+		msg.setFile(null, "data/html/admin/siegablehall.htm");
+		msg.replace("%clanhallId%", hallId);
+		msg.replace("%clanhallName%", hall.getName());
+		if(hall.getOwnerId() > 0)
+		{
+			L2Clan owner = ClanTable.getInstance().getClan(hall.getOwnerId());
+			if(owner != null)
+				msg.replace("%clanhallOwner%", owner.getName());
+			else
+				msg.replace("%clanhallOwner%", "No Owner");
+		}
+		else
+			msg.replace("%clanhallOwner%", "No Owner");
+		activeChar.sendPacket(msg);
+	}
+}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно