Guest User

Untitled

a guest
Jun 30th, 2016
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 375.69 KB | None | 0 0
  1. Index: aCis_datapack/data/html/admin/knownlist.htm
  2. ===================================================================
  3. --- aCis_datapack/data/html/admin/knownlist.htm (revision 2)
  4. +++ aCis_datapack/data/html/admin/knownlist.htm (working copy)
  5. @@ -1,8 +1,11 @@
  6.  <html><body>
  7.     <center>Knownlist for <font color="LEVEL">%target%</font></center><br>
  8. -   Knownlist is <font color="LEVEL">%type%</font>, has <font color="LEVEL">%size%</font> objects.
  9. +   Knownlist has <font color="LEVEL">%size%</font> objects.
  10.     <table width=270>
  11. -       <tr><td width=170></td><td width=100></td></tr>
  12. +       <tr><td width=150></td><td width=120></td></tr>
  13.         %knownlist%
  14. +   </table><br>
  15. +   <table width=270 bgcolor=444444>
  16. +       <tr><td width=270>Page: %pages%</td></tr>
  17.     </table>
  18.  </body></html>
  19. \ No newline at end of file
  20. Index: aCis_datapack/data/html/default/30747.htm
  21. ===================================================================
  22. --- aCis_datapack/data/html/default/30747.htm   (revision 2)
  23. +++ aCis_datapack/data/html/default/30747.htm   (working copy)
  24. @@ -1,4 +1,4 @@
  25.  <html><body>Fairy Mimyu:<br>
  26. -Ah...! I've returned to this world after a long time; so why is it so busy like this? There are people everywhere... Is some half-wit going to catch and stuff me?... Have hunters come all the way up to here now? I mean, how many more do they have to kill to be satisfied?... Yah! That's dangerous! It's dangerous! Don't kill me...<br>
  27. +It has been many years since I visited this place... Why is it so busy? People everywhere... I am afraid some half-wit is going to try to catch and stuff me! Are there hunters about? How many more of us must die to satisfy their ignorant blood lust? It's dangerous I tell you! Don't let them kill me...<br>
  28.  <a action="bypass -h npc_%objectId%_Quest">Quest</a>
  29.  </body></html>
  30. \ No newline at end of file
  31. Index: aCis_datapack/data/html/mods/wedding/disabled.htm
  32. ===================================================================
  33. --- aCis_datapack/data/html/mods/wedding/disabled.htm   (revision 0)
  34. +++ aCis_datapack/data/html/mods/wedding/disabled.htm   (working copy)
  35. @@ -0,0 +1,5 @@
  36. +<html><body>
  37. +   The Wedding Manager is currently disabled.<br>
  38. +   Contact an administrator in order to enable it via configuration files. It can be found in <font color="LEVEL">events.properties</font>.<br>
  39. +   <font color="LEVEL">AllowWedding</font> have to be set on <font color="LEVEL">True</font> (False by default).
  40. +</body></html>
  41. \ No newline at end of file
  42. Index: aCis_datapack/data/html/mods/wedding/error_adena.htm
  43. ===================================================================
  44. --- aCis_datapack/data/html/mods/wedding/error_adena.htm    (revision 0)
  45. +++ aCis_datapack/data/html/mods/wedding/error_adena.htm    (working copy)
  46. @@ -0,0 +1,4 @@
  47. +<html><body>
  48. +   You or your partner haven't enough adenas.<br>
  49. +   You need <font color="LEVEL">%adenasCost% adenas</font> to pay marriage fees.
  50. +</body></html>
  51. \ No newline at end of file
  52. Index: aCis_datapack/data/html/mods/wedding/error_alreadymarried.htm
  53. ===================================================================
  54. --- aCis_datapack/data/html/mods/wedding/error_alreadymarried.htm   (revision 0)
  55. +++ aCis_datapack/data/html/mods/wedding/error_alreadymarried.htm   (working copy)
  56. @@ -0,0 +1,4 @@
  57. +<html><body>
  58. +   I'm sorry, but this player is already married.<br>
  59. +   Find another belover, or ask him/her to divorce first.
  60. +</body></html>
  61. \ No newline at end of file
  62. Index: aCis_datapack/data/html/mods/wedding/error_friendlist.htm
  63. ===================================================================
  64. --- aCis_datapack/data/html/mods/wedding/error_friendlist.htm   (revision 0)
  65. +++ aCis_datapack/data/html/mods/wedding/error_friendlist.htm   (working copy)
  66. @@ -0,0 +1,4 @@
  67. +<html><body>
  68. +   This player isn't on your friends list. You must be friends in order to marry.<br>
  69. +   To invite someone as a friend, type /friendinvite Name, where Name is the player's name. He/she has to accept you.
  70. +</body></html>
  71. \ No newline at end of file
  72. Index: aCis_datapack/data/html/mods/wedding/error_noformal.htm
  73. ===================================================================
  74. --- aCis_datapack/data/html/mods/wedding/error_noformal.htm (revision 0)
  75. +++ aCis_datapack/data/html/mods/wedding/error_noformal.htm (working copy)
  76. @@ -0,0 +1,4 @@
  77. +<html><body>
  78. +   You or your partner aren't wearing a Formal wear, so go find one and come back later !<br>
  79. +   I heard <font color="LEVEL">Trader Alexis</font> in Aden town can help you, if you don't know how to get one.
  80. +</body></html>
  81. \ No newline at end of file
  82. Index: aCis_datapack/data/html/mods/wedding/error_sex.htm
  83. ===================================================================
  84. --- aCis_datapack/data/html/mods/wedding/error_sex.htm  (revision 0)
  85. +++ aCis_datapack/data/html/mods/wedding/error_sex.htm  (working copy)
  86. @@ -0,0 +1,4 @@
  87. +<html><body>
  88. +   Homosexual marriages aren't allowed.<br>
  89. +   Your partner has to be from opposite sex in order I accept your request.
  90. +</body></html>
  91. \ No newline at end of file
  92. Index: aCis_datapack/data/html/mods/wedding/error_wrongtarget.htm
  93. ===================================================================
  94. --- aCis_datapack/data/html/mods/wedding/error_wrongtarget.htm  (revision 0)
  95. +++ aCis_datapack/data/html/mods/wedding/error_wrongtarget.htm  (working copy)
  96. @@ -0,0 +1,4 @@
  97. +<html><body>
  98. +   Is there something wrong with you ?<br>
  99. +   You try to marry with yourself ! Target another player.
  100. +</body></html>
  101. \ No newline at end of file
  102. Index: aCis_datapack/data/html/mods/wedding/notfound.htm
  103. ===================================================================
  104. --- aCis_datapack/data/html/mods/wedding/notfound.htm   (revision 0)
  105. +++ aCis_datapack/data/html/mods/wedding/notfound.htm   (working copy)
  106. @@ -0,0 +1,3 @@
  107. +<html><body>
  108. +   Your friend must be online to begin the marriage process.
  109. +</body></html>
  110. \ No newline at end of file
  111. Index: aCis_datapack/data/html/mods/wedding/start.htm
  112. ===================================================================
  113. --- aCis_datapack/data/html/mods/wedding/start.htm  (revision 0)
  114. +++ aCis_datapack/data/html/mods/wedding/start.htm  (working copy)
  115. @@ -0,0 +1,16 @@
  116. +<html><body>
  117. +   Hi there !<br>
  118. +   So, you decided to marry ? In order to get married, <font color="LEVEL">you need first to be on your beloved's friends list.</font> To do this, you have to type "/friendinvite Name" without the quotes, where Name is the name of your partner.<br>
  119. +   Once friends, ask me to get married. You and your partner <font color="LEVEL">%needOrNot% need to wear Formal wear</font>, and the wedding ceremony's formalities worth <font color="LEVEL">%adenasCost% adenas</font>.<br>
  120. +  
  121. +   <table width=270>
  122. +       <tr>
  123. +           <td width=130><font color="LEVEL">I want to bind my life to</font></td>
  124. +           <td width=100><edit var="beloved" width=100 height=15></td>
  125. +           <td width=40><button value="Accept" action="bypass -h npc_%objectId%_AskWedding $beloved" width=40 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
  126. +       </tr>
  127. +   </table>
  128. +  
  129. +   <br><center><img src="L2UI_CH3.herotower_deco" width=256 height=32></center><br>
  130. +   Come speak to me anew once married, I could teleport you to your beloved, or even pronounces a divorce if you think he/she wasn't the good one.
  131. +</body></html>
  132. \ No newline at end of file
  133. Index: aCis_datapack/data/html/mods/wedding/start2.htm
  134. ===================================================================
  135. --- aCis_datapack/data/html/mods/wedding/start2.htm (revision 0)
  136. +++ aCis_datapack/data/html/mods/wedding/start2.htm (working copy)
  137. @@ -0,0 +1,6 @@
  138. +<html><body>
  139. +   Hello there, how can I help you on this beautiful day ?<br>
  140. +   <center><a action="bypass -h npc_%objectId%_GoToLove">Teleport me near my beloved.</a>
  141. +   <br>
  142. +   <a action="bypass -h npc_%objectId%_Divorce">I want to divorce.</a></center>
  143. +</body></html>
  144. \ No newline at end of file
  145. Index: aCis_datapack/data/html/mods/wedding/waitforpartner.htm
  146. ===================================================================
  147. --- aCis_datapack/data/html/mods/wedding/waitforpartner.htm (revision 0)
  148. +++ aCis_datapack/data/html/mods/wedding/waitforpartner.htm (working copy)
  149. @@ -0,0 +1,4 @@
  150. +<html><body>
  151. +   You or your partner asked to marry ! If you're the requestor, wait until your partner accepted or declined your request.<br>
  152. +   If you're the requested, what are you waiting for to say "Yes" or "No" ? I won't answer for you !
  153. +</body></html>
  154. \ No newline at end of file
  155. Index: aCis_datapack/data/xml/npcs/31000-31999.xml
  156. ===================================================================
  157. --- aCis_datapack/data/xml/npcs/31000-31999.xml (revision 2)
  158. +++ aCis_datapack/data/xml/npcs/31000-31999.xml (working copy)
  159. @@ -27339,7 +27339,7 @@
  160.         <set name="walkSpd" val="80"/>
  161.         <set name="runSpd" val="120"/>
  162.         <set name="dropHerbGroup" val="0"/>
  163. -       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" clan="all_elemental_clan" clanRange="300" canMove="true" seedable="false"/>
  164. +       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="1000" clan="all_elemental_clan" clanRange="300" canMove="true" seedable="false"/>
  165.         <skills>
  166.             <skill id="4045" level="1"/>
  167.             <skill id="4416" level="13"/>
  168. @@ -27409,7 +27409,7 @@
  169.         <set name="walkSpd" val="12"/>
  170.         <set name="runSpd" val="12"/>
  171.         <set name="dropHerbGroup" val="0"/>
  172. -       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" clan="all_elemental2_clan" clanRange="300" canMove="true" seedable="false"/>
  173. +       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="1000" clan="all_elemental2_clan" clanRange="300" canMove="true" seedable="false"/>
  174.         <skills>
  175.             <skill id="4045" level="1"/>
  176.             <skill id="4416" level="7"/>
  177. @@ -27444,7 +27444,7 @@
  178.         <set name="walkSpd" val="12"/>
  179.         <set name="runSpd" val="12"/>
  180.         <set name="dropHerbGroup" val="0"/>
  181. -       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" clan="all_elemental_clan" clanRange="300" canMove="true" seedable="false"/>
  182. +       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="1000" clan="all_elemental_clan" clanRange="300" canMove="true" seedable="false"/>
  183.         <skills>
  184.             <skill id="4045" level="1"/>
  185.             <skill id="4416" level="7"/>
  186. Index: aCis_datapack/data/xml/skills/0300-0399.xml
  187. ===================================================================
  188. --- aCis_datapack/data/xml/skills/0300-0399.xml (revision 2)
  189. +++ aCis_datapack/data/xml/skills/0300-0399.xml (working copy)
  190. @@ -1787,7 +1787,7 @@
  191.                 <sub order="0x40" stat="cancelVuln" val="80" />
  192.                 <mul order="0x30" stat="gainHp" val="2" />
  193.                 <mul order="0x30" stat="pDef" val="0.75"/>
  194. -               <mul order="0x30" stat="mDef" val="0.75"/>
  195. +               <sub order="0x40" stat="mDef" val="25"/>
  196.             </effect>
  197.             <effect name="BlockDebuff" time="120" noicon="1" val="0" stackOrder="3" stackType="abnormal_debuff_invincibility" />
  198.         </for>
  199. Index: aCis_datapack/data/xml/skills/0400-0499.xml
  200. ===================================================================
  201. --- aCis_datapack/data/xml/skills/0400-0499.xml (revision 2)
  202. +++ aCis_datapack/data/xml/skills/0400-0499.xml (working copy)
  203. @@ -383,6 +383,7 @@
  204.     <skill id="413" levels="8" name="Rapid Fire">
  205.         <table name="#mpConsume"> 28 29 30 31 32 33 34 34 </table>
  206.         <table name="#atk"> 62 67 73 78 83 88 94 100 </table>
  207. +       <table name="#stackOrder"> 1 2 3 4 5 6 7 8 </table>
  208.         <set name="mpConsume" val="#mpConsume"/>
  209.         <set name="target" val="TARGET_SELF"/>
  210.         <set name="skillType" val="BUFF"/>
  211. @@ -391,7 +392,7 @@
  212.         <set name="hitTime" val="2000"/>
  213.         <set name="weaponsAllowed" val="BOW" /> <!-- Bow -->
  214.         <for>
  215. -           <effect count="1" name="Buff" time="120" val="0">
  216. +           <effect count="1" name="Buff" time="120" val="0" stackOrder="#stackOrder" stackType="rapid_fire">
  217.                 <add order="0x40" stat="pAtk" val="#atk">
  218.                     <using kind="BOW"/>
  219.                 </add>
  220. @@ -500,7 +501,7 @@
  221.         <set name="itemConsumeId" val="1661"/>
  222.         <set name="mpConsume" val="#mpConsume"/>
  223.         <set name="hitTime" val="3000"/>
  224. -       <set name="reuseDelay" val="120000"/>
  225. +       <set name="reuseDelay" val="1200000"/>
  226.         <set name="target" val="TARGET_SELF"/>
  227.         <set name="skillType" val="EXTRACTABLE" />
  228.         <set name="operateType" val="OP_ACTIVE"/>
  229. @@ -798,6 +799,7 @@
  230.     </skill>
  231.     <skill id="439" levels="1" name="Shield of Revenge">
  232.         <set name="magicLvl" val="79" />
  233. +       <set name="mpConsume" val="87"/>
  234.         <set name="hitTime" val="4000" />
  235.         <set name="mpConsume" val="78" />
  236.         <set name="operateType" val="OP_ACTIVE" />
  237. @@ -882,10 +884,10 @@
  238.         <set name="target" val="TARGET_AREA_CORPSE_MOB" />
  239.     </skill>
  240.     <skill id="445" levels="1" name="Mirage">
  241. -       <set name="aggroPoints" val="673" />
  242. +       <set name="aggroPoints" val="669" />
  243.         <set name="hitTime" val="2000"/>  
  244.         <set name="magicLvl" val="79"/>
  245. -       <set name="mpConsume" val="43"/>
  246. +       <set name="mpConsume" val="63"/>
  247.         <set name="operateType" val="OP_ACTIVE"/>
  248.         <set name="reuseDelay" val="300000"/>
  249.         <set name="skillType" val="BUFF"/>
  250. @@ -895,29 +897,31 @@
  251.         </for>
  252.     </skill>
  253.     <skill id="446" levels="1" name="Dodge">
  254. +       <set name="aggroPoints" val="669" />
  255.         <set name="hitTime" val="500" />
  256. -       <set name="mpConsume" val="29" />
  257. +       <set name="mpConsume" val="49" />
  258.         <set name="operateType" val="OP_ACTIVE" />
  259. -       <set name="reuseDelay" val="150000" />
  260. +       <set name="reuseDelay" val="300000" />
  261.         <set name="skillType" val="BUFF" />
  262.         <set name="target" val="TARGET_SELF" />
  263.         <for>
  264.             <effect name="Buff" time="5" val="0" stackOrder="1" stackType="avoid_skill">
  265. -               <add order="0x40" stat="pSkillEvas" val="90" />
  266. +               <add order="0x40" stat="pSkillEvas" val="100" />
  267.             </effect>
  268.         </for>
  269.     </skill>
  270.     <skill id="447" levels="1" name="Counterattack">
  271. +       <set name="aggroPoints" val="669" />
  272.         <set name="magicLvl" val="79" />
  273.         <set name="hitTime" val="500" />
  274. -       <set name="mpConsume" val="29" />
  275. +       <set name="mpConsume" val="49" />
  276.         <set name="operateType" val="OP_ACTIVE" />
  277. -       <set name="reuseDelay" val="150000" />
  278. +       <set name="reuseDelay" val="300000" />
  279.         <set name="skillType" val="BUFF" />
  280.         <set name="target" val="TARGET_SELF" />
  281.         <for>
  282. -           <effect name="Buff" time="10" val="0" stackOrder="1" stackType="counter_skill">
  283. -               <add order="0x40" stat="vengeancePdam" val="90" />
  284. +           <effect name="Buff" time="5" val="0" stackOrder="1" stackType="counter_skill">
  285. +               <add order="0x40" stat="vengeancePdam" val="100" />
  286.             </effect>
  287.         </for>
  288.     </skill>
  289. @@ -1020,8 +1024,9 @@
  290.             </effect>
  291.         </for>
  292.     </skill>
  293. -   <skill id="452" levels="5" name="Shock Stomp">
  294. -       <table name="#effectPower"> 40 50 60 70 80 </table>
  295. +   <skill id="452" levels="5" name="Shock Stomp" enchantLevels1="30" >
  296. +       <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 82 83 83 83 84 84 85 85 85 </table>
  297. +       <table name="#ench1power"> 50 51 52 52 53 54 54 55 56 56 57 58 58 59 60 60 61 62 62 63 64 64 65 66 66 67 68 68 69 70 </table>
  298.         <table name="#magicLvl"> 55 60 64 68 72 </table>
  299.         <table name="#mpConsume"> 55 55 55 55 55 </table>
  300.         <set name="weaponsAllowed" val="POLE"/>
  301. @@ -1037,9 +1042,11 @@
  302.         <set name="operateType" val="OP_ACTIVE"/>
  303.         <set name="skillType" val="STUN" />
  304.         <set name="isDebuff" val="true" />
  305. +       <enchant1 name="power" val="#ench1power"/>
  306. +       <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  307.         <for>
  308. -           <effect name="Stun" time="5" val="0" stackOrder="2" stackType="stun" />
  309. -           <effect name="RemoveTarget" noicon="1" val="0" effectPower="#effectPower" effectType="DEBUFF" />
  310. +           <effect name="Stun" time="9" val="0" stackOrder="2" stackType="stun" />
  311. +           <effect name="RemoveTarget" noicon="1" val="0" effectPower="50" effectType="DEBUFF" />
  312.         </for>
  313.     </skill>
  314.     <skill id="453" levels="1" name="Escape Shackle">
  315. Index: aCis_datapack/data/xml/skills/1000-1099.xml
  316. ===================================================================
  317. --- aCis_datapack/data/xml/skills/1000-1099.xml (revision 2)
  318. +++ aCis_datapack/data/xml/skills/1000-1099.xml (working copy)
  319. @@ -845,9 +845,13 @@
  320.             </effect>
  321.         </enchant1for>
  322.     </skill>
  323. -   <skill id="1045" levels="6" name="Blessed Body">
  324. -       <table name="#mpInitialConsume"> 8 9 10 11 12 14 </table>
  325. -       <table name="#mpConsume"> 31 35 38 41 48 53 </table>
  326. +   <skill id="1045" levels="6" name="Blessed Body" enchantLevels1="30" enchantLevels2="30" >
  327. +       <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 83 83 83 84 84 84 85 85 85 </table>
  328. +       <table name="#ench2mpInitialConsume"> 13 13 13 12 12 12 12 11 11 11 11 11 10 10 10 10 9 9 9 9 9 8 8 8 8 7 7 7 7 7 </table>
  329. +       <table name="#ench2MpConsume"> 52 51 50 50 48 47 46 46 45 44 43 42 41 40 39 38 38 37 36 35 34 33 32 31 30 30 29 28 27 26 </table>
  330. +       <table name="#ench1time"> 1240 1280 1320 1360 1400 1440 1480 1520 1560 1600 1640 1680 1720 1760 1800 1840 1880 1920 1960 2000 2040 2080 2120 2160 2200 2240 2280 2320 2360 2400 </table>
  331. +       <table name="#mpInitialConsume"> 8 9 10 10 12 13 </table>
  332. +       <table name="#mpConsume"> 31 35 38 42 48 54 </table>
  333.         <table name="#maxHp"> 1.1 1.15 1.2 1.25 1.3 1.35 </table>
  334.         <table name="#stackOrder"> 1 2 3 4 5 6 </table>
  335.         <table name="#aggro"> 418 457 495 532 597 646 </table>
  336. @@ -862,11 +866,20 @@
  337.         <set name="castRange" val="400"/>
  338.         <set name="effectRange" val="900"/>
  339.         <set name="aggroPoints" val="#aggro"/>
  340. +       <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  341. +       <enchant2 name="magicLvl" val="#enchantMagicLvl"/>     
  342. +       <enchant2 name="mpConsume" val="#ench2MpConsume"/>
  343. +       <enchant2 name="mpInitialConsume" val="#ench2mpInitialConsume"/>
  344.         <for>
  345.             <effect name="Buff" time="1200" val="0" stackOrder="#stackOrder" stackType="max_hp_up">
  346.                 <mul order="0x30" stat="maxHp" val="#maxHp"/>
  347.             </effect>
  348.         </for>
  349. +       <enchant1for>
  350. +           <effect name="Buff" time="#ench1time" val="0" stackOrder="6" stackType="max_hp_up">
  351. +               <mul order="0x30" stat="maxHp" val="1.35"/>
  352. +           </effect>
  353. +       </enchant1for>
  354.     </skill>
  355.     <skill id="1047" levels="4" name="Mana Regeneration">
  356.         <table name="#regMp"> 1.72 2.16 2.74 3.09 </table>
  357. @@ -892,9 +905,13 @@
  358.             </effect>
  359.         </for>
  360.     </skill>
  361. -   <skill id="1048" levels="6" name="Blessed Soul">
  362. -       <table name="#mpInitialConsume"> 8 9 10 11 12 13 </table>
  363. -       <table name="#mpConsume"> 31 35 38 41 46 52 </table>
  364. +   <skill id="1048" levels="6" name="Blessed Soul" enchantLevels1="30" enchantLevels2="30" >
  365. +       <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 83 83 83 84 84 84 85 85 85 </table>
  366. +       <table name="#ench2mpInitialConsume"> 13 12 12 12 12 11 11 11 11 11 10 10 10 10 10 9 9 9 9 8 8 8 8 8 7 7 7 7 6 6 </table>
  367. +       <table name="#ench2MpConsume"> 50 50 49 48 46 46 45 45 44 42 42 41 40 38 38 38 37 36 34 34 33 32 32 30 30 29 28 26 26 26 </table>
  368. +       <table name="#ench1time"> 1240 1280 1320 1360 1400 1440 1480 1520 1560 1600 1640 1680 1720 1760 1800 1840 1880 1920 1960 2000 2040 2080 2120 2160 2200 2240 2280 2320 2360 2400 </table>
  369. +       <table name="#mpInitialConsume"> 8 9 10 10 12 13 </table>
  370. +       <table name="#mpConsume"> 31 35 38 42 46 52 </table>
  371.         <table name="#maxMp"> 1.1 1.15 1.2 1.25 1.3 1.35 </table>
  372.         <table name="#mpConsume"> 39 44 48 52 62 70 </table>
  373.         <table name="#stackOrder"> 1 2 3 4 5 6 </table>
  374. @@ -910,11 +927,20 @@
  375.         <set name="castRange" val="400"/>
  376.         <set name="effectRange" val="900"/>
  377.         <set name="aggroPoints" val="#aggro"/>
  378. +       <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  379. +       <enchant2 name="magicLvl" val="#enchantMagicLvl"/>     
  380. +       <enchant2 name="mpConsume" val="#ench2MpConsume"/>
  381. +       <enchant2 name="mpInitialConsume" val="#ench2mpInitialConsume"/>
  382.         <for>
  383.             <effect name="Buff" time="1200" val="0" stackOrder="#stackOrder" stackType="max_mp_up">
  384.                 <mul order="0x30" stat="maxMp" val="#maxMp"/>
  385.             </effect>
  386.         </for>
  387. +       <enchant1for>
  388. +           <effect name="Buff" time="#ench1time" val="0" stackOrder="6" stackType="max_mp_up">
  389. +               <mul order="0x30" stat="maxMp" val="1.35"/>
  390. +           </effect>
  391. +       </enchant1for>
  392.     </skill>
  393.     <skill id="1049" levels="14" name="Requiem">
  394.         <table name="#mpInitialConsume"> 11 12 13 14 16 16 17 18 18 19 19 20 20 21 </table>
  395. @@ -1567,7 +1593,7 @@
  396.         <set name="castRange" val="600"/>
  397.         <set name="effectRange" val="1100"/>
  398.         <for>
  399. -           <effect count="5" name="Fear" time="6" val="0" stackOrder="1" stackType="turn_flee"/>
  400. +           <effect name="Fear" time="30" val="0" stackOrder="1" stackType="turn_flee"/>
  401.         </for>
  402.     </skill>
  403.     <skill id="1095" levels="5" name="Venom">
  404. Index: aCis_datapack/data/xml/skills/1100-1199.xml
  405. ===================================================================
  406. --- aCis_datapack/data/xml/skills/1100-1199.xml (revision 2)
  407. +++ aCis_datapack/data/xml/skills/1100-1199.xml (working copy)
  408. @@ -874,7 +874,7 @@
  409.         <set name="castRange" val="600"/>
  410.         <set name="effectRange" val="1100"/>
  411.         <for>
  412. -           <effect count="5" name="Fear" time="6" val="0" stackOrder="1" stackType="turn_flee" />
  413. +           <effect name="Fear" time="30" val="0" stackOrder="1" stackType="turn_flee" />
  414.         </for>
  415.     </skill>
  416.     <skill id="1170" levels="13" name="Anchor" enchantLevels1="30" enchantLevels2="30" >
  417. Index: aCis_datapack/data/xml/skills/1200-1299.xml
  418. ===================================================================
  419. --- aCis_datapack/data/xml/skills/1200-1299.xml (revision 2)
  420. +++ aCis_datapack/data/xml/skills/1200-1299.xml (working copy)
  421. @@ -1374,10 +1374,10 @@
  422.         <enchant2 name="mpConsume" val="#ench2MpConsume"/>
  423.         <enchant2 name="mpInitialConsume" val="#ench2mpInitialConsume"/>
  424.         <for>
  425. -           <effect time="15" name="HealOverTime" val="#hot" stackOrder="#stackOrder" stackType="life_force_orc"/>
  426. +           <effect count="15" name="HealOverTime" val="#hot" stackOrder="#stackOrder" stackType="life_force_orc"/>
  427.         </for>
  428.         <enchant1for>
  429. -           <effect time="15" name="HealOverTime" val="#ench1hot" stackOrder="#ench1stackOrder" stackType="life_force_orc"/>
  430. +           <effect count="15" name="HealOverTime" val="#ench1hot" stackOrder="#ench1stackOrder" stackType="life_force_orc"/>
  431.         </enchant1for>
  432.     </skill>
  433.     <skill id="1257" levels="3" name="Decrease Weight" enchantLevels1="30" enchantLevels2="30" >
  434. Index: aCis_datapack/data/xml/skills/1300-1399.xml
  435. ===================================================================
  436. --- aCis_datapack/data/xml/skills/1300-1399.xml (revision 2)
  437. +++ aCis_datapack/data/xml/skills/1300-1399.xml (working copy)
  438. @@ -1573,7 +1573,10 @@
  439.             <effect name="Betray" time="30" val="0" stackOrder="1" stackType="derangement" />
  440.         </for>
  441.     </skill>
  442. -   <skill id="1381" levels="5" name="Mass Fear">
  443. +   <skill id="1381" levels="5" name="Mass Fear" enchantLevels1="30" enchantLevels2="30" >
  444. +       <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 82 83 83 83 84 84 85 85 85 </table>
  445. +       <table name="#ench2Power"> 20 21 22 22 23 24 24 25 26 26 27 28 28 29 30 30 31 32 32 33 34 34 35 36 36 37 38 38 39 40 </table>
  446. +       <table name="#ench1MpConsume"> 100 98 97 96 95 93 91 90 88 87 86 85 83 82 81 80 78 77 75 73 72 71 70 68 67 66 65 63 62 60  </table>
  447.         <table name="#magicLvl"> 58 62 66 70 74 </table>
  448.         <table name="#mpConsume"> 80 87 93 98 103 </table>
  449.         <set name="magicLvl" val="#magicLvl" />
  450. @@ -1585,16 +1588,23 @@
  451.         <set name="skillRadius" val="200"/>
  452.         <set name="skillType" val="FEAR"/>
  453.         <set name="operateType" val="OP_ACTIVE"/>
  454. -       <set name="power" val="30" /> <!-- Base Land Rate -->
  455. +       <set name="power" val="20" /> <!-- Base Land Rate -->
  456.         <set name="castRange" val="500"/>
  457.         <set name="effectRange" val="1000"/>
  458.         <set name="isMagic" val="true"/>
  459.         <set name="isDebuff" val="true" />
  460. +       <enchant1 name="mpConsume" val="#ench1MpConsume"/>
  461. +       <enchant2 name="power" val="#ench2Power"/>
  462. +       <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  463. +       <enchant2 name="magicLvl" val="#enchantMagicLvl"/>
  464.         <for>
  465. -           <effect count="5" name="Fear" time="6" val="0" stackOrder="1" stackType="turn_flee" />
  466. +           <effect name="Fear" time="30" val="0" stackOrder="1" stackType="turn_flee" />
  467.         </for>
  468.     </skill>
  469. -   <skill id="1382" levels="5" name="Mass Gloom">
  470. +   <skill id="1382" levels="5" name="Mass Gloom" enchantLevels1="30" enchantLevels2="30" >
  471. +       <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 82 83 83 83 84 84 85 85 85 </table>
  472. +       <table name="#ench2Power"> 40 41 42 42 43 44 44 45 46 46 47 48 48 49 50 50 51 52 52 53 54 54 55 56 56 57 58 58 59 60 </table>
  473. +       <table name="#ench1MpConsume"> 100 98 97 96 95 93 91 90 88 87 86 85 83 82 81 80 78 77 75 73 72 71 70 68 67 66 65 63 62 60  </table>
  474.         <table name="#magicLvl"> 58 62 66 70 74 </table>
  475.         <table name="#mpConsume"> 80 87 93 98 103 </table>
  476.         <table name="#itemConsumeCount"> 4 4 4 5 5 </table>
  477. @@ -1614,6 +1624,10 @@
  478.         <set name="power" val="40" /> <!-- Base Land Rate -->
  479.         <set name="castRange" val="900"/>
  480.         <set name="effectRange" val="1400"/>
  481. +       <enchant1 name="mpConsume" val="#ench1MpConsume"/>
  482. +       <enchant2 name="power" val="#ench2Power"/>
  483. +       <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  484. +       <enchant2 name="magicLvl" val="#enchantMagicLvl"/>
  485.         <for>
  486.             <effect name="Debuff" time="15" val="0" stackOrder="3" stackType="md_down">
  487.                 <mul order="0x30" stat="mDef" val="0.77" />
  488. @@ -1865,7 +1879,10 @@
  489.             </effect>
  490.         </for>
  491.     </skill>
  492. -   <skill id="1394" levels="10" name="Trance">
  493. +   <skill id="1394" levels="10" name="Trance" enchantLevels1="30" enchantLevels2="30" >
  494. +       <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 82 83 83 83 84 84 85 85 85 </table>
  495. +       <table name="#ench2Power"> 80 81 82 82 83 84 84 85 86 86 87 88 88 89 90 90 91 92 92 93 94 94 95 96 96 97 98 98 99 100 </table>
  496. +       <table name="#ench1MpConsume"> 32 32 32 31 31 31 30 30 28 28 28 27 27 27 26 26 26 25 25 23 23 23 22 22 22 21 21 21 20 20  </table>
  497.         <table name="#magicLvl"> 56 58 60 62 64 66 68 70 72 74 </table>
  498.         <table name="#mpConsume"> 27 28 28 29 30 32 33 33 34 35 </table>
  499.         <set name="magicLvl" val="#magicLvl" />
  500. @@ -1881,11 +1898,17 @@
  501.         <set name="effectRange" val="1100"/>
  502.         <set name="isMagic" val="true"/>
  503.         <set name="isDebuff" val="true" />
  504. +       <enchant1 name="mpConsume" val="#ench1MpConsume"/>
  505. +       <enchant2 name="power" val="#ench2Power"/>
  506. +       <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  507. +       <enchant2 name="magicLvl" val="#enchantMagicLvl"/>
  508.         <for>
  509.             <effect name="Sleep" time="15" val="0" stackOrder="1" stackType="sleep" />
  510.         </for>
  511.     </skill>
  512. -   <skill id="1395" levels="10" name="Erase">
  513. +   <skill id="1395" levels="10" name="Erase" enchantLevels1="30" >
  514. +       <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 82 83 83 83 84 84 85 85 85 </table>
  515. +       <table name="#ench1MpConsume"> 66 65 65 63 62 62 61 60 58 58 57 56 55 55 53 52 52 51 50 48 48 47 46 45 45 43 42 42 41 40  </table>
  516.         <table name="#mpConsume"> 52 54 55 58 60 62 64 65 67 69 </table>
  517.         <table name="#itemConsumeCount"> 3 3 3 3 4 4 4 5 5 5 </table>
  518.         <table name="#magicLvl"> 56 58 60 62 64 66 68 70 72 74 </table>
  519. @@ -1901,8 +1924,13 @@
  520.         <set name="power" val="100" /> <!-- Base Land Rate -->
  521.         <set name="castRange" val="600"/>
  522.         <set name="isMagic" val="true"/>
  523. +       <enchant1 name="mpConsume" val="#ench1MpConsume"/>
  524. +       <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  525.     </skill>
  526. -   <skill id="1396" levels="10" name="Magical Backfire">
  527. +   <skill id="1396" levels="10" name="Magical Backfire" enchantLevels1="30" enchantLevels2="30" >
  528. +       <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 82 83 83 83 84 84 85 85 85 </table>
  529. +       <table name="#ench2Power"> 80 81 82 82 83 84 84 85 86 86 87 88 88 89 90 90 91 92 92 93 94 94 95 96 96 97 98 98 99 100 </table>
  530. +       <table name="#ench1MpConsume"> 66 65 65 63 62 62 61 60 58 58 57 56 55 55 53 52 52 51 50 48 48 47 46 45 45 43 42 42 41 40 </table>
  531.         <table name="#mpConsume"> 52 54 55 58 60 62 64 65 67 69 </table>
  532.         <table name="#magicLvl"> 56 58 60 62 64 66 68 70 72 74 </table>
  533.         <set name="magicLvl" val="#magicLvl" />
  534. @@ -1918,6 +1946,10 @@
  535.         <set name="castRange" val="600"/>
  536.         <set name="effectRange" val="1100"/>
  537.         <set name="isMagic" val="true"/>
  538. +       <enchant1 name="mpConsume" val="#ench1MpConsume"/>
  539. +       <enchant2 name="power" val="#ench2Power"/>
  540. +       <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  541. +       <enchant2 name="magicLvl" val="#enchantMagicLvl"/>
  542.         <for>
  543.             <effect name="Debuff" time="30" val="0" stackOrder="3" stackType="mp_cost_up">
  544.                 <mul order="0x30" stat="MagicalMpConsumeRate" val="3" />
  545. Index: aCis_datapack/data/xml/skills/1400-1499.xml
  546. ===================================================================
  547. --- aCis_datapack/data/xml/skills/1400-1499.xml (revision 2)
  548. +++ aCis_datapack/data/xml/skills/1400-1499.xml (working copy)
  549. @@ -208,18 +208,18 @@
  550.     </skill>
  551.     <skill id="1411" levels="1" name="Mystic Immunity">
  552.         <set name="castRange" val="400"/>
  553. -       <set name="effectRange" val="900"/>
  554. +       <set name="effectRange" val="600"/>
  555.         <set name="hitTime" val="4000"/>
  556.         <set name="isMagic" val="true"/>
  557.         <set name="magicLvl" val="79"/>
  558.         <set name="mpConsume" val="73"/>
  559.         <set name="operateType" val="OP_ACTIVE"/>
  560. -       <set name="reuseDelay" val="600000"/>
  561. +       <set name="reuseDelay" val="120000"/>
  562.         <set name="skillType" val="BUFF"/>
  563. -       <set name="target" val="TARGET_ONE"/>
  564. +       <set name="target" val="TARGET_PARTY_MEMBER"/>
  565.         <for>
  566. -           <effect name="BlockBuff" time="30" val="0" stackOrder="3" stackType="abnormal_buff_invincibility" />
  567. -           <effect name="BlockDebuff" time="30" noicon="1" val="0" stackOrder="3" stackType="abnormal_debuff_invincibility" />
  568. +           <effect name="BlockBuff" time="30" val="0" stackOrder="2" stackType="abnormal_buff_invincibility" />
  569. +           <effect name="BlockDebuff" time="30" noicon="1" val="0" stackOrder="2" stackType="abnormal_debuff_invincibility" />
  570.         </for>
  571.     </skill>
  572.     <skill id="1412" levels="1" name="Spell Turning">
  573. @@ -323,16 +323,16 @@
  574.         <set name="mpConsume" val="228" />
  575.         <set name="itemConsumeId" val="3031"/>
  576.         <set name="itemConsumeCount" val="20"/>
  577. -       <set name="power" val="100"/>
  578. +       <set name="power" val="800"/>
  579.         <set name="target" val="TARGET_ALLY"/>
  580.         <set name="skillRadius" val="1000"/>
  581.         <set name="reuseDelay" val="1200000"/>
  582.         <set name="hitTime" val="2500"/>
  583. -       <set name="skillType" val="CPHEAL_PERCENT" />
  584. +       <set name="skillType" val="COMBATPOINTHEAL" />
  585.         <set name="isMagic" val="true"/>
  586.         <set name="operateType" val="OP_ACTIVE"/>
  587.         <for>
  588. -           <effect name="Buff" time="300" val="0" stackOrder="2" stackType="cp_up">
  589. +           <effect name="Buff" time="300" val="0" stackOrder="1" stackType="cp_up">
  590.                 <add order="0x40" stat="maxCp" val="800" />
  591.             </effect>
  592.         </for>
  593. Index: aCis_datapack/data/xml/skills/3100-3199.xml
  594. ===================================================================
  595. --- aCis_datapack/data/xml/skills/3100-3199.xml (revision 2)
  596. +++ aCis_datapack/data/xml/skills/3100-3199.xml (working copy)
  597. @@ -343,23 +343,23 @@
  598.         </for>
  599.     </skill>
  600.     <skill id="3125" levels="10" name="Item Skill: Battle Roar">
  601. -       <table name="#mpInitialConsume"> 10 11 11 12 13 13 14 15 16 17 </table>
  602. -       <table name="#mpConsume"> 38 42 44 47 51 52 55 58 61 65 </table>
  603. -       <table name="#magicLvl"> 46 49 52 55 58 61 64 67 70 75 </table>
  604. +       <table name="#mpConsume"> 48 53 55 59 64 65 69 73 77 82 </table>
  605. +       <table name="#magicLvl"> 40 44 48 52 56 60 64 68 72 76 </table>
  606. +       <table name="#stackOrder"> 1 2 3 4 5 6 7 8 9 10 </table>
  607. +       <table name="#maxHp"> 30 60 90 120 150 180 210 240 270 300 </table>
  608.         <set name="magicLvl" val="#magicLvl" />
  609. -       <set name="mpInitialConsume" val="#mpInitialConsume" />
  610.         <set name="mpConsume" val="#mpConsume" />
  611. -       <set name="power" val="3" />
  612. +       <set name="power" val="#maxHp" />
  613.         <set name="target" val="TARGET_SELF" />
  614. -       <set name="reuseDelay" val="300000" />
  615. +       <set name="reuseDelay" val="180000" />
  616.         <set name="staticReuse" val="true" />
  617. -       <set name="hitTime" val="4000" />
  618. +       <set name="hitTime" val="1500" />
  619.         <set name="skillType" val="HEAL_PERCENT" />
  620.         <set name="operateType" val="OP_ACTIVE" />
  621.         <set name="staticHitTime" val="true" />
  622.         <for>
  623. -           <effect name="Buff" time="120" val="0" stackOrder="1" stackType="abnormal_item">
  624. -               <mul order="0x40" stat="maxHp" val="1.03" />
  625. +           <effect name="Buff" time="120" val="0" stackOrder="#stackOrder" stackType="abnormal_item" >
  626. +               <add order="0x40" stat="maxHp" val="#maxHp" />
  627.             </effect>
  628.         </for>
  629.     </skill>
  630. Index: aCis_datapack/data/xml/skills/3500-3599.xml
  631. ===================================================================
  632. --- aCis_datapack/data/xml/skills/3500-3599.xml (revision 2)
  633. +++ aCis_datapack/data/xml/skills/3500-3599.xml (working copy)
  634. @@ -898,6 +898,7 @@
  635.         <for>
  636.             <mul order="0x30" stat="maxHp" val="1.25"/> <!-- HP +25% -->
  637.             <mul order="0x30" stat="maxMp" val="1.30"/> <!-- MP +30% -->
  638. +           <mul order="0x30" stat="maxCp" val="1.5"/> <!-- CP +50% -->
  639.             <mul order="0x30" stat="rShld" val="1.39"/> <!-- Shield Block Rate +39% -->
  640.             <mul order="0x30" stat="pvpPhysDmg" val="1.05"/> <!-- PVP Damage Bonus +5% -->
  641.             <mul order="0x30" stat="pvpMagicalDmg" val="1.05"/> <!-- PVP Damage Bonus +5% -->
  642. Index: aCis_datapack/data/xml/skills/5000-5099.xml
  643. ===================================================================
  644. --- aCis_datapack/data/xml/skills/5000-5099.xml (revision 2)
  645. +++ aCis_datapack/data/xml/skills/5000-5099.xml (working copy)
  646. @@ -1249,29 +1249,32 @@
  647.         <set name="magicLvl" val="80" />
  648.         <set name="mpConsume" val="#mpConsume" />
  649.         <set name="power" val="2112" />
  650. -       <set name="target" val="TARGET_AURA" />
  651. +       <set name="target" val="TARGET_ONE" />
  652.         <set name="skillRadius" val="150" />
  653.         <set name="hitTime" val="1500" />
  654.         <set name="coolTime" val="800" />
  655. +       <set name="reuseDelay" val="6000"/>
  656.         <set name="skillType" val="PDAM" />
  657.         <set name="operateType" val="OP_ACTIVE" />
  658.     </skill>
  659.     <skill id="5083" levels="4" name="Shock">
  660.         <table name="#mpConsume"> 93 93 93 5 </table>
  661. -       <set name="magicLvl" val="80" />
  662. +       <table name="#magicLvl"> 80 82 84 86 </table>
  663. +       <set name="magicLvl" val="#magicLvl" />
  664.         <set name="lvlDepend" val="1" />
  665.         <set name="mpConsume" val="#mpConsume" />
  666.         <set name="power" val="1704" />
  667.         <set name="target" val="TARGET_ONE" />
  668.         <set name="hitTime" val="1500" />
  669. -       <set name="coolTime" val="800" />
  670. +       <set name="reuseDelay" val="6000"/>
  671.         <set name="skillType" val="PDAM" />
  672.         <set name="operateType" val="OP_ACTIVE" />
  673.         <set name="isDebuff" val="true" />
  674.         <set name="castRange" val="40" />
  675.         <set name="effectRange" val="200" />
  676.         <for>
  677. -           <effect name="Stun" time="9" val="0" effectPower="50" effectType="STUN" stackOrder="1" stackType="stun" />
  678. +           <effect name="Stun" time="9" val="0" effectPower="80" effectType="STUN" stackOrder="1" stackType="stun" />
  679. +           <effect name="RemoveTarget" noicon="1" val="0"/>
  680.         </for>
  681.     </skill>
  682.     <skill id="5084" levels="4" name="NPC Blinding Blow">
  683. @@ -1286,7 +1289,7 @@
  684.         <set name="skillType" val="BLOW" />
  685.         <set name="operateType" val="OP_ACTIVE" />
  686.         <set name="castRange" val="40" />
  687. -       <set name="effectRange" val="200" />
  688. +       <set name="effectRange" val="60" />
  689.         <for>
  690.             <effect self="1" name="Buff" time="15" val="0" stackOrder="1" stackType="speed_up_special">
  691.                 <add order="0x40" stat="runSpd" val="40" />
  692. @@ -1308,6 +1311,7 @@
  693.         <set name="effectRange" val="900"/>
  694.         <for>
  695.             <effect count="1" name="Stun" time="9" val="0" stackOrder="1" stackType="Stun" effectPower="50" effectType="STUN"/>
  696. +            <effect name="RemoveTarget" noicon="1" val="0" effectPower="50" effectType="DEBUFF"/>
  697.         </for>
  698.     </skill>
  699.     <skill id="5086" levels="1" name="Deadly Poison">
  700. Index: aCis_datapack/data/xml/skillstrees/enchant_skills_tree.xml
  701. ===================================================================
  702. --- aCis_datapack/data/xml/skillstrees/enchant_skills_tree.xml  (revision 2)
  703. +++ aCis_datapack/data/xml/skillstrees/enchant_skills_tree.xml  (working copy)
  704. @@ -14941,6 +14941,134 @@
  705.         <data level="130" type="+30 Summon" enchant="30" />
  706.     </enchant>
  707.    
  708. +   <!-- Mass Fear -->
  709. +   <enchant id="1381" name="Mass Fear" baseLvl="5">
  710. +       <data level="101" type="+1 Cost" enchant="1" />
  711. +       <data level="102" type="+2 Cost" enchant="2" />
  712. +       <data level="103" type="+3 Cost" enchant="3" />
  713. +       <data level="104" type="+4 Cost" enchant="4" />
  714. +       <data level="105" type="+5 Cost" enchant="5" />
  715. +       <data level="106" type="+6 Cost" enchant="6" />
  716. +       <data level="107" type="+7 Cost" enchant="7" />
  717. +       <data level="108" type="+8 Cost" enchant="8" />
  718. +       <data level="109" type="+9 Cost" enchant="9" />
  719. +       <data level="110" type="+10 Cost" enchant="10" />
  720. +       <data level="111" type="+11 Cost" enchant="11" />
  721. +       <data level="112" type="+12 Cost" enchant="12" />
  722. +       <data level="113" type="+13 Cost" enchant="13" />
  723. +       <data level="114" type="+14 Cost" enchant="14" />
  724. +       <data level="115" type="+15 Cost" enchant="15" />
  725. +       <data level="116" type="+16 Cost" enchant="16" />
  726. +       <data level="117" type="+17 Cost" enchant="17" />
  727. +       <data level="118" type="+18 Cost" enchant="18" />
  728. +       <data level="119" type="+19 Cost" enchant="19" />
  729. +       <data level="120" type="+20 Cost" enchant="20" />
  730. +       <data level="121" type="+21 Cost" enchant="21" />
  731. +       <data level="122" type="+22 Cost" enchant="22" />
  732. +       <data level="123" type="+23 Cost" enchant="23" />
  733. +       <data level="124" type="+24 Cost" enchant="24" />
  734. +       <data level="125" type="+25 Cost" enchant="25" />
  735. +       <data level="126" type="+26 Cost" enchant="26" />
  736. +       <data level="127" type="+27 Cost" enchant="27" />
  737. +       <data level="128" type="+28 Cost" enchant="28" />
  738. +       <data level="129" type="+29 Cost" enchant="29" />
  739. +       <data level="130" type="+30 Cost" enchant="30" />
  740. +       <data level="141" type="+1 Chance" enchant="1" />
  741. +       <data level="142" type="+2 Chance" enchant="2" />
  742. +       <data level="143" type="+3 Chance" enchant="3" />
  743. +       <data level="144" type="+4 Chance" enchant="4" />
  744. +       <data level="145" type="+5 Chance" enchant="5" />
  745. +       <data level="146" type="+6 Chance" enchant="6" />
  746. +       <data level="147" type="+7 Chance" enchant="7" />
  747. +       <data level="148" type="+8 Chance" enchant="8" />
  748. +       <data level="149" type="+9 Chance" enchant="9" />
  749. +       <data level="150" type="+10 Chance" enchant="10" />
  750. +       <data level="151" type="+11 Chance" enchant="11" />
  751. +       <data level="152" type="+12 Chance" enchant="12" />
  752. +       <data level="153" type="+13 Chance" enchant="13" />
  753. +       <data level="154" type="+14 Chance" enchant="14" />
  754. +       <data level="155" type="+15 Chance" enchant="15" />
  755. +       <data level="156" type="+16 Chance" enchant="16" />
  756. +       <data level="157" type="+17 Chance" enchant="17" />
  757. +       <data level="158" type="+18 Chance" enchant="18" />
  758. +       <data level="159" type="+19 Chance" enchant="19" />
  759. +       <data level="160" type="+20 Chance" enchant="20" />
  760. +       <data level="161" type="+21 Chance" enchant="21" />
  761. +       <data level="162" type="+22 Chance" enchant="22" />
  762. +       <data level="163" type="+23 Chance" enchant="23" />
  763. +       <data level="164" type="+24 Chance" enchant="24" />
  764. +       <data level="165" type="+25 Chance" enchant="25" />
  765. +       <data level="166" type="+26 Chance" enchant="26" />
  766. +       <data level="167" type="+27 Chance" enchant="27" />
  767. +       <data level="168" type="+28 Chance" enchant="28" />
  768. +       <data level="169" type="+29 Chance" enchant="29" />
  769. +       <data level="170" type="+30 Chance" enchant="30" />
  770. +   </enchant>
  771. +  
  772. +   <!-- Mass Gloom -->
  773. +   <enchant id="1382" name="Mass Gloom" baseLvl="5">
  774. +       <data level="101" type="+1 Cost" enchant="1" />
  775. +       <data level="102" type="+2 Cost" enchant="2" />
  776. +       <data level="103" type="+3 Cost" enchant="3" />
  777. +       <data level="104" type="+4 Cost" enchant="4" />
  778. +       <data level="105" type="+5 Cost" enchant="5" />
  779. +       <data level="106" type="+6 Cost" enchant="6" />
  780. +       <data level="107" type="+7 Cost" enchant="7" />
  781. +       <data level="108" type="+8 Cost" enchant="8" />
  782. +       <data level="109" type="+9 Cost" enchant="9" />
  783. +       <data level="110" type="+10 Cost" enchant="10" />
  784. +       <data level="111" type="+11 Cost" enchant="11" />
  785. +       <data level="112" type="+12 Cost" enchant="12" />
  786. +       <data level="113" type="+13 Cost" enchant="13" />
  787. +       <data level="114" type="+14 Cost" enchant="14" />
  788. +       <data level="115" type="+15 Cost" enchant="15" />
  789. +       <data level="116" type="+16 Cost" enchant="16" />
  790. +       <data level="117" type="+17 Cost" enchant="17" />
  791. +       <data level="118" type="+18 Cost" enchant="18" />
  792. +       <data level="119" type="+19 Cost" enchant="19" />
  793. +       <data level="120" type="+20 Cost" enchant="20" />
  794. +       <data level="121" type="+21 Cost" enchant="21" />
  795. +       <data level="122" type="+22 Cost" enchant="22" />
  796. +       <data level="123" type="+23 Cost" enchant="23" />
  797. +       <data level="124" type="+24 Cost" enchant="24" />
  798. +       <data level="125" type="+25 Cost" enchant="25" />
  799. +       <data level="126" type="+26 Cost" enchant="26" />
  800. +       <data level="127" type="+27 Cost" enchant="27" />
  801. +       <data level="128" type="+28 Cost" enchant="28" />
  802. +       <data level="129" type="+29 Cost" enchant="29" />
  803. +       <data level="130" type="+30 Cost" enchant="30" />
  804. +       <data level="141" type="+1 Chance" enchant="1" />
  805. +       <data level="142" type="+2 Chance" enchant="2" />
  806. +       <data level="143" type="+3 Chance" enchant="3" />
  807. +       <data level="144" type="+4 Chance" enchant="4" />
  808. +       <data level="145" type="+5 Chance" enchant="5" />
  809. +       <data level="146" type="+6 Chance" enchant="6" />
  810. +       <data level="147" type="+7 Chance" enchant="7" />
  811. +       <data level="148" type="+8 Chance" enchant="8" />
  812. +       <data level="149" type="+9 Chance" enchant="9" />
  813. +       <data level="150" type="+10 Chance" enchant="10" />
  814. +       <data level="151" type="+11 Chance" enchant="11" />
  815. +       <data level="152" type="+12 Chance" enchant="12" />
  816. +       <data level="153" type="+13 Chance" enchant="13" />
  817. +       <data level="154" type="+14 Chance" enchant="14" />
  818. +       <data level="155" type="+15 Chance" enchant="15" />
  819. +       <data level="156" type="+16 Chance" enchant="16" />
  820. +       <data level="157" type="+17 Chance" enchant="17" />
  821. +       <data level="158" type="+18 Chance" enchant="18" />
  822. +       <data level="159" type="+19 Chance" enchant="19" />
  823. +       <data level="160" type="+20 Chance" enchant="20" />
  824. +       <data level="161" type="+21 Chance" enchant="21" />
  825. +       <data level="162" type="+22 Chance" enchant="22" />
  826. +       <data level="163" type="+23 Chance" enchant="23" />
  827. +       <data level="164" type="+24 Chance" enchant="24" />
  828. +       <data level="165" type="+25 Chance" enchant="25" />
  829. +       <data level="166" type="+26 Chance" enchant="26" />
  830. +       <data level="167" type="+27 Chance" enchant="27" />
  831. +       <data level="168" type="+28 Chance" enchant="28" />
  832. +       <data level="169" type="+29 Chance" enchant="29" />
  833. +       <data level="170" type="+30 Chance" enchant="30" />
  834. +   </enchant>
  835. +  
  836.     <!-- Trance -->
  837.     <enchant id="1394" name="Trance" baseLvl="10">
  838.         <data level="101" type="+1 Cost" enchant="1" />
  839. Index: aCis_datapack/sql/mods_wedding.sql
  840. ===================================================================
  841. --- aCis_datapack/sql/mods_wedding.sql  (revision 2)
  842. +++ aCis_datapack/sql/mods_wedding.sql  (working copy)
  843. @@ -1,7 +1,6 @@
  844. CREATE TABLE IF NOT EXISTS `mods_wedding` (
  845. -  `id` int(11) NOT NULL auto_increment,
  846. -  `player1Id` int(11) NOT NULL default '0',
  847. -  `player2Id` int(11) NOT NULL default '0',
  848. -  `married` varchar(5) default NULL,
  849. -  PRIMARY KEY  (`id`)
  850. +  `id` INT UNSIGNED NOT NULL DEFAULT 0,
  851. +  `requesterId` INT UNSIGNED NOT NULL DEFAULT 0,
  852. +  `partnerId` INT UNSIGNED NOT NULL DEFAULT 0,
  853. +  PRIMARY KEY (`id`)
  854. );
  855. \ No newline at end of file
  856. Index: aCis_gameserver/config/npcs.properties
  857. ===================================================================
  858. --- aCis_gameserver/config/npcs.properties  (revision 2)
  859. +++ aCis_gameserver/config/npcs.properties  (working copy)
  860. @@ -252,15 +252,4 @@
  861. MinNPCAnimation = 20
  862. MaxNPCAnimation = 40
  863. MinMonsterAnimation = 10
  864. -MaxMonsterAnimation = 40
  865. -
  866. -# Grid options: Grids can now turn themselves on and off.  This also affects the loading
  867. -# and processing of all AI tasks and (in the future) geodata within this grid.
  868. -# Turn on for a grid with a person in it is immediate, but it then turns on
  869. -# the 8 neighboring grids based on the specified number of seconds.
  870. -# Turn off for self and neighbors occures after the specified number of
  871. -# seconds have passed during which a grid has had no players in or in any of its neighbors.
  872. -# The always on option allows to ignore all this and let all grids be active at all times
  873. -GridsAlwaysOn = False
  874. -GridNeighborTurnOnTime = 1
  875. -GridNeighborTurnOffTime = 90
  876. \ No newline at end of file
  877. +MaxMonsterAnimation = 40
  878. \ No newline at end of file
  879. Index: aCis_gameserver/dist/LoginServer_loop.sh
  880. ===================================================================
  881. --- aCis_gameserver/dist/LoginServer_loop.sh    (revision 2)
  882. +++ aCis_gameserver/dist/LoginServer_loop.sh    (working copy)
  883. @@ -5,7 +5,7 @@
  884. do
  885.     [ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
  886.     [ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
  887. -   nice -n -2 java -Xmx512m -cp ./libs/*:l2jserver.jar net.sf.l2j.loginserver.L2LoginServer > log/stdout.log 2>&1
  888. +   nice -n -2 java -Xmx32m -cp ./libs/*:l2jserver.jar net.sf.l2j.loginserver.L2LoginServer > log/stdout.log 2>&1
  889.     err=$?
  890.  #  /etc/init.d/mysql restart
  891.     sleep 10;
  892. Index: aCis_gameserver/dist/startLoginServer.bat
  893. ===================================================================
  894. --- aCis_gameserver/dist/startLoginServer.bat   (revision 2)
  895. +++ aCis_gameserver/dist/startLoginServer.bat   (working copy)
  896. @@ -1,7 +1,7 @@
  897. @echo off
  898. title aCis loginserver console
  899. :start
  900. -java -Xmx128m -cp ./libs/*; net.sf.l2j.loginserver.L2LoginServer
  901. +java -Xmx32m -cp ./libs/*; net.sf.l2j.loginserver.L2LoginServer
  902. if ERRORLEVEL 2 goto restart
  903. if ERRORLEVEL 1 goto error
  904. goto end
  905. Index: aCis_gameserver/java/net/sf/l2j/Config.java
  906. ===================================================================
  907. --- aCis_gameserver/java/net/sf/l2j/Config.java (revision 2)
  908. +++ aCis_gameserver/java/net/sf/l2j/Config.java (working copy)
  909. @@ -371,10 +371,6 @@
  910.     public static int MIN_MONSTER_ANIMATION;
  911.     public static int MAX_MONSTER_ANIMATION;
  912.    
  913. -   public static boolean GRIDS_ALWAYS_ON;
  914. -   public static int GRID_NEIGHBOR_TURNON_TIME;
  915. -   public static int GRID_NEIGHBOR_TURNOFF_TIME;
  916. -  
  917.     // --------------------------------------------------
  918.     // Players
  919.     // --------------------------------------------------
  920. @@ -1075,10 +1071,6 @@
  921.         MAX_NPC_ANIMATION = npcs.getProperty("MaxNPCAnimation", 40);
  922.         MIN_MONSTER_ANIMATION = npcs.getProperty("MinMonsterAnimation", 10);
  923.         MAX_MONSTER_ANIMATION = npcs.getProperty("MaxMonsterAnimation", 40);
  924. -      
  925. -       GRIDS_ALWAYS_ON = npcs.getProperty("GridsAlwaysOn", false);
  926. -       GRID_NEIGHBOR_TURNON_TIME = npcs.getProperty("GridNeighborTurnOnTime", 1);
  927. -       GRID_NEIGHBOR_TURNOFF_TIME = npcs.getProperty("GridNeighborTurnOffTime", 90);
  928.     }
  929.    
  930.     /**
  931. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/CtrlEvent.java
  932. ===================================================================
  933. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/CtrlEvent.java    (revision 2)
  934. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/CtrlEvent.java    (working copy)
  935. @@ -43,8 +43,6 @@
  936.     EVT_ARRIVED,
  937.     /** The actor cannot move anymore. */
  938.     EVT_ARRIVED_BLOCKED,
  939. -   /** Forgets an object (if it's used as attack target, follow target and so on. */
  940. -   EVT_FORGET_OBJECT,
  941.     /**
  942.      * Attempt to cancel current step execution, but not change the intention. For example, the actor was put into a stun, so it's current attack or movement has to be canceled. But after the stun state expired, the actor may try to attack again. Another usage for CANCEL is a user's attempt to
  943.      * cancel a cast/bow attack and so on.
  944. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/AbstractAI.java
  945. ===================================================================
  946. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/AbstractAI.java (revision 2)
  947. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/AbstractAI.java (working copy)
  948. @@ -283,9 +283,6 @@
  949.             case EVT_ARRIVED_BLOCKED:
  950.                 onEvtArrivedBlocked((SpawnLocation) arg0);
  951.                 break;
  952. -           case EVT_FORGET_OBJECT:
  953. -               onEvtForgetObject((L2Object) arg0);
  954. -               break;
  955.             case EVT_CANCEL:
  956.                 onEvtCancel();
  957.                 break;
  958. @@ -354,8 +351,6 @@
  959.    
  960.     protected abstract void onEvtArrivedBlocked(SpawnLocation loc);
  961.    
  962. -   protected abstract void onEvtForgetObject(L2Object object);
  963. -  
  964.     protected abstract void onEvtCancel();
  965.    
  966.     protected abstract void onEvtDead();
  967. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2AttackableAI.java
  968. ===================================================================
  969. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2AttackableAI.java (revision 2)
  970. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2AttackableAI.java (working copy)
  971. @@ -242,7 +242,7 @@
  972.             if (!npc.isAlikeDead())
  973.             {
  974.                 // If its _knownPlayer isn't empty set the Intention to ACTIVE
  975. -               if (!npc.getKnownList().getKnownType(L2PcInstance.class).isEmpty())
  976. +               if (!npc.getKnownType(L2PcInstance.class).isEmpty())
  977.                     intention = CtrlIntention.ACTIVE;
  978.                 else
  979.                 {
  980. @@ -342,7 +342,7 @@
  981.         if (_globalAggro >= 0)
  982.         {
  983.             // Get all visible objects inside its Aggro Range
  984. -           for (L2Character target : npc.getKnownList().getKnownType(L2Character.class))
  985. +           for (L2Character target : npc.getKnownType(L2Character.class))
  986.             {
  987.                 // Check to see if this is a festival mob spawn. If it is, then check to see if the aggro trigger is a festival participant...if so, move to attack it.
  988.                 if (npc instanceof L2FestivalMonsterInstance && target instanceof L2PcInstance)
  989. @@ -425,7 +425,7 @@
  990.         else
  991.         {
  992.             // Return to home if too far.
  993. -           if (npc.returnHome())
  994. +           if (npc.returnHome(false))
  995.                 return;
  996.            
  997.             // Random walk otherwise.
  998. @@ -618,7 +618,7 @@
  999.                     if (sk.getTargetType() == SkillTargetType.TARGET_ONE)
  1000.                     {
  1001.                         final String[] actorClans = npc.getTemplate().getClans();
  1002. -                       for (L2Attackable obj : npc.getKnownList().getKnownTypeInRadius(L2Attackable.class, sk.getCastRange() + actorCollision))
  1003. +                       for (L2Attackable obj : npc.getKnownTypeInRadius(L2Attackable.class, sk.getCastRange() + actorCollision))
  1004.                         {
  1005.                             if (obj.isDead())
  1006.                                 continue;
  1007. @@ -741,9 +741,9 @@
  1008.        
  1009.         if (Rnd.get(100) <= 3)
  1010.         {
  1011. -           for (L2Object nearby : npc.getKnownList().getKnownObjects())
  1012. +           for (L2Attackable nearby : npc.getKnownTypeInRadius(L2Attackable.class, actorCollision))
  1013.             {
  1014. -               if (nearby instanceof L2Attackable && npc.isInsideRadius(nearby, actorCollision, false, false) && nearby != attackTarget)
  1015. +               if (nearby != attackTarget)
  1016.                 {
  1017.                     int newX = combinedCollision + Rnd.get(40);
  1018.                     if (Rnd.nextBoolean())
  1019. @@ -903,7 +903,7 @@
  1020.                
  1021.                 if (sk.getTargetType() == SkillTargetType.TARGET_ONE)
  1022.                 {
  1023. -                   for (L2Attackable obj : caster.getKnownList().getKnownTypeInRadius(L2Attackable.class, (int) (sk.getCastRange() + caster.getCollisionRadius())))
  1024. +                   for (L2Attackable obj : caster.getKnownTypeInRadius(L2Attackable.class, (int) (sk.getCastRange() + caster.getCollisionRadius())))
  1025.                     {
  1026.                         if (obj.isDead())
  1027.                             continue;
  1028. @@ -927,7 +927,7 @@
  1029.                
  1030.                 if (sk.getTargetType() == SkillTargetType.TARGET_PARTY)
  1031.                 {
  1032. -                   for (L2Attackable obj : caster.getKnownList().getKnownTypeInRadius(L2Attackable.class, (int) (sk.getSkillRadius() + caster.getCollisionRadius())))
  1033. +                   for (L2Attackable obj : caster.getKnownTypeInRadius(L2Attackable.class, (int) (sk.getSkillRadius() + caster.getCollisionRadius())))
  1034.                     {
  1035.                         if (!ArraysUtil.contains(caster.getTemplate().getClans(), obj.getTemplate().getClans()))
  1036.                             continue;
  1037. @@ -1286,7 +1286,7 @@
  1038.         // If hate list gave nothing, then verify first if the actor is aggressive, and then pickup a victim from his knownlist.
  1039.         if (actor.isAggressive())
  1040.         {
  1041. -           for (L2Character target : actor.getKnownList().getKnownTypeInRadius(L2Character.class, actor.getTemplate().getAggroRange()))
  1042. +           for (L2Character target : actor.getKnownTypeInRadius(L2Character.class, actor.getTemplate().getAggroRange()))
  1043.             {
  1044.                 if (!autoAttackCondition(target))
  1045.                     continue;
  1046. @@ -1426,7 +1426,7 @@
  1047.             final String[] actorClans = me.getTemplate().getClans();
  1048.             if (actorClans != null && me.getAttackByList().contains(attacker))
  1049.             {
  1050. -               for (L2Attackable called : me.getKnownList().getKnownTypeInRadius(L2Attackable.class, me.getTemplate().getClanRange()))
  1051. +               for (L2Attackable called : me.getKnownTypeInRadius(L2Attackable.class, me.getTemplate().getClanRange()))
  1052.                 {
  1053.                     // Caller hasn't AI or is dead.
  1054.                     if (!called.hasAI() || called.isDead())
  1055. @@ -1515,7 +1515,7 @@
  1056.         final String[] actorClans = me.getTemplate().getClans();
  1057.         if (actorClans != null && me.getAttackByList().contains(target))
  1058.         {
  1059. -           for (L2Attackable called : me.getKnownList().getKnownTypeInRadius(L2Attackable.class, me.getTemplate().getClanRange()))
  1060. +           for (L2Attackable called : me.getKnownTypeInRadius(L2Attackable.class, me.getTemplate().getClanRange()))
  1061.             {
  1062.                 // Caller hasn't AI or is dead.
  1063.                 if (!called.hasAI() || called.isDead())
  1064. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2CharacterAI.java
  1065. ===================================================================
  1066. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2CharacterAI.java  (revision 2)
  1067. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2CharacterAI.java  (working copy)
  1068. @@ -619,59 +619,6 @@
  1069.     }
  1070.    
  1071.     /**
  1072. -    * Launch actions corresponding to the Event ForgetObject.
  1073. -    * <ul>
  1074. -    * <li>If the object was targeted and the Intention was INTERACT or PICK_UP, set the Intention to ACTIVE</li>
  1075. -    * <li>If the object was targeted to attack, stop the auto-attack, cancel target and set the Intention to ACTIVE</li>
  1076. -    * <li>If the object was targeted to cast, cancel target and set the Intention to ACTIVE</li>
  1077. -    * <li>If the object was targeted to follow, stop the movement, cancel AI Follow Task and set the Intention to ACTIVE</li>
  1078. -    * <li>If the targeted object was the actor , cancel AI target, stop AI Follow Task, stop the movement and set the Intention to IDLE</li>
  1079. -    * </ul>
  1080. -    */
  1081. -   @Override
  1082. -   protected void onEvtForgetObject(L2Object object)
  1083. -   {
  1084. -       // Check if the object was targeted to attack
  1085. -       if (getTarget() == object)
  1086. -       {
  1087. -           // Cancel attack target
  1088. -           setTarget(null);
  1089. -          
  1090. -           // Set the Intention of this AbstractAI to ACTIVE
  1091. -           setIntention(CtrlIntention.ACTIVE);
  1092. -       }
  1093. -      
  1094. -       // Check if the object was targeted to follow
  1095. -       if (getFollowTarget() == object)
  1096. -       {
  1097. -           // Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation (broadcast)
  1098. -           clientStopMoving(null);
  1099. -          
  1100. -           // Stop an AI Follow Task
  1101. -           stopFollow();
  1102. -          
  1103. -           // Set the Intention of this AbstractAI to ACTIVE
  1104. -           setIntention(CtrlIntention.ACTIVE);
  1105. -       }
  1106. -      
  1107. -       // Check if the targeted object was the actor
  1108. -       if (_actor == object)
  1109. -       {
  1110. -           // Cancel AI target
  1111. -           setTarget(null);
  1112. -          
  1113. -           // Stop an AI Follow Task
  1114. -           stopFollow();
  1115. -          
  1116. -           // Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation (broadcast)
  1117. -           clientStopMoving(null);
  1118. -          
  1119. -           // Set the Intention of this AbstractAI to IDLE
  1120. -           changeIntention(CtrlIntention.IDLE, null, null);
  1121. -       }
  1122. -   }
  1123. -  
  1124. -   /**
  1125.      * Launch actions corresponding to the Event Cancel.
  1126.      * <ul>
  1127.      * <li>Stop an AI Follow Task</li>
  1128. @@ -918,7 +865,7 @@
  1129.     {
  1130.         if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AURA)
  1131.         {
  1132. -           for (L2Object target : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1133. +           for (L2Object target : _actor.getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1134.             {
  1135.                 if (target == getTarget())
  1136.                     return true;
  1137. @@ -934,7 +881,7 @@
  1138.             if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AURA)
  1139.             {
  1140.                 boolean cancast = true;
  1141. -               for (L2Character target : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1142. +               for (L2Character target : _actor.getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1143.                 {
  1144.                     if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  1145.                         continue;
  1146. @@ -952,7 +899,7 @@
  1147.             else if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AREA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AREA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AREA)
  1148.             {
  1149.                 boolean cancast = true;
  1150. -               for (L2Character target : ((L2Character) getTarget()).getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1151. +               for (L2Character target : ((L2Character) getTarget()).getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1152.                 {
  1153.                     if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  1154.                         continue;
  1155. @@ -973,7 +920,7 @@
  1156.             if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AURA)
  1157.             {
  1158.                 boolean cancast = false;
  1159. -               for (L2Character target : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1160. +               for (L2Character target : _actor.getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1161.                 {
  1162.                     if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  1163.                         continue;
  1164. @@ -991,7 +938,7 @@
  1165.             else if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AREA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AREA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AREA)
  1166.             {
  1167.                 boolean cancast = true;
  1168. -               for (L2Character target : ((L2Character) getTarget()).getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1169. +               for (L2Character target : ((L2Character) getTarget()).getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  1170.                 {
  1171.                     if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  1172.                         continue;
  1173. @@ -1019,7 +966,7 @@
  1174.         int ccount = 0;
  1175.        
  1176.         final String[] actorClans = ((L2Npc) _actor).getTemplate().getClans();
  1177. -       for (L2Attackable target : _actor.getKnownList().getKnownTypeInRadius(L2Attackable.class, sk.getSkillRadius()))
  1178. +       for (L2Attackable target : _actor.getKnownTypeInRadius(L2Attackable.class, sk.getSkillRadius()))
  1179.         {
  1180.             if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  1181.                 continue;
  1182. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2DoorAI.java
  1183. ===================================================================
  1184. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2DoorAI.java   (revision 2)
  1185. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2DoorAI.java   (working copy)
  1186. @@ -129,11 +129,6 @@
  1187.     }
  1188.    
  1189.     @Override
  1190. -   protected void onEvtForgetObject(L2Object object)
  1191. -   {
  1192. -   }
  1193. -  
  1194. -   @Override
  1195.     protected void onEvtCancel()
  1196.     {
  1197.     }
  1198. @@ -157,7 +152,7 @@
  1199.         @Override
  1200.         public void run()
  1201.         {
  1202. -           for (L2SiegeGuardInstance guard : _door.getKnownList().getKnownType(L2SiegeGuardInstance.class))
  1203. +           for (L2SiegeGuardInstance guard : _door.getKnownType(L2SiegeGuardInstance.class))
  1204.             {
  1205.                 if (_actor.isInsideRadius(guard, guard.getTemplate().getClanRange(), false, true) && Math.abs(_attacker.getZ() - guard.getZ()) < 200)
  1206.                     guard.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, _attacker, 15);
  1207. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2PlayerAI.java
  1208. ===================================================================
  1209. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2PlayerAI.java (revision 2)
  1210. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2PlayerAI.java (working copy)
  1211. @@ -23,7 +23,9 @@
  1212.  import net.sf.l2j.gameserver.model.actor.L2Character;
  1213.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1214.  import net.sf.l2j.gameserver.model.actor.instance.L2StaticObjectInstance;
  1215. +import net.sf.l2j.gameserver.network.SystemMessageId;
  1216.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  1217. +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  1218.  
  1219.  public class L2PlayerAI extends L2PlayableAI
  1220.  {
  1221. @@ -247,6 +249,9 @@
  1222.                 _actor.setIsCastingNow(false);
  1223.                 return;
  1224.             }
  1225. +          
  1226. +           if (_actor.isSkillDisabled(_skill))
  1227. +               _actor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE).addSkillName(_skill));
  1228.         }
  1229.        
  1230.         if (_skill.getHitTime() > 50 && !_skill.isSimultaneousCast())
  1231. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2SiegeGuardAI.java
  1232. ===================================================================
  1233. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2SiegeGuardAI.java (revision 2)
  1234. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2SiegeGuardAI.java (working copy)
  1235. @@ -22,7 +22,6 @@
  1236.  
  1237.  import net.sf.l2j.gameserver.ai.CtrlIntention;
  1238.  import net.sf.l2j.gameserver.geoengine.GeoEngine;
  1239. -import net.sf.l2j.gameserver.model.L2Object;
  1240.  import net.sf.l2j.gameserver.model.L2Skill;
  1241.  import net.sf.l2j.gameserver.model.Location;
  1242.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  1243. @@ -94,7 +93,7 @@
  1244.             if (!_actor.isAlikeDead())
  1245.             {
  1246.                 // If its _knownPlayer isn't empty, set the Intention to ACTIVE
  1247. -               if (!getActiveChar().getKnownList().getKnownType(L2PcInstance.class).isEmpty())
  1248. +               if (!getActiveChar().getKnownType(L2PcInstance.class).isEmpty())
  1249.                     intention = CtrlIntention.ACTIVE;
  1250.             }
  1251.            
  1252. @@ -149,7 +148,7 @@
  1253.         if (_globalAggro >= 0)
  1254.         {
  1255.             final L2Attackable npc = (L2Attackable) _actor;
  1256. -           for (L2Character target : npc.getKnownList().getKnownTypeInRadius(L2Character.class, npc.getTemplate().getClanRange()))
  1257. +           for (L2Character target : npc.getKnownTypeInRadius(L2Character.class, npc.getTemplate().getClanRange()))
  1258.             {
  1259.                 if (autoAttackCondition(target)) // check aggression
  1260.                 {
  1261. @@ -176,7 +175,7 @@
  1262.             }
  1263.         }
  1264.         // Order to the L2SiegeGuardInstance to return to its home location because there's no target to attack
  1265. -       getActiveChar().returnHome();
  1266. +       getActiveChar().returnHome(true);
  1267.     }
  1268.    
  1269.     /**
  1270. @@ -201,7 +200,7 @@
  1271.          */
  1272.         if (!actor.isInsideZone(ZoneId.SIEGE))
  1273.         {
  1274. -           actor.returnHome();
  1275. +           actor.returnHome(true);
  1276.             return;
  1277.         }
  1278.        
  1279. @@ -264,7 +263,7 @@
  1280.                 final String[] clans = actor.getTemplate().getClans();
  1281.                
  1282.                 // Go through all characters around the actor that belongs to its faction.
  1283. -               for (L2Character cha : actor.getKnownList().getKnownTypeInRadius(L2Character.class, 1000))
  1284. +               for (L2Character cha : actor.getKnownTypeInRadius(L2Character.class, 1000))
  1285.                 {
  1286.                     // Don't bother about dead, not visible, or healthy characters.
  1287.                     if (cha.isAlikeDead() || !GeoEngine.getInstance().canSeeTarget(actor, cha) || (cha.getCurrentHp() / cha.getMaxHp() > 0.75))
  1288. @@ -382,9 +381,9 @@
  1289.        
  1290.         if (Rnd.get(100) <= 3)
  1291.         {
  1292. -           for (L2Object nearby : actor.getKnownList().getKnownObjects())
  1293. +           for (L2Attackable nearby : actor.getKnownTypeInRadius(L2Attackable.class, actorCollision))
  1294.             {
  1295. -               if (nearby instanceof L2Attackable && actor.isInsideRadius(nearby, actorCollision, false, false) && nearby != attackTarget)
  1296. +               if (nearby != attackTarget)
  1297.                 {
  1298.                     int newX = combinedCollision + Rnd.get(40);
  1299.                     if (Rnd.nextBoolean())
  1300. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2VehicleAI.java
  1301. ===================================================================
  1302. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2VehicleAI.java    (revision 2)
  1303. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2VehicleAI.java    (working copy)
  1304. @@ -123,11 +123,6 @@
  1305.     }
  1306.    
  1307.     @Override
  1308. -   protected void onEvtForgetObject(L2Object object)
  1309. -   {
  1310. -   }
  1311. -  
  1312. -   @Override
  1313.     protected void onEvtCancel()
  1314.     {
  1315.     }
  1316. Index: aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/Manager/FriendsBBSManager.java
  1317. ===================================================================
  1318. --- aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/Manager/FriendsBBSManager.java  (revision 2)
  1319. +++ aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/Manager/FriendsBBSManager.java  (working copy)
  1320. @@ -27,7 +27,7 @@
  1321.  import net.sf.l2j.gameserver.cache.HtmCache;
  1322.  import net.sf.l2j.gameserver.datatables.CharNameTable;
  1323.  import net.sf.l2j.gameserver.model.BlockList;
  1324. -import net.sf.l2j.gameserver.model.L2World;
  1325. +import net.sf.l2j.gameserver.model.World;
  1326.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1327.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1328.  import net.sf.l2j.gameserver.network.serverpackets.FriendList;
  1329. @@ -87,7 +87,7 @@
  1330.                
  1331.                 for (int friendId : activeChar.getFriendList())
  1332.                 {
  1333. -                   L2PcInstance player = L2World.getInstance().getPlayer(friendId);
  1334. +                   L2PcInstance player = World.getInstance().getPlayer(friendId);
  1335.                     if (player != null)
  1336.                     {
  1337.                         player.getFriendList().remove(Integer.valueOf(activeChar.getObjectId()));
  1338. @@ -122,7 +122,7 @@
  1339.                        
  1340.                         String name = CharNameTable.getInstance().getPlayerName(friendId);
  1341.                        
  1342. -                       L2PcInstance player = L2World.getInstance().getPlayer(friendId);
  1343. +                       L2PcInstance player = World.getInstance().getPlayer(friendId);
  1344.                         if (player != null)
  1345.                         {
  1346.                             player.getFriendList().remove(Integer.valueOf(activeChar.getObjectId()));
  1347. @@ -227,7 +227,7 @@
  1348.             if (friendName == null)
  1349.                 continue;
  1350.            
  1351. -           final L2PcInstance friend = L2World.getInstance().getPlayer(id);
  1352. +           final L2PcInstance friend = World.getInstance().getPlayer(id);
  1353.             StringUtil.append(sb, "<a action=\"bypass _friend;select;", id, "\">[Select]</a>&nbsp;", friendName, " ", ((friend != null && friend.isOnline()) ? "(on)" : "(off)"), "<br1>");
  1354.         }
  1355.         content = content.replaceAll("%friendslist%", sb.toString());
  1356. @@ -242,7 +242,7 @@
  1357.             if (friendName == null)
  1358.                 continue;
  1359.            
  1360. -           final L2PcInstance friend = L2World.getInstance().getPlayer(id);
  1361. +           final L2PcInstance friend = World.getInstance().getPlayer(id);
  1362.             StringUtil.append(sb, "<a action=\"bypass _friend;deselect;", id, "\">[Deselect]</a>&nbsp;", friendName, " ", ((friend != null && friend.isOnline()) ? "(on)" : "(off)"), "<br1>");
  1363.         }
  1364.         content = content.replaceAll("%selectedFriendsList%", sb.toString());
  1365. @@ -275,7 +275,7 @@
  1366.             if (blockName == null)
  1367.                 continue;
  1368.            
  1369. -           final L2PcInstance block = L2World.getInstance().getPlayer(id);
  1370. +           final L2PcInstance block = World.getInstance().getPlayer(id);
  1371.             StringUtil.append(sb, "<a action=\"bypass _block;select;", id, "\">[Select]</a>&nbsp;", blockName, " ", ((block != null && block.isOnline()) ? "(on)" : "(off)"), "<br1>");
  1372.         }
  1373.         content = content.replaceAll("%blocklist%", sb.toString());
  1374. @@ -290,7 +290,7 @@
  1375.             if (blockName == null)
  1376.                 continue;
  1377.            
  1378. -           final L2PcInstance block = L2World.getInstance().getPlayer(id);
  1379. +           final L2PcInstance block = World.getInstance().getPlayer(id);
  1380.             StringUtil.append(sb, "<a action=\"bypass _block;deselect;", id, "\">[Deselect]</a>&nbsp;", blockName, " ", ((block != null && block.isOnline()) ? "(on)" : "(off)"), "<br1>");
  1381.         }
  1382.         content = content.replaceAll("%selectedBlocksList%", sb.toString());
  1383. Index: aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/Manager/MailBBSManager.java
  1384. ===================================================================
  1385. --- aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/Manager/MailBBSManager.java (revision 2)
  1386. +++ aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/Manager/MailBBSManager.java (working copy)
  1387. @@ -32,7 +32,7 @@
  1388.  import net.sf.l2j.gameserver.cache.HtmCache;
  1389.  import net.sf.l2j.gameserver.datatables.CharNameTable;
  1390.  import net.sf.l2j.gameserver.model.BlockList;
  1391. -import net.sf.l2j.gameserver.model.L2World;
  1392. +import net.sf.l2j.gameserver.model.World;
  1393.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1394.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1395.  import net.sf.l2j.gameserver.network.serverpackets.ExMailArrived;
  1396. @@ -521,7 +521,7 @@
  1397.                     continue;
  1398.                 }
  1399.                
  1400. -               final L2PcInstance recipientPlayer = L2World.getInstance().getPlayer(recipientId);
  1401. +               final L2PcInstance recipientPlayer = World.getInstance().getPlayer(recipientId);
  1402.                
  1403.                 if (!activeChar.isGM())
  1404.                 {
  1405. @@ -656,7 +656,7 @@
  1406.    
  1407.     private static boolean isBlocked(L2PcInstance activeChar, int recipId)
  1408.     {
  1409. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  1410. +       for (L2PcInstance player : World.getInstance().getPlayers())
  1411.         {
  1412.             if (player.getObjectId() == recipId)
  1413.             {
  1414. Index: aCis_gameserver/java/net/sf/l2j/gameserver/datatables/DoorTable.java
  1415. ===================================================================
  1416. --- aCis_gameserver/java/net/sf/l2j/gameserver/datatables/DoorTable.java    (revision 2)
  1417. +++ aCis_gameserver/java/net/sf/l2j/gameserver/datatables/DoorTable.java    (working copy)
  1418. @@ -267,7 +267,7 @@
  1419.                             // create door instance
  1420.                             final L2DoorInstance door = new L2DoorInstance(IdFactory.getInstance().getNextId(), template);
  1421.                             door.setCurrentHpMp(door.getMaxHp(), door.getMaxMp());
  1422. -                           door.setXYZInvisible(posX, posY, posZ);
  1423. +                           door.getPosition().set(posX, posY, posZ);
  1424.                            
  1425.                             _doors.put(door.getDoorId(), door);
  1426.                         }
  1427. Index: aCis_gameserver/java/net/sf/l2j/gameserver/datatables/ItemTable.java
  1428. ===================================================================
  1429. --- aCis_gameserver/java/net/sf/l2j/gameserver/datatables/ItemTable.java    (revision 2)
  1430. +++ aCis_gameserver/java/net/sf/l2j/gameserver/datatables/ItemTable.java    (working copy)
  1431. @@ -27,7 +27,7 @@
  1432.  import net.sf.l2j.L2DatabaseFactory;
  1433.  import net.sf.l2j.gameserver.idfactory.IdFactory;
  1434.  import net.sf.l2j.gameserver.model.L2Object;
  1435. -import net.sf.l2j.gameserver.model.L2World;
  1436. +import net.sf.l2j.gameserver.model.World;
  1437.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  1438.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1439.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  1440. @@ -166,8 +166,8 @@
  1441.                 item.setDropProtection(actor.getObjectId(), false);
  1442.         }
  1443.        
  1444. -       // Add the ItemInstance object to _allObjects of L2world
  1445. -       L2World.getInstance().addObject(item);
  1446. +       // Add the ItemInstance object to _objects of World.
  1447. +       World.getInstance().addObject(item);
  1448.        
  1449.         // Set Item parameters
  1450.         if (item.isStackable() && count > 1)
  1451. @@ -219,7 +219,7 @@
  1452.             item.setLocation(ItemLocation.VOID);
  1453.             item.setLastChange(ItemInstance.REMOVED);
  1454.            
  1455. -           L2World.getInstance().removeObject(item);
  1456. +           World.getInstance().removeObject(item);
  1457.             IdFactory.getInstance().releaseId(item.getObjectId());
  1458.            
  1459.             if (Config.LOG_ITEMS)
  1460. Index: aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
  1461. ===================================================================
  1462. --- aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java  (revision 2)
  1463. +++ aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java  (working copy)
  1464. @@ -20,7 +20,6 @@
  1465.  import java.io.InputStream;
  1466.  import java.net.InetAddress;
  1467.  import java.net.UnknownHostException;
  1468. -import java.util.Calendar;
  1469.  import java.util.logging.Level;
  1470.  import java.util.logging.LogManager;
  1471.  import java.util.logging.Logger;
  1472. @@ -98,7 +97,7 @@
  1473.  import net.sf.l2j.gameserver.instancemanager.ZoneManager;
  1474.  import net.sf.l2j.gameserver.instancemanager.games.MonsterRace;
  1475.  import net.sf.l2j.gameserver.model.L2Manor;
  1476. -import net.sf.l2j.gameserver.model.L2World;
  1477. +import net.sf.l2j.gameserver.model.World;
  1478.  import net.sf.l2j.gameserver.model.entity.Hero;
  1479.  import net.sf.l2j.gameserver.model.olympiad.Olympiad;
  1480.  import net.sf.l2j.gameserver.model.olympiad.OlympiadGameManager;
  1481. @@ -116,7 +115,6 @@
  1482.  import net.sf.l2j.gameserver.taskmanager.DecayTaskManager;
  1483.  import net.sf.l2j.gameserver.taskmanager.GameTimeTaskManager;
  1484.  import net.sf.l2j.gameserver.taskmanager.ItemsOnGroundTaskManager;
  1485. -import net.sf.l2j.gameserver.taskmanager.KnownListUpdateTaskManager;
  1486.  import net.sf.l2j.gameserver.taskmanager.MovementTaskManager;
  1487.  import net.sf.l2j.gameserver.taskmanager.PvpFlagTaskManager;
  1488.  import net.sf.l2j.gameserver.taskmanager.RandomAnimationTaskManager;
  1489. @@ -135,7 +133,6 @@
  1490.     private final DeadLockDetector _deadDetectThread;
  1491.     public static GameServer gameServer;
  1492.     private final LoginServerThread _loginThread;
  1493. -   public static final Calendar dateTimeServerStarted = Calendar.getInstance();
  1494.    
  1495.     public long getUsedMemoryMB()
  1496.     {
  1497. @@ -159,7 +156,7 @@
  1498.         IdFactory.getInstance();
  1499.        
  1500.         StringUtil.printSection("World");
  1501. -       L2World.getInstance();
  1502. +       World.getInstance();
  1503.         MapRegionTable.getInstance();
  1504.         AnnouncementTable.getInstance();
  1505.         ServerMemo.getInstance();
  1506. @@ -223,7 +220,6 @@
  1507.         DecayTaskManager.getInstance();
  1508.         GameTimeTaskManager.getInstance();
  1509.         ItemsOnGroundTaskManager.getInstance();
  1510. -       KnownListUpdateTaskManager.getInstance();
  1511.         MovementTaskManager.getInstance();
  1512.         PvpFlagTaskManager.getInstance();
  1513.         RandomAnimationTaskManager.getInstance();
  1514. @@ -280,9 +276,15 @@
  1515.             BoatTalkingGludin.load();
  1516.         }
  1517.        
  1518. -       StringUtil.printSection("Monster Derby Track");
  1519. +       StringUtil.printSection("Events");
  1520.         MonsterRace.getInstance();
  1521.        
  1522. +       if (Config.ALLOW_WEDDING)
  1523. +           CoupleManager.getInstance();
  1524. +      
  1525. +       if (Config.ALT_FISH_CHAMPIONSHIP_ENABLED)
  1526. +           FishingChampionshipManager.getInstance();
  1527. +      
  1528.         StringUtil.printSection("Handlers");
  1529.         _log.config("AutoSpawnHandler: Loaded " + AutoSpawnManager.getInstance().size() + " handlers.");
  1530.         _log.config("AdminCommandHandler: Loaded " + AdminCommandHandler.getInstance().size() + " handlers.");
  1531. @@ -291,12 +293,6 @@
  1532.         _log.config("SkillHandler: Loaded " + SkillHandler.getInstance().size() + " handlers.");
  1533.         _log.config("UserCommandHandler: Loaded " + UserCommandHandler.getInstance().size() + " handlers.");
  1534.        
  1535. -       if (Config.ALLOW_WEDDING)
  1536. -           CoupleManager.getInstance();
  1537. -      
  1538. -       if (Config.ALT_FISH_CHAMPIONSHIP_ENABLED)
  1539. -           FishingChampionshipManager.getInstance();
  1540. -      
  1541.         StringUtil.printSection("System");
  1542.         Runtime.getRuntime().addShutdownHook(Shutdown.getInstance());
  1543.         ForumsBBSManager.getInstance();
  1544. Index: aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/geodata/GeoStructure.java
  1545. ===================================================================
  1546. --- aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/geodata/GeoStructure.java  (revision 2)
  1547. +++ aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/geodata/GeoStructure.java  (working copy)
  1548. @@ -14,7 +14,7 @@
  1549.   */
  1550.  package net.sf.l2j.gameserver.geoengine.geodata;
  1551.  
  1552. -import net.sf.l2j.gameserver.model.L2World;
  1553. +import net.sf.l2j.gameserver.model.World;
  1554.  
  1555.  /**
  1556.   * @author Hasha
  1557. @@ -62,8 +62,8 @@
  1558.     public static final int REGION_CELLS_Y = REGION_BLOCKS_Y * BLOCK_CELLS_Y;
  1559.    
  1560.     // global geodata
  1561. -   public static final int GEO_REGIONS_X = (L2World.TILE_X_MAX - L2World.TILE_X_MIN + 1);
  1562. -   public static final int GEO_REGIONS_Y = (L2World.TILE_Y_MAX - L2World.TILE_Y_MIN + 1);
  1563. +   public static final int GEO_REGIONS_X = (World.TILE_X_MAX - World.TILE_X_MIN + 1);
  1564. +   public static final int GEO_REGIONS_Y = (World.TILE_Y_MAX - World.TILE_Y_MIN + 1);
  1565.    
  1566.     public static final int GEO_BLOCKS_X = GEO_REGIONS_X * REGION_BLOCKS_X;
  1567.     public static final int GEO_BLOCKS_Y = GEO_REGIONS_Y * REGION_BLOCKS_Y;
  1568. Index: aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/GeoEngine.java
  1569. ===================================================================
  1570. --- aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/GeoEngine.java (revision 2)
  1571. +++ aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/GeoEngine.java (working copy)
  1572. @@ -43,8 +43,8 @@
  1573.  import net.sf.l2j.gameserver.geoengine.geodata.IGeoObject;
  1574.  import net.sf.l2j.gameserver.idfactory.IdFactory;
  1575.  import net.sf.l2j.gameserver.model.L2Object;
  1576. -import net.sf.l2j.gameserver.model.L2World;
  1577.  import net.sf.l2j.gameserver.model.Location;
  1578. +import net.sf.l2j.gameserver.model.World;
  1579.  import net.sf.l2j.gameserver.model.actor.L2Character;
  1580.  import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  1581.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  1582. @@ -93,9 +93,9 @@
  1583.         final ExProperties props = Config.initProperties(Config.GEOENGINE_FILE);
  1584.         int loaded = 0;
  1585.         int failed = 0;
  1586. -       for (int rx = L2World.TILE_X_MIN; rx <= L2World.TILE_X_MAX; rx++)
  1587. +       for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
  1588.         {
  1589. -           for (int ry = L2World.TILE_Y_MIN; ry <= L2World.TILE_Y_MAX; ry++)
  1590. +           for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
  1591.             {
  1592.                 if (props.containsKey(String.valueOf(rx) + "_" + String.valueOf(ry)))
  1593.                 {
  1594. @@ -158,8 +158,8 @@
  1595.             buffer.order(ByteOrder.LITTLE_ENDIAN);
  1596.            
  1597.             // get block indexes
  1598. -           final int blockX = (regionX - L2World.TILE_X_MIN) * GeoStructure.REGION_BLOCKS_X;
  1599. -           final int blockY = (regionY - L2World.TILE_Y_MIN) * GeoStructure.REGION_BLOCKS_Y;
  1600. +           final int blockX = (regionX - World.TILE_X_MIN) * GeoStructure.REGION_BLOCKS_X;
  1601. +           final int blockY = (regionY - World.TILE_Y_MIN) * GeoStructure.REGION_BLOCKS_Y;
  1602.            
  1603.             // loop over region blocks
  1604.             for (int ix = 0; ix < GeoStructure.REGION_BLOCKS_X; ix++)
  1605. @@ -220,8 +220,8 @@
  1606.     private final void loadNullBlocks(int regionX, int regionY)
  1607.     {
  1608.         // get block indexes
  1609. -       final int blockX = (regionX - L2World.TILE_X_MIN) * GeoStructure.REGION_BLOCKS_X;
  1610. -       final int blockY = (regionY - L2World.TILE_Y_MIN) * GeoStructure.REGION_BLOCKS_Y;
  1611. +       final int blockX = (regionX - World.TILE_X_MIN) * GeoStructure.REGION_BLOCKS_X;
  1612. +       final int blockY = (regionY - World.TILE_Y_MIN) * GeoStructure.REGION_BLOCKS_Y;
  1613.        
  1614.         // load all null blocks
  1615.         for (int ix = 0; ix < GeoStructure.REGION_BLOCKS_X; ix++)
  1616. @@ -238,7 +238,7 @@
  1617.      */
  1618.     public static final int getGeoX(int worldX)
  1619.     {
  1620. -       return (MathUtil.limit(worldX, L2World.WORLD_X_MIN, L2World.WORLD_X_MAX) - L2World.WORLD_X_MIN) >> 4;
  1621. +       return (MathUtil.limit(worldX, World.WORLD_X_MIN, World.WORLD_X_MAX) - World.WORLD_X_MIN) >> 4;
  1622.     }
  1623.    
  1624.     /**
  1625. @@ -248,7 +248,7 @@
  1626.      */
  1627.     public static final int getGeoY(int worldY)
  1628.     {
  1629. -       return (MathUtil.limit(worldY, L2World.WORLD_Y_MIN, L2World.WORLD_Y_MAX) - L2World.WORLD_Y_MIN) >> 4;
  1630. +       return (MathUtil.limit(worldY, World.WORLD_Y_MIN, World.WORLD_Y_MAX) - World.WORLD_Y_MIN) >> 4;
  1631.     }
  1632.    
  1633.     /**
  1634. @@ -258,7 +258,7 @@
  1635.      */
  1636.     public static final int getWorldX(int geoX)
  1637.     {
  1638. -       return (MathUtil.limit(geoX, 0, GeoStructure.GEO_CELLS_X) << 4) + L2World.WORLD_X_MIN + 8;
  1639. +       return (MathUtil.limit(geoX, 0, GeoStructure.GEO_CELLS_X) << 4) + World.WORLD_X_MIN + 8;
  1640.     }
  1641.    
  1642.     /**
  1643. @@ -268,7 +268,7 @@
  1644.      */
  1645.     public static final int getWorldY(int geoY)
  1646.     {
  1647. -       return (MathUtil.limit(geoY, 0, GeoStructure.GEO_CELLS_Y) << 4) + L2World.WORLD_Y_MIN + 8;
  1648. +       return (MathUtil.limit(geoY, 0, GeoStructure.GEO_CELLS_Y) << 4) + World.WORLD_Y_MIN + 8;
  1649.     }
  1650.    
  1651.     /**
  1652. @@ -1184,8 +1184,8 @@
  1653.         int gox = getGeoX(loc.getX());
  1654.         int goy = getGeoY(loc.getY());
  1655.         int goz = loc.getZ();
  1656. -       int rx = gox / GeoStructure.REGION_CELLS_X + L2World.TILE_X_MIN;
  1657. -       int ry = goy / GeoStructure.REGION_CELLS_Y + L2World.TILE_Y_MIN;
  1658. +       int rx = gox / GeoStructure.REGION_CELLS_X + World.TILE_X_MIN;
  1659. +       int ry = goy / GeoStructure.REGION_CELLS_Y + World.TILE_Y_MIN;
  1660.         int bx = (gox / GeoStructure.BLOCK_CELLS_X) % GeoStructure.REGION_BLOCKS_X;
  1661.         int by = (goy / GeoStructure.BLOCK_CELLS_Y) % GeoStructure.REGION_BLOCKS_Y;
  1662.         int cx = gox % GeoStructure.BLOCK_CELLS_X;
  1663. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java
  1664. ===================================================================
  1665. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 2)
  1666. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (working copy)
  1667. @@ -35,7 +35,7 @@
  1668.  import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
  1669.  import net.sf.l2j.gameserver.instancemanager.ZoneManager;
  1670.  import net.sf.l2j.gameserver.model.L2Object;
  1671. -import net.sf.l2j.gameserver.model.L2World;
  1672. +import net.sf.l2j.gameserver.model.World;
  1673.  import net.sf.l2j.gameserver.model.actor.L2Character;
  1674.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1675.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1676. @@ -97,7 +97,7 @@
  1677.             }
  1678.            
  1679.             String firstParam = st.nextToken();
  1680. -           L2PcInstance player = L2World.getInstance().getPlayer(firstParam);
  1681. +           L2PcInstance player = World.getInstance().getPlayer(firstParam);
  1682.             if (player != null)
  1683.             {
  1684.                 if (st.hasMoreTokens())
  1685. @@ -106,7 +106,7 @@
  1686.                     if (StringUtil.isDigit(secondParam))
  1687.                     {
  1688.                         int radius = Integer.parseInt(secondParam);
  1689. -                       for (L2Character knownChar : player.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  1690. +                       for (L2Character knownChar : player.getKnownTypeInRadius(L2Character.class, radius))
  1691.                         {
  1692.                             if (knownChar.equals(activeChar))
  1693.                                 continue;
  1694. @@ -124,13 +124,9 @@
  1695.             else if (StringUtil.isDigit(firstParam))
  1696.             {
  1697.                 int radius = Integer.parseInt(firstParam);
  1698. -               for (L2Character knownChar : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  1699. -               {
  1700. -                   if (knownChar.equals(activeChar))
  1701. -                       continue;
  1702. -                  
  1703. +               for (L2Character knownChar : activeChar.getKnownTypeInRadius(L2Character.class, radius))
  1704.                     kill(activeChar, knownChar);
  1705. -               }
  1706. +              
  1707.                 activeChar.sendMessage("Killed all characters within a " + radius + " unit radius.");
  1708.             }
  1709.         }
  1710. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAnnouncements.java
  1711. ===================================================================
  1712. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAnnouncements.java (revision 2)
  1713. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAnnouncements.java (working copy)
  1714. @@ -16,7 +16,7 @@
  1715.  
  1716.  import net.sf.l2j.gameserver.datatables.AnnouncementTable;
  1717.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  1718. -import net.sf.l2j.gameserver.model.L2World;
  1719. +import net.sf.l2j.gameserver.model.World;
  1720.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1721.  
  1722.  /**
  1723. @@ -53,7 +53,7 @@
  1724.                     case "all":
  1725.                     case "all_auto":
  1726.                         final boolean isAuto = tokens[1].equalsIgnoreCase("all_auto");
  1727. -                       for (L2PcInstance player : L2World.getInstance().getPlayers())
  1728. +                       for (L2PcInstance player : World.getInstance().getPlayers())
  1729.                             AnnouncementTable.getInstance().showAnnouncements(player, isAuto);
  1730.                        
  1731.                         AnnouncementTable.getInstance().listAnnouncements(activeChar);
  1732. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBan.java
  1733. ===================================================================
  1734. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBan.java   (revision 2)
  1735. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBan.java   (working copy)
  1736. @@ -23,7 +23,7 @@
  1737.  import net.sf.l2j.L2DatabaseFactory;
  1738.  import net.sf.l2j.gameserver.LoginServerThread;
  1739.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  1740. -import net.sf.l2j.gameserver.model.L2World;
  1741. +import net.sf.l2j.gameserver.model.World;
  1742.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1743.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1744.  
  1745. @@ -71,7 +71,7 @@
  1746.         if (st.hasMoreTokens())
  1747.         {
  1748.             player = st.nextToken();
  1749. -           targetPlayer = L2World.getInstance().getPlayer(player);
  1750. +           targetPlayer = World.getInstance().getPlayer(player);
  1751.            
  1752.             // Second parameter, duration
  1753.             if (st.hasMoreTokens())
  1754. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBuffs.java
  1755. ===================================================================
  1756. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBuffs.java (revision 2)
  1757. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBuffs.java (working copy)
  1758. @@ -7,7 +7,7 @@
  1759.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  1760.  import net.sf.l2j.gameserver.model.L2Effect;
  1761.  import net.sf.l2j.gameserver.model.L2Object;
  1762. -import net.sf.l2j.gameserver.model.L2World;
  1763. +import net.sf.l2j.gameserver.model.World;
  1764.  import net.sf.l2j.gameserver.model.actor.L2Character;
  1765.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1766.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1767. @@ -38,7 +38,7 @@
  1768.             if (st.hasMoreTokens())
  1769.             {
  1770.                 String playername = st.nextToken();
  1771. -               L2PcInstance player = L2World.getInstance().getPlayer(playername);
  1772. +               L2PcInstance player = World.getInstance().getPlayer(playername);
  1773.                 if (player == null)
  1774.                 {
  1775.                     activeChar.sendPacket(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME);
  1776. @@ -109,11 +109,8 @@
  1777.                 String val = st.nextToken();
  1778.                 int radius = Integer.parseInt(val);
  1779.                
  1780. -               for (L2PcInstance knownChar : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  1781. -               {
  1782. -                   if (!knownChar.equals(activeChar))
  1783. -                       knownChar.stopAllEffects();
  1784. -               }
  1785. +               for (L2PcInstance knownChar : activeChar.getKnownTypeInRadius(L2PcInstance.class, radius))
  1786. +                   knownChar.stopAllEffects();
  1787.                
  1788.                 activeChar.sendMessage("All effects canceled within radius " + radius + ".");
  1789.                 return true;
  1790. @@ -134,7 +131,7 @@
  1791.             {
  1792.                 final String name = st.nextToken();
  1793.                
  1794. -               player = L2World.getInstance().getPlayer(name);
  1795. +               player = World.getInstance().getPlayer(name);
  1796.                 if (player == null)
  1797.                 {
  1798.                     activeChar.sendMessage("The player " + name + " is not online.");
  1799. @@ -211,7 +208,7 @@
  1800.         if (skillId < 1)
  1801.             return;
  1802.        
  1803. -       final L2Object obj = L2World.getInstance().getObject(objId);
  1804. +       final L2Object obj = World.getInstance().getObject(objId);
  1805.         if (obj instanceof L2Character)
  1806.         {
  1807.             final L2Character target = (L2Character) obj;
  1808. @@ -230,7 +227,7 @@
  1809.    
  1810.     private static void removeAllBuffs(L2PcInstance activeChar, int objId)
  1811.     {
  1812. -       final L2Object target = L2World.getInstance().getObject(objId);
  1813. +       final L2Object target = World.getInstance().getObject(objId);
  1814.         if (target instanceof L2Character)
  1815.         {
  1816.             ((L2Character) target).stopAllEffects();
  1817. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChangeAccessLevel.java
  1818. ===================================================================
  1819. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChangeAccessLevel.java (revision 2)
  1820. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChangeAccessLevel.java (working copy)
  1821. @@ -19,7 +19,7 @@
  1822.  
  1823.  import net.sf.l2j.L2DatabaseFactory;
  1824.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  1825. -import net.sf.l2j.gameserver.model.L2World;
  1826. +import net.sf.l2j.gameserver.model.World;
  1827.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1828.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1829.  
  1830. @@ -56,7 +56,7 @@
  1831.         {
  1832.             String name = parts[1];
  1833.             int lvl = Integer.parseInt(parts[2]);
  1834. -           L2PcInstance player = L2World.getInstance().getPlayer(name);
  1835. +           L2PcInstance player = World.getInstance().getPlayer(name);
  1836.             if (player != null)
  1837.                 onLineChange(activeChar, player, lvl);
  1838.             else
  1839. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java
  1840. ===================================================================
  1841. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java    (revision 2)
  1842. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java    (working copy)
  1843. @@ -15,12 +15,13 @@
  1844.  package net.sf.l2j.gameserver.handler.admincommandhandlers;
  1845.  
  1846.  import java.util.Collection;
  1847. +import java.util.List;
  1848.  import java.util.StringTokenizer;
  1849.  
  1850.  import net.sf.l2j.gameserver.datatables.ArmorSetsTable;
  1851.  import net.sf.l2j.gameserver.datatables.ItemTable;
  1852.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  1853. -import net.sf.l2j.gameserver.model.L2World;
  1854. +import net.sf.l2j.gameserver.model.World;
  1855.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1856.  import net.sf.l2j.gameserver.model.item.ArmorSet;
  1857.  import net.sf.l2j.gameserver.model.item.kind.Item;
  1858. @@ -63,7 +64,7 @@
  1859.                 final int id = Integer.parseInt(st.nextToken());
  1860.                 final int count = (st.hasMoreTokens()) ? Integer.parseInt(st.nextToken()) : 1;
  1861.                
  1862. -               final Collection<L2PcInstance> players = L2World.getInstance().getPlayers();
  1863. +               final Collection<L2PcInstance> players = World.getInstance().getPlayers();
  1864.                 for (L2PcInstance player : players)
  1865.                     createItem(activeChar, player, id, count, 0, false);
  1866.                
  1867. @@ -176,23 +177,15 @@
  1868.        
  1869.         if (radius > 0)
  1870.         {
  1871. -           int counter = 0;
  1872. -          
  1873. -           for (L2PcInstance obj : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  1874. +           final List<L2PcInstance> players = activeChar.getKnownTypeInRadius(L2PcInstance.class, radius);
  1875. +           for (L2PcInstance obj : players)
  1876.             {
  1877. -               if (!(obj.equals(activeChar)))
  1878. -               {
  1879. -                   obj.getInventory().addItem("Admin", id, num, obj, activeChar);
  1880. -                   obj.sendMessage("A GM spawned " + num + " " + template.getName() + " in your inventory.");
  1881. -                   counter++;
  1882. -                  
  1883. -                   // Send whole item list and open inventory window
  1884. -                   obj.sendPacket(new ItemList(obj, true));
  1885. -               }
  1886. +               obj.addItem("Admin", id, num, activeChar, false);
  1887. +               obj.sendMessage("A GM spawned " + num + " " + template.getName() + " in your inventory.");
  1888.             }
  1889.            
  1890.             if (sendGmMessage)
  1891. -               activeChar.sendMessage(counter + " players rewarded with " + num + " " + template.getName() + " in a " + radius + " radius.");
  1892. +               activeChar.sendMessage(players.size() + " players rewarded with " + num + " " + template.getName() + " in a " + radius + " radius.");
  1893.         }
  1894.         else
  1895.         {
  1896. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEditChar.java
  1897. ===================================================================
  1898. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEditChar.java  (revision 2)
  1899. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEditChar.java  (working copy)
  1900. @@ -35,7 +35,7 @@
  1901.  import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
  1902.  import net.sf.l2j.gameserver.model.L2Clan;
  1903.  import net.sf.l2j.gameserver.model.L2Object;
  1904. -import net.sf.l2j.gameserver.model.L2World;
  1905. +import net.sf.l2j.gameserver.model.World;
  1906.  import net.sf.l2j.gameserver.model.actor.L2Summon;
  1907.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1908.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  1909. @@ -91,7 +91,7 @@
  1910.         {
  1911.             try
  1912.             {
  1913. -               final L2PcInstance target = L2World.getInstance().getPlayer(command.substring(21));
  1914. +               final L2PcInstance target = World.getInstance().getPlayer(command.substring(21));
  1915.                 if (target != null)
  1916.                     showCharacterInfo(activeChar, target);
  1917.                 else
  1918. @@ -430,7 +430,7 @@
  1919.             L2Object target;
  1920.             try
  1921.             {
  1922. -               target = L2World.getInstance().getPet(Integer.parseInt(command.substring(19)));
  1923. +               target = World.getInstance().getPet(Integer.parseInt(command.substring(19)));
  1924.             }
  1925.             catch (Exception e)
  1926.             {
  1927. @@ -459,7 +459,7 @@
  1928.             L2Object target;
  1929.             try
  1930.             {
  1931. -               target = L2World.getInstance().getPlayer(command.substring(17));
  1932. +               target = World.getInstance().getPlayer(command.substring(17));
  1933.                 if (target == null)
  1934.                     target = activeChar.getTarget();
  1935.             }
  1936. @@ -482,7 +482,7 @@
  1937.         {
  1938.             try
  1939.             {
  1940. -               final L2PcInstance player = L2World.getInstance().getPlayer(command.substring(16));
  1941. +               final L2PcInstance player = World.getInstance().getPlayer(command.substring(16));
  1942.                 if (player == null)
  1943.                 {
  1944.                     activeChar.sendPacket(SystemMessageId.TARGET_CANT_FOUND);
  1945. @@ -529,7 +529,7 @@
  1946.                 boolean changeCreateExpiryTime = st.nextToken().equalsIgnoreCase("create");
  1947.                 String playerName = st.nextToken();
  1948.                
  1949. -               L2PcInstance player = L2World.getInstance().getPlayer(playerName);
  1950. +               L2PcInstance player = World.getInstance().getPlayer(playerName);
  1951.                 if (player == null)
  1952.                 {
  1953.                     try (Connection con = L2DatabaseFactory.getInstance().getConnection())
  1954. @@ -561,7 +561,7 @@
  1955.    
  1956.     private static void listCharacters(L2PcInstance activeChar, int page)
  1957.     {
  1958. -       List<L2PcInstance> players = new ArrayList<>(L2World.getInstance().getPlayers());
  1959. +       List<L2PcInstance> players = new ArrayList<>(World.getInstance().getPlayers());
  1960.        
  1961.         final int max = MathUtil.countPagesNumber(players.size(), PAGE_LIMIT);
  1962.        
  1963. @@ -708,7 +708,7 @@
  1964.         final StringBuilder sb = new StringBuilder();
  1965.        
  1966.         // First use of sb, add player info into new Table row
  1967. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  1968. +       for (L2PcInstance player : World.getInstance().getPlayers())
  1969.         {
  1970.             String name = player.getName();
  1971.             if (name.toLowerCase().contains(characterToFind.toLowerCase()))
  1972. @@ -767,7 +767,7 @@
  1973.         html.setFile("data/html/admin/ipfind.htm");
  1974.        
  1975.         final StringBuilder sb = new StringBuilder(1000);
  1976. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  1977. +       for (L2PcInstance player : World.getInstance().getPlayers())
  1978.         {
  1979.             L2GameClient client = player.getClient();
  1980.             if (client.isDetached())
  1981. @@ -827,7 +827,7 @@
  1982.             return;
  1983.         }
  1984.        
  1985. -       final L2PcInstance player = L2World.getInstance().getPlayer(characterName);
  1986. +       final L2PcInstance player = World.getInstance().getPlayer(characterName);
  1987.         if (player == null)
  1988.         {
  1989.             activeChar.sendPacket(SystemMessageId.TARGET_CANT_FOUND);
  1990. @@ -854,7 +854,7 @@
  1991.        
  1992.         final Map<String, Integer> dualboxIPs = new HashMap<>();
  1993.        
  1994. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  1995. +       for (L2PcInstance player : World.getInstance().getPlayers())
  1996.         {
  1997.             L2GameClient client = player.getClient();
  1998.             if (client == null || client.isDetached())
  1999. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEffects.java
  2000. ===================================================================
  2001. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEffects.java   (revision 2)
  2002. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEffects.java   (working copy)
  2003. @@ -19,7 +19,7 @@
  2004.  import net.sf.l2j.gameserver.datatables.SkillTable;
  2005.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2006.  import net.sf.l2j.gameserver.model.L2Object;
  2007. -import net.sf.l2j.gameserver.model.L2World;
  2008. +import net.sf.l2j.gameserver.model.World;
  2009.  import net.sf.l2j.gameserver.model.actor.L2Character;
  2010.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  2011.  import net.sf.l2j.gameserver.model.actor.L2Summon;
  2012. @@ -183,7 +183,7 @@
  2013.         }
  2014.         else if (command.startsWith("admin_para_all"))
  2015.         {
  2016. -           for (L2PcInstance player : activeChar.getKnownList().getKnownType(L2PcInstance.class))
  2017. +           for (L2PcInstance player : activeChar.getKnownType(L2PcInstance.class))
  2018.             {
  2019.                 if (!player.isGM())
  2020.                 {
  2021. @@ -195,7 +195,7 @@
  2022.         }
  2023.         else if (command.startsWith("admin_unpara_all"))
  2024.         {
  2025. -           for (L2PcInstance player : activeChar.getKnownList().getKnownType(L2PcInstance.class))
  2026. +           for (L2PcInstance player : activeChar.getKnownType(L2PcInstance.class))
  2027.             {
  2028.                 player.stopAbnormalEffect(0x0800);
  2029.                 player.setIsParalyzed(false);
  2030. @@ -255,31 +255,16 @@
  2031.                 String oldName = "null";
  2032.                
  2033.                 L2Object target = activeChar.getTarget();
  2034. -               L2Character player = null;
  2035.                
  2036. -               if (target instanceof L2Character)
  2037. -               {
  2038. -                   player = (L2Character) target;
  2039. -                   oldName = player.getName();
  2040. -               }
  2041. -               else
  2042. -               {
  2043. -                   player = activeChar;
  2044. -                   oldName = activeChar.getName();
  2045. -               }
  2046. +               if (!(target instanceof L2Npc))
  2047. +                   return false;
  2048.                
  2049. -               if (player instanceof L2PcInstance)
  2050. -                   L2World.getInstance().removePlayer((L2PcInstance) player);
  2051. +               oldName = target.getName();
  2052.                
  2053. -               player.setName(name);
  2054. +               target.setName(name);
  2055.                
  2056. -               if (player instanceof L2PcInstance)
  2057. -               {
  2058. -                   L2World.getInstance().addVisibleObject(player, null);
  2059. -                   ((L2PcInstance) player).broadcastUserInfo();
  2060. -               }
  2061. -               else if (player instanceof L2Npc)
  2062. -                   player.broadcastPacket(new NpcInfo((L2Npc) player, null));
  2063. +               if (target instanceof L2Npc)
  2064. +                   ((L2Npc) target).broadcastPacket(new NpcInfo((L2Npc) target, null));
  2065.                
  2066.                 activeChar.sendMessage("Changed name from " + oldName + " to " + name + ".");
  2067.             }
  2068. @@ -298,7 +283,7 @@
  2069.                     final String targetOrRadius = st.nextToken();
  2070.                     if (targetOrRadius != null)
  2071.                     {
  2072. -                       L2PcInstance player = L2World.getInstance().getPlayer(targetOrRadius);
  2073. +                       L2PcInstance player = World.getInstance().getPlayer(targetOrRadius);
  2074.                         if (player != null)
  2075.                         {
  2076.                             if (performSocial(social, player))
  2077. @@ -310,7 +295,7 @@
  2078.                         {
  2079.                             final int radius = Integer.parseInt(targetOrRadius);
  2080.                            
  2081. -                           for (L2Object object : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  2082. +                           for (L2Character object : activeChar.getKnownTypeInRadius(L2Character.class, radius))
  2083.                                 performSocial(social, object);
  2084.                            
  2085.                             activeChar.sendMessage(radius + " units radius was affected by your social request.");
  2086. @@ -347,7 +332,7 @@
  2087.                     final String targetOrRadius = st.nextToken();
  2088.                     if (targetOrRadius != null)
  2089.                     {
  2090. -                       L2PcInstance player = L2World.getInstance().getPlayer(targetOrRadius);
  2091. +                       L2PcInstance player = World.getInstance().getPlayer(targetOrRadius);
  2092.                         if (player != null)
  2093.                         {
  2094.                             if (performAbnormal(abnormal, player))
  2095. @@ -359,7 +344,7 @@
  2096.                         {
  2097.                             final int radius = Integer.parseInt(targetOrRadius);
  2098.                            
  2099. -                           for (L2Object object : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  2100. +                           for (L2Character object : activeChar.getKnownTypeInRadius(L2Character.class, radius))
  2101.                                 performAbnormal(abnormal, object);
  2102.                            
  2103.                             activeChar.sendMessage(radius + " units radius was affected by your abnormal request.");
  2104. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGeoEngine.java
  2105. ===================================================================
  2106. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGeoEngine.java (revision 2)
  2107. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGeoEngine.java (working copy)
  2108. @@ -21,8 +21,8 @@
  2109.  import net.sf.l2j.gameserver.geoengine.geodata.GeoStructure;
  2110.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2111.  import net.sf.l2j.gameserver.model.L2Object;
  2112. -import net.sf.l2j.gameserver.model.L2World;
  2113.  import net.sf.l2j.gameserver.model.Location;
  2114. +import net.sf.l2j.gameserver.model.World;
  2115.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2116.  import net.sf.l2j.gameserver.network.SystemMessageId;
  2117.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  2118. @@ -72,8 +72,8 @@
  2119.         {
  2120.             final int geoX = GeoEngine.getGeoX(activeChar.getX());
  2121.             final int geoY = GeoEngine.getGeoY(activeChar.getY());
  2122. -           final int rx = (activeChar.getX() - L2World.WORLD_X_MIN) / L2World.TILE_SIZE + L2World.TILE_X_MIN;
  2123. -           final int ry = (activeChar.getY() - L2World.WORLD_Y_MIN) / L2World.TILE_SIZE + L2World.TILE_Y_MIN;
  2124. +           final int rx = (activeChar.getX() - World.WORLD_X_MIN) / World.TILE_SIZE + World.TILE_X_MIN;
  2125. +           final int ry = (activeChar.getY() - World.WORLD_Y_MIN) / World.TILE_SIZE + World.TILE_Y_MIN;
  2126.             final ABlock block = GeoEngine.getInstance().getBlock(geoX, geoY);
  2127.             activeChar.sendMessage("Region: " + rx + "_" + ry + "; Block: " + block.getClass().getSimpleName());
  2128.             if (block.hasGeoPos())
  2129. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHeal.java
  2130. ===================================================================
  2131. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHeal.java  (revision 2)
  2132. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHeal.java  (working copy)
  2133. @@ -19,7 +19,7 @@
  2134.  import net.sf.l2j.Config;
  2135.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2136.  import net.sf.l2j.gameserver.model.L2Object;
  2137. -import net.sf.l2j.gameserver.model.L2World;
  2138. +import net.sf.l2j.gameserver.model.World;
  2139.  import net.sf.l2j.gameserver.model.actor.L2Character;
  2140.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2141.  import net.sf.l2j.gameserver.network.SystemMessageId;
  2142. @@ -73,7 +73,7 @@
  2143.         L2Object obj = activeChar.getTarget();
  2144.         if (player != null)
  2145.         {
  2146. -           L2PcInstance plyr = L2World.getInstance().getPlayer(player);
  2147. +           L2PcInstance plyr = World.getInstance().getPlayer(player);
  2148.            
  2149.             if (plyr != null)
  2150.                 obj = plyr;
  2151. @@ -82,7 +82,7 @@
  2152.                 try
  2153.                 {
  2154.                     int radius = Integer.parseInt(player);
  2155. -                   for (L2Character character : activeChar.getKnownList().getKnownType(L2Character.class))
  2156. +                   for (L2Character character : activeChar.getKnownType(L2Character.class))
  2157.                     {
  2158.                         character.setCurrentHpMp(character.getMaxHp(), character.getMaxMp());
  2159.                         if (character instanceof L2PcInstance)
  2160. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKick.java
  2161. ===================================================================
  2162. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKick.java  (revision 2)
  2163. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKick.java  (working copy)
  2164. @@ -18,7 +18,7 @@
  2165.  
  2166.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2167.  import net.sf.l2j.gameserver.model.L2Object;
  2168. -import net.sf.l2j.gameserver.model.L2World;
  2169. +import net.sf.l2j.gameserver.model.World;
  2170.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2171.  
  2172.  public class AdminKick implements IAdminCommandHandler
  2173. @@ -43,7 +43,7 @@
  2174.             {
  2175.                 st.nextToken();
  2176.                 String player = st.nextToken();
  2177. -               L2PcInstance plyr = L2World.getInstance().getPlayer(player);
  2178. +               L2PcInstance plyr = World.getInstance().getPlayer(player);
  2179.                 if (plyr != null)
  2180.                 {
  2181.                     plyr.logout();
  2182. @@ -56,7 +56,7 @@
  2183.         {
  2184.             int counter = 0;
  2185.            
  2186. -           for (L2PcInstance player : L2World.getInstance().getPlayers())
  2187. +           for (L2PcInstance player : World.getInstance().getPlayers())
  2188.             {
  2189.                 if (player.isGM())
  2190.                     continue;
  2191. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKnownlist.java
  2192. ===================================================================
  2193. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKnownlist.java (revision 2)
  2194. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKnownlist.java (working copy)
  2195. @@ -14,27 +14,29 @@
  2196.   */
  2197.  package net.sf.l2j.gameserver.handler.admincommandhandlers;
  2198.  
  2199. -import java.util.Collection;
  2200. +import java.util.List;
  2201.  import java.util.StringTokenizer;
  2202.  
  2203.  import net.sf.l2j.commons.lang.StringUtil;
  2204. +import net.sf.l2j.commons.math.MathUtil;
  2205.  
  2206.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2207.  import net.sf.l2j.gameserver.model.L2Object;
  2208. -import net.sf.l2j.gameserver.model.L2World;
  2209. +import net.sf.l2j.gameserver.model.World;
  2210.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2211. -import net.sf.l2j.gameserver.model.actor.knownlist.ObjectKnownList;
  2212.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  2213.  
  2214.  /**
  2215.   * Handles visibility over target's knownlist, offering details about current target's vicinity.
  2216. - * @author Tryskell
  2217.   */
  2218.  public class AdminKnownlist implements IAdminCommandHandler
  2219.  {
  2220. +   private static final int PAGE_LIMIT = 15;
  2221. +  
  2222.     private static final String[] ADMIN_COMMANDS =
  2223.     {
  2224. -       "admin_knownlist"
  2225. +       "admin_knownlist",
  2226. +       "admin_knownlist_page",
  2227.     };
  2228.    
  2229.     @Override
  2230. @@ -55,11 +57,11 @@
  2231.                 try
  2232.                 {
  2233.                     final int objectId = Integer.parseInt(parameter);
  2234. -                   target = L2World.getInstance().getObject(objectId);
  2235. +                   target = World.getInstance().getObject(objectId);
  2236.                 }
  2237.                 catch (NumberFormatException nfe)
  2238.                 {
  2239. -                   target = L2World.getInstance().getPlayer(parameter);
  2240. +                   target = World.getInstance().getPlayer(parameter);
  2241.                 }
  2242.             }
  2243.            
  2244. @@ -71,25 +73,72 @@
  2245.                     target = activeChar;
  2246.             }
  2247.            
  2248. -           final ObjectKnownList knownlist = target.getKnownList();
  2249. -           final Collection<L2Object> list = knownlist.getKnownObjects();
  2250. +           int page = 1;
  2251.            
  2252. -           // Generate data.
  2253. -           final StringBuilder sb = new StringBuilder(list.size() * 150);
  2254. -           for (L2Object object : list)
  2255. -               StringUtil.append(sb, "<tr><td>", object.getName(), "</td><td>", object.getClass().getSimpleName(), "</td></tr>");
  2256. +           if (command.startsWith("admin_knownlist_page") && st.hasMoreTokens())
  2257. +           {
  2258. +               try
  2259. +               {
  2260. +                   page = Integer.parseInt(st.nextToken());
  2261. +               }
  2262. +               catch (NumberFormatException nfe)
  2263. +               {
  2264. +               }
  2265. +           }
  2266.            
  2267. -           final NpcHtmlMessage html = new NpcHtmlMessage(0);
  2268. -           html.setFile("data/html/admin/knownlist.htm");
  2269. -           html.replace("%target%", target.getName());
  2270. -           html.replace("%type%", knownlist.getClass().getSimpleName());
  2271. -           html.replace("%size%", list.size());
  2272. -           html.replace("%knownlist%", sb.toString());
  2273. -           activeChar.sendPacket(html);
  2274. +           showKnownlist(activeChar, target, page);
  2275.         }
  2276.         return true;
  2277.     }
  2278.    
  2279. +   private static void showKnownlist(L2PcInstance activeChar, L2Object target, int page)
  2280. +   {
  2281. +       List<L2Object> knownlist = target.getKnownType(L2Object.class);
  2282. +      
  2283. +       // Load static Htm.
  2284. +       final NpcHtmlMessage html = new NpcHtmlMessage(0);
  2285. +       html.setFile("data/html/admin/knownlist.htm");
  2286. +       html.replace("%target%", target.getName());
  2287. +       html.replace("%size%", knownlist.size());
  2288. +      
  2289. +       if (knownlist.isEmpty())
  2290. +       {
  2291. +           html.replace("%knownlist%", "<tr><td>No objects in vicinity.</td></tr>");
  2292. +           html.replace("%pages%", 0);
  2293. +           activeChar.sendPacket(html);
  2294. +           return;
  2295. +       }
  2296. +      
  2297. +       final int max = MathUtil.countPagesNumber(knownlist.size(), PAGE_LIMIT);
  2298. +       if (page > max)
  2299. +           page = max;
  2300. +      
  2301. +       knownlist = knownlist.subList((page - 1) * PAGE_LIMIT, Math.min(page * PAGE_LIMIT, knownlist.size()));
  2302. +      
  2303. +       // Generate data.
  2304. +       final StringBuilder sb = new StringBuilder(knownlist.size() * 150);
  2305. +       for (L2Object object : knownlist)
  2306. +           StringUtil.append(sb, "<tr><td>", object.getName(), "</td><td>", object.getClass().getSimpleName(), "</td></tr>");
  2307. +      
  2308. +       html.replace("%knownlist%", sb.toString());
  2309. +      
  2310. +       sb.setLength(0);
  2311. +      
  2312. +       // End of table, open a new table for pages system.
  2313. +       for (int i = 0; i < max; i++)
  2314. +       {
  2315. +           final int pagenr = i + 1;
  2316. +           if (page == pagenr)
  2317. +               StringUtil.append(sb, pagenr, "&nbsp;");
  2318. +           else
  2319. +               StringUtil.append(sb, "<a action=\"bypass -h admin_knownlist_page ", target.getObjectId(), " ", pagenr, "\">", pagenr, "</a>&nbsp;");
  2320. +       }
  2321. +      
  2322. +       html.replace("%pages%", sb.toString());
  2323. +      
  2324. +       activeChar.sendPacket(html);
  2325. +   }
  2326. +  
  2327.     @Override
  2328.     public String[] getAdminCommandList()
  2329.     {
  2330. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMaintenance.java
  2331. ===================================================================
  2332. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMaintenance.java   (revision 2)
  2333. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMaintenance.java   (working copy)
  2334. @@ -18,7 +18,7 @@
  2335.  import net.sf.l2j.gameserver.LoginServerThread;
  2336.  import net.sf.l2j.gameserver.Shutdown;
  2337.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2338. -import net.sf.l2j.gameserver.model.L2World;
  2339. +import net.sf.l2j.gameserver.model.World;
  2340.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2341.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  2342.  import net.sf.l2j.gameserver.taskmanager.GameTimeTaskManager;
  2343. @@ -108,7 +108,7 @@
  2344.     {
  2345.         final NpcHtmlMessage html = new NpcHtmlMessage(0);
  2346.         html.setFile("data/html/admin/maintenance.htm");
  2347. -       html.replace("%count%", L2World.getInstance().getPlayers().size());
  2348. +       html.replace("%count%", World.getInstance().getPlayers().size());
  2349.         html.replace("%used%", Math.round((int) ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576)));
  2350.         html.replace("%server_name%", LoginServerThread.getInstance().getServerName());
  2351.         html.replace("%status%", LoginServerThread.getInstance().getStatusString());
  2352. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMenu.java
  2353. ===================================================================
  2354. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMenu.java  (revision 2)
  2355. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMenu.java  (working copy)
  2356. @@ -15,7 +15,7 @@
  2357.  package net.sf.l2j.gameserver.handler.admincommandhandlers;
  2358.  
  2359.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2360. -import net.sf.l2j.gameserver.model.L2World;
  2361. +import net.sf.l2j.gameserver.model.World;
  2362.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2363.  
  2364.  public class AdminMenu implements IAdminCommandHandler
  2365. @@ -37,7 +37,7 @@
  2366.             if (data.length == 5)
  2367.             {
  2368.                 String playerName = data[1];
  2369. -               L2PcInstance player = L2World.getInstance().getPlayer(playerName);
  2370. +               L2PcInstance player = World.getInstance().getPlayer(playerName);
  2371.                 if (player != null)
  2372.                     teleportCharacter(player, Integer.parseInt(data[2]), Integer.parseInt(data[3]), Integer.parseInt(data[4]), activeChar);
  2373.             }
  2374. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminRes.java
  2375. ===================================================================
  2376. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminRes.java   (revision 2)
  2377. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminRes.java   (working copy)
  2378. @@ -19,7 +19,7 @@
  2379.  import net.sf.l2j.Config;
  2380.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2381.  import net.sf.l2j.gameserver.model.L2Object;
  2382. -import net.sf.l2j.gameserver.model.L2World;
  2383. +import net.sf.l2j.gameserver.model.World;
  2384.  import net.sf.l2j.gameserver.model.actor.L2Character;
  2385.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2386.  import net.sf.l2j.gameserver.network.SystemMessageId;
  2387. @@ -72,7 +72,7 @@
  2388.         if (resParam != null)
  2389.         {
  2390.             // Check if a player name was specified as a param.
  2391. -           L2PcInstance plyr = L2World.getInstance().getPlayer(resParam);
  2392. +           L2PcInstance plyr = World.getInstance().getPlayer(resParam);
  2393.            
  2394.             if (plyr != null)
  2395.                 obj = plyr;
  2396. @@ -83,7 +83,7 @@
  2397.                 {
  2398.                     int radius = Integer.parseInt(resParam);
  2399.                    
  2400. -                   for (L2PcInstance knownPlayer : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  2401. +                   for (L2PcInstance knownPlayer : activeChar.getKnownTypeInRadius(L2PcInstance.class, radius))
  2402.                         doResurrect(knownPlayer);
  2403.                    
  2404.                     activeChar.sendMessage("Resurrected all players within a " + radius + " unit radius.");
  2405. @@ -123,7 +123,7 @@
  2406.             {
  2407.                 radius = Integer.parseInt(radiusStr);
  2408.                
  2409. -               for (L2Character knownChar : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  2410. +               for (L2Character knownChar : activeChar.getKnownTypeInRadius(L2Character.class, radius))
  2411.                     if (!(knownChar instanceof L2PcInstance))
  2412.                         doResurrect(knownChar);
  2413.                
  2414. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminSpawn.java
  2415. ===================================================================
  2416. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminSpawn.java (revision 2)
  2417. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminSpawn.java (working copy)
  2418. @@ -32,7 +32,7 @@
  2419.  import net.sf.l2j.gameserver.instancemanager.SevenSigns;
  2420.  import net.sf.l2j.gameserver.model.L2Object;
  2421.  import net.sf.l2j.gameserver.model.L2Spawn;
  2422. -import net.sf.l2j.gameserver.model.L2World;
  2423. +import net.sf.l2j.gameserver.model.World;
  2424.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  2425.  import net.sf.l2j.gameserver.model.actor.instance.L2FenceInstance;
  2426.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2427. @@ -198,7 +198,7 @@
  2428.             Broadcast.toAllOnlinePlayers(SystemMessage.getSystemMessage(SystemMessageId.NPC_SERVER_NOT_OPERATING));
  2429.             RaidBossSpawnManager.getInstance().cleanUp();
  2430.             DayNightSpawnManager.getInstance().cleanUp();
  2431. -           L2World.getInstance().deleteVisibleNpcSpawns();
  2432. +           World.getInstance().deleteVisibleNpcSpawns();
  2433.             GmListTable.broadcastMessageToGMs("NPCs' unspawn is now complete.");
  2434.         }
  2435.         else if (command.startsWith("admin_spawnday"))
  2436. @@ -210,7 +210,7 @@
  2437.             // make sure all spawns are deleted
  2438.             RaidBossSpawnManager.getInstance().cleanUp();
  2439.             DayNightSpawnManager.getInstance().cleanUp();
  2440. -           L2World.getInstance().deleteVisibleNpcSpawns();
  2441. +           World.getInstance().deleteVisibleNpcSpawns();
  2442.             // now respawn all
  2443.             NpcTable.getInstance().reloadAllNpc();
  2444.             SpawnTable.getInstance().reloadAll();
  2445. @@ -246,7 +246,7 @@
  2446.             st.nextToken();
  2447.             try
  2448.             {
  2449. -               L2Object object = L2World.getInstance().getObject(Integer.parseInt(st.nextToken()));
  2450. +               L2Object object = World.getInstance().getObject(Integer.parseInt(st.nextToken()));
  2451.                 if (object instanceof L2FenceInstance)
  2452.                 {
  2453.                     FenceTable.getInstance().removeFence((L2FenceInstance) object);
  2454. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTarget.java
  2455. ===================================================================
  2456. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTarget.java    (revision 2)
  2457. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTarget.java    (working copy)
  2458. @@ -15,7 +15,7 @@
  2459.  package net.sf.l2j.gameserver.handler.admincommandhandlers;
  2460.  
  2461.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2462. -import net.sf.l2j.gameserver.model.L2World;
  2463. +import net.sf.l2j.gameserver.model.World;
  2464.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2465.  import net.sf.l2j.gameserver.network.SystemMessageId;
  2466.  
  2467. @@ -48,7 +48,7 @@
  2468.         try
  2469.         {
  2470.             String targetName = command.substring(13);
  2471. -           L2PcInstance obj = L2World.getInstance().getPlayer(targetName);
  2472. +           L2PcInstance obj = World.getInstance().getPlayer(targetName);
  2473.            
  2474.             if (obj != null)
  2475.                 obj.onAction(activeChar);
  2476. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTeleport.java
  2477. ===================================================================
  2478. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTeleport.java  (revision 2)
  2479. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminTeleport.java  (working copy)
  2480. @@ -22,7 +22,7 @@
  2481.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2482.  import net.sf.l2j.gameserver.model.L2Clan;
  2483.  import net.sf.l2j.gameserver.model.L2Object;
  2484. -import net.sf.l2j.gameserver.model.L2World;
  2485. +import net.sf.l2j.gameserver.model.World;
  2486.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2487.  import net.sf.l2j.gameserver.network.SystemMessageId;
  2488.  
  2489. @@ -71,7 +71,7 @@
  2490.             {
  2491.                 st.nextToken();
  2492.                 String plyr = st.nextToken();
  2493. -               L2PcInstance player = L2World.getInstance().getPlayer(plyr);
  2494. +               L2PcInstance player = World.getInstance().getPlayer(plyr);
  2495.                 if (player == null)
  2496.                 {
  2497.                     activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
  2498. @@ -86,7 +86,7 @@
  2499.             try
  2500.             {
  2501.                 String targetName = command.substring(13);
  2502. -               L2PcInstance player = L2World.getInstance().getPlayer(targetName);
  2503. +               L2PcInstance player = World.getInstance().getPlayer(targetName);
  2504.                 if (player == null)
  2505.                 {
  2506.                     activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
  2507. @@ -104,7 +104,7 @@
  2508.             try
  2509.             {
  2510.                 String targetName = command.substring(19);
  2511. -               L2PcInstance player = L2World.getInstance().getPlayer(targetName);
  2512. +               L2PcInstance player = World.getInstance().getPlayer(targetName);
  2513.                 if (player == null)
  2514.                 {
  2515.                     activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
  2516. @@ -133,7 +133,7 @@
  2517.             try
  2518.             {
  2519.                 String targetName = command.substring(18);
  2520. -               L2PcInstance player = L2World.getInstance().getPlayer(targetName);
  2521. +               L2PcInstance player = World.getInstance().getPlayer(targetName);
  2522.                 if (player == null)
  2523.                 {
  2524.                     activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
  2525. @@ -178,7 +178,7 @@
  2526.             {
  2527.                 st.nextToken();
  2528.                 String plyr = st.nextToken();
  2529. -               L2PcInstance player = L2World.getInstance().getPlayer(plyr);
  2530. +               L2PcInstance player = World.getInstance().getPlayer(plyr);
  2531.                 if (player == null)
  2532.                 {
  2533.                     activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
  2534. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminZone.java
  2535. ===================================================================
  2536. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminZone.java  (revision 2)
  2537. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminZone.java  (working copy)
  2538. @@ -21,7 +21,7 @@
  2539.  import net.sf.l2j.gameserver.datatables.MapRegionTable;
  2540.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2541.  import net.sf.l2j.gameserver.instancemanager.ZoneManager;
  2542. -import net.sf.l2j.gameserver.model.L2World;
  2543. +import net.sf.l2j.gameserver.model.World;
  2544.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2545.  import net.sf.l2j.gameserver.model.zone.L2ZoneType;
  2546.  import net.sf.l2j.gameserver.model.zone.ZoneId;
  2547. @@ -82,8 +82,8 @@
  2548.     {
  2549.         int x = activeChar.getX();
  2550.         int y = activeChar.getY();
  2551. -       int rx = (x - L2World.WORLD_X_MIN) / L2World.TILE_SIZE + L2World.TILE_X_MIN;
  2552. -       int ry = (y - L2World.WORLD_Y_MIN) / L2World.TILE_SIZE + L2World.TILE_Y_MIN;
  2553. +       int rx = (x - World.WORLD_X_MIN) / World.TILE_SIZE + World.TILE_X_MIN;
  2554. +       int ry = (y - World.WORLD_Y_MIN) / World.TILE_SIZE + World.TILE_Y_MIN;
  2555.        
  2556.         final NpcHtmlMessage html = new NpcHtmlMessage(0);
  2557.         html.setFile("data/html/admin/zone.htm");
  2558. @@ -113,7 +113,7 @@
  2559.         html.replace("%NORESTART%", (activeChar.isInsideZone(ZoneId.NO_RESTART) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
  2560.        
  2561.         final StringBuilder sb = new StringBuilder(100);
  2562. -       for (L2ZoneType zone : L2World.getInstance().getRegion(x, y).getZones())
  2563. +       for (L2ZoneType zone : World.getInstance().getRegion(x, y).getZones())
  2564.         {
  2565.             if (zone.isCharacterInZone(activeChar))
  2566.                 StringUtil.append(sb, zone.getId(), " ");
  2567. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
  2568. ===================================================================
  2569. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java    (revision 2)
  2570. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java    (working copy)
  2571. @@ -35,7 +35,7 @@
  2572.             return;
  2573.        
  2574.         final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  2575. -       for (L2PcInstance player : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 1250))
  2576. +       for (L2PcInstance player : activeChar.getKnownTypeInRadius(L2PcInstance.class, 1250))
  2577.         {
  2578.             if (!BlockList.isBlocked(player, activeChar))
  2579.                 player.sendPacket(cs);
  2580. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java
  2581. ===================================================================
  2582. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java  (revision 2)
  2583. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java  (working copy)
  2584. @@ -15,7 +15,7 @@
  2585.  package net.sf.l2j.gameserver.handler.chathandlers;
  2586.  
  2587.  import net.sf.l2j.gameserver.handler.IChatHandler;
  2588. -import net.sf.l2j.gameserver.model.L2World;
  2589. +import net.sf.l2j.gameserver.model.World;
  2590.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2591.  import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  2592.  import net.sf.l2j.gameserver.util.FloodProtectors;
  2593. @@ -38,7 +38,7 @@
  2594.             return;
  2595.        
  2596.         final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  2597. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  2598. +       for (L2PcInstance player : World.getInstance().getPlayers())
  2599.             player.sendPacket(cs);
  2600.     }
  2601.    
  2602. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java
  2603. ===================================================================
  2604. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java  (revision 2)
  2605. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java  (working copy)
  2606. @@ -17,7 +17,7 @@
  2607.  import net.sf.l2j.gameserver.datatables.MapRegionTable;
  2608.  import net.sf.l2j.gameserver.handler.IChatHandler;
  2609.  import net.sf.l2j.gameserver.model.BlockList;
  2610. -import net.sf.l2j.gameserver.model.L2World;
  2611. +import net.sf.l2j.gameserver.model.World;
  2612.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2613.  import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  2614.  import net.sf.l2j.gameserver.util.FloodProtectors;
  2615. @@ -39,7 +39,7 @@
  2616.         final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  2617.         final int region = MapRegionTable.getMapRegion(activeChar.getX(), activeChar.getY());
  2618.        
  2619. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  2620. +       for (L2PcInstance player : World.getInstance().getPlayers())
  2621.         {
  2622.             if (!BlockList.isBlocked(player, activeChar) && region == MapRegionTable.getMapRegion(player.getX(), player.getY()))
  2623.                 player.sendPacket(cs);
  2624. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java
  2625. ===================================================================
  2626. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java   (revision 2)
  2627. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java   (working copy)
  2628. @@ -16,7 +16,7 @@
  2629.  
  2630.  import net.sf.l2j.gameserver.handler.IChatHandler;
  2631.  import net.sf.l2j.gameserver.model.BlockList;
  2632. -import net.sf.l2j.gameserver.model.L2World;
  2633. +import net.sf.l2j.gameserver.model.World;
  2634.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2635.  import net.sf.l2j.gameserver.network.SystemMessageId;
  2636.  import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  2637. @@ -34,7 +34,7 @@
  2638.         if (target == null)
  2639.             return;
  2640.        
  2641. -       final L2PcInstance receiver = L2World.getInstance().getPlayer(target);
  2642. +       final L2PcInstance receiver = World.getInstance().getPlayer(target);
  2643.         if (receiver == null || receiver.getClient().isDetached())
  2644.         {
  2645.             activeChar.sendPacket(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME);
  2646. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java
  2647. ===================================================================
  2648. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java  (revision 2)
  2649. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java  (working copy)
  2650. @@ -17,7 +17,7 @@
  2651.  import net.sf.l2j.gameserver.datatables.MapRegionTable;
  2652.  import net.sf.l2j.gameserver.handler.IChatHandler;
  2653.  import net.sf.l2j.gameserver.model.BlockList;
  2654. -import net.sf.l2j.gameserver.model.L2World;
  2655. +import net.sf.l2j.gameserver.model.World;
  2656.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2657.  import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  2658.  import net.sf.l2j.gameserver.util.FloodProtectors;
  2659. @@ -39,7 +39,7 @@
  2660.         final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  2661.         final int region = MapRegionTable.getMapRegion(activeChar.getX(), activeChar.getY());
  2662.        
  2663. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  2664. +       for (L2PcInstance player : World.getInstance().getPlayers())
  2665.         {
  2666.             if (!BlockList.isBlocked(player, activeChar) && region == MapRegionTable.getMapRegion(player.getX(), player.getY()))
  2667.                 player.sendPacket(cs);
  2668. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShot.java
  2669. ===================================================================
  2670. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShot.java  (revision 2)
  2671. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShot.java  (working copy)
  2672. @@ -74,6 +74,6 @@
  2673.        
  2674.         activeOwner.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PET_USES_S1).addItemName(item.getItemId()));
  2675.         activePet.setChargedShot(ShotType.SOULSHOT, true);
  2676. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 360000);
  2677. +       Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 600);
  2678.     }
  2679.  }
  2680. \ No newline at end of file
  2681. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShot.java
  2682. ===================================================================
  2683. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShot.java    (revision 2)
  2684. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShot.java    (working copy)
  2685. @@ -76,6 +76,6 @@
  2686.        
  2687.         activeOwner.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PET_USES_S1).addItemName(itemId));
  2688.         activePet.setChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOT : ShotType.SPIRITSHOT, true);
  2689. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeOwner, new MagicSkillUse(activePet, activePet, (isBlessed ? 2009 : 2008), 1, 0, 0), 360000);
  2690. +       Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, (isBlessed ? 2009 : 2008), 1, 0, 0), 600);
  2691.     }
  2692.  }
  2693. \ No newline at end of file
  2694. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java
  2695. ===================================================================
  2696. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java  (revision 2)
  2697. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java  (working copy)
  2698. @@ -72,6 +72,6 @@
  2699.        
  2700.         activeChar.sendPacket(SystemMessageId.ENABLED_SPIRITSHOT);
  2701.         activeChar.setChargedShot(ShotType.BLESSED_SPIRITSHOT, true);
  2702. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 360000);
  2703. +       Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 600);
  2704.     }
  2705.  }
  2706. \ No newline at end of file
  2707. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java
  2708. ===================================================================
  2709. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java  (revision 2)
  2710. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java  (working copy)
  2711. @@ -77,6 +77,6 @@
  2712.        
  2713.         weaponInst.setChargedShot(ShotType.SOULSHOT, true);
  2714.         activeChar.sendPacket(SystemMessageId.ENABLED_SOULSHOT);
  2715. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 360000);
  2716. +       Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 600);
  2717.     }
  2718.  }
  2719. \ No newline at end of file
  2720. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java
  2721. ===================================================================
  2722. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java (revision 2)
  2723. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java (working copy)
  2724. @@ -70,6 +70,6 @@
  2725.        
  2726.         activeChar.sendPacket(SystemMessageId.ENABLED_SPIRITSHOT);
  2727.         activeChar.setChargedShot(ShotType.SPIRITSHOT, true);
  2728. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 360000);
  2729. +       Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 600);
  2730.     }
  2731.  }
  2732. \ No newline at end of file
  2733. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java
  2734. ===================================================================
  2735. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java    (revision 2)
  2736. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java    (working copy)
  2737. @@ -29,6 +29,7 @@
  2738.  import net.sf.l2j.gameserver.handler.IItemHandler;
  2739.  import net.sf.l2j.gameserver.model.L2Object;
  2740.  import net.sf.l2j.gameserver.model.L2Spawn;
  2741. +import net.sf.l2j.gameserver.model.World;
  2742.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  2743.  import net.sf.l2j.gameserver.model.actor.L2Playable;
  2744.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2745. @@ -40,8 +41,8 @@
  2746.  import net.sf.l2j.gameserver.network.SystemMessageId;
  2747.  import net.sf.l2j.gameserver.network.serverpackets.MagicSkillLaunched;
  2748.  import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
  2749. -import net.sf.l2j.gameserver.network.serverpackets.PetItemList;
  2750.  import net.sf.l2j.gameserver.network.serverpackets.SetupGauge;
  2751. +import net.sf.l2j.gameserver.network.serverpackets.SetupGauge.GaugeColor;
  2752.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  2753.  import net.sf.l2j.gameserver.util.Broadcast;
  2754.  
  2755. @@ -96,7 +97,7 @@
  2756.             case 0: // static summons (like Christmas tree)
  2757.                 try
  2758.                 {
  2759. -                   for (L2XmassTreeInstance ch : activeChar.getKnownList().getKnownTypeInRadius(L2XmassTreeInstance.class, 1200))
  2760. +                   for (L2XmassTreeInstance ch : activeChar.getKnownTypeInRadius(L2XmassTreeInstance.class, 1200)) // FIXME pointless
  2761.                     {
  2762.                         if (npcTemplate.getNpcId() == L2XmassTreeInstance.SPECIAL_TREE_ID)
  2763.                         {
  2764. @@ -126,7 +127,7 @@
  2765.                 activeChar.setTarget(activeChar);
  2766.                 Broadcast.toSelfAndKnownPlayers(activeChar, new MagicSkillUse(activeChar, 2046, 1, 5000, 0));
  2767.                 activeChar.setTarget(oldTarget);
  2768. -               activeChar.sendPacket(new SetupGauge(0, 5000));
  2769. +               activeChar.sendPacket(new SetupGauge(GaugeColor.BLUE, 5000));
  2770.                 activeChar.sendPacket(SystemMessageId.SUMMON_A_PET);
  2771.                 activeChar.setIsCastingNow(true);
  2772.                
  2773. @@ -164,35 +165,24 @@
  2774.                 if (_item == null || _item.getOwnerId() != _activeChar.getObjectId() || _item.getLocation() != ItemInstance.ItemLocation.INVENTORY)
  2775.                     return;
  2776.                
  2777. -               final L2PetInstance pet = L2PetInstance.spawnPet(_npcTemplate, _activeChar, _item);
  2778. +               // Owner has a pet listed in world.
  2779. +               if (World.getInstance().getPet(_activeChar.getObjectId()) != null)
  2780. +                   return;
  2781. +              
  2782. +               // Add the pet instance to world.
  2783. +               final L2PetInstance pet = L2PetInstance.restore(_item, _npcTemplate, _activeChar);
  2784.                 if (pet == null)
  2785.                     return;
  2786.                
  2787. -               pet.setShowSummonAnimation(true);
  2788. +               World.getInstance().addPet(_activeChar.getObjectId(), pet);
  2789.                
  2790. -               if (!pet.isRespawned())
  2791. -               {
  2792. -                   pet.setCurrentHp(pet.getMaxHp());
  2793. -                   pet.setCurrentMp(pet.getMaxMp());
  2794. -                   pet.getStat().setExp(pet.getExpForThisLevel());
  2795. -                   pet.setCurrentFed(pet.getPetData().getMaxMeal());
  2796. -               }
  2797. +               _activeChar.setPet(pet);
  2798.                
  2799.                 pet.setRunning();
  2800. -              
  2801. -               if (!pet.isRespawned())
  2802. -                   pet.store();
  2803. -              
  2804. -               _activeChar.setPet(pet);
  2805. -              
  2806. -               pet.spawnMe(_activeChar.getX() + 50, _activeChar.getY() + 100, _activeChar.getZ());
  2807. +               pet.setTitle(_activeChar.getName());
  2808. +               pet.spawnMe();
  2809.                 pet.startFeed();
  2810. -               _item.setEnchantLevel(pet.getLevel());
  2811. -              
  2812.                 pet.setFollowStatus(true);
  2813. -              
  2814. -               pet.getOwner().sendPacket(new PetItemList(pet));
  2815. -               pet.broadcastStatusUpdate();
  2816.             }
  2817.             catch (Exception e)
  2818.             {
  2819. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/skillhandlers/HealPercent.java
  2820. ===================================================================
  2821. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/skillhandlers/HealPercent.java   (revision 2)
  2822. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/skillhandlers/HealPercent.java   (working copy)
  2823. @@ -32,8 +32,7 @@
  2824.     private static final L2SkillType[] SKILL_IDS =
  2825.     {
  2826.         L2SkillType.HEAL_PERCENT,
  2827. -       L2SkillType.MANAHEAL_PERCENT,
  2828. -       L2SkillType.CPHEAL_PERCENT
  2829. +       L2SkillType.MANAHEAL_PERCENT
  2830.     };
  2831.    
  2832.     @Override
  2833. @@ -44,16 +43,11 @@
  2834.         if (handler != null)
  2835.             handler.useSkill(activeChar, skill, targets);
  2836.        
  2837. -       boolean cp = false;
  2838.         boolean hp = false;
  2839.         boolean mp = false;
  2840.        
  2841.         switch (skill.getSkillType())
  2842.         {
  2843. -           case CPHEAL_PERCENT:
  2844. -               cp = true;
  2845. -               break;
  2846. -          
  2847.             case HEAL_PERCENT:
  2848.                 hp = true;
  2849.                 break;
  2850. @@ -109,18 +103,8 @@
  2851.             {
  2852.                 su = new StatusUpdate(target);
  2853.                
  2854. -               if (cp)
  2855. +               if (hp)
  2856.                 {
  2857. -                   amount = Math.min(((full) ? target.getMaxCp() : (target.getMaxCp() * skill.getPower() / 100.0)), target.getMaxCp() - target.getCurrentCp());
  2858. -                   target.setCurrentCp(amount + target.getCurrentCp());
  2859. -                  
  2860. -                   sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_WILL_BE_RESTORED);
  2861. -                   sm.addNumber((int) amount);
  2862. -                   target.sendPacket(sm);
  2863. -                   su.addAttribute(StatusUpdate.CUR_CP, (int) target.getCurrentCp());
  2864. -               }
  2865. -               else if (hp)
  2866. -               {
  2867.                     if (activeChar != target)
  2868.                         sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_RESTORED_BY_S1).addCharName(activeChar);
  2869.                     else
  2870. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/BoatManager.java
  2871. ===================================================================
  2872. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/BoatManager.java (revision 2)
  2873. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/BoatManager.java (working copy)
  2874. @@ -18,8 +18,8 @@
  2875.  import java.util.Map;
  2876.  
  2877.  import net.sf.l2j.gameserver.idfactory.IdFactory;
  2878. -import net.sf.l2j.gameserver.model.L2World;
  2879.  import net.sf.l2j.gameserver.model.VehiclePathPoint;
  2880. +import net.sf.l2j.gameserver.model.World;
  2881.  import net.sf.l2j.gameserver.model.actor.L2Vehicle;
  2882.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2883.  import net.sf.l2j.gameserver.model.actor.template.CharTemplate;
  2884. @@ -89,8 +89,7 @@
  2885.         _boats.put(boat.getObjectId(), boat);
  2886.        
  2887.         boat.setHeading(heading);
  2888. -       boat.setXYZInvisible(x, y, z);
  2889. -       boat.spawnMe();
  2890. +       boat.spawnMe(x, y, z);
  2891.        
  2892.         return boat;
  2893.     }
  2894. @@ -132,7 +131,7 @@
  2895.      */
  2896.     public void broadcastPacket(VehiclePathPoint point1, VehiclePathPoint point2, L2GameServerPacket packet)
  2897.     {
  2898. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  2899. +       for (L2PcInstance player : World.getInstance().getPlayers())
  2900.         {
  2901.             double dx = (double) player.getX() - point1.x;
  2902.             double dy = (double) player.getY() - point1.y;
  2903. @@ -158,7 +157,7 @@
  2904.      */
  2905.     public void broadcastPackets(VehiclePathPoint point1, VehiclePathPoint point2, L2GameServerPacket... packets)
  2906.     {
  2907. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  2908. +       for (L2PcInstance player : World.getInstance().getPlayers())
  2909.         {
  2910.             double dx = (double) player.getX() - point1.x;
  2911.             double dy = (double) player.getY() - point1.y;
  2912. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/CastleManorManager.java
  2913. ===================================================================
  2914. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/CastleManorManager.java  (revision 2)
  2915. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/CastleManorManager.java  (working copy)
  2916. @@ -32,7 +32,7 @@
  2917.  import net.sf.l2j.gameserver.datatables.ClanTable;
  2918.  import net.sf.l2j.gameserver.model.L2Clan;
  2919.  import net.sf.l2j.gameserver.model.L2Manor;
  2920. -import net.sf.l2j.gameserver.model.L2World;
  2921. +import net.sf.l2j.gameserver.model.World;
  2922.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2923.  import net.sf.l2j.gameserver.model.entity.Castle;
  2924.  import net.sf.l2j.gameserver.model.itemcontainer.ClanWarehouse;
  2925. @@ -454,7 +454,7 @@
  2926.            
  2927.             // Sending notification to a clan leader
  2928.             L2PcInstance clanLeader = null;
  2929. -           clanLeader = L2World.getInstance().getPlayer(clan.getLeader().getName());
  2930. +           clanLeader = World.getInstance().getPlayer(clan.getLeader().getName());
  2931.             if (clanLeader != null)
  2932.                 clanLeader.sendPacket(SystemMessageId.THE_MANOR_INFORMATION_HAS_BEEN_UPDATED);
  2933.            
  2934. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/CoupleManager.java
  2935. ===================================================================
  2936. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/CoupleManager.java   (revision 2)
  2937. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/CoupleManager.java   (working copy)
  2938. @@ -17,125 +17,145 @@
  2939.  import java.sql.Connection;
  2940.  import java.sql.PreparedStatement;
  2941.  import java.sql.ResultSet;
  2942. -import java.util.ArrayList;
  2943. -import java.util.List;
  2944. +import java.util.Map;
  2945. +import java.util.Map.Entry;
  2946. +import java.util.concurrent.ConcurrentHashMap;
  2947.  import java.util.logging.Level;
  2948.  import java.util.logging.Logger;
  2949.  
  2950.  import net.sf.l2j.L2DatabaseFactory;
  2951. -import net.sf.l2j.gameserver.model.L2World;
  2952. +import net.sf.l2j.gameserver.idfactory.IdFactory;
  2953. +import net.sf.l2j.gameserver.model.World;
  2954.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2955. -import net.sf.l2j.gameserver.model.entity.Couple;
  2956. +import net.sf.l2j.gameserver.model.holder.IntIntHolder;
  2957.  
  2958. -/**
  2959. - * @author evill33t
  2960. - */
  2961.  public class CoupleManager
  2962.  {
  2963.     private static final Logger _log = Logger.getLogger(CoupleManager.class.getName());
  2964.    
  2965. +   private final Map<Integer, IntIntHolder> _couples = new ConcurrentHashMap<>();
  2966. +  
  2967.     protected CoupleManager()
  2968.     {
  2969. -       load();
  2970. -   }
  2971. -  
  2972. -   public static final CoupleManager getInstance()
  2973. -   {
  2974. -       return SingletonHolder._instance;
  2975. -   }
  2976. -  
  2977. -   private List<Couple> _couples;
  2978. -  
  2979. -   public void reload()
  2980. -   {
  2981. -       _couples.clear();
  2982. -       load();
  2983. -   }
  2984. -  
  2985. -   private final void load()
  2986. -   {
  2987. -       _couples = new ArrayList<>();
  2988. -      
  2989.         try (Connection con = L2DatabaseFactory.getInstance().getConnection())
  2990.         {
  2991. -           PreparedStatement statement = con.prepareStatement("SELECT id FROM mods_wedding ORDER BY id");
  2992. -           ResultSet rs = statement.executeQuery();
  2993. +           PreparedStatement ps = con.prepareStatement("SELECT * FROM mods_wedding");
  2994.            
  2995. +           ResultSet rs = ps.executeQuery();
  2996.             while (rs.next())
  2997. -               _couples.add(new Couple(rs.getInt("id")));
  2998. +               _couples.put(rs.getInt("id"), new IntIntHolder(rs.getInt("requesterId"), rs.getInt("partnerId")));
  2999.            
  3000.             rs.close();
  3001. -           statement.close();
  3002. +           ps.close();
  3003.            
  3004. -           _log.info("CoupleManager : Loaded " + getCouples().size() + " couples.");
  3005. +           _log.info("CoupleManager : Loaded " + _couples.size() + " couples.");
  3006.         }
  3007.         catch (Exception e)
  3008.         {
  3009. -           _log.log(Level.WARNING, "Exception: CoupleManager.load(): " + e.getMessage(), e);
  3010. +           _log.log(Level.WARNING, "CoupleManager: " + e.getMessage(), e);
  3011.         }
  3012.     }
  3013.    
  3014. -   public final Couple getCouple(int coupleId)
  3015. +   public final Map<Integer, IntIntHolder> getCouples()
  3016.     {
  3017. -       int index = getCoupleIndex(coupleId);
  3018. -       if (index >= 0)
  3019. -           return _couples.get(index);
  3020. +       return _couples;
  3021. +   }
  3022. +  
  3023. +   public final IntIntHolder getCouple(int coupleId)
  3024. +   {
  3025. +       return _couples.get(coupleId);
  3026. +   }
  3027. +  
  3028. +   /**
  3029. +    * Add a couple to the couples map. Both players must be logged.
  3030. +    * @param requester : The wedding requester.
  3031. +    * @param partner : The wedding partner.
  3032. +    */
  3033. +   public void addCouple(L2PcInstance requester, L2PcInstance partner)
  3034. +   {
  3035. +       if (requester == null || partner == null)
  3036. +           return;
  3037.        
  3038. -       return null;
  3039. +       final int coupleId = IdFactory.getInstance().getNextId();
  3040. +      
  3041. +       _couples.put(coupleId, new IntIntHolder(requester.getObjectId(), partner.getObjectId()));
  3042. +      
  3043. +       requester.setCoupleId(coupleId);
  3044. +       partner.setCoupleId(coupleId);
  3045.     }
  3046.    
  3047. -   public void createCouple(L2PcInstance player1, L2PcInstance player2)
  3048. +   /**
  3049. +    * Delete the couple. If players are logged, reset wedding variables.
  3050. +    * @param coupleId : The couple id to delete.
  3051. +    */
  3052. +   public void deleteCouple(int coupleId)
  3053.     {
  3054. -       if (player1 != null && player2 != null)
  3055. +       final IntIntHolder couple = _couples.remove(coupleId);
  3056. +       if (couple == null)
  3057. +           return;
  3058. +      
  3059. +       final L2PcInstance requester = World.getInstance().getPlayer(couple.getId());
  3060. +       if (requester != null)
  3061.         {
  3062. -           Couple _new = new Couple(player1, player2);
  3063. -           _couples.add(_new);
  3064. -           player1.setCoupleId(_new.getId());
  3065. -           player2.setCoupleId(_new.getId());
  3066. +           requester.setCoupleId(0);
  3067. +           requester.sendMessage("You are now divorced.");
  3068.         }
  3069. +      
  3070. +       final L2PcInstance partner = World.getInstance().getPlayer(couple.getValue());
  3071. +       if (partner != null)
  3072. +       {
  3073. +           partner.setCoupleId(0);
  3074. +           partner.sendMessage("You are now divorced.");
  3075. +       }
  3076.     }
  3077.    
  3078. -   public void deleteCouple(int coupleId)
  3079. +   /**
  3080. +    * Save all couples on shutdown. Delete previous SQL infos.
  3081. +    */
  3082. +   public void save()
  3083.     {
  3084. -       int index = getCoupleIndex(coupleId);
  3085. -       Couple couple = _couples.get(index);
  3086. -       if (couple != null)
  3087. +       try (Connection con = L2DatabaseFactory.getInstance().getConnection())
  3088.         {
  3089. -           L2PcInstance player1 = L2World.getInstance().getPlayer(couple.getPlayer1Id());
  3090. -           L2PcInstance player2 = L2World.getInstance().getPlayer(couple.getPlayer2Id());
  3091. +           PreparedStatement ps = con.prepareStatement("DELETE FROM mods_wedding");
  3092. +           ps.execute();
  3093. +           ps.close();
  3094.            
  3095. -           if (player1 != null)
  3096. +           ps = con.prepareStatement("INSERT INTO mods_wedding (id, requesterId, partnerId) VALUES (?,?,?)");
  3097. +           for (Entry<Integer, IntIntHolder> coupleEntry : _couples.entrySet())
  3098.             {
  3099. -               player1.setMarried(false);
  3100. -               player1.setCoupleId(0);
  3101. +               final IntIntHolder couple = coupleEntry.getValue();
  3102. +              
  3103. +               ps.setInt(1, coupleEntry.getKey());
  3104. +               ps.setInt(2, couple.getId());
  3105. +               ps.setInt(3, couple.getValue());
  3106. +               ps.addBatch();
  3107.             }
  3108. -          
  3109. -           if (player2 != null)
  3110. -           {
  3111. -               player2.setMarried(false);
  3112. -               player2.setCoupleId(0);
  3113. -           }
  3114. -           couple.divorce();
  3115. -           _couples.remove(index);
  3116. +           ps.executeBatch();
  3117. +           ps.close();
  3118.         }
  3119. +       catch (Exception e)
  3120. +       {
  3121. +           _log.log(Level.WARNING, "CoupleManager: " + e.getMessage(), e);
  3122. +       }
  3123.     }
  3124.    
  3125. -   public final int getCoupleIndex(int coupleId)
  3126. +   /**
  3127. +    * @param coupleId : The couple id to check.
  3128. +    * @param objectId : The player objectId to check.
  3129. +    * @return the partner objectId, or 0 if not found.
  3130. +    */
  3131. +   public final int getPartnerId(int coupleId, int objectId)
  3132.     {
  3133. -       int i = 0;
  3134. -       for (Couple temp : _couples)
  3135. -       {
  3136. -           if (temp != null && temp.getId() == coupleId)
  3137. -               return i;
  3138. -          
  3139. -           i++;
  3140. -       }
  3141. -       return -1;
  3142. +       final IntIntHolder couple = _couples.get(coupleId);
  3143. +       if (couple == null)
  3144. +           return 0;
  3145. +      
  3146. +       return (couple.getId() == objectId) ? couple.getValue() : couple.getId();
  3147.     }
  3148.    
  3149. -   public final List<Couple> getCouples()
  3150. +   public static final CoupleManager getInstance()
  3151.     {
  3152. -       return _couples;
  3153. +       return SingletonHolder._instance;
  3154.     }
  3155.    
  3156.     private static class SingletonHolder
  3157. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/MercTicketManager.java
  3158. ===================================================================
  3159. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/MercTicketManager.java   (revision 2)
  3160. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/MercTicketManager.java   (working copy)
  3161. @@ -26,7 +26,7 @@
  3162.  import net.sf.l2j.L2DatabaseFactory;
  3163.  import net.sf.l2j.gameserver.datatables.NpcTable;
  3164.  import net.sf.l2j.gameserver.idfactory.IdFactory;
  3165. -import net.sf.l2j.gameserver.model.L2World;
  3166. +import net.sf.l2j.gameserver.model.World;
  3167.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3168.  import net.sf.l2j.gameserver.model.actor.instance.L2SiegeGuardInstance;
  3169.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3170. @@ -712,7 +712,7 @@
  3171.                             dropticket.setLocation(ItemInstance.ItemLocation.INVENTORY);
  3172.                             dropticket.setDestroyProtected(true);
  3173.                             dropticket.dropMe(null, x, y, z);
  3174. -                           L2World.getInstance().addObject(dropticket);
  3175. +                           World.getInstance().addObject(dropticket);
  3176.                             _droppedTickets.add(dropticket);
  3177.                         }
  3178.                         break;
  3179. @@ -842,7 +842,7 @@
  3180.                 dropticket.setLocation(ItemInstance.ItemLocation.INVENTORY);
  3181.                 dropticket.setDestroyProtected(true);
  3182.                 dropticket.dropMe(activeChar, x, y, z);
  3183. -               L2World.getInstance().addObject(dropticket); // add to the world
  3184. +               World.getInstance().addObject(dropticket); // add to the world
  3185.                 // and keep track of this ticket in the list
  3186.                 _droppedTickets.add(dropticket);
  3187.                
  3188. @@ -880,7 +880,7 @@
  3189.             if (item != null && getTicketCastleId(item.getItemId()) == castleId)
  3190.             {
  3191.                 item.decayMe();
  3192. -               L2World.getInstance().removeObject(item);
  3193. +               World.getInstance().removeObject(item);
  3194.                 it.remove();
  3195.             }
  3196.         }
  3197. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSigns.java
  3198. ===================================================================
  3199. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSigns.java  (revision 2)
  3200. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSigns.java  (working copy)
  3201. @@ -31,7 +31,7 @@
  3202.  import net.sf.l2j.gameserver.datatables.MapRegionTable.TeleportWhereType;
  3203.  import net.sf.l2j.gameserver.datatables.SkillTable;
  3204.  import net.sf.l2j.gameserver.instancemanager.AutoSpawnManager.AutoSpawnInstance;
  3205. -import net.sf.l2j.gameserver.model.L2World;
  3206. +import net.sf.l2j.gameserver.model.World;
  3207.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3208.  import net.sf.l2j.gameserver.network.SystemMessageId;
  3209.  import net.sf.l2j.gameserver.network.serverpackets.SSQInfo;
  3210. @@ -1222,7 +1222,7 @@
  3211.      */
  3212.     protected void teleLosingCabalFromDungeons(String compWinner)
  3213.     {
  3214. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  3215. +       for (L2PcInstance player : World.getInstance().getPlayers())
  3216.         {
  3217.             StatsSet currPlayer = _signsPlayerData.get(player.getObjectId());
  3218.            
  3219. @@ -1362,7 +1362,7 @@
  3220.      */
  3221.     public void giveSosEffect(int strifeOwner)
  3222.     {
  3223. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  3224. +       for (L2PcInstance player : World.getInstance().getPlayers())
  3225.         {
  3226.             int cabal = getPlayerCabal(player.getObjectId());
  3227.             if (cabal != SevenSigns.CABAL_NULL)
  3228. @@ -1382,7 +1382,7 @@
  3229.      */
  3230.     public void removeSosEffect()
  3231.     {
  3232. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  3233. +       for (L2PcInstance player : World.getInstance().getPlayers())
  3234.         {
  3235.             // Remove Seal of Strife buffs/debuffs.
  3236.             player.removeSkill(SkillTable.FrequentSkill.THE_VICTOR_OF_WAR.getSkill());
  3237. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSignsFestival.java
  3238. ===================================================================
  3239. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSignsFestival.java  (revision 2)
  3240. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSignsFestival.java  (working copy)
  3241. @@ -41,8 +41,8 @@
  3242.  import net.sf.l2j.gameserver.model.L2Party;
  3243.  import net.sf.l2j.gameserver.model.L2Party.MessageType;
  3244.  import net.sf.l2j.gameserver.model.L2Spawn;
  3245. -import net.sf.l2j.gameserver.model.L2World;
  3246.  import net.sf.l2j.gameserver.model.Location;
  3247. +import net.sf.l2j.gameserver.model.World;
  3248.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  3249.  import net.sf.l2j.gameserver.model.actor.instance.L2FestivalMonsterInstance;
  3250.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3251. @@ -3502,7 +3502,7 @@
  3252.    
  3253.     private static void addReputationPointsForPartyMemberClan(String partyMemberName)
  3254.     {
  3255. -       L2PcInstance player = L2World.getInstance().getPlayer(partyMemberName);
  3256. +       L2PcInstance player = World.getInstance().getPlayer(partyMemberName);
  3257.         if (player != null)
  3258.         {
  3259.             if (player.getClan() != null)
  3260. @@ -3603,7 +3603,7 @@
  3261.         saveFestivalData(updateSettings);
  3262.        
  3263.         // Remove any unused blood offerings from online players.
  3264. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  3265. +       for (L2PcInstance player : World.getInstance().getPlayers())
  3266.         {
  3267.             ItemInstance bloodOfferings = player.getInventory().getItemByItemId(FESTIVAL_OFFERING_ID);
  3268.             if (bloodOfferings != null)
  3269. @@ -3784,7 +3784,7 @@
  3270.                 if (festivalParty == null)// leader has left
  3271.                     for (int partyMemberObjId : getParticipants(oracle, festivalId))
  3272.                     {
  3273. -                       L2PcInstance partyMember = L2World.getInstance().getPlayer(partyMemberObjId);
  3274. +                       L2PcInstance partyMember = World.getInstance().getPlayer(partyMemberObjId);
  3275.                         if (partyMember == null)
  3276.                             continue;
  3277.                        
  3278. @@ -4395,7 +4395,7 @@
  3279.             {
  3280.                 for (int participantObjId : _participants)
  3281.                 {
  3282. -                   L2PcInstance participant = L2World.getInstance().getPlayer(participantObjId);
  3283. +                   L2PcInstance participant = World.getInstance().getPlayer(participantObjId);
  3284.                     if (participant == null)
  3285.                         continue;
  3286.                    
  3287. @@ -4615,7 +4615,7 @@
  3288.             {
  3289.                 for (int participantObjId : _participants)
  3290.                 {
  3291. -                   L2PcInstance participant = L2World.getInstance().getPlayer(participantObjId);
  3292. +                   L2PcInstance participant = World.getInstance().getPlayer(participantObjId);
  3293.                     if (participant == null)
  3294.                         continue;
  3295.                    
  3296. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java
  3297. ===================================================================
  3298. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java (revision 2)
  3299. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java (working copy)
  3300. @@ -30,8 +30,8 @@
  3301.  import net.sf.l2j.Config;
  3302.  import net.sf.l2j.L2DatabaseFactory;
  3303.  import net.sf.l2j.gameserver.model.L2Object;
  3304. -import net.sf.l2j.gameserver.model.L2World;
  3305. -import net.sf.l2j.gameserver.model.L2WorldRegion;
  3306. +import net.sf.l2j.gameserver.model.World;
  3307. +import net.sf.l2j.gameserver.model.WorldRegion;
  3308.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3309.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  3310.  import net.sf.l2j.gameserver.model.zone.L2SpawnZone;
  3311. @@ -82,9 +82,9 @@
  3312.        
  3313.         // remove zones from world
  3314.         int count = 0;
  3315. -       for (L2WorldRegion[] worldRegion : L2World.getInstance().getWorldRegions())
  3316. +       for (WorldRegion[] worldRegion : World.getInstance().getWorldRegions())
  3317.         {
  3318. -           for (L2WorldRegion element : worldRegion)
  3319. +           for (WorldRegion element : worldRegion)
  3320.             {
  3321.                 element.getZones().clear();
  3322.                 count++;
  3323. @@ -101,7 +101,7 @@
  3324.         load();
  3325.        
  3326.         // revalidate objects in zones
  3327. -       for (L2Object o : L2World.getInstance().getObjects())
  3328. +       for (L2Object o : World.getInstance().getObjects())
  3329.         {
  3330.             if (o instanceof L2Character)
  3331.                 ((L2Character) o).revalidateZone(true);
  3332. @@ -111,7 +111,7 @@
  3333.     private final void load()
  3334.     {
  3335.         // Get the world regions
  3336. -       L2WorldRegion[][] worldRegions = L2World.getInstance().getWorldRegions();
  3337. +       WorldRegion[][] worldRegions = World.getInstance().getWorldRegions();
  3338.        
  3339.         // Load the zone xml
  3340.         try
  3341. @@ -148,7 +148,7 @@
  3342.         _log.info("ZoneManager: Loaded " + _classZones.size() + " zones classes and total " + size + " zones.");
  3343.     }
  3344.    
  3345. -   private void loadFileZone(final File f, L2WorldRegion[][] worldRegions) throws Exception
  3346. +   private void loadFileZone(final File f, WorldRegion[][] worldRegions) throws Exception
  3347.     {
  3348.         final Document doc = XMLDocumentFactory.getInstance().loadDocument(f);
  3349.         for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
  3350. @@ -317,7 +317,7 @@
  3351.                         {
  3352.                             for (int y = 0; y < worldRegions[x].length; y++)
  3353.                             {
  3354. -                               if (temp.getZone().intersectsRectangle(L2World.getRegionX(x), L2World.getRegionX(x + 1), L2World.getRegionY(y), L2World.getRegionY(y + 1)))
  3355. +                               if (temp.getZone().intersectsRectangle(World.getRegionX(x), World.getRegionX(x + 1), World.getRegionY(y), World.getRegionY(y + 1)))
  3356.                                 {
  3357.                                     if (Config.DEBUG)
  3358.                                         _log.info("Zone (" + zoneId + ") added to: " + x + " " + y);
  3359. @@ -469,7 +469,7 @@
  3360.     public List<L2ZoneType> getZones(int x, int y)
  3361.     {
  3362.         final List<L2ZoneType> temp = new ArrayList<>();
  3363. -       for (L2ZoneType zone : L2World.getInstance().getRegion(x, y).getZones())
  3364. +       for (L2ZoneType zone : World.getInstance().getRegion(x, y).getZones())
  3365.         {
  3366.             if (zone.isInsideZone(x, y))
  3367.                 temp.add(zone);
  3368. @@ -487,7 +487,7 @@
  3369.     public List<L2ZoneType> getZones(int x, int y, int z)
  3370.     {
  3371.         final List<L2ZoneType> temp = new ArrayList<>();
  3372. -       for (L2ZoneType zone : L2World.getInstance().getRegion(x, y).getZones())
  3373. +       for (L2ZoneType zone : World.getInstance().getRegion(x, y).getZones())
  3374.         {
  3375.             if (zone.isInsideZone(x, y, z))
  3376.                 temp.add(zone);
  3377. @@ -507,7 +507,7 @@
  3378.     @SuppressWarnings("unchecked")
  3379.     public <T extends L2ZoneType> T getZone(int x, int y, int z, Class<T> type)
  3380.     {
  3381. -       for (L2ZoneType zone : L2World.getInstance().getRegion(x, y).getZones())
  3382. +       for (L2ZoneType zone : World.getInstance().getRegion(x, y).getZones())
  3383.         {
  3384.             if (zone.isInsideZone(x, y, z) && type.isInstance(zone))
  3385.                 return (T) zone;
  3386. @@ -579,7 +579,7 @@
  3387.     }
  3388.    
  3389.     /**
  3390. -    * Remove all debug items from l2world
  3391. +    * Remove all debug items from the world.
  3392.      */
  3393.     public void clearDebugItems()
  3394.     {
  3395. Index: aCis_gameserver/java/net/sf/l2j/gameserver/LoginServerThread.java
  3396. ===================================================================
  3397. --- aCis_gameserver/java/net/sf/l2j/gameserver/LoginServerThread.java   (revision 2)
  3398. +++ aCis_gameserver/java/net/sf/l2j/gameserver/LoginServerThread.java   (working copy)
  3399. @@ -38,7 +38,7 @@
  3400.  import net.sf.l2j.commons.random.Rnd;
  3401.  
  3402.  import net.sf.l2j.Config;
  3403. -import net.sf.l2j.gameserver.model.L2World;
  3404. +import net.sf.l2j.gameserver.model.World;
  3405.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3406.  import net.sf.l2j.gameserver.network.L2GameClient;
  3407.  import net.sf.l2j.gameserver.network.L2GameClient.GameClientState;
  3408. @@ -271,7 +271,7 @@
  3409.                            
  3410.                             sendPacket(st);
  3411.                            
  3412. -                           final Collection<L2PcInstance> players = L2World.getInstance().getPlayers();
  3413. +                           final Collection<L2PcInstance> players = World.getInstance().getPlayers();
  3414.                             if (!players.isEmpty())
  3415.                             {
  3416.                                 final List<String> playerList = new ArrayList<>();
  3417. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CabaleBufferInstance.java
  3418. ===================================================================
  3419. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CabaleBufferInstance.java (revision 2)
  3420. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CabaleBufferInstance.java (working copy)
  3421. @@ -139,7 +139,7 @@
  3422.             final List<L2PcInstance> playersList = new ArrayList<>();
  3423.             final List<L2PcInstance> gmsList = new ArrayList<>();
  3424.            
  3425. -           for (L2PcInstance player : getKnownList().getKnownTypeInRadius(L2PcInstance.class, 900))
  3426. +           for (L2PcInstance player : getKnownTypeInRadius(L2PcInstance.class, 900))
  3427.             {
  3428.                 if (player.isGM())
  3429.                     gmsList.add(player);
  3430. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CastleTeleporterInstance.java
  3431. ===================================================================
  3432. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CastleTeleporterInstance.java (revision 2)
  3433. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CastleTeleporterInstance.java (working copy)
  3434. @@ -19,7 +19,7 @@
  3435.  import net.sf.l2j.commons.concurrent.ThreadPool;
  3436.  
  3437.  import net.sf.l2j.gameserver.datatables.MapRegionTable;
  3438. -import net.sf.l2j.gameserver.model.L2World;
  3439. +import net.sf.l2j.gameserver.model.World;
  3440.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3441.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  3442.  import net.sf.l2j.gameserver.network.serverpackets.NpcSay;
  3443. @@ -102,7 +102,7 @@
  3444.                 final NpcSay cs = new NpcSay(getObjectId(), 1, getNpcId(), "The defenders of " + getCastle().getName() + " castle have been teleported to the inner castle.");
  3445.                 final int region = MapRegionTable.getMapRegion(getX(), getY());
  3446.                
  3447. -               for (L2PcInstance player : L2World.getInstance().getPlayers())
  3448. +               for (L2PcInstance player : World.getInstance().getPlayers())
  3449.                 {
  3450.                     if (region == MapRegionTable.getMapRegion(player.getX(), player.getY()))
  3451.                         player.sendPacket(cs);
  3452. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2DoorInstance.java
  3453. ===================================================================
  3454. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2DoorInstance.java (revision 2)
  3455. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2DoorInstance.java (working copy)
  3456. @@ -31,7 +31,6 @@
  3457.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3458.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  3459.  import net.sf.l2j.gameserver.model.actor.L2Playable;
  3460. -import net.sf.l2j.gameserver.model.actor.knownlist.DoorKnownList;
  3461.  import net.sf.l2j.gameserver.model.actor.stat.DoorStat;
  3462.  import net.sf.l2j.gameserver.model.actor.status.DoorStatus;
  3463.  import net.sf.l2j.gameserver.model.actor.template.DoorTemplate;
  3464. @@ -200,18 +199,6 @@
  3465.     }
  3466.    
  3467.     @Override
  3468. -   public void initKnownList()
  3469. -   {
  3470. -       setKnownList(new DoorKnownList(this));
  3471. -   }
  3472. -  
  3473. -   @Override
  3474. -   public final DoorKnownList getKnownList()
  3475. -   {
  3476. -       return (DoorKnownList) super.getKnownList();
  3477. -   }
  3478. -  
  3479. -   @Override
  3480.     public void initCharStat()
  3481.     {
  3482.         setStat(new DoorStat(this));
  3483. @@ -427,7 +414,7 @@
  3484.     @Override
  3485.     public void broadcastStatusUpdate()
  3486.     {
  3487. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  3488. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  3489.             player.sendPacket(new DoorStatusUpdate(this, player));
  3490.     }
  3491.    
  3492. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2FriendlyMobInstance.java
  3493. ===================================================================
  3494. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2FriendlyMobInstance.java  (revision 2)
  3495. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2FriendlyMobInstance.java  (working copy)
  3496. @@ -16,11 +16,11 @@
  3497.  
  3498.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  3499.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3500. -import net.sf.l2j.gameserver.model.actor.knownlist.FriendlyMobKnownList;
  3501.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3502.  
  3503.  /**
  3504. - * This class represents Friendly Mobs lying over the world. These friendly mobs should only attack players with karma > 0 and it is always aggro, since it just attacks players with karma
  3505. + * This class represents Friendly Mobs lying over the world.<br>
  3506. + * These friendly mobs should only attack players with karma > 0 and it is always aggro, since it just attacks players with karma.
  3507.   */
  3508.  public class L2FriendlyMobInstance extends L2Attackable
  3509.  {
  3510. @@ -30,24 +30,9 @@
  3511.     }
  3512.    
  3513.     @Override
  3514. -   public void initKnownList()
  3515. -   {
  3516. -       setKnownList(new FriendlyMobKnownList(this));
  3517. -   }
  3518. -  
  3519. -   @Override
  3520. -   public final FriendlyMobKnownList getKnownList()
  3521. -   {
  3522. -       return (FriendlyMobKnownList) super.getKnownList();
  3523. -   }
  3524. -  
  3525. -   @Override
  3526.     public boolean isAutoAttackable(L2Character attacker)
  3527.     {
  3528. -       if (attacker instanceof L2PcInstance)
  3529. -           return ((L2PcInstance) attacker).getKarma() > 0;
  3530. -      
  3531. -       return false;
  3532. +       return attacker instanceof L2PcInstance && ((L2PcInstance) attacker).getKarma() > 0;
  3533.     }
  3534.    
  3535.     @Override
  3536. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
  3537. ===================================================================
  3538. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java    (revision 2)
  3539. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java    (working copy)
  3540. @@ -22,7 +22,6 @@
  3541.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  3542.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3543.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  3544. -import net.sf.l2j.gameserver.model.actor.knownlist.GuardKnownList;
  3545.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3546.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  3547.  import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;
  3548. @@ -45,18 +44,6 @@
  3549.     }
  3550.    
  3551.     @Override
  3552. -   public void initKnownList()
  3553. -   {
  3554. -       setKnownList(new GuardKnownList(this));
  3555. -   }
  3556. -  
  3557. -   @Override
  3558. -   public final GuardKnownList getKnownList()
  3559. -   {
  3560. -       return (GuardKnownList) super.getKnownList();
  3561. -   }
  3562. -  
  3563. -   @Override
  3564.     public boolean isAutoAttackable(L2Character attacker)
  3565.     {
  3566.         return attacker instanceof L2MonsterInstance;
  3567. @@ -97,21 +84,28 @@
  3568.             }
  3569.             else
  3570.             {
  3571. +               // Rotate the player to face the instance
  3572. +               player.sendPacket(new MoveToPawn(player, this, L2Npc.INTERACTION_DISTANCE));
  3573. +              
  3574. +               // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
  3575. +               player.sendPacket(ActionFailed.STATIC_PACKET);
  3576. +              
  3577.                 // Some guards have no HTMs on retail. Bypass the chat window if such guard is met.
  3578.                 switch (getNpcId())
  3579.                 {
  3580. -                   case 31671:
  3581. +                   case 30733: // Guards in start villages
  3582. +                   case 31032:
  3583. +                   case 31033:
  3584. +                   case 31034:
  3585. +                   case 31035:
  3586. +                   case 31036:
  3587. +                   case 31671: // Patrols
  3588.                     case 31672:
  3589.                     case 31673:
  3590.                     case 31674:
  3591. -                       // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
  3592. -                       player.sendPacket(ActionFailed.STATIC_PACKET);
  3593.                         return;
  3594.                 }
  3595.                
  3596. -               // Rotate the player to face the instance
  3597. -               player.sendPacket(new MoveToPawn(player, this, L2Npc.INTERACTION_DISTANCE));
  3598. -              
  3599.                 if (hasRandomAnimation())
  3600.                     onRandomAnimation(Rnd.get(8));
  3601.                
  3602. @@ -135,17 +129,8 @@
  3603.     }
  3604.    
  3605.     @Override
  3606. -   public boolean returnHome()
  3607. +   public int getDriftRange()
  3608.     {
  3609. -       getAggroList().clear();
  3610. -      
  3611. -       if (getMoveSpeed() > 0 && hasAI() && getSpawn() != null && !isInsideRadius(getSpawn().getLocX(), getSpawn().getLocY(), 20, false))
  3612. -       {
  3613. -           setIsReturningToSpawnPoint(true);
  3614. -           setWalking();
  3615. -           getAI().setIntention(CtrlIntention.MOVE_TO, getSpawn().getLoc());
  3616. -           return true;
  3617. -       }
  3618. -       return false;
  3619. +       return 20;
  3620.     }
  3621.  }
  3622. \ No newline at end of file
  3623. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2MonsterInstance.java
  3624. ===================================================================
  3625. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2MonsterInstance.java  (revision 2)
  3626. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2MonsterInstance.java  (working copy)
  3627. @@ -17,7 +17,6 @@
  3628.  import net.sf.l2j.gameserver.model.MinionList;
  3629.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  3630.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3631. -import net.sf.l2j.gameserver.model.actor.knownlist.MonsterKnownList;
  3632.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3633.  
  3634.  /**
  3635. @@ -49,18 +48,6 @@
  3636.     }
  3637.    
  3638.     @Override
  3639. -   public void initKnownList()
  3640. -   {
  3641. -       setKnownList(new MonsterKnownList(this));
  3642. -   }
  3643. -  
  3644. -   @Override
  3645. -   public final MonsterKnownList getKnownList()
  3646. -   {
  3647. -       return (MonsterKnownList) super.getKnownList();
  3648. -   }
  3649. -  
  3650. -   @Override
  3651.     public boolean isAutoAttackable(L2Character attacker)
  3652.     {
  3653.         // FIXME: to test to allow monsters hit others monsters
  3654. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  3655. ===================================================================
  3656. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 2)
  3657. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
  3658. @@ -94,13 +94,13 @@
  3659.  import net.sf.l2j.gameserver.model.L2Skill;
  3660.  import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType;
  3661.  import net.sf.l2j.gameserver.model.L2SkillLearn;
  3662. -import net.sf.l2j.gameserver.model.L2World;
  3663.  import net.sf.l2j.gameserver.model.Location;
  3664.  import net.sf.l2j.gameserver.model.MacroList;
  3665.  import net.sf.l2j.gameserver.model.PetDataEntry;
  3666.  import net.sf.l2j.gameserver.model.ShortCuts;
  3667.  import net.sf.l2j.gameserver.model.ShotType;
  3668.  import net.sf.l2j.gameserver.model.SpawnLocation;
  3669. +import net.sf.l2j.gameserver.model.World;
  3670.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  3671.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3672.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  3673. @@ -108,7 +108,6 @@
  3674.  import net.sf.l2j.gameserver.model.actor.L2Summon;
  3675.  import net.sf.l2j.gameserver.model.actor.L2Vehicle;
  3676.  import net.sf.l2j.gameserver.model.actor.appearance.PcAppearance;
  3677. -import net.sf.l2j.gameserver.model.actor.knownlist.PcKnownList;
  3678.  import net.sf.l2j.gameserver.model.actor.stat.PcStat;
  3679.  import net.sf.l2j.gameserver.model.actor.status.PcStatus;
  3680.  import net.sf.l2j.gameserver.model.actor.template.PcTemplate;
  3681. @@ -160,6 +159,7 @@
  3682.  import net.sf.l2j.gameserver.network.serverpackets.ChangeWaitType;
  3683.  import net.sf.l2j.gameserver.network.serverpackets.CharInfo;
  3684.  import net.sf.l2j.gameserver.network.serverpackets.ConfirmDlg;
  3685. +import net.sf.l2j.gameserver.network.serverpackets.DeleteObject;
  3686.  import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
  3687.  import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot;
  3688.  import net.sf.l2j.gameserver.network.serverpackets.ExDuelUpdateUserInfo;
  3689. @@ -200,11 +200,13 @@
  3690.  import net.sf.l2j.gameserver.network.serverpackets.SendTradeDone;
  3691.  import net.sf.l2j.gameserver.network.serverpackets.ServerClose;
  3692.  import net.sf.l2j.gameserver.network.serverpackets.SetupGauge;
  3693. +import net.sf.l2j.gameserver.network.serverpackets.SetupGauge.GaugeColor;
  3694.  import net.sf.l2j.gameserver.network.serverpackets.ShortBuffStatusUpdate;
  3695.  import net.sf.l2j.gameserver.network.serverpackets.ShortCutInit;
  3696.  import net.sf.l2j.gameserver.network.serverpackets.SkillCoolTime;
  3697.  import net.sf.l2j.gameserver.network.serverpackets.SkillList;
  3698.  import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  3699. +import net.sf.l2j.gameserver.network.serverpackets.SpawnItem;
  3700.  import net.sf.l2j.gameserver.network.serverpackets.StaticObject;
  3701.  import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
  3702.  import net.sf.l2j.gameserver.network.serverpackets.StopMove;
  3703. @@ -389,7 +391,6 @@
  3704.    
  3705.     private int _lastCompassZone; // the last compass zone update send to the client
  3706.    
  3707. -   private boolean _isInWater;
  3708.     private boolean _isIn7sDungeon;
  3709.    
  3710.     private PunishLevel _punishLevel = PunishLevel.NONE;
  3711. @@ -599,7 +600,6 @@
  3712.     private ScheduledFuture<?> _shortBuffTask;
  3713.     private int _shortBuffTaskSkillId;
  3714.    
  3715. -   private boolean _isMarried;
  3716.     private int _coupleId;
  3717.     private boolean _isUnderMarryRequest;
  3718.     private int _requesterId;
  3719. @@ -765,18 +765,6 @@
  3720.     }
  3721.    
  3722.     @Override
  3723. -   public void initKnownList()
  3724. -   {
  3725. -       setKnownList(new PcKnownList(this));
  3726. -   }
  3727. -  
  3728. -   @Override
  3729. -   public final PcKnownList getKnownList()
  3730. -   {
  3731. -       return (PcKnownList) super.getKnownList();
  3732. -   }
  3733. -  
  3734. -   @Override
  3735.     public void initCharStat()
  3736.     {
  3737.         setStat(new PcStat(this));
  3738. @@ -1052,7 +1040,7 @@
  3739.         if (qs == null)
  3740.             return;
  3741.        
  3742. -       L2Object object = L2World.getInstance().getObject(getLastQuestNpcObject());
  3743. +       L2Object object = World.getInstance().getObject(getLastQuestNpcObject());
  3744.         if (!(object instanceof L2Npc) || !isInsideRadius(object, L2Npc.INTERACTION_DISTANCE, false, false))
  3745.             return;
  3746.        
  3747. @@ -1263,7 +1251,12 @@
  3748.         super.revalidateZone(force);
  3749.        
  3750.         if (Config.ALLOW_WATER)
  3751. -           checkWaterState();
  3752. +       {
  3753. +           if (isInsideZone(ZoneId.WATER))
  3754. +               WaterTaskManager.getInstance().add(this);
  3755. +           else
  3756. +               WaterTaskManager.getInstance().remove(this);
  3757. +       }
  3758.        
  3759.         if (isInsideZone(ZoneId.SIEGE))
  3760.         {
  3761. @@ -2247,7 +2240,7 @@
  3762.             {
  3763.                 if (_throneId != 0)
  3764.                 {
  3765. -                   final L2Object object = L2World.getInstance().getObject(_throneId);
  3766. +                   final L2Object object = World.getInstance().getObject(_throneId);
  3767.                     if (object instanceof L2StaticObjectInstance)
  3768.                         ((L2StaticObjectInstance) object).setBusy(false);
  3769.                    
  3770. @@ -2284,7 +2277,7 @@
  3771.                     {
  3772.                         if (_throneId != 0)
  3773.                         {
  3774. -                           final L2Object object = L2World.getInstance().getObject(_throneId);
  3775. +                           final L2Object object = World.getInstance().getObject(_throneId);
  3776.                             if (object instanceof L2StaticObjectInstance)
  3777.                                 ((L2StaticObjectInstance) object).setBusy(false);
  3778.                            
  3779. @@ -2934,7 +2927,7 @@
  3780.    
  3781.     public ItemInstance checkItemManipulation(int objectId, int count)
  3782.     {
  3783. -       if (L2World.getInstance().getObject(objectId) == null)
  3784. +       if (World.getInstance().getObject(objectId) == null)
  3785.             return null;
  3786.        
  3787.         final ItemInstance item = getInventory().getItemByObjectId(objectId);
  3788. @@ -3312,7 +3305,7 @@
  3789.    
  3790.     public final void broadcastCharInfo()
  3791.     {
  3792. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  3793. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  3794.         {
  3795.             player.sendPacket(new CharInfo(this));
  3796.            
  3797. @@ -3799,16 +3792,6 @@
  3798.         return armor.getItemType() instanceof ArmorType && armor.getItemType() == type;
  3799.     }
  3800.    
  3801. -   public boolean isMarried()
  3802. -   {
  3803. -       return _isMarried;
  3804. -   }
  3805. -  
  3806. -   public void setMarried(boolean state)
  3807. -   {
  3808. -       _isMarried = state;
  3809. -   }
  3810. -  
  3811.     public boolean isUnderMarryRequest()
  3812.     {
  3813.         return _isUnderMarryRequest;
  3814. @@ -3834,29 +3817,29 @@
  3815.         _requesterId = requesterId;
  3816.     }
  3817.    
  3818. -   public void EngageAnswer(int answer)
  3819. +   public void engageAnswer(int answer)
  3820.     {
  3821.         if (!_isUnderMarryRequest || _requesterId == 0)
  3822.             return;
  3823.        
  3824. -       L2PcInstance ptarget = L2World.getInstance().getPlayer(_requesterId);
  3825. -       if (ptarget != null)
  3826. +       final L2PcInstance requester = World.getInstance().getPlayer(_requesterId);
  3827. +       if (requester != null)
  3828.         {
  3829.             if (answer == 1)
  3830.             {
  3831.                 // Create the couple
  3832. -               CoupleManager.getInstance().createCouple(ptarget, this);
  3833. +               CoupleManager.getInstance().addCouple(requester, this);
  3834.                
  3835.                 // Then "finish the job"
  3836. -               L2WeddingManagerInstance.justMarried(ptarget, this);
  3837. +               L2WeddingManagerInstance.justMarried(requester, this);
  3838.             }
  3839.             else
  3840.             {
  3841.                 setUnderMarryRequest(false);
  3842.                 sendMessage("You declined your partner's marriage request.");
  3843.                
  3844. -               ptarget.setUnderMarryRequest(false);
  3845. -               ptarget.sendMessage("Your partner declined your marriage request.");
  3846. +               requester.setUnderMarryRequest(false);
  3847. +               requester.sendMessage("Your partner declined your marriage request.");
  3848.             }
  3849.         }
  3850.     }
  3851. @@ -3966,7 +3949,7 @@
  3852.         if (_fusionSkill != null)
  3853.             abortCast();
  3854.        
  3855. -       for (L2Character character : getKnownList().getKnownType(L2Character.class))
  3856. +       for (L2Character character : getKnownType(L2Character.class))
  3857.             if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  3858.                 character.abortCast();
  3859.        
  3860. @@ -3976,7 +3959,7 @@
  3861.         // calculate death penalty buff
  3862.         calculateDeathPenaltyBuffLevel(killer);
  3863.        
  3864. -       stopWaterTask();
  3865. +       WaterTaskManager.getInstance().remove(this);
  3866.        
  3867.         if (isPhoenixBlessed() || (isAffected(L2EffectFlag.CHARM_OF_COURAGE) && isInSiege()))
  3868.             reviveRequest(this, null, false);
  3869. @@ -4269,7 +4252,7 @@
  3870.     public void stopAllTimers()
  3871.     {
  3872.         stopHpMpRegeneration();
  3873. -       stopWaterTask();
  3874. +       WaterTaskManager.getInstance().remove(this);
  3875.         stopFeed();
  3876.        
  3877.         _petTemplate = null;
  3878. @@ -4892,7 +4875,8 @@
  3879.    
  3880.     public boolean dismount()
  3881.     {
  3882. -       sendPacket(new SetupGauge(3, 0, 0));
  3883. +       sendPacket(new SetupGauge(GaugeColor.GREEN, 0));
  3884. +      
  3885.         int petId = _mountNpcId;
  3886.         if (setMount(0, 0, 0))
  3887.         {
  3888. @@ -4982,14 +4966,14 @@
  3889.         {
  3890.             setCurrentFeed(((L2PetInstance) getPet()).getCurrentFed());
  3891.             _controlItemId = getPet().getControlItemId();
  3892. -           sendPacket(new SetupGauge(3, getCurrentFeed() * 10000 / getFeedConsume(), _petData.getMaxMeal() * 10000 / getFeedConsume()));
  3893. +           sendPacket(new SetupGauge(GaugeColor.GREEN, getCurrentFeed() * 10000 / getFeedConsume(), _petData.getMaxMeal() * 10000 / getFeedConsume()));
  3894.             if (!isDead())
  3895.                 _mountFeedTask = ThreadPool.scheduleAtFixedRate(new FeedTask(), 10000, 10000);
  3896.         }
  3897.         else if (_canFeed)
  3898.         {
  3899.             setCurrentFeed(_petData.getMaxMeal());
  3900. -           sendPacket(new SetupGauge(3, getCurrentFeed() * 10000 / getFeedConsume(), _petData.getMaxMeal() * 10000 / getFeedConsume()));
  3901. +           sendPacket(new SetupGauge(GaugeColor.GREEN, getCurrentFeed() * 10000 / getFeedConsume(), _petData.getMaxMeal() * 10000 / getFeedConsume()));
  3902.             if (!isDead())
  3903.                 _mountFeedTask = ThreadPool.scheduleAtFixedRate(new FeedTask(), 10000, 10000);
  3904.         }
  3905. @@ -5026,8 +5010,9 @@
  3906.    
  3907.     public void setCurrentFeed(int num)
  3908.     {
  3909. -       _curFeed = (num > _petData.getMaxMeal()) ? _petData.getMaxMeal() : num;
  3910. -       sendPacket(new SetupGauge(3, getCurrentFeed() * 10000 / getFeedConsume(), _petData.getMaxMeal() * 10000 / getFeedConsume()));
  3911. +       _curFeed = Math.min(num, _petData.getMaxMeal());
  3912. +      
  3913. +       sendPacket(new SetupGauge(GaugeColor.GREEN, getCurrentFeed() * 10000 / getFeedConsume(), _petData.getMaxMeal() * 10000 / getFeedConsume()));
  3914.     }
  3915.    
  3916.     /**
  3917. @@ -5266,10 +5251,9 @@
  3918.     }
  3919.    
  3920.     /**
  3921. -    * Retrieve a L2PcInstance from the characters table of the database and add it in _allObjects of the L2world.
  3922. +    * Retrieve a L2PcInstance from the characters table of the database.
  3923.      * <ul>
  3924.      * <li>Retrieve the L2PcInstance from the characters table of the database</li>
  3925. -    * <li>Add the L2PcInstance object in _allObjects</li>
  3926.      * <li>Set the x,y,z position of the L2PcInstance and make it invisible</li>
  3927.      * <li>Update the overloaded status of the L2PcInstance</li>
  3928.      * </ul>
  3929. @@ -5402,7 +5386,7 @@
  3930.                 player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));
  3931.                
  3932.                 // Set the x,y,z position of the L2PcInstance and make it invisible
  3933. -               player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
  3934. +               player.getPosition().set(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
  3935.                
  3936.                 // Set Hero status if it applies
  3937.                 if (Hero.getInstance().isActiveHero(objectId))
  3938. @@ -5434,7 +5418,7 @@
  3939.                 }
  3940.                
  3941.                 // Restore pet if exists in the world
  3942. -               player.setPet(L2World.getInstance().getPet(player.getObjectId()));
  3943. +               player.setPet(World.getInstance().getPet(player.getObjectId()));
  3944.                 if (player.getPet() != null)
  3945.                     player.getPet().setOwner(player);
  3946.                
  3947. @@ -6763,13 +6747,6 @@
  3948.         if (skill.isSiegeSummonSkill() && (!SiegeManager.checkIfOkToSummon(this) || !SevenSigns.getInstance().checkSummonConditions(this)))
  3949.             return false;
  3950.        
  3951. -       // Check if this skill is enabled (ex : reuse time)
  3952. -       if (isSkillDisabled(skill))
  3953. -       {
  3954. -           sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE).addSkillName(skill));
  3955. -           return false;
  3956. -       }
  3957. -      
  3958.         // ************************************* Check casting conditions *******************************************
  3959.        
  3960.         // Check if all casting conditions are completed
  3961. @@ -7067,7 +7044,7 @@
  3962.         if (objectId == getObjectId())
  3963.             return true;
  3964.        
  3965. -       final L2PcInstance looter = L2World.getInstance().getPlayer(objectId);
  3966. +       final L2PcInstance looter = World.getInstance().getPlayer(objectId);
  3967.         if (looter == null)
  3968.             return false;
  3969.        
  3970. @@ -7643,7 +7620,6 @@
  3971.         getAppearance().setInvisible();
  3972.        
  3973.         sendPacket(new ObservationMode(x, y, z));
  3974. -       getKnownList().removeAllKnownObjects(); // reinit knownlist
  3975.         setXYZ(x, y, z);
  3976.        
  3977.         broadcastUserInfo();
  3978. @@ -7679,7 +7655,6 @@
  3979.     public void leaveObserverMode()
  3980.     {
  3981.         setTarget(null);
  3982. -       getKnownList().removeAllKnownObjects(); // reinit knownlist
  3983.         setXYZ(_savedLocation.getX(), _savedLocation.getY(), _savedLocation.getZ());
  3984.         setIsParalyzed(false);
  3985.         stopParalyze(false);
  3986. @@ -8293,7 +8268,7 @@
  3987.             abortCast();
  3988.            
  3989.             // Stop casting for any player that may be casting a force buff on this l2pcinstance.
  3990. -           for (L2Character character : getKnownList().getKnownType(L2Character.class))
  3991. +           for (L2Character character : getKnownType(L2Character.class))
  3992.                 if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  3993.                     character.abortCast();
  3994.            
  3995. @@ -8402,36 +8377,6 @@
  3996.         return _subclassLock.isLocked();
  3997.     }
  3998.    
  3999. -   public void stopWaterTask()
  4000. -   {
  4001. -       if (_isInWater)
  4002. -       {
  4003. -           _isInWater = false;
  4004. -           sendPacket(new SetupGauge(2, 0));
  4005. -           WaterTaskManager.getInstance().remove(this);
  4006. -       }
  4007. -   }
  4008. -  
  4009. -   public void startWaterTask()
  4010. -   {
  4011. -       if (!isDead() && !_isInWater)
  4012. -       {
  4013. -           _isInWater = true;
  4014. -           final int time = (int) calcStat(Stats.BREATH, 60000 * getRace().getBreathMultiplier(), this, null);
  4015. -          
  4016. -           sendPacket(new SetupGauge(2, time));
  4017. -           WaterTaskManager.getInstance().add(this, time);
  4018. -       }
  4019. -   }
  4020. -  
  4021. -   public void checkWaterState()
  4022. -   {
  4023. -       if (isInsideZone(ZoneId.WATER))
  4024. -           startWaterTask();
  4025. -       else
  4026. -           stopWaterTask();
  4027. -   }
  4028. -  
  4029.     public void onPlayerEnter()
  4030.     {
  4031.         if (isCursedWeaponEquipped())
  4032. @@ -8914,7 +8859,7 @@
  4033.             stopAllTimers();
  4034.            
  4035.             // Cancel the cast of eventual fusion skill users on this target.
  4036. -           for (L2Character character : getKnownList().getKnownType(L2Character.class))
  4037. +           for (L2Character character : getKnownType(L2Character.class))
  4038.                 if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  4039.                     character.abortCast();
  4040.            
  4041. @@ -8970,10 +8915,9 @@
  4042.             if (isGM())
  4043.                 GmListTable.getInstance().deleteGm(this);
  4044.            
  4045. -           // Check if the L2PcInstance is in observer mode to set its position to its position
  4046. -           // before entering in observer mode
  4047. +           // Check if the L2PcInstance is in observer mode to set its position to its position before entering in observer mode
  4048.             if (inObserverMode())
  4049. -               setXYZInvisible(_savedLocation.getX(), _savedLocation.getY(), _savedLocation.getZ());
  4050. +               setXYZInvisible(_savedLocation);
  4051.            
  4052.             // Oust player from boat
  4053.             if (getVehicle() != null)
  4054. @@ -8992,20 +8936,17 @@
  4055.             if (isCursedWeaponEquipped())
  4056.                 CursedWeaponsManager.getInstance().getCursedWeapon(_cursedWeaponEquippedId).setPlayer(null);
  4057.            
  4058. -           // Remove all L2Object from _knownObjects and _knownPlayer of the L2Character then cancel Attak or Cast and notify AI
  4059. -           getKnownList().removeAllKnownObjects();
  4060. -          
  4061.             if (getClanId() > 0)
  4062.                 getClan().broadcastToOtherOnlineMembers(new PledgeShowMemberListUpdate(this), this);
  4063.            
  4064.             if (isSeated())
  4065.             {
  4066. -               final L2Object object = L2World.getInstance().getObject(_throneId);
  4067. +               final L2Object object = World.getInstance().getObject(_throneId);
  4068.                 if (object instanceof L2StaticObjectInstance)
  4069.                     ((L2StaticObjectInstance) object).setBusy(false);
  4070.             }
  4071.            
  4072. -           L2World.getInstance().removePlayer(this); // force remove in case of crash during teleport
  4073. +           World.getInstance().removePlayer(this); // force remove in case of crash during teleport
  4074.            
  4075.             // friends & blocklist update
  4076.             notifyFriends(false);
  4077. @@ -10382,7 +10323,7 @@
  4078.     {
  4079.         for (int id : _friendList)
  4080.         {
  4081. -           L2PcInstance friend = L2World.getInstance().getPlayer(id);
  4082. +           L2PcInstance friend = World.getInstance().getPlayer(id);
  4083.             if (friend != null)
  4084.             {
  4085.                 friend.sendPacket(new FriendList(friend));
  4086. @@ -10413,7 +10354,7 @@
  4087.     @Override
  4088.     public void broadcastRelationsChanges()
  4089.     {
  4090. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  4091. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  4092.         {
  4093.             final int relation = getRelation(player);
  4094.             final boolean isAutoAttackable = isAutoAttackable(player);
  4095. @@ -10438,7 +10379,7 @@
  4096.            
  4097.             if (isSeated())
  4098.             {
  4099. -               final L2Object object = L2World.getInstance().getObject(_throneId);
  4100. +               final L2Object object = World.getInstance().getObject(_throneId);
  4101.                 if (object instanceof L2StaticObjectInstance)
  4102.                     activeChar.sendPacket(new ChairSit(getObjectId(), ((L2StaticObjectInstance) object).getStaticObjectId()));
  4103.             }
  4104. @@ -10552,9 +10493,47 @@
  4105.     }
  4106.    
  4107.     @Override
  4108. -   protected void badCoords()
  4109. +   public void addKnownObject(L2Object object)
  4110.     {
  4111. -       teleToLocation(0, 0, 0, 0);
  4112. -       sendMessage("Error with your coords, Please ask a GM for help!");
  4113. +       sendInfoFrom(object);
  4114.     }
  4115. +  
  4116. +   @Override
  4117. +   public void removeKnownObject(L2Object object)
  4118. +   {
  4119. +       super.removeKnownObject(object);
  4120. +      
  4121. +       // send Server-Client Packet DeleteObject to the L2PcInstance
  4122. +       sendPacket(new DeleteObject(object, (object instanceof L2PcInstance) && ((L2PcInstance) object).isSeated()));
  4123. +   }
  4124. +  
  4125. +   public final void refreshInfos()
  4126. +   {
  4127. +       for (L2Object object : getKnownType(L2Object.class))
  4128. +       {
  4129. +           if (object instanceof L2PcInstance && ((L2PcInstance) object).inObserverMode())
  4130. +               continue;
  4131. +          
  4132. +           sendInfoFrom(object);
  4133. +       }
  4134. +   }
  4135. +  
  4136. +   private final void sendInfoFrom(L2Object object)
  4137. +   {
  4138. +       if (object.getPolyType() == PolyType.ITEM)
  4139. +           sendPacket(new SpawnItem(object));
  4140. +       else
  4141. +       {
  4142. +           // send object info to player
  4143. +           object.sendInfo(this);
  4144. +          
  4145. +           if (object instanceof L2Character)
  4146. +           {
  4147. +               // Update the state of the L2Character object client side by sending Server->Client packet MoveToPawn/MoveToLocation and AutoAttackStart to the L2PcInstance
  4148. +               L2Character obj = (L2Character) object;
  4149. +               if (obj.hasAI())
  4150. +                   obj.getAI().describeStateToPlayer(this);
  4151. +           }
  4152. +       }
  4153. +   }
  4154.  }
  4155. \ No newline at end of file
  4156. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PetInstance.java
  4157. ===================================================================
  4158. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PetInstance.java  (revision 2)
  4159. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PetInstance.java  (working copy)
  4160. @@ -38,8 +38,8 @@
  4161.  import net.sf.l2j.gameserver.model.L2Object;
  4162.  import net.sf.l2j.gameserver.model.L2Party;
  4163.  import net.sf.l2j.gameserver.model.L2Skill;
  4164. -import net.sf.l2j.gameserver.model.L2World;
  4165.  import net.sf.l2j.gameserver.model.PetDataEntry;
  4166. +import net.sf.l2j.gameserver.model.World;
  4167.  import net.sf.l2j.gameserver.model.actor.L2Character;
  4168.  import net.sf.l2j.gameserver.model.actor.L2Summon;
  4169.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.TimeStamp;
  4170. @@ -174,39 +174,17 @@
  4171.         }
  4172.     }
  4173.    
  4174. -   public synchronized static L2PetInstance spawnPet(NpcTemplate template, L2PcInstance owner, ItemInstance control)
  4175. -   {
  4176. -       // Owner has a pet listed in world.
  4177. -       if (L2World.getInstance().getPet(owner.getObjectId()) != null)
  4178. -           return null;
  4179. -      
  4180. -       // Add the pet instance to world.
  4181. -       final L2PetInstance pet = restore(control, template, owner);
  4182. -       if (pet != null)
  4183. -       {
  4184. -           pet.setTitle(owner.getName());
  4185. -           L2World.getInstance().addPet(owner.getObjectId(), pet);
  4186. -       }
  4187. -      
  4188. -       return pet;
  4189. -   }
  4190. -  
  4191.     public L2PetInstance(int objectId, NpcTemplate template, L2PcInstance owner, ItemInstance control)
  4192.     {
  4193.         super(objectId, template, owner);
  4194.        
  4195. +       getPosition().set(owner.getX() + 50, owner.getY() + 100, owner.getZ());
  4196. +      
  4197.         _controlItemId = control.getObjectId();
  4198.        
  4199. -       if (template.getNpcId() == 12564)
  4200. -           getStat().setLevel((byte) getOwner().getLevel());
  4201. -       else
  4202. -           getStat().setLevel(template.getLevel());
  4203. -      
  4204.         _inventory = new PetInventory(this);
  4205. -       _inventory.restore();
  4206.        
  4207.         _mountable = isMountable(template.getNpcId());
  4208. -       _petData = getTemplate().getPetDataEntry(getLevel());
  4209.     }
  4210.    
  4211.     @Override
  4212. @@ -396,6 +374,13 @@
  4213.             return;
  4214.         }
  4215.        
  4216. +       // Can't pickup shots and arrows.
  4217. +       if (target.getItem().getItemType() == EtcItemType.ARROW || target.getItem().getItemType() == EtcItemType.SHOT)
  4218. +       {
  4219. +           getOwner().sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS);
  4220. +           return;
  4221. +       }
  4222. +      
  4223.         synchronized (target)
  4224.         {
  4225.             if (!target.isVisible())
  4226. @@ -562,9 +547,6 @@
  4227.             petIU.addRemovedItem(oldItem);
  4228.         sendPacket(petIU);
  4229.        
  4230. -       // Update pet current load aswell
  4231. -       updateAndBroadcastStatus(1);
  4232. -      
  4233.         // Send player inventory update packet
  4234.         InventoryUpdate playerIU = new InventoryUpdate();
  4235.         if (newItem.getCount() > count)
  4236. @@ -606,7 +588,7 @@
  4237.     public void destroyControlItem(L2PcInstance owner)
  4238.     {
  4239.         // remove the pet instance from world
  4240. -       L2World.getInstance().removePet(owner.getObjectId());
  4241. +       World.getInstance().removePet(owner.getObjectId());
  4242.        
  4243.         // delete from inventory
  4244.         try
  4245. @@ -628,7 +610,7 @@
  4246.                
  4247.                 owner.broadcastUserInfo();
  4248.                
  4249. -               L2World.getInstance().removeObject(removedItem);
  4250. +               World.getInstance().removeObject(removedItem);
  4251.             }
  4252.         }
  4253.         catch (Exception e)
  4254. @@ -657,7 +639,7 @@
  4255.         return _mountable;
  4256.     }
  4257.    
  4258. -   private static L2PetInstance restore(ItemInstance control, NpcTemplate template, L2PcInstance owner)
  4259. +   public static L2PetInstance restore(ItemInstance control, NpcTemplate template, L2PcInstance owner)
  4260.     {
  4261.         try (Connection con = L2DatabaseFactory.getInstance().getConnection())
  4262.         {
  4263. @@ -674,6 +656,14 @@
  4264.             {
  4265.                 rset.close();
  4266.                 statement.close();
  4267. +              
  4268. +               pet.getStat().setLevel((template.getNpcId() == 12564) ? (byte) pet.getOwner().getLevel() : template.getLevel());
  4269. +               pet.getStat().setExp(pet.getExpForThisLevel());
  4270. +               pet.getStatus().setCurrentHp(pet.getMaxHp());
  4271. +               pet.getStatus().setCurrentMp(pet.getMaxMp());
  4272. +               pet.setCurrentFed(pet.getPetData().getMaxMeal());
  4273. +               pet.store();
  4274. +              
  4275.                 return pet;
  4276.             }
  4277.            
  4278. @@ -686,7 +676,6 @@
  4279.            
  4280.             pet.getStatus().setCurrentHp(rset.getDouble("curHp"));
  4281.             pet.getStatus().setCurrentMp(rset.getDouble("curMp"));
  4282. -           pet.getStatus().setCurrentCp(pet.getMaxCp());
  4283.             if (rset.getDouble("curHp") < 0.5)
  4284.             {
  4285.                 pet.setIsDead(true);
  4286. @@ -782,7 +771,7 @@
  4287.        
  4288.         // Drop pet from world's pet list.
  4289.         if (!isDead())
  4290. -           L2World.getInstance().removePet(owner.getObjectId());
  4291. +           World.getInstance().removePet(owner.getObjectId());
  4292.     }
  4293.    
  4294.     /**
  4295. @@ -854,8 +843,8 @@
  4296.         int oldOwnerId = getOwner().getObjectId();
  4297.        
  4298.         setOwner(owner);
  4299. -       L2World.getInstance().removePet(oldOwnerId);
  4300. -       L2World.getInstance().addPet(oldOwnerId, this);
  4301. +       World.getInstance().removePet(oldOwnerId);
  4302. +       World.getInstance().addPet(oldOwnerId, this);
  4303.     }
  4304.    
  4305.     public int getCurrentLoad()
  4306. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java
  4307. ===================================================================
  4308. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java  (revision 2)
  4309. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java  (working copy)
  4310. @@ -23,11 +23,13 @@
  4311.  import net.sf.l2j.gameserver.instancemanager.games.MonsterRace;
  4312.  import net.sf.l2j.gameserver.instancemanager.games.MonsterRace.HistoryInfo;
  4313.  import net.sf.l2j.gameserver.instancemanager.games.MonsterRace.RaceState;
  4314. -import net.sf.l2j.gameserver.model.actor.knownlist.RaceManagerKnownList;
  4315. +import net.sf.l2j.gameserver.model.L2Object;
  4316. +import net.sf.l2j.gameserver.model.actor.L2Npc;
  4317.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  4318.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  4319.  import net.sf.l2j.gameserver.network.SystemMessageId;
  4320.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  4321. +import net.sf.l2j.gameserver.network.serverpackets.DeleteObject;
  4322.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  4323.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  4324.  
  4325. @@ -51,18 +53,6 @@
  4326.     }
  4327.    
  4328.     @Override
  4329. -   public void initKnownList()
  4330. -   {
  4331. -       setKnownList(new RaceManagerKnownList(this));
  4332. -   }
  4333. -  
  4334. -   @Override
  4335. -   public final RaceManagerKnownList getKnownList()
  4336. -   {
  4337. -       return (RaceManagerKnownList) super.getKnownList();
  4338. -   }
  4339. -  
  4340. -   @Override
  4341.     public void onBypassFeedback(L2PcInstance player, String command)
  4342.     {
  4343.         if (command.startsWith("BuyTicket"))
  4344. @@ -345,4 +335,25 @@
  4345.         else
  4346.             super.onBypassFeedback(player, command);
  4347.     }
  4348. +  
  4349. +   @Override
  4350. +   public void addKnownObject(L2Object object)
  4351. +   {
  4352. +       if (object instanceof L2PcInstance)
  4353. +           ((L2PcInstance) object).sendPacket(MonsterRace.getInstance().getRacePacket());
  4354. +   }
  4355. +  
  4356. +   @Override
  4357. +   public void removeKnownObject(L2Object object)
  4358. +   {
  4359. +       super.removeKnownObject(object);
  4360. +      
  4361. +       if (object instanceof L2PcInstance)
  4362. +       {
  4363. +           final L2PcInstance player = ((L2PcInstance) object);
  4364. +          
  4365. +           for (L2Npc npc : MonsterRace.getInstance().getMonsters())
  4366. +               player.sendPacket(new DeleteObject(npc));
  4367. +       }
  4368. +   }
  4369.  }
  4370. \ No newline at end of file
  4371. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
  4372. ===================================================================
  4373. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java (revision 2)
  4374. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java (working copy)
  4375. @@ -23,7 +23,7 @@
  4376.  import net.sf.l2j.gameserver.ai.CtrlIntention;
  4377.  import net.sf.l2j.gameserver.datatables.DoorTable;
  4378.  import net.sf.l2j.gameserver.instancemanager.FourSepulchersManager;
  4379. -import net.sf.l2j.gameserver.model.L2World;
  4380. +import net.sf.l2j.gameserver.model.World;
  4381.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  4382.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  4383.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  4384. @@ -374,7 +374,7 @@
  4385.             return;// wrong usage
  4386.            
  4387.         final CreatureSay sm = new CreatureSay(0, Say2.SHOUT, getName(), msg);
  4388. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  4389. +       for (L2PcInstance player : World.getInstance().getPlayers())
  4390.         {
  4391.             if (Util.checkIfInRange(15000, player, this, true))
  4392.                 player.sendPacket(sm);
  4393. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SiegeGuardInstance.java
  4394. ===================================================================
  4395. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SiegeGuardInstance.java   (revision 2)
  4396. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SiegeGuardInstance.java   (working copy)
  4397. @@ -20,7 +20,6 @@
  4398.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  4399.  import net.sf.l2j.gameserver.model.actor.L2Character;
  4400.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  4401. -import net.sf.l2j.gameserver.model.actor.knownlist.SiegeGuardKnownList;
  4402.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  4403.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  4404.  import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;
  4405. @@ -36,18 +35,6 @@
  4406.     }
  4407.    
  4408.     @Override
  4409. -   public void initKnownList()
  4410. -   {
  4411. -       setKnownList(new SiegeGuardKnownList(this));
  4412. -   }
  4413. -  
  4414. -   @Override
  4415. -   public final SiegeGuardKnownList getKnownList()
  4416. -   {
  4417. -       return (SiegeGuardKnownList) super.getKnownList();
  4418. -   }
  4419. -  
  4420. -   @Override
  4421.     public L2CharacterAI getAI()
  4422.     {
  4423.         L2CharacterAI ai = _ai;
  4424. @@ -131,17 +118,8 @@
  4425.     }
  4426.    
  4427.     @Override
  4428. -   public boolean returnHome()
  4429. +   public int getDriftRange()
  4430.     {
  4431. -       getAggroList().clear();
  4432. -      
  4433. -       if (getMoveSpeed() > 0 && hasAI() && getSpawn() != null && !isInsideRadius(getSpawn().getLocX(), getSpawn().getLocY(), 20, false))
  4434. -       {
  4435. -           setIsReturningToSpawnPoint(true);
  4436. -           setWalking();
  4437. -           getAI().setIntention(CtrlIntention.MOVE_TO, getSpawn().getLoc());
  4438. -           return true;
  4439. -       }
  4440. -       return false;
  4441. +       return 20;
  4442.     }
  4443.  }
  4444. \ No newline at end of file
  4445. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SummonInstance.java
  4446. ===================================================================
  4447. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SummonInstance.java   (revision 2)
  4448. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SummonInstance.java   (working copy)
  4449. @@ -49,7 +49,6 @@
  4450.     public L2SummonInstance(int objectId, NpcTemplate template, L2PcInstance owner, L2Skill skill)
  4451.     {
  4452.         super(objectId, template, owner);
  4453. -       setShowSummonAnimation(true);
  4454.        
  4455.         if (skill != null)
  4456.         {
  4457. @@ -161,7 +160,7 @@
  4458.             return false;
  4459.        
  4460.         // Send aggro of mobs to summoner.
  4461. -       for (L2Attackable mob : getKnownList().getKnownType(L2Attackable.class))
  4462. +       for (L2Attackable mob : getKnownType(L2Attackable.class))
  4463.         {
  4464.             if (mob.isDead())
  4465.                 continue;
  4466. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2WeddingManagerInstance.java
  4467. ===================================================================
  4468. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2WeddingManagerInstance.java   (revision 2)
  4469. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2WeddingManagerInstance.java   (working copy)
  4470. @@ -23,11 +23,9 @@
  4471.  import net.sf.l2j.gameserver.datatables.SkillTable.FrequentSkill;
  4472.  import net.sf.l2j.gameserver.instancemanager.CastleManager;
  4473.  import net.sf.l2j.gameserver.instancemanager.CoupleManager;
  4474. -import net.sf.l2j.gameserver.model.L2Skill;
  4475. -import net.sf.l2j.gameserver.model.L2World;
  4476. +import net.sf.l2j.gameserver.model.World;
  4477.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  4478.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  4479. -import net.sf.l2j.gameserver.model.entity.Couple;
  4480.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  4481.  import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
  4482.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  4483. @@ -37,9 +35,6 @@
  4484.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  4485.  import net.sf.l2j.gameserver.util.Broadcast;
  4486.  
  4487. -/**
  4488. - * @author evill33t & squeezed, rework Tryskell
  4489. - */
  4490.  public class L2WeddingManagerInstance extends L2NpcInstance
  4491.  {
  4492.     public L2WeddingManagerInstance(int objectId, NpcTemplate template)
  4493. @@ -68,18 +63,18 @@
  4494.                
  4495.                 // Shouldn't be able to see wedding content if the mod isn't activated on configs
  4496.                 if (!Config.ALLOW_WEDDING)
  4497. -                   sendHtmlMessage(player, "data/html/mods/Wedding_disabled.htm");
  4498. +                   sendHtmlMessage(player, "data/html/mods/wedding/disabled.htm");
  4499.                 else
  4500.                 {
  4501.                     // Married people got access to another menu
  4502. -                   if (player.isMarried())
  4503. -                       sendHtmlMessage(player, "data/html/mods/Wedding_start2.htm");
  4504. +                   if (player.getCoupleId() > 0)
  4505. +                       sendHtmlMessage(player, "data/html/mods/wedding/start2.htm");
  4506.                     // "Under marriage acceptance" people go to this one
  4507.                     else if (player.isUnderMarryRequest())
  4508. -                       sendHtmlMessage(player, "data/html/mods/Wedding_waitforpartner.htm");
  4509. +                       sendHtmlMessage(player, "data/html/mods/wedding/waitforpartner.htm");
  4510.                     // And normal players go here :)
  4511.                     else
  4512. -                       sendHtmlMessage(player, "data/html/mods/Wedding_start.htm");
  4513. +                       sendHtmlMessage(player, "data/html/mods/wedding/start.htm");
  4514.                 }
  4515.             }
  4516.         }
  4517. @@ -95,43 +90,41 @@
  4518.            
  4519.             if (st.hasMoreTokens())
  4520.             {
  4521. -               final L2PcInstance ptarget = L2World.getInstance().getPlayer(st.nextToken());
  4522. -               if (ptarget == null)
  4523. +               final L2PcInstance partner = World.getInstance().getPlayer(st.nextToken());
  4524. +               if (partner == null)
  4525.                 {
  4526. -                   sendHtmlMessage(player, "data/html/mods/Wedding_notfound.htm");
  4527. +                   sendHtmlMessage(player, "data/html/mods/wedding/notfound.htm");
  4528.                     return;
  4529.                 }
  4530.                
  4531.                 // check conditions
  4532. -               if (!weddingConditions(player, ptarget))
  4533. +               if (!weddingConditions(player, partner))
  4534.                     return;
  4535.                
  4536.                 // block the wedding manager until an answer is given.
  4537.                 player.setUnderMarryRequest(true);
  4538. -               ptarget.setUnderMarryRequest(true);
  4539. +               partner.setUnderMarryRequest(true);
  4540.                
  4541.                 // memorize the requesterId for future use, and send a popup to the target
  4542. -               ptarget.setRequesterId(player.getObjectId());
  4543. -               ptarget.sendPacket(new ConfirmDlg(1983).addString(player.getName() + " asked you to marry. Do you want to start a new relationship ?"));
  4544. +               partner.setRequesterId(player.getObjectId());
  4545. +               partner.sendPacket(new ConfirmDlg(1983).addString(player.getName() + " asked you to marry. Do you want to start a new relationship ?"));
  4546.             }
  4547.             else
  4548. -               sendHtmlMessage(player, "data/html/mods/Wedding_notfound.htm");
  4549. +               sendHtmlMessage(player, "data/html/mods/wedding/notfound.htm");
  4550.         }
  4551.         else if (command.startsWith("Divorce"))
  4552. -       {
  4553. -           player.sendMessage("You are now divorced.");
  4554. -          
  4555. -           // Find the partner using the couple information
  4556. -           final L2PcInstance partner = L2World.getInstance().getPlayer(Couple.getPartnerId(player.getObjectId()));
  4557. -           if (partner != null)
  4558. -               partner.sendMessage("Your beloved has decided to divorce.");
  4559. -          
  4560.             CoupleManager.getInstance().deleteCouple(player.getCoupleId());
  4561. -       }
  4562.         else if (command.startsWith("GoToLove"))
  4563.         {
  4564. -           // Find the partner using the couple information
  4565. -           final L2PcInstance partner = L2World.getInstance().getPlayer(Couple.getPartnerId(player.getObjectId()));
  4566. +           // Find the partner using the couple id.
  4567. +           final int partnerId = CoupleManager.getInstance().getPartnerId(player.getCoupleId(), player.getObjectId());
  4568. +           if (partnerId == 0)
  4569. +           {
  4570. +               player.sendMessage("Your partner can't be found.");
  4571. +               return;
  4572. +           }
  4573. +          
  4574. +           final L2PcInstance partner = World.getInstance().getPlayer(partnerId);
  4575.             if (partner == null)
  4576.             {
  4577.                 player.sendMessage("Your partner is not online.");
  4578. @@ -175,85 +168,76 @@
  4579.         return true;
  4580.     }
  4581.    
  4582. -   private boolean weddingConditions(L2PcInstance player, L2PcInstance ptarget)
  4583. +   private boolean weddingConditions(L2PcInstance requester, L2PcInstance partner)
  4584.     {
  4585.         // Check if player target himself
  4586. -       if (ptarget.getObjectId() == player.getObjectId())
  4587. +       if (partner.getObjectId() == requester.getObjectId())
  4588.         {
  4589. -           sendHtmlMessage(player, "data/html/mods/Wedding_error_wrongtarget.htm");
  4590. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_wrongtarget.htm");
  4591.             return false;
  4592.         }
  4593.        
  4594.         // Sex check
  4595. -       if (ptarget.getAppearance().getSex() == player.getAppearance().getSex() && !Config.WEDDING_SAMESEX)
  4596. +       if (!Config.WEDDING_SAMESEX && partner.getAppearance().getSex() == requester.getAppearance().getSex())
  4597.         {
  4598. -           sendHtmlMessage(player, "data/html/mods/Wedding_error_sex.htm");
  4599. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_sex.htm");
  4600.             return false;
  4601.         }
  4602.        
  4603.         // Check if player has the target on friendlist
  4604. -       if (!player.getFriendList().contains(ptarget.getObjectId()))
  4605. +       if (!requester.getFriendList().contains(partner.getObjectId()))
  4606.         {
  4607. -           sendHtmlMessage(player, "data/html/mods/Wedding_error_friendlist.htm");
  4608. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_friendlist.htm");
  4609.             return false;
  4610.         }
  4611.        
  4612.         // Target mustn't be already married
  4613. -       if (ptarget.isMarried())
  4614. +       if (partner.getCoupleId() > 0)
  4615.         {
  4616. -           sendHtmlMessage(player, "data/html/mods/Wedding_error_alreadymarried.htm");
  4617. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_alreadymarried.htm");
  4618.             return false;
  4619.         }
  4620.        
  4621.         // Check for Formal Wear
  4622. -       if (Config.WEDDING_FORMALWEAR)
  4623. -           if (!wearsFormalWear(player, ptarget))
  4624. -           {
  4625. -               sendHtmlMessage(player, "data/html/mods/Wedding_error_noformal.htm");
  4626. -               return false;
  4627. -           }
  4628. +       if (Config.WEDDING_FORMALWEAR && !wearsFormalWear(requester, partner))
  4629. +       {
  4630. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_noformal.htm");
  4631. +           return false;
  4632. +       }
  4633.        
  4634.         // Check and reduce wedding price
  4635. -       if (player.getAdena() < Config.WEDDING_PRICE || ptarget.getAdena() < Config.WEDDING_PRICE)
  4636. +       if (requester.getAdena() < Config.WEDDING_PRICE || partner.getAdena() < Config.WEDDING_PRICE)
  4637.         {
  4638. -           sendHtmlMessage(player, "data/html/mods/Wedding_error_adena.htm");
  4639. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_adena.htm");
  4640.             return false;
  4641.         }
  4642.        
  4643.         return true;
  4644.     }
  4645.    
  4646. -   public static void justMarried(L2PcInstance player, L2PcInstance ptarget)
  4647. +   public static void justMarried(L2PcInstance requester, L2PcInstance partner)
  4648.     {
  4649.         // Unlock the wedding manager for both users, and set them as married
  4650. -       player.setUnderMarryRequest(false);
  4651. -       ptarget.setUnderMarryRequest(false);
  4652. +       requester.setUnderMarryRequest(false);
  4653. +       partner.setUnderMarryRequest(false);
  4654.        
  4655. -       player.setMarried(true);
  4656. -       ptarget.setMarried(true);
  4657. -      
  4658.         // reduce adenas amount according to configs
  4659. -       player.reduceAdena("Wedding", Config.WEDDING_PRICE, player.getCurrentFolkNPC(), true);
  4660. -       ptarget.reduceAdena("Wedding", Config.WEDDING_PRICE, player.getCurrentFolkNPC(), true);
  4661. +       requester.reduceAdena("Wedding", Config.WEDDING_PRICE, requester.getCurrentFolkNPC(), true);
  4662. +       partner.reduceAdena("Wedding", Config.WEDDING_PRICE, requester.getCurrentFolkNPC(), true);
  4663.        
  4664. -       // Flag players as married
  4665. -       Couple couple = CoupleManager.getInstance().getCouple(player.getCoupleId());
  4666. -       couple.marry();
  4667. -      
  4668.         // Messages to the couple
  4669. -       player.sendMessage("Congratulations, you are now married with " + ptarget.getName() + " !");
  4670. -       ptarget.sendMessage("Congratulations, you are now married with " + player.getName() + " !");
  4671. +       requester.sendMessage("Congratulations, you are now married with " + partner.getName() + " !");
  4672. +       partner.sendMessage("Congratulations, you are now married with " + requester.getName() + " !");
  4673.        
  4674.         // Wedding march
  4675. -       player.broadcastPacket(new MagicSkillUse(player, player, 2230, 1, 1, 0));
  4676. -       ptarget.broadcastPacket(new MagicSkillUse(ptarget, ptarget, 2230, 1, 1, 0));
  4677. +       requester.broadcastPacket(new MagicSkillUse(requester, requester, 2230, 1, 1, 0));
  4678. +       partner.broadcastPacket(new MagicSkillUse(partner, partner, 2230, 1, 1, 0));
  4679.        
  4680.         // Fireworks
  4681. -       L2Skill skill = FrequentSkill.LARGE_FIREWORK.getSkill();
  4682. -       player.doCast(skill);
  4683. -       ptarget.doCast(skill);
  4684. +       requester.doCast(FrequentSkill.LARGE_FIREWORK.getSkill());
  4685. +       partner.doCast(FrequentSkill.LARGE_FIREWORK.getSkill());
  4686.        
  4687. -       Broadcast.announceToOnlinePlayers("Congratulations to " + player.getName() + " and " + ptarget.getName() + "! They have been married.");
  4688. +       Broadcast.announceToOnlinePlayers("Congratulations to " + requester.getName() + " and " + partner.getName() + "! They have been married.");
  4689.     }
  4690.    
  4691.     private void sendHtmlMessage(L2PcInstance player, String file)
  4692. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2XmassTreeInstance.java
  4693. ===================================================================
  4694. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2XmassTreeInstance.java    (revision 2)
  4695. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2XmassTreeInstance.java    (working copy)
  4696. @@ -62,7 +62,7 @@
  4697.                 return;
  4698.             }
  4699.            
  4700. -           for (L2PcInstance player : getKnownList().getKnownTypeInRadius(L2PcInstance.class, 200))
  4701. +           for (L2PcInstance player : getKnownTypeInRadius(L2PcInstance.class, 200))
  4702.             {
  4703.                 if (player.getFirstEffect(_skill.getId()) == null)
  4704.                     _skill.getEffects(player, player);
  4705. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java
  4706. ===================================================================
  4707. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java    (revision 2)
  4708. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java    (working copy)
  4709. @@ -44,7 +44,6 @@
  4710.  import net.sf.l2j.gameserver.model.RewardInfo;
  4711.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4712.  import net.sf.l2j.gameserver.model.actor.instance.L2SummonInstance;
  4713. -import net.sf.l2j.gameserver.model.actor.knownlist.AttackableKnownList;
  4714.  import net.sf.l2j.gameserver.model.actor.status.AttackableStatus;
  4715.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  4716.  import net.sf.l2j.gameserver.model.holder.IntIntHolder;
  4717. @@ -94,18 +93,6 @@
  4718.     }
  4719.    
  4720.     @Override
  4721. -   public void initKnownList()
  4722. -   {
  4723. -       setKnownList(new AttackableKnownList(this));
  4724. -   }
  4725. -  
  4726. -   @Override
  4727. -   public AttackableKnownList getKnownList()
  4728. -   {
  4729. -       return (AttackableKnownList) super.getKnownList();
  4730. -   }
  4731. -  
  4732. -   @Override
  4733.     public void initCharStatus()
  4734.     {
  4735.         setStatus(new AttackableStatus(this));
  4736. @@ -311,7 +298,7 @@
  4737.             if (attackerParty == null)
  4738.             {
  4739.                 // Calculate Exp and SP rewards.
  4740. -               if (attacker.getKnownList().knowsObject(this) && !attacker.isDead())
  4741. +               if (!attacker.isDead() && attacker.getKnownType(L2Attackable.class).contains(this))
  4742.                 {
  4743.                     // Calculate the difference of level between this attacker and the L2Attackable.
  4744.                     final int levelDiff = attacker.getLevel() - getLevel();
  4745. @@ -1218,11 +1205,12 @@
  4746.         getAI().setIntention(CtrlIntention.CAST, skill, target);
  4747.     }
  4748.    
  4749. -   public boolean returnHome()
  4750. +   public final boolean returnHome(boolean cleanAggro)
  4751.     {
  4752. -       _aggroList.clear();
  4753. +       if (cleanAggro)
  4754. +           _aggroList.clear();
  4755.        
  4756. -       if (getMoveSpeed() > 0 && hasAI() && getSpawn() != null && !isInsideRadius(getSpawn().getLocX(), getSpawn().getLocY(), Config.MAX_DRIFT_RANGE, false))
  4757. +       if (hasAI() && !isDead() && getMoveSpeed() > 0 && getSpawn() != null && !isInsideRadius(getSpawn().getLocX(), getSpawn().getLocY(), getDriftRange(), false))
  4758.         {
  4759.             setIsReturningToSpawnPoint(true);
  4760.             setWalking();
  4761. @@ -1232,6 +1220,11 @@
  4762.         return false;
  4763.     }
  4764.    
  4765. +   public int getDriftRange()
  4766. +   {
  4767. +       return Config.MAX_DRIFT_RANGE;
  4768. +   }
  4769. +  
  4770.     public final Set<L2Character> getAttackByList()
  4771.     {
  4772.         return _attackByList;
  4773. @@ -1630,4 +1623,21 @@
  4774.             _quest.notifyKill(_attackable, _killer, _isPet);
  4775.         }
  4776.     }
  4777. +  
  4778. +   @Override
  4779. +   public void addKnownObject(L2Object object)
  4780. +   {
  4781. +       if (object instanceof L2PcInstance && getAI().getIntention() == CtrlIntention.IDLE)
  4782. +           getAI().setIntention(CtrlIntention.ACTIVE, null);
  4783. +   }
  4784. +  
  4785. +   @Override
  4786. +   public void removeKnownObject(L2Object object)
  4787. +   {
  4788. +       super.removeKnownObject(object);
  4789. +      
  4790. +       // remove object from agro list
  4791. +       if (object instanceof L2Character)
  4792. +           getAggroList().remove(object);
  4793. +   }
  4794.  }
  4795. \ No newline at end of file
  4796. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Character.java
  4797. ===================================================================
  4798. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Character.java (revision 2)
  4799. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Character.java (working copy)
  4800. @@ -46,17 +46,16 @@
  4801.  import net.sf.l2j.gameserver.model.L2Party;
  4802.  import net.sf.l2j.gameserver.model.L2Skill;
  4803.  import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType;
  4804. -import net.sf.l2j.gameserver.model.L2World;
  4805. -import net.sf.l2j.gameserver.model.L2WorldRegion;
  4806.  import net.sf.l2j.gameserver.model.Location;
  4807.  import net.sf.l2j.gameserver.model.ShotType;
  4808.  import net.sf.l2j.gameserver.model.SpawnLocation;
  4809. +import net.sf.l2j.gameserver.model.World;
  4810. +import net.sf.l2j.gameserver.model.WorldRegion;
  4811.  import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  4812.  import net.sf.l2j.gameserver.model.actor.instance.L2NpcWalkerInstance;
  4813.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4814.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  4815.  import net.sf.l2j.gameserver.model.actor.instance.L2RiftInvaderInstance;
  4816. -import net.sf.l2j.gameserver.model.actor.knownlist.CharKnownList;
  4817.  import net.sf.l2j.gameserver.model.actor.stat.CharStat;
  4818.  import net.sf.l2j.gameserver.model.actor.status.CharStatus;
  4819.  import net.sf.l2j.gameserver.model.actor.template.CharTemplate;
  4820. @@ -84,6 +83,7 @@
  4821.  import net.sf.l2j.gameserver.network.serverpackets.Revive;
  4822.  import net.sf.l2j.gameserver.network.serverpackets.ServerObjectInfo;
  4823.  import net.sf.l2j.gameserver.network.serverpackets.SetupGauge;
  4824. +import net.sf.l2j.gameserver.network.serverpackets.SetupGauge.GaugeColor;
  4825.  import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
  4826.  import net.sf.l2j.gameserver.network.serverpackets.StopMove;
  4827.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  4828. @@ -150,7 +150,6 @@
  4829.     private CharStat _stat;
  4830.     private CharStatus _status;
  4831.     private CharTemplate _template; // The link on the L2CharTemplate object containing generic and static properties
  4832. -   private CharKnownList _knownList;
  4833.    
  4834.     private String _title;
  4835.     private double _hpUpdateIncCheck = .0;
  4836. @@ -196,7 +195,6 @@
  4837.     public L2Character(int objectId, CharTemplate template)
  4838.     {
  4839.         super(objectId);
  4840. -       initKnownList();
  4841.         initCharStat();
  4842.         initCharStatus();
  4843.        
  4844. @@ -246,9 +244,8 @@
  4845.     /**
  4846.      * Remove the L2Character from the world when the decay task is launched.<BR>
  4847.      * <BR>
  4848. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR>
  4849. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players</B></FONT><BR>
  4850. -    * <BR>
  4851. +    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _objects of World.</B></FONT><BR>
  4852. +    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players.</B></FONT>
  4853.      */
  4854.     public void onDecay()
  4855.     {
  4856. @@ -529,7 +526,7 @@
  4857.        
  4858.         if (!isAlikeDead())
  4859.         {
  4860. -           if (this instanceof L2Npc && target.isAlikeDead() || !getKnownList().knowsObject(target))
  4861. +           if (this instanceof L2Npc && target.isAlikeDead() || !getKnownType(L2Character.class).contains(target))
  4862.             {
  4863.                 getAI().setIntention(CtrlIntention.ACTIVE);
  4864.                 sendPacket(ActionFailed.STATIC_PACKET);
  4865. @@ -633,9 +630,6 @@
  4866.             }
  4867.         }
  4868.        
  4869. -       // Add the L2PcInstance to _knownObjects and _knownPlayer of the target
  4870. -       target.getKnownList().addKnownObject(this);
  4871. -      
  4872.         // Recharge any active auto soulshot tasks for current L2Character instance.
  4873.         rechargeShots(true, false);
  4874.        
  4875. @@ -805,7 +799,7 @@
  4876.             sendPacket(SystemMessage.getSystemMessage(SystemMessageId.GETTING_READY_TO_SHOOT_AN_ARROW));
  4877.            
  4878.             // Send SetupGauge
  4879. -           sendPacket(new SetupGauge(SetupGauge.RED, sAtk + reuse));
  4880. +           sendPacket(new SetupGauge(GaugeColor.RED, sAtk + reuse));
  4881.         }
  4882.        
  4883.         // Create a new hit task with Medium priority
  4884. @@ -917,7 +911,7 @@
  4885.         boolean hitted = doAttackHitSimple(attack, target, 100, sAtk);
  4886.         double attackpercent = 85;
  4887.        
  4888. -       for (L2Character obj : getKnownList().getKnownType(L2Character.class))
  4889. +       for (L2Character obj : getKnownType(L2Character.class))
  4890.         {
  4891.             if (obj == target || obj.isAlikeDead())
  4892.                 continue;
  4893. @@ -1322,7 +1316,7 @@
  4894.         {
  4895.             // Send SetupGauge with the color of the gauge and the casting time
  4896.             if (this instanceof L2PcInstance && !effectWhileCasting)
  4897. -               sendPacket(new SetupGauge(SetupGauge.BLUE, hitTime));
  4898. +               sendPacket(new SetupGauge(GaugeColor.BLUE, hitTime));
  4899.            
  4900.             if (effectWhileCasting)
  4901.                 mut.phase = 2;
  4902. @@ -1408,7 +1402,7 @@
  4903.         // prevent casting signets to peace zone
  4904.         if (skill.getSkillType() == L2SkillType.SIGNET || skill.getSkillType() == L2SkillType.SIGNET_CASTTIME)
  4905.         {
  4906. -           final L2WorldRegion region = getRegion();
  4907. +           final WorldRegion region = getRegion();
  4908.             if (region == null)
  4909.                 return false;
  4910.            
  4911. @@ -1535,7 +1529,7 @@
  4912.         if (hasAI())
  4913.             getAI().notifyEvent(CtrlEvent.EVT_DEAD, null);
  4914.        
  4915. -       final L2WorldRegion region = getRegion();
  4916. +       final WorldRegion region = getRegion();
  4917.         if (region != null)
  4918.             region.onDeath(this);
  4919.        
  4920. @@ -1570,7 +1564,7 @@
  4921.         // Start broadcast status
  4922.         broadcastPacket(new Revive(this));
  4923.        
  4924. -       final L2WorldRegion region = getRegion();
  4925. +       final WorldRegion region = getRegion();
  4926.         if (region != null)
  4927.             region.onRevive(this);
  4928.     }
  4929. @@ -1858,7 +1852,7 @@
  4930.             ((L2Summon) this).broadcastStatusUpdate();
  4931.         else if (this instanceof L2Npc)
  4932.         {
  4933. -           for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  4934. +           for (L2PcInstance player : getKnownType(L2PcInstance.class))
  4935.             {
  4936.                 if (getMoveSpeed() == 0)
  4937.                     player.sendPacket(new ServerObjectInfo((L2Npc) this, player));
  4938. @@ -1910,22 +1904,6 @@
  4939.         return false;
  4940.     }
  4941.    
  4942. -   public void initKnownList()
  4943. -   {
  4944. -       setKnownList(new CharKnownList(this));
  4945. -   }
  4946. -  
  4947. -   @Override
  4948. -   public CharKnownList getKnownList()
  4949. -   {
  4950. -       return _knownList;
  4951. -   }
  4952. -  
  4953. -   public void setKnownList(CharKnownList value)
  4954. -   {
  4955. -       _knownList = value;
  4956. -   }
  4957. -  
  4958.     public void initCharStat()
  4959.     {
  4960.         _stat = new CharStat(this);
  4961. @@ -2888,7 +2866,7 @@
  4962.         {
  4963.             if (broadcastFull)
  4964.             {
  4965. -               for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  4966. +               for (L2PcInstance player : getKnownType(L2PcInstance.class))
  4967.                 {
  4968.                     if (getMoveSpeed() == 0)
  4969.                         player.sendPacket(new ServerObjectInfo((L2Npc) this, player));
  4970. @@ -3217,26 +3195,19 @@
  4971.     }
  4972.    
  4973.     /**
  4974. -    * Stop movement of the L2Character (Called by AI Accessor only).<BR>
  4975. -    * <BR>
  4976. -    * <B><U> Actions</U> :</B>
  4977. +    * Stop movement of the L2Character (called by AI Accessor only).
  4978.      * <ul>
  4979.      * <li>Delete movement data of the L2Character</li>
  4980. -    * <li>Set the current position (x,y,z), its current L2WorldRegion if necessary and its heading</li>
  4981. -    * <li>Remove the L2Object object from _gmList** of GmListTable</li>
  4982. -    * <li>Remove object from _knownObjects and _knownPlayer* of all surrounding L2WorldRegion L2Characters</li>
  4983. +    * <li>Set the current position and refresh the region if necessary</li>
  4984.      * </ul>
  4985. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T send Server->Client packet StopMove/StopRotation </B></FONT><BR>
  4986. -    * <BR>
  4987. -    * @param loc
  4988. +    * @param loc : The SpawnLocation where the character must stop.
  4989.      */
  4990.     public void stopMove(SpawnLocation loc)
  4991.     {
  4992.         // Delete movement data of the L2Character
  4993.         _move = null;
  4994.        
  4995. -       // Set the current position (x,y,z), its current L2WorldRegion if necessary and its heading
  4996. -       // All data are contained in a L2CharPosition object
  4997. +       // Set the current position and refresh the region if necessary.
  4998.         if (loc != null)
  4999.         {
  5000.             setXYZ(loc.getX(), loc.getY(), loc.getZ());
  5001. @@ -3281,18 +3252,8 @@
  5002.      */
  5003.     public void setTarget(L2Object object)
  5004.     {
  5005. -       if (object != null)
  5006. -       {
  5007. -           if (!object.isVisible())
  5008. -               object = null;
  5009. -           else if (object != _target)
  5010. -           {
  5011. -               getKnownList().addKnownObject(object);
  5012. -              
  5013. -               if (object.getKnownList() != null)
  5014. -                   object.getKnownList().addKnownObject(this);
  5015. -           }
  5016. -       }
  5017. +       if (object != null && !object.isVisible())
  5018. +           object = null;
  5019.        
  5020.         _target = object;
  5021.     }
  5022. @@ -3302,10 +3263,7 @@
  5023.      */
  5024.     public final int getTargetId()
  5025.     {
  5026. -       if (_target != null)
  5027. -           return _target.getObjectId();
  5028. -      
  5029. -       return -1;
  5030. +       return (_target != null) ? _target.getObjectId() : -1;
  5031.     }
  5032.    
  5033.     /**
  5034. @@ -3445,8 +3403,8 @@
  5035.             int originalX = x;
  5036.             int originalY = y;
  5037.             int originalZ = z;
  5038. -           int gtx = (originalX - L2World.WORLD_X_MIN) >> 4;
  5039. -           int gty = (originalY - L2World.WORLD_Y_MIN) >> 4;
  5040. +           int gtx = (originalX - World.WORLD_X_MIN) >> 4;
  5041. +           int gty = (originalY - World.WORLD_Y_MIN) >> 4;
  5042.            
  5043.             // Movement checks:
  5044.             // when geodata == 2, for all characters except mobs returning home (could be changed later to teleport if pathfinding fails)
  5045. @@ -3469,7 +3427,7 @@
  5046.                     }
  5047.                 }
  5048.                
  5049. -               if (curX < L2World.WORLD_X_MIN || curX > L2World.WORLD_X_MAX || curY < L2World.WORLD_Y_MIN || curY > L2World.WORLD_Y_MAX)
  5050. +               if (curX < World.WORLD_X_MIN || curX > World.WORLD_X_MAX || curY < World.WORLD_Y_MIN || curY > World.WORLD_Y_MAX)
  5051.                 {
  5052.                     // Temporary fix for character outside world region errors
  5053.                     _log.warning("Character " + getName() + " outside world area, in coordinates x:" + curX + " y:" + curY);
  5054. @@ -3827,7 +3785,7 @@
  5055.             return;
  5056.         }
  5057.        
  5058. -       if ((this instanceof L2Npc && target.isAlikeDead()) || target.isDead() || (!getKnownList().knowsObject(target) && !(this instanceof L2DoorInstance)))
  5059. +       if ((this instanceof L2Npc && target.isAlikeDead()) || target.isDead() || (!getKnownType(L2Character.class).contains(target) && !(this instanceof L2DoorInstance)))
  5060.         {
  5061.             getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
  5062.            
  5063. @@ -4096,7 +4054,7 @@
  5064.     {
  5065.         try
  5066.         {
  5067. -           L2WorldRegion region = L2World.getInstance().getRegion(getX(), getY());
  5068. +           WorldRegion region = World.getInstance().getRegion(getX(), getY());
  5069.             return ((region != null) && (region.isActive()));
  5070.         }
  5071.         catch (Exception e)
  5072. @@ -4952,7 +4910,7 @@
  5073.                 }
  5074.                
  5075.                 // Mobs in range 1000 see spell
  5076. -               for (L2Npc npcMob : player.getKnownList().getKnownTypeInRadius(L2Npc.class, 1000))
  5077. +               for (L2Npc npcMob : player.getKnownTypeInRadius(L2Npc.class, 1000))
  5078.                 {
  5079.                     List<Quest> quests = npcMob.getTemplate().getEventQuests(EventType.ON_SKILL_SEE);
  5080.                     if (quests != null)
  5081. @@ -5521,14 +5479,8 @@
  5082.     }
  5083.    
  5084.     @Override
  5085. -   protected void badCoords()
  5086. +   public final void setRegion(WorldRegion value)
  5087.     {
  5088. -       decayMe();
  5089. -   }
  5090. -  
  5091. -   @Override
  5092. -   public final void setRegion(L2WorldRegion value)
  5093. -   {
  5094.         // confirm revalidation of old region's zones
  5095.         if (getRegion() != null)
  5096.         {
  5097. @@ -5540,4 +5492,12 @@
  5098.        
  5099.         super.setRegion(value);
  5100.     }
  5101. +  
  5102. +   @Override
  5103. +   public void removeKnownObject(L2Object object)
  5104. +   {
  5105. +       // If object is targeted by the L2Character, cancel Attack or Cast
  5106. +       if (object == getTarget())
  5107. +           setTarget(null);
  5108. +   }
  5109.  }
  5110. \ No newline at end of file
  5111. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Npc.java
  5112. ===================================================================
  5113. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Npc.java   (revision 2)
  5114. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Npc.java   (working copy)
  5115. @@ -51,7 +51,6 @@
  5116.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5117.  import net.sf.l2j.gameserver.model.actor.instance.L2TeleporterInstance;
  5118.  import net.sf.l2j.gameserver.model.actor.instance.L2WarehouseInstance;
  5119. -import net.sf.l2j.gameserver.model.actor.knownlist.NpcKnownList;
  5120.  import net.sf.l2j.gameserver.model.actor.stat.NpcStat;
  5121.  import net.sf.l2j.gameserver.model.actor.status.NpcStatus;
  5122.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  5123. @@ -96,7 +95,7 @@
  5124.   */
  5125.  public class L2Npc extends L2Character
  5126.  {
  5127. -   public static final int INTERACTION_DISTANCE = 150;
  5128. +   public static final int INTERACTION_DISTANCE = 100;
  5129.     private static final int SOCIAL_INTERVAL = 12000;
  5130.    
  5131.     private L2Spawn _spawn;
  5132. @@ -191,18 +190,6 @@
  5133.     }
  5134.    
  5135.     @Override
  5136. -   public void initKnownList()
  5137. -   {
  5138. -       setKnownList(new NpcKnownList(this));
  5139. -   }
  5140. -  
  5141. -   @Override
  5142. -   public NpcKnownList getKnownList()
  5143. -   {
  5144. -       return (NpcKnownList) super.getKnownList();
  5145. -   }
  5146. -  
  5147. -   @Override
  5148.     public void initCharStat()
  5149.     {
  5150.         setStat(new NpcStat(this));
  5151. @@ -280,7 +267,7 @@
  5152.     public void updateAbnormalEffect()
  5153.     {
  5154.         // Send NpcInfo with state of abnormal effect to all L2PcInstance in the _KnownPlayers of the L2Npc
  5155. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  5156. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  5157.         {
  5158.             if (getMoveSpeed() == 0)
  5159.                 player.sendPacket(new ServerObjectInfo(this, player));
  5160. @@ -1340,17 +1327,6 @@
  5161.                 quest.notifySpawn(this);
  5162.     }
  5163.    
  5164. -   /**
  5165. -    * Remove the L2Npc from the world and update its spawn object (for a complete removal use the deleteMe method).<BR>
  5166. -    * <BR>
  5167. -    * <B><U> Actions</U> :</B><BR>
  5168. -    * <BR>
  5169. -    * <li>Remove the L2Npc from the world when the decay task is launched</li> <li>Decrease its spawn counter</li> <li>Manage Siege task (killFlag, killCT)</li><BR>
  5170. -    * <BR>
  5171. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR>
  5172. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players</B></FONT><BR>
  5173. -    * <BR>
  5174. -    */
  5175.     @Override
  5176.     public void onDecay()
  5177.     {
  5178. @@ -1372,25 +1348,12 @@
  5179.             _spawn.doRespawn();
  5180.     }
  5181.    
  5182. -   /**
  5183. -    * Remove PROPERLY the L2Npc from the world.<BR>
  5184. -    * <BR>
  5185. -    * <B><U> Actions</U> :</B><BR>
  5186. -    * <BR>
  5187. -    * <li>Remove the L2Npc from the world and update its spawn object</li> <li>Remove all L2Object from _knownObjects and _knownPlayer of the L2Npc then cancel Attak or Cast and notify AI</li> <li>Remove L2Object object from _allObjects of L2World</li><BR>
  5188. -    * <BR>
  5189. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players</B></FONT><BR>
  5190. -    * <BR>
  5191. -    */
  5192.     @Override
  5193.     public void deleteMe()
  5194.     {
  5195.         // Decay
  5196.         onDecay();
  5197.        
  5198. -       // Remove all L2Object from _knownObjects and _knownPlayer of the L2Character then cancel Attak or Cast and notify AI
  5199. -       getKnownList().removeAllKnownObjects();
  5200. -      
  5201.         super.deleteMe();
  5202.     }
  5203.    
  5204. @@ -1574,7 +1537,7 @@
  5205.                 return;
  5206.            
  5207.             _currentSsCount--;
  5208. -           Broadcast.toSelfAndKnownPlayersInRadiusSq(this, new MagicSkillUse(this, this, 2154, 1, 0, 0), 360000);
  5209. +           Broadcast.toSelfAndKnownPlayersInRadius(this, new MagicSkillUse(this, this, 2154, 1, 0, 0), 600);
  5210.             setChargedShot(ShotType.SOULSHOT, true);
  5211.         }
  5212.        
  5213. @@ -1587,7 +1550,7 @@
  5214.                 return;
  5215.            
  5216.             _currentSpsCount--;
  5217. -           Broadcast.toSelfAndKnownPlayersInRadiusSq(this, new MagicSkillUse(this, this, 2061, 1, 0, 0), 360000);
  5218. +           Broadcast.toSelfAndKnownPlayersInRadius(this, new MagicSkillUse(this, this, 2061, 1, 0, 0), 600);
  5219.             setChargedShot(ShotType.SPIRITSHOT, true);
  5220.         }
  5221.     }
  5222. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Playable.java
  5223. ===================================================================
  5224. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Playable.java  (revision 2)
  5225. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Playable.java  (working copy)
  5226. @@ -19,7 +19,7 @@
  5227.  import net.sf.l2j.gameserver.model.L2Effect;
  5228.  import net.sf.l2j.gameserver.model.L2Object;
  5229.  import net.sf.l2j.gameserver.model.L2Skill;
  5230. -import net.sf.l2j.gameserver.model.L2WorldRegion;
  5231. +import net.sf.l2j.gameserver.model.WorldRegion;
  5232.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5233.  import net.sf.l2j.gameserver.model.actor.stat.PlayableStat;
  5234.  import net.sf.l2j.gameserver.model.actor.status.PlayableStatus;
  5235. @@ -141,7 +141,7 @@
  5236.         // Notify L2Character AI
  5237.         getAI().notifyEvent(CtrlEvent.EVT_DEAD);
  5238.        
  5239. -       final L2WorldRegion region = getRegion();
  5240. +       final WorldRegion region = getRegion();
  5241.         if (region != null)
  5242.             region.onDeath(this);
  5243.        
  5244. @@ -181,7 +181,7 @@
  5245.         // Start broadcast status
  5246.         broadcastPacket(new Revive(this));
  5247.        
  5248. -       final L2WorldRegion region = getRegion();
  5249. +       final WorldRegion region = getRegion();
  5250.         if (region != null)
  5251.             region.onRevive(this);
  5252.     }
  5253. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Summon.java
  5254. ===================================================================
  5255. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Summon.java    (revision 2)
  5256. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Summon.java    (working copy)
  5257. @@ -33,7 +33,6 @@
  5258.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5259.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  5260.  import net.sf.l2j.gameserver.model.actor.instance.L2SummonInstance;
  5261. -import net.sf.l2j.gameserver.model.actor.knownlist.SummonKnownList;
  5262.  import net.sf.l2j.gameserver.model.actor.stat.SummonStat;
  5263.  import net.sf.l2j.gameserver.model.actor.status.SummonStatus;
  5264.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  5265. @@ -75,24 +74,9 @@
  5266.        
  5267.         _showSummonAnimation = true;
  5268.         _owner = owner;
  5269. -       _ai = new L2SummonAI(this);
  5270. -      
  5271. -       setXYZInvisible(owner.getX() + 50, owner.getY() + 100, owner.getZ() + 100);
  5272.     }
  5273.    
  5274.     @Override
  5275. -   public void initKnownList()
  5276. -   {
  5277. -       setKnownList(new SummonKnownList(this));
  5278. -   }
  5279. -  
  5280. -   @Override
  5281. -   public final SummonKnownList getKnownList()
  5282. -   {
  5283. -       return (SummonKnownList) super.getKnownList();
  5284. -   }
  5285. -  
  5286. -   @Override
  5287.     public void initCharStat()
  5288.     {
  5289.         setStat(new SummonStat(this));
  5290. @@ -145,7 +129,7 @@
  5291.     @Override
  5292.     public void updateAbnormalEffect()
  5293.     {
  5294. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  5295. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  5296.             player.sendPacket(new SummonInfo(this, player, 1));
  5297.     }
  5298.    
  5299. @@ -343,7 +327,6 @@
  5300.         owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
  5301.        
  5302.         decayMe();
  5303. -       getKnownList().removeAllKnownObjects();
  5304.         owner.setPet(null);
  5305.         super.deleteMe();
  5306.     }
  5307. @@ -371,7 +354,6 @@
  5308.            
  5309.             decayMe();
  5310.            
  5311. -           getKnownList().removeAllKnownObjects();
  5312.             setTarget(null);
  5313.            
  5314.             // Disable beastshots
  5315. @@ -796,17 +778,14 @@
  5316.         sendPacket(new PetStatusUpdate(this));
  5317.        
  5318.         if (isVisible())
  5319. -           broadcastNpcInfo(val);
  5320. -   }
  5321. -  
  5322. -   public void broadcastNpcInfo(int val)
  5323. -   {
  5324. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  5325.         {
  5326. -           if (player == getOwner())
  5327. -               continue;
  5328. -          
  5329. -           player.sendPacket(new SummonInfo(this, player, val));
  5330. +           for (L2PcInstance player : getKnownType(L2PcInstance.class))
  5331. +           {
  5332. +               if (player == getOwner())
  5333. +                   continue;
  5334. +              
  5335. +               player.sendPacket(new SummonInfo(this, player, val));
  5336. +           }
  5337.         }
  5338.     }
  5339.    
  5340. @@ -826,7 +805,7 @@
  5341.     @Override
  5342.     public void broadcastRelationsChanges()
  5343.     {
  5344. -       for (L2PcInstance player : getOwner().getKnownList().getKnownType(L2PcInstance.class))
  5345. +       for (L2PcInstance player : getOwner().getKnownType(L2PcInstance.class))
  5346.             player.sendPacket(new RelationChanged(this, getOwner().getRelation(player), isAutoAttackable(player)));
  5347.     }
  5348.    
  5349. @@ -834,7 +813,7 @@
  5350.     public void sendInfo(L2PcInstance activeChar)
  5351.     {
  5352.         // Check if the L2PcInstance is the owner of the Pet
  5353. -       if (activeChar.equals(getOwner()))
  5354. +       if (activeChar == getOwner())
  5355.         {
  5356.             activeChar.sendPacket(new PetInfo(this, 0));
  5357.            
  5358. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Vehicle.java
  5359. ===================================================================
  5360. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Vehicle.java   (revision 2)
  5361. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Vehicle.java   (working copy)
  5362. @@ -28,7 +28,6 @@
  5363.  import net.sf.l2j.gameserver.model.SpawnLocation;
  5364.  import net.sf.l2j.gameserver.model.VehiclePathPoint;
  5365.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5366. -import net.sf.l2j.gameserver.model.actor.knownlist.VehicleKnownList;
  5367.  import net.sf.l2j.gameserver.model.actor.stat.VehicleStat;
  5368.  import net.sf.l2j.gameserver.model.actor.template.CharTemplate;
  5369.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  5370. @@ -158,12 +157,6 @@
  5371.     }
  5372.    
  5373.     @Override
  5374. -   public void initKnownList()
  5375. -   {
  5376. -       setKnownList(new VehicleKnownList(this));
  5377. -   }
  5378. -  
  5379. -   @Override
  5380.     public VehicleStat getStat()
  5381.     {
  5382.         return (VehicleStat) super.getStat();
  5383. @@ -212,7 +205,7 @@
  5384.         if (player.isOnline())
  5385.             player.teleToLocation(loc.getX(), loc.getY(), loc.getZ(), 0);
  5386.         else
  5387. -           player.setXYZInvisible(loc.getX(), loc.getY(), loc.getZ()); // disconnects handling
  5388. +           player.setXYZInvisible(loc); // disconnects handling
  5389.     }
  5390.    
  5391.     public boolean addPassenger(L2PcInstance player)
  5392. @@ -264,7 +257,7 @@
  5393.      */
  5394.     public void payForRide(int itemId, int count, Location loc)
  5395.     {
  5396. -       for (L2PcInstance player : getKnownList().getKnownTypeInRadius(L2PcInstance.class, 1000))
  5397. +       for (L2PcInstance player : getKnownTypeInRadius(L2PcInstance.class, 1000))
  5398.         {
  5399.             if (player.isInBoat() && player.getBoat() == this)
  5400.             {
  5401. @@ -356,9 +349,6 @@
  5402.         // Decay the vehicle.
  5403.         decayMe();
  5404.        
  5405. -       // Remove from knownlist.
  5406. -       getKnownList().removeAllKnownObjects();
  5407. -      
  5408.         super.deleteMe();
  5409.     }
  5410.    
  5411. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PetStat.java
  5412. ===================================================================
  5413. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PetStat.java    (revision 2)
  5414. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PetStat.java    (working copy)
  5415. @@ -80,9 +80,7 @@
  5416.     {
  5417.         getActiveChar().setPetData(getActiveChar().getTemplate().getPetDataEntry(value));
  5418.        
  5419. -       getActiveChar().stopFeed();
  5420.         super.setLevel(value); // Set level.
  5421. -       getActiveChar().startFeed();
  5422.        
  5423.         // If a control item exists and its level is different of the new level.
  5424.         final ItemInstance controlItem = getActiveChar().getControlItem();
  5425. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/template/PcTemplate.java
  5426. ===================================================================
  5427. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/template/PcTemplate.java (revision 2)
  5428. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/template/PcTemplate.java (working copy)
  5429. @@ -18,15 +18,13 @@
  5430.  import java.util.List;
  5431.  
  5432.  import net.sf.l2j.gameserver.datatables.ItemTable;
  5433. +import net.sf.l2j.gameserver.model.Location;
  5434.  import net.sf.l2j.gameserver.model.base.ClassId;
  5435.  import net.sf.l2j.gameserver.model.base.ClassRace;
  5436.  import net.sf.l2j.gameserver.model.base.Sex;
  5437.  import net.sf.l2j.gameserver.model.item.kind.Item;
  5438.  import net.sf.l2j.gameserver.templates.StatsSet;
  5439.  
  5440. -/**
  5441. - * @author mkizub
  5442. - */
  5443.  public class PcTemplate extends CharTemplate
  5444.  {
  5445.     private final ClassId _classId;
  5446. @@ -38,9 +36,7 @@
  5447.     private final double _collisionRadiusFemale;
  5448.     private final double _collisionHeightFemale;
  5449.    
  5450. -   private final int _spawnX;
  5451. -   private final int _spawnY;
  5452. -   private final int _spawnZ;
  5453. +   private final Location _spawn;
  5454.    
  5455.     private final int _classBaseLevel;
  5456.    
  5457. @@ -63,9 +59,7 @@
  5458.         _collisionRadiusFemale = set.getDouble("radiusFemale");
  5459.         _collisionHeightFemale = set.getDouble("heightFemale");
  5460.        
  5461. -       _spawnX = set.getInteger("spawnX");
  5462. -       _spawnY = set.getInteger("spawnY");
  5463. -       _spawnZ = set.getInteger("spawnZ");
  5464. +       _spawn = new Location(set.getInteger("spawnX"), set.getInteger("spawnY"), set.getInteger("spawnZ"));
  5465.        
  5466.         _classBaseLevel = set.getInteger("baseLvl");
  5467.        
  5468. @@ -153,21 +147,11 @@
  5469.         return (sex == Sex.MALE) ? _collisionHeight : _collisionHeightFemale;
  5470.     }
  5471.    
  5472. -   public final int getSpawnX()
  5473. +   public final Location getSpawn()
  5474.     {
  5475. -       return _spawnX;
  5476. +       return _spawn;
  5477.     }
  5478.    
  5479. -   public final int getSpawnY()
  5480. -   {
  5481. -       return _spawnY;
  5482. -   }
  5483. -  
  5484. -   public final int getSpawnZ()
  5485. -   {
  5486. -       return _spawnZ;
  5487. -   }
  5488. -  
  5489.     public final int getClassBaseLevel()
  5490.     {
  5491.         return _classBaseLevel;
  5492. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/AggroInfo.java
  5493. ===================================================================
  5494. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/AggroInfo.java (revision 2)
  5495. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/AggroInfo.java (working copy)
  5496. @@ -48,7 +48,7 @@
  5497.    
  5498.     public int checkHate(L2Character owner)
  5499.     {
  5500. -       if (_attacker.isAlikeDead() || !_attacker.isVisible() || !owner.getKnownList().knowsObject(_attacker))
  5501. +       if (_attacker.isAlikeDead() || !_attacker.isVisible() || !owner.getKnownType(L2Character.class).contains(_attacker))
  5502.             _hate = 0;
  5503.        
  5504.         return _hate;
  5505. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/BlockList.java
  5506. ===================================================================
  5507. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/BlockList.java (revision 2)
  5508. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/BlockList.java (working copy)
  5509. @@ -184,7 +184,7 @@
  5510.         sm.addString(charName);
  5511.         listOwner.sendPacket(sm);
  5512.        
  5513. -       L2PcInstance player = L2World.getInstance().getPlayer(targetId);
  5514. +       L2PcInstance player = World.getInstance().getPlayer(targetId);
  5515.        
  5516.         if (player != null)
  5517.         {
  5518. @@ -249,7 +249,7 @@
  5519.      */
  5520.     public static boolean isInBlockList(int ownerId, int targetId)
  5521.     {
  5522. -       L2PcInstance player = L2World.getInstance().getPlayer(ownerId);
  5523. +       L2PcInstance player = World.getInstance().getPlayer(ownerId);
  5524.        
  5525.         if (player != null)
  5526.             return BlockList.isBlocked(player, targetId);
  5527. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/CharEffectList.java
  5528. ===================================================================
  5529. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/CharEffectList.java    (revision 2)
  5530. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/CharEffectList.java    (working copy)
  5531. @@ -288,6 +288,7 @@
  5532.                 switch (e.getSkill().getSkillType())
  5533.                 {
  5534.                     case BUFF:
  5535. +                   case COMBATPOINTHEAL:
  5536.                     case REFLECT:
  5537.                     case HEAL_PERCENT:
  5538.                     case MANAHEAL_PERCENT:
  5539. @@ -656,6 +657,12 @@
  5540.         // array modified, then rebuild on next request
  5541.         _rebuildCache = true;
  5542.        
  5543. +       if (isAffected(newEffect.getEffectFlags()) && !newEffect.onSameEffect(null))
  5544. +       {
  5545. +           newEffect.stopEffectTask();
  5546. +           return;
  5547. +       }
  5548. +      
  5549.         if (newSkill.isDebuff())
  5550.         {
  5551.             if (_debuffs == null)
  5552. @@ -704,6 +711,7 @@
  5553.                         case REFLECT:
  5554.                         case HEAL_PERCENT:
  5555.                         case MANAHEAL_PERCENT:
  5556. +                       case COMBATPOINTHEAL:
  5557.                             for (L2Effect e : _buffs)
  5558.                             {
  5559.                                 if (e == null)
  5560. @@ -715,6 +723,7 @@
  5561.                                     case REFLECT:
  5562.                                     case HEAL_PERCENT:
  5563.                                     case MANAHEAL_PERCENT:
  5564. +                                   case COMBATPOINTHEAL:
  5565.                                         e.exit();
  5566.                                         effectsToRemove--;
  5567.                                         break; // break switch()
  5568. @@ -1064,9 +1073,14 @@
  5569.      */
  5570.     public boolean isAffected(L2EffectFlag flag)
  5571.     {
  5572. -       return (_effectFlags & flag.getMask()) != 0;
  5573. +       return isAffected(flag.getMask());
  5574.     }
  5575.    
  5576. +   public boolean isAffected(int mask)
  5577. +   {
  5578. +       return (_effectFlags & mask) != 0;
  5579. +   }
  5580. +  
  5581.     /**
  5582.      * Clear and null all queues and lists Use only during delete character from the world.
  5583.      */
  5584. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/entity/Hero.java
  5585. ===================================================================
  5586. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/entity/Hero.java   (revision 2)
  5587. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/entity/Hero.java   (working copy)
  5588. @@ -41,7 +41,7 @@
  5589.  import net.sf.l2j.gameserver.datatables.NpcTable;
  5590.  import net.sf.l2j.gameserver.instancemanager.CastleManager;
  5591.  import net.sf.l2j.gameserver.model.L2Clan;
  5592. -import net.sf.l2j.gameserver.model.L2World;
  5593. +import net.sf.l2j.gameserver.model.World;
  5594.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5595.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  5596.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  5597. @@ -595,7 +595,7 @@
  5598.             {
  5599.                 String name = hero.getString(Olympiad.CHAR_NAME);
  5600.                
  5601. -               L2PcInstance player = L2World.getInstance().getPlayer(name);
  5602. +               L2PcInstance player = World.getInstance().getPlayer(name);
  5603.                 if (player == null)
  5604.                     continue;
  5605.                
  5606. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java
  5607. ===================================================================
  5608. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java    (revision 2)
  5609. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java    (working copy)
  5610. @@ -35,8 +35,6 @@
  5611.  import net.sf.l2j.gameserver.instancemanager.MercTicketManager;
  5612.  import net.sf.l2j.gameserver.model.L2Augmentation;
  5613.  import net.sf.l2j.gameserver.model.L2Object;
  5614. -import net.sf.l2j.gameserver.model.L2World;
  5615. -import net.sf.l2j.gameserver.model.L2WorldRegion;
  5616.  import net.sf.l2j.gameserver.model.Location;
  5617.  import net.sf.l2j.gameserver.model.ShotType;
  5618.  import net.sf.l2j.gameserver.model.actor.L2Character;
  5619. @@ -921,7 +919,7 @@
  5620.     /**
  5621.      * Init a dropped ItemInstance and add it in the world as a visible object.<BR>
  5622.      * <BR>
  5623. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T ADD the object to _allObjects of L2World </B></FONT><BR>
  5624. +    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T ADD the object to _objects of World </B></FONT><BR>
  5625.      * <BR>
  5626.      * @param dropper : the character who dropped the item.
  5627.      * @param x : X location of the item.
  5628. @@ -961,20 +959,9 @@
  5629.                 _z = dropDest.getZ();
  5630.             }
  5631.            
  5632. -           synchronized (_itm)
  5633. -           {
  5634. -               // Set the x,y,z position of the ItemInstance dropped and update its _worldregion
  5635. -               _itm.setIsVisible(true);
  5636. -               _itm.getPosition().set(_x, _y, _z);
  5637. -               _itm.setRegion(L2World.getInstance().getRegion(getPosition()));
  5638. -           }
  5639. -          
  5640. -           _itm.getRegion().addVisibleObject(_itm);
  5641.             _itm.setDropperObjectId(_dropper != null ? _dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
  5642. +           _itm.spawnMe(_x, _y, _z);
  5643.            
  5644. -           // Add the ItemInstance dropped in the world as a visible object
  5645. -           L2World.getInstance().addVisibleObject(_itm, _itm.getRegion());
  5646. -          
  5647.             ItemsOnGroundTaskManager.getInstance().add(_itm, _dropper);
  5648.            
  5649.             _itm.setDropperObjectId(0); // Set the dropper Id back to 0 so it no longer shows the drop packet
  5650. @@ -982,46 +969,32 @@
  5651.     }
  5652.    
  5653.     /**
  5654. -    * Remove a ItemInstance from the world and send server->client GetItem packets.<BR>
  5655. +    * Remove a ItemInstance from the visible world and send server->client GetItem packets.<BR>
  5656.      * <BR>
  5657. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR>
  5658. +    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _objects of World.</B></FONT><BR>
  5659.      * <BR>
  5660.      * @param player Player that pick up the item
  5661.      */
  5662.     public final void pickupMe(L2Character player)
  5663.     {
  5664. -       assert getRegion() != null;
  5665. -      
  5666. -       L2WorldRegion oldregion = getRegion();
  5667. -      
  5668. -       // Create a server->client GetItem packet to pick up the ItemInstance
  5669.         player.broadcastPacket(new GetItem(this, player.getObjectId()));
  5670.        
  5671. -       synchronized (this)
  5672. -       {
  5673. -           setIsVisible(false);
  5674. -           setRegion(null);
  5675. -       }
  5676. -      
  5677. -       // if this item is a mercenary ticket, remove the spawns!
  5678. -       int itemId = getItemId();
  5679. -      
  5680. -       if (MercTicketManager.getTicketCastleId(itemId) > 0)
  5681. +       if (MercTicketManager.getTicketCastleId(_itemId) > 0)
  5682.             MercTicketManager.getInstance().removeTicket(this);
  5683.        
  5684. -       if (!Config.DISABLE_TUTORIAL && (itemId == 57 || itemId == 6353))
  5685. +       if (!Config.DISABLE_TUTORIAL && (_itemId == 57 || _itemId == 6353))
  5686.         {
  5687.             L2PcInstance actor = player.getActingPlayer();
  5688.             if (actor != null)
  5689.             {
  5690.                 QuestState qs = actor.getQuestState("Tutorial");
  5691.                 if (qs != null)
  5692. -                   qs.getQuest().notifyEvent("CE" + itemId + "", null, actor);
  5693. +                   qs.getQuest().notifyEvent("CE" + _itemId + "", null, actor);
  5694.             }
  5695.         }
  5696.        
  5697. -       // Remove the ItemInstance from the world (out of synchro, to avoid deadlocks)
  5698. -       L2World.getInstance().removeVisibleObject(this, oldregion);
  5699. +       // Calls directly setRegion(null), we don't have to care about.
  5700. +       setIsVisible(false);
  5701.     }
  5702.    
  5703.     /**
  5704. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/item/kind/Weapon.java
  5705. ===================================================================
  5706. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/item/kind/Weapon.java  (revision 2)
  5707. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/item/kind/Weapon.java  (working copy)
  5708. @@ -373,7 +373,7 @@
  5709.         if (caster instanceof L2PcInstance)
  5710.         {
  5711.             // Mobs in range 1000 see spell
  5712. -           for (L2Npc npcMob : caster.getKnownList().getKnownTypeInRadius(L2Npc.class, 1000))
  5713. +           for (L2Npc npcMob : caster.getKnownTypeInRadius(L2Npc.class, 1000))
  5714.             {
  5715.                 List<Quest> quests = npcMob.getTemplate().getEventQuests(EventType.ON_SKILL_SEE);
  5716.                 if (quests != null)
  5717. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/Inventory.java
  5718. ===================================================================
  5719. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/Inventory.java   (revision 2)
  5720. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/Inventory.java   (working copy)
  5721. @@ -25,7 +25,7 @@
  5722.  import net.sf.l2j.L2DatabaseFactory;
  5723.  import net.sf.l2j.gameserver.datatables.ItemTable;
  5724.  import net.sf.l2j.gameserver.model.L2Object;
  5725. -import net.sf.l2j.gameserver.model.L2World;
  5726. +import net.sf.l2j.gameserver.model.World;
  5727.  import net.sf.l2j.gameserver.model.actor.L2Playable;
  5728.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5729.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  5730. @@ -956,7 +956,7 @@
  5731.                         item.setLocation(ItemLocation.INVENTORY);
  5732.                 }
  5733.                
  5734. -               L2World.getInstance().addObject(item);
  5735. +               World.getInstance().addObject(item);
  5736.                
  5737.                 // If stackable item is found in inventory just add to current quantity
  5738.                 if (item.isStackable() && getItemByItemId(item.getItemId()) != null)
  5739. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/ItemContainer.java
  5740. ===================================================================
  5741. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/ItemContainer.java   (revision 2)
  5742. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/ItemContainer.java   (working copy)
  5743. @@ -29,7 +29,7 @@
  5744.  import net.sf.l2j.L2DatabaseFactory;
  5745.  import net.sf.l2j.gameserver.datatables.ItemTable;
  5746.  import net.sf.l2j.gameserver.model.L2Object;
  5747. -import net.sf.l2j.gameserver.model.L2World;
  5748. +import net.sf.l2j.gameserver.model.World;
  5749.  import net.sf.l2j.gameserver.model.actor.L2Character;
  5750.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5751.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  5752. @@ -509,7 +509,7 @@
  5753.             for (ItemInstance item : _items)
  5754.             {
  5755.                 item.updateDatabase();
  5756. -               L2World.getInstance().removeObject(item);
  5757. +               World.getInstance().removeObject(item);
  5758.             }
  5759.         }
  5760.         _items.clear();
  5761. @@ -545,7 +545,7 @@
  5762.                 if (item == null)
  5763.                     continue;
  5764.                
  5765. -               L2World.getInstance().addObject(item);
  5766. +               World.getInstance().addObject(item);
  5767.                
  5768.                 L2PcInstance owner = (getOwner() == null) ? null : getOwner().getActingPlayer();
  5769.                
  5770. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/PetInventory.java
  5771. ===================================================================
  5772. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/PetInventory.java    (revision 2)
  5773. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/PetInventory.java    (working copy)
  5774. @@ -14,12 +14,12 @@
  5775.   */
  5776.  package net.sf.l2j.gameserver.model.itemcontainer;
  5777.  
  5778. -import net.sf.l2j.gameserver.datatables.ItemTable;
  5779. +import net.sf.l2j.commons.random.Rnd;
  5780. +
  5781.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5782.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  5783.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  5784.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance.ItemLocation;
  5785. -import net.sf.l2j.gameserver.model.item.kind.Item;
  5786.  import net.sf.l2j.gameserver.model.item.type.EtcItemType;
  5787.  
  5788.  public class PetInventory extends Inventory
  5789. @@ -61,6 +61,7 @@
  5790.     {
  5791.         super.refreshWeight();
  5792.         getOwner().updateAndBroadcastStatus(1);
  5793. +       getOwner().sendPetInfosToOwner();
  5794.     }
  5795.    
  5796.     public boolean validateCapacity(ItemInstance item)
  5797. @@ -79,16 +80,9 @@
  5798.         return (_items.size() + slots <= _owner.getInventoryLimit());
  5799.     }
  5800.    
  5801. -   public boolean validateWeight(ItemInstance item, long count)
  5802. +   public boolean validateWeight(ItemInstance item, int count)
  5803.     {
  5804. -       int weight = 0;
  5805. -      
  5806. -       Item template = ItemTable.getInstance().getTemplate(item.getItemId());
  5807. -       if (template == null)
  5808. -           return false;
  5809. -      
  5810. -       weight += count * template.getWeight();
  5811. -       return validateWeight(weight);
  5812. +       return validateWeight(count * item.getItem().getWeight());
  5813.     }
  5814.    
  5815.     @Override
  5816. @@ -110,29 +104,22 @@
  5817.     }
  5818.    
  5819.     @Override
  5820. -   public void restore()
  5821. -   {
  5822. -       super.restore();
  5823. -      
  5824. -       // check for equipped items from other pets
  5825. -       for (ItemInstance item : _items)
  5826. -       {
  5827. -           if (item.isEquipped())
  5828. -           {
  5829. -               if (!item.getItem().checkCondition(getOwner(), getOwner(), false))
  5830. -                   unEquipItemInSlot(item.getLocationSlot());
  5831. -           }
  5832. -       }
  5833. -   }
  5834. -  
  5835. -   @Override
  5836.     public void deleteMe()
  5837.     {
  5838.         final L2PcInstance petOwner = getOwner().getOwner();
  5839.         if (petOwner != null)
  5840.         {
  5841.             for (ItemInstance item : _items)
  5842. -               getOwner().transferItem("return", item.getObjectId(), item.getCount(), petOwner.getInventory(), petOwner, getOwner());
  5843. +           {
  5844. +               if (petOwner.getInventory().validateCapacity(1))
  5845. +                   getOwner().transferItem("return", item.getObjectId(), item.getCount(), petOwner.getInventory(), petOwner, getOwner());
  5846. +               else
  5847. +               {
  5848. +                   final ItemInstance droppedItem = dropItem("drop", item.getObjectId(), item.getCount(), petOwner, getOwner());
  5849. +                   droppedItem.dropMe(getOwner(), getOwner().getX() + Rnd.get(-70, 70), getOwner().getY() + Rnd.get(-70, 70), getOwner().getZ() + 30);
  5850. +               }
  5851. +              
  5852. +           }
  5853.         }
  5854.         _items.clear();
  5855.     }
  5856. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Effect.java
  5857. ===================================================================
  5858. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Effect.java  (revision 2)
  5859. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Effect.java  (working copy)
  5860. @@ -542,4 +542,9 @@
  5861.     {
  5862.         return false;
  5863.     }
  5864. +  
  5865. +   public boolean onSameEffect(L2Effect effect)
  5866. +   {
  5867. +       return true;
  5868. +   }
  5869.  }
  5870. \ No newline at end of file
  5871. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Object.java
  5872. ===================================================================
  5873. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Object.java  (revision 2)
  5874. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Object.java  (working copy)
  5875. @@ -14,18 +14,23 @@
  5876.   */
  5877.  package net.sf.l2j.gameserver.model;
  5878.  
  5879. +import java.util.ArrayList;
  5880. +import java.util.Collections;
  5881. +import java.util.List;
  5882.  import java.util.logging.Logger;
  5883.  
  5884. +import net.sf.l2j.commons.math.MathUtil;
  5885. +
  5886.  import net.sf.l2j.gameserver.datatables.ItemTable;
  5887.  import net.sf.l2j.gameserver.datatables.NpcTable;
  5888.  import net.sf.l2j.gameserver.idfactory.IdFactory;
  5889.  import net.sf.l2j.gameserver.model.actor.L2Character;
  5890.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  5891.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5892. -import net.sf.l2j.gameserver.model.actor.knownlist.ObjectKnownList;
  5893.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  5894.  import net.sf.l2j.gameserver.model.zone.ZoneId;
  5895.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  5896. +import net.sf.l2j.gameserver.util.Util;
  5897.  
  5898.  /**
  5899.   * Mother class of all interactive objects in the world (PC, NPC, Item...)
  5900. @@ -49,15 +54,13 @@
  5901.     private int _polyId;
  5902.    
  5903.     private SpawnLocation _position = new SpawnLocation(0, 0, 0, 0);
  5904. -   private L2WorldRegion _region;
  5905. +   private WorldRegion _region;
  5906.    
  5907.     private boolean _isVisible;
  5908.    
  5909.     public L2Object(int objectId)
  5910.     {
  5911.         _objectId = objectId;
  5912. -      
  5913. -       setRegion(L2World.getInstance().getRegion(_position));
  5914.     }
  5915.    
  5916.     public void onAction(L2PcInstance player)
  5917. @@ -84,24 +87,14 @@
  5918.      */
  5919.     public void decayMe()
  5920.     {
  5921. -       assert _region != null;
  5922. +       setRegion(null);
  5923.        
  5924. -       final L2WorldRegion region = _region;
  5925. -      
  5926. -       synchronized (this)
  5927. -       {
  5928. -           _isVisible = false;
  5929. -           setRegion(null);
  5930. -       }
  5931. -      
  5932. -       // Out of synchronized to avoid deadlocks
  5933. -       L2World.getInstance().removeVisibleObject(this, region);
  5934. -       L2World.getInstance().removeObject(this);
  5935. +       World.getInstance().removeObject(this);
  5936.     }
  5937.    
  5938.     public void refreshID()
  5939.     {
  5940. -       L2World.getInstance().removeObject(this);
  5941. +       World.getInstance().removeObject(this);
  5942.         IdFactory.getInstance().releaseId(getObjectId());
  5943.         _objectId = IdFactory.getInstance().getNextId();
  5944.     }
  5945. @@ -111,69 +104,22 @@
  5946.      */
  5947.     public final void spawnMe()
  5948.     {
  5949. -       assert _region == null;
  5950. +       _isVisible = true;
  5951.        
  5952. -       synchronized (this)
  5953. -       {
  5954. -           // Set the x,y,z position of the L2Object spawn and update its _worldregion
  5955. -           _isVisible = true;
  5956. -           setRegion(L2World.getInstance().getRegion(_position));
  5957. -       }
  5958. +       setRegion(World.getInstance().getRegion(_position));
  5959.        
  5960. -       // Add the L2Object spawn in the _allobjects of L2World
  5961. -       L2World.getInstance().addObject(this);
  5962. +       World.getInstance().addObject(this);
  5963.        
  5964. -       // Add the L2Object spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion
  5965. -       _region.addVisibleObject(this);
  5966. -      
  5967. -       // Add the L2Object spawn in the world as a visible object -- out of synchronized to avoid deadlocks
  5968. -       L2World.getInstance().addVisibleObject(this, _region);
  5969. -      
  5970.         onSpawn();
  5971.     }
  5972.    
  5973.     public final void spawnMe(int x, int y, int z)
  5974.     {
  5975. -       assert _region == null;
  5976. +       _position.set(MathUtil.limit(x, World.WORLD_X_MIN + 100, World.WORLD_X_MAX - 100), MathUtil.limit(y, World.WORLD_Y_MIN + 100, World.WORLD_Y_MAX - 100), z);
  5977.        
  5978. -       synchronized (this)
  5979. -       {
  5980. -           // Set the x,y,z position of the L2Object spawn and update its _worldregion
  5981. -           _isVisible = true;
  5982. -          
  5983. -           if (x > L2World.WORLD_X_MAX)
  5984. -               x = L2World.WORLD_X_MAX - 5000;
  5985. -           if (x < L2World.WORLD_X_MIN)
  5986. -               x = L2World.WORLD_X_MIN + 5000;
  5987. -           if (y > L2World.WORLD_Y_MAX)
  5988. -               y = L2World.WORLD_Y_MAX - 5000;
  5989. -           if (y < L2World.WORLD_Y_MIN)
  5990. -               y = L2World.WORLD_Y_MIN + 5000;
  5991. -          
  5992. -           _position.set(x, y, z);
  5993. -           setRegion(L2World.getInstance().getRegion(_position));
  5994. -       }
  5995. -      
  5996. -       // Add the L2Object spawn in the _allobjects of L2World
  5997. -       L2World.getInstance().addObject(this);
  5998. -      
  5999. -       // Add the L2Object spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion
  6000. -       _region.addVisibleObject(this);
  6001. -      
  6002. -       // Add the L2Object spawn in the world as a visible object
  6003. -       L2World.getInstance().addVisibleObject(this, _region);
  6004. -      
  6005. -       onSpawn();
  6006. +       spawnMe();
  6007.     }
  6008.    
  6009. -   public void toggleVisible()
  6010. -   {
  6011. -       if (isVisible())
  6012. -           decayMe();
  6013. -       else
  6014. -           spawnMe();
  6015. -   }
  6016. -  
  6017.     public boolean isAttackable()
  6018.     {
  6019.         return false;
  6020. @@ -202,11 +148,6 @@
  6021.             setRegion(null);
  6022.     }
  6023.    
  6024. -   public ObjectKnownList getKnownList()
  6025. -   {
  6026. -       return null;
  6027. -   }
  6028. -  
  6029.     public final String getName()
  6030.     {
  6031.         return _name;
  6032. @@ -343,41 +284,17 @@
  6033.      */
  6034.     public final void setXYZ(int x, int y, int z)
  6035.     {
  6036. -       assert _region != null;
  6037. -      
  6038.         _position.set(x, y, z);
  6039.        
  6040. -       try
  6041. -       {
  6042. -           if (!isVisible())
  6043. -               return;
  6044. -          
  6045. -           final L2WorldRegion region = L2World.getInstance().getRegion(_position);
  6046. -           if (region != _region)
  6047. -           {
  6048. -               _region.removeVisibleObject(this);
  6049. -              
  6050. -               setRegion(region);
  6051. -              
  6052. -               // Add the L2Oject spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion
  6053. -               _region.addVisibleObject(this);
  6054. -           }
  6055. -       }
  6056. -       catch (Exception e)
  6057. -       {
  6058. -           _log.warning("Object Id at bad coords: (x: " + getX() + ", y: " + getY() + ", z: " + getZ() + ").");
  6059. -           badCoords();
  6060. -       }
  6061. +       if (!isVisible())
  6062. +           return;
  6063. +      
  6064. +       final WorldRegion region = World.getInstance().getRegion(_position);
  6065. +       if (region != _region)
  6066. +           setRegion(region);
  6067.     }
  6068.    
  6069.     /**
  6070. -    * Called on setXYZ exception.
  6071. -    */
  6072. -   protected void badCoords()
  6073. -   {
  6074. -   }
  6075. -  
  6076. -   /**
  6077.      * Set the x,y,z position of the L2Object and make it invisible. A L2Object is invisble if <B>_hidden</B>=true or <B>_worldregion</B>==null
  6078.      * @param x
  6079.      * @param y
  6080. @@ -385,48 +302,28 @@
  6081.      */
  6082.     public final void setXYZInvisible(int x, int y, int z)
  6083.     {
  6084. -       assert _region == null;
  6085. +       _position.set(MathUtil.limit(x, World.WORLD_X_MIN + 100, World.WORLD_X_MAX - 100), MathUtil.limit(y, World.WORLD_Y_MIN + 100, World.WORLD_Y_MAX - 100), z);
  6086.        
  6087. -       if (x > L2World.WORLD_X_MAX)
  6088. -           x = L2World.WORLD_X_MAX - 5000;
  6089. -       if (x < L2World.WORLD_X_MIN)
  6090. -           x = L2World.WORLD_X_MIN + 5000;
  6091. -       if (y > L2World.WORLD_Y_MAX)
  6092. -           y = L2World.WORLD_Y_MAX - 5000;
  6093. -       if (y < L2World.WORLD_Y_MIN)
  6094. -           y = L2World.WORLD_Y_MIN + 5000;
  6095. -      
  6096. -       _position.set(x, y, z);
  6097.         setIsVisible(false);
  6098.     }
  6099.    
  6100. -   /**
  6101. -    * @return the x position of the L2Object.
  6102. -    */
  6103. +   public final void setXYZInvisible(Location loc)
  6104. +   {
  6105. +       setXYZInvisible(loc.getX(), loc.getY(), loc.getZ());
  6106. +   }
  6107. +  
  6108.     public final int getX()
  6109.     {
  6110. -       assert _region != null || _isVisible;
  6111. -      
  6112.         return _position.getX();
  6113.     }
  6114.    
  6115. -   /**
  6116. -    * @return the y position of the L2Object.
  6117. -    */
  6118.     public final int getY()
  6119.     {
  6120. -       assert _region != null || _isVisible;
  6121. -      
  6122.         return _position.getY();
  6123.     }
  6124.    
  6125. -   /**
  6126. -    * @return the z position of the L2Object.
  6127. -    */
  6128.     public final int getZ()
  6129.     {
  6130. -       assert _region != null || _isVisible;
  6131. -      
  6132.         return _position.getZ();
  6133.     }
  6134.    
  6135. @@ -435,13 +332,150 @@
  6136.         return _position;
  6137.     }
  6138.    
  6139. -   public final L2WorldRegion getRegion()
  6140. +   public final WorldRegion getRegion()
  6141.     {
  6142.         return _region;
  6143.     }
  6144.    
  6145. -   public void setRegion(L2WorldRegion value)
  6146. +   /**
  6147. +    * Update current and surrounding regions, based on both current region and region setted as parameter.
  6148. +    * @param newRegion : null to remove the object, or the new region.
  6149. +    */
  6150. +   public void setRegion(WorldRegion newRegion)
  6151.     {
  6152. -       _region = value;
  6153. +       List<WorldRegion> oldAreas = Collections.emptyList();
  6154. +      
  6155. +       if (_region != null)
  6156. +       {
  6157. +           _region.removeVisibleObject(this);
  6158. +           oldAreas = _region.getSurroundingRegions();
  6159. +       }
  6160. +      
  6161. +       List<WorldRegion> newAreas = Collections.emptyList();
  6162. +      
  6163. +       if (newRegion != null)
  6164. +       {
  6165. +           newRegion.addVisibleObject(this);
  6166. +           newAreas = newRegion.getSurroundingRegions();
  6167. +       }
  6168. +      
  6169. +       // For every old surrounding area NOT SHARED with new surrounding areas.
  6170. +       for (WorldRegion region : oldAreas)
  6171. +       {
  6172. +           if (!newAreas.contains(region))
  6173. +           {
  6174. +               // Update all objects.
  6175. +               for (L2Object obj : region.getObjects())
  6176. +               {
  6177. +                   if (obj == this)
  6178. +                       continue;
  6179. +                  
  6180. +                   obj.removeKnownObject(this);
  6181. +                   removeKnownObject(obj);
  6182. +               }
  6183. +              
  6184. +               // Desactivate the old neighbor region.
  6185. +               if (this instanceof L2PcInstance && region.isEmptyNeighborhood())
  6186. +                   region.setActive(false);
  6187. +           }
  6188. +       }
  6189. +      
  6190. +       // For every new surrounding area NOT SHARED with old surrounding areas.
  6191. +       for (WorldRegion region : newAreas)
  6192. +       {
  6193. +           if (!oldAreas.contains(region))
  6194. +           {
  6195. +               // Update all objects.
  6196. +               for (L2Object obj : region.getObjects())
  6197. +               {
  6198. +                   if (obj == this)
  6199. +                       continue;
  6200. +                  
  6201. +                   obj.addKnownObject(this);
  6202. +                   addKnownObject(obj);
  6203. +               }
  6204. +              
  6205. +               // Activate the new neighbor region.
  6206. +               if (this instanceof L2PcInstance)
  6207. +                   region.setActive(true);
  6208. +           }
  6209. +       }
  6210. +      
  6211. +       _region = newRegion;
  6212.     }
  6213. +  
  6214. +   /**
  6215. +    * Add object to known list.
  6216. +    * @param object : {@link L2Object} to be added.
  6217. +    */
  6218. +   public void addKnownObject(L2Object object)
  6219. +   {
  6220. +   }
  6221. +  
  6222. +   /**
  6223. +    * Remove object from known list.
  6224. +    * @param object : {@link L2Object} to be removed.
  6225. +    */
  6226. +   public void removeKnownObject(L2Object object)
  6227. +   {
  6228. +   }
  6229. +  
  6230. +   /**
  6231. +    * Return the known list of given object type.
  6232. +    * @param <A> : Object type must be instance of {@link L2Object}.
  6233. +    * @param type : Class specifying object type.
  6234. +    * @return List<A> : Known list of given object type.
  6235. +    */
  6236. +   @SuppressWarnings("unchecked")
  6237. +   public final <A> List<A> getKnownType(Class<A> type)
  6238. +   {
  6239. +       final WorldRegion region = _region;
  6240. +       if (region == null)
  6241. +           return Collections.emptyList();
  6242. +      
  6243. +       final List<A> result = new ArrayList<>();
  6244. +      
  6245. +       for (WorldRegion reg : region.getSurroundingRegions())
  6246. +       {
  6247. +           for (L2Object obj : reg.getObjects())
  6248. +           {
  6249. +               if (obj == this || !type.isAssignableFrom(obj.getClass()))
  6250. +                   continue;
  6251. +              
  6252. +               result.add((A) obj);
  6253. +           }
  6254. +       }
  6255. +      
  6256. +       return result;
  6257. +   }
  6258. +  
  6259. +   /**
  6260. +    * Return the known list of given object type within specified radius.
  6261. +    * @param <A> : Object type must be instance of {@link L2Object}.
  6262. +    * @param type : Class specifying object type.
  6263. +    * @param radius : Radius to in which object must be located.
  6264. +    * @return List<A> : Known list of given object type.
  6265. +    */
  6266. +   @SuppressWarnings("unchecked")
  6267. +   public final <A> List<A> getKnownTypeInRadius(Class<A> type, int radius)
  6268. +   {
  6269. +       final WorldRegion region = _region;
  6270. +       if (region == null)
  6271. +           return Collections.emptyList();
  6272. +      
  6273. +       final List<A> result = new ArrayList<>();
  6274. +      
  6275. +       for (WorldRegion reg : region.getSurroundingRegions())
  6276. +       {
  6277. +           for (L2Object obj : reg.getObjects())
  6278. +           {
  6279. +               if (obj == this || !type.isAssignableFrom(obj.getClass()) || !Util.checkIfInRange(radius, this, obj, true))
  6280. +                   continue;
  6281. +              
  6282. +               result.add((A) obj);
  6283. +           }
  6284. +       }
  6285. +      
  6286. +       return result;
  6287. +   }
  6288.  }
  6289. \ No newline at end of file
  6290. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Party.java
  6291. ===================================================================
  6292. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Party.java   (revision 2)
  6293. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Party.java   (working copy)
  6294. @@ -402,7 +402,7 @@
  6295.         if (player.getFusionSkill() != null)
  6296.             player.abortCast();
  6297.        
  6298. -       for (L2Character character : player.getKnownList().getKnownType(L2Character.class))
  6299. +       for (L2Character character : player.getKnownType(L2Character.class))
  6300.             if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == player)
  6301.                 character.abortCast();
  6302.        
  6303. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java
  6304. ===================================================================
  6305. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java   (revision 2)
  6306. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java   (working copy)
  6307. @@ -1390,7 +1390,7 @@
  6308.                     final L2PcInstance sourcePlayer = activeChar.getActingPlayer();
  6309.                    
  6310.                     targetList.add(activeChar);
  6311. -                   for (L2Character obj : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, _skillRadius))
  6312. +                   for (L2Character obj : activeChar.getKnownTypeInRadius(L2Character.class, _skillRadius))
  6313.                     {
  6314.                         if (!(obj == activeChar || obj == sourcePlayer || obj instanceof L2Npc || obj instanceof L2Attackable))
  6315.                             continue;
  6316. @@ -1402,7 +1402,7 @@
  6317.                 {
  6318.                     final boolean srcInArena = activeChar.isInArena();
  6319.                    
  6320. -                   for (L2Character obj : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, _skillRadius))
  6321. +                   for (L2Character obj : activeChar.getKnownTypeInRadius(L2Character.class, _skillRadius))
  6322.                     {
  6323.                         if (obj instanceof L2Attackable || obj instanceof L2Playable)
  6324.                         {
  6325. @@ -1448,7 +1448,7 @@
  6326.                 final boolean srcInArena = activeChar.isInArena();
  6327.                 List<L2Character> targetList = new ArrayList<>();
  6328.                
  6329. -               for (L2Character obj : target.getKnownList().getKnownType(L2Character.class))
  6330. +               for (L2Character obj : target.getKnownType(L2Character.class))
  6331.                 {
  6332.                     if (obj == null || obj == target || obj == activeChar)
  6333.                         continue;
  6334. @@ -1501,7 +1501,7 @@
  6335.                 else
  6336.                     origin = activeChar;
  6337.                
  6338. -               for (L2Character obj : activeChar.getKnownList().getKnownType(L2Character.class))
  6339. +               for (L2Character obj : activeChar.getKnownType(L2Character.class))
  6340.                 {
  6341.                     if (!(obj instanceof L2Attackable || obj instanceof L2Playable))
  6342.                         continue;
  6343. @@ -1657,7 +1657,7 @@
  6344.                
  6345.                 if (player.getClan() != null)
  6346.                 {
  6347. -                   for (L2PcInstance obj : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  6348. +                   for (L2PcInstance obj : activeChar.getKnownTypeInRadius(L2PcInstance.class, radius))
  6349.                     {
  6350.                         if ((obj.getAllyId() == 0 || obj.getAllyId() != player.getAllyId()) && (obj.getClan() == null || obj.getClanId() != player.getClanId()))
  6351.                             continue;
  6352. @@ -1703,7 +1703,7 @@
  6353.                
  6354.                 if (player.getClan() != null)
  6355.                 {
  6356. -                   for (L2PcInstance obj : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  6357. +                   for (L2PcInstance obj : activeChar.getKnownTypeInRadius(L2PcInstance.class, radius))
  6358.                     {
  6359.                         if (!obj.isDead())
  6360.                             continue;
  6361. @@ -1786,7 +1786,7 @@
  6362.                 else if (activeChar instanceof L2Npc)
  6363.                 {
  6364.                     targetList.add(activeChar);
  6365. -                   for (L2Npc newTarget : activeChar.getKnownList().getKnownTypeInRadius(L2Npc.class, _castRange))
  6366. +                   for (L2Npc newTarget : activeChar.getKnownTypeInRadius(L2Npc.class, _castRange))
  6367.                     {
  6368.                         if (newTarget.isDead() || !ArraysUtil.contains(((L2Npc) activeChar).getTemplate().getClans(), newTarget.getTemplate().getClans()))
  6369.                             continue;
  6370. @@ -1912,7 +1912,7 @@
  6371.                
  6372.                 final boolean srcInArena = activeChar.isInArena();
  6373.                
  6374. -               for (L2Character obj : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, _skillRadius))
  6375. +               for (L2Character obj : activeChar.getKnownTypeInRadius(L2Character.class, _skillRadius))
  6376.                 {
  6377.                     if (!(obj instanceof L2Attackable || obj instanceof L2Playable))
  6378.                         continue;
  6379. @@ -1962,7 +1962,7 @@
  6380.             {
  6381.                 List<L2Character> targetList = new ArrayList<>();
  6382.                
  6383. -               for (L2Character obj : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, _skillRadius))
  6384. +               for (L2Character obj : activeChar.getKnownTypeInRadius(L2Character.class, _skillRadius))
  6385.                 {
  6386.                     if (obj instanceof L2Npc || obj instanceof L2SummonInstance)
  6387.                         target = obj;
  6388. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/AbstractOlympiadGame.java
  6389. ===================================================================
  6390. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/AbstractOlympiadGame.java (revision 2)
  6391. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/AbstractOlympiadGame.java (working copy)
  6392. @@ -242,10 +242,10 @@
  6393.     }
  6394.    
  6395.     /**
  6396. -    * Buff and heal the player. WW2 for fighter/mage + haste 1 if fighter.
  6397. +    * Buff the player. WW2 for fighter/mage + haste 1 if fighter.
  6398.      * @param player : the happy benefactor.
  6399.      */
  6400. -   protected static final void buffAndHealPlayer(L2PcInstance player)
  6401. +   protected static final void buffPlayer(L2PcInstance player)
  6402.     {
  6403.         L2Skill skill = SkillTable.getInstance().getInfo(1204, 2); // Windwalk 2
  6404.         if (skill != null)
  6405. @@ -263,8 +263,14 @@
  6406.                 player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(1086));
  6407.             }
  6408.         }
  6409. -      
  6410. -       // Heal Player fully
  6411. +   }
  6412. +  
  6413. +   /**
  6414. +    * Heal the player.
  6415. +    * @param player : the happy benefactor.
  6416. +    */
  6417. +   protected static final void healPlayer(L2PcInstance player)
  6418. +   {
  6419.         player.setCurrentCp(player.getMaxCp());
  6420.         player.setCurrentHp(player.getMaxHp());
  6421.         player.setCurrentMp(player.getMaxMp());
  6422. @@ -405,8 +411,10 @@
  6423.    
  6424.     protected abstract void removals();
  6425.    
  6426. -   protected abstract void buffAndHealPlayers();
  6427. +   protected abstract void buffPlayers();
  6428.    
  6429. +   protected abstract void healPlayers();
  6430. +  
  6431.     protected abstract boolean portPlayersToArena(List<Location> spawns);
  6432.    
  6433.     protected abstract void cleanEffects();
  6434. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java
  6435. ===================================================================
  6436. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java   (revision 2)
  6437. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java   (working copy)
  6438. @@ -24,8 +24,8 @@
  6439.  
  6440.  import net.sf.l2j.Config;
  6441.  import net.sf.l2j.L2DatabaseFactory;
  6442. -import net.sf.l2j.gameserver.model.L2World;
  6443.  import net.sf.l2j.gameserver.model.Location;
  6444. +import net.sf.l2j.gameserver.model.World;
  6445.  import net.sf.l2j.gameserver.model.actor.L2Character;
  6446.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  6447.  import net.sf.l2j.gameserver.model.zone.type.L2OlympiadStadiumZone;
  6448. @@ -68,11 +68,11 @@
  6449.         while (list.size() > 1)
  6450.         {
  6451.             playerOneObjectId = list.remove(Rnd.get(list.size()));
  6452. -           playerOne = L2World.getInstance().getPlayer(playerOneObjectId);
  6453. +           playerOne = World.getInstance().getPlayer(playerOneObjectId);
  6454.             if (playerOne == null || !playerOne.isOnline())
  6455.                 continue;
  6456.            
  6457. -           playerTwo = L2World.getInstance().getPlayer(list.remove(Rnd.get(list.size())));
  6458. +           playerTwo = World.getInstance().getPlayer(list.remove(Rnd.get(list.size())));
  6459.             if (playerTwo == null || !playerTwo.isOnline())
  6460.             {
  6461.                 list.add(playerOneObjectId);
  6462. @@ -160,16 +160,26 @@
  6463.     }
  6464.    
  6465.     @Override
  6466. -   protected final void buffAndHealPlayers()
  6467. +   protected final void buffPlayers()
  6468.     {
  6469.         if (_aborted)
  6470.             return;
  6471.        
  6472. -       buffAndHealPlayer(_playerOne.player);
  6473. -       buffAndHealPlayer(_playerTwo.player);
  6474. +       buffPlayer(_playerOne.player);
  6475. +       buffPlayer(_playerTwo.player);
  6476.     }
  6477.    
  6478.     @Override
  6479. +   protected final void healPlayers()
  6480. +   {
  6481. +       if (_aborted)
  6482. +           return;
  6483. +      
  6484. +       healPlayer(_playerOne.player);
  6485. +       healPlayer(_playerTwo.player);
  6486. +   }
  6487. +  
  6488. +   @Override
  6489.     protected final boolean makeCompetitionStart()
  6490.     {
  6491.         if (!super.makeCompetitionStart())
  6492. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameTask.java
  6493. ===================================================================
  6494. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameTask.java (revision 2)
  6495. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameTask.java (working copy)
  6496. @@ -205,7 +205,10 @@
  6497.                     _zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.THE_GAME_WILL_START_IN_S1_SECOND_S).addNumber(_countDown));
  6498.                    
  6499.                     if (_countDown == 20)
  6500. -                       _game.buffAndHealPlayers();
  6501. +                   {
  6502. +                       _game.buffPlayers();
  6503. +                       _game.healPlayers();
  6504. +                   }
  6505.                    
  6506.                     delay = getDelay(BATTLE_START_TIME);
  6507.                     if (_countDown <= 0)
  6508. @@ -217,7 +220,10 @@
  6509.                 case BATTLE_STARTED:
  6510.                 {
  6511.                     _countDown = 0;
  6512. +                  
  6513. +                   _game.healPlayers();
  6514.                     _game.resetDamage();
  6515. +                  
  6516.                     _state = GameState.BATTLE_IN_PROGRESS; // set state first, used in zone update
  6517.                     if (!startBattle())
  6518.                         _state = GameState.GAME_STOPPED;
  6519. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/Participant.java
  6520. ===================================================================
  6521. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/Participant.java  (revision 2)
  6522. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/Participant.java  (working copy)
  6523. @@ -14,7 +14,7 @@
  6524.   */
  6525.  package net.sf.l2j.gameserver.model.olympiad;
  6526.  
  6527. -import net.sf.l2j.gameserver.model.L2World;
  6528. +import net.sf.l2j.gameserver.model.World;
  6529.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  6530.  import net.sf.l2j.gameserver.templates.StatsSet;
  6531.  
  6532. @@ -55,7 +55,7 @@
  6533.     public final void updatePlayer()
  6534.     {
  6535.         if (player == null || !player.isOnline())
  6536. -           player = L2World.getInstance().getPlayer(objectId);
  6537. +           player = World.getInstance().getPlayer(objectId);
  6538.     }
  6539.    
  6540.     public final void updateStat(String statName, int increment)
  6541. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/tradelist/TradeList.java
  6542. ===================================================================
  6543. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/tradelist/TradeList.java   (revision 2)
  6544. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/tradelist/TradeList.java   (working copy)
  6545. @@ -23,7 +23,7 @@
  6546.  import net.sf.l2j.gameserver.datatables.ItemTable;
  6547.  import net.sf.l2j.gameserver.model.ItemRequest;
  6548.  import net.sf.l2j.gameserver.model.L2Object;
  6549. -import net.sf.l2j.gameserver.model.L2World;
  6550. +import net.sf.l2j.gameserver.model.World;
  6551.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  6552.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  6553.  import net.sf.l2j.gameserver.model.item.kind.Item;
  6554. @@ -187,7 +187,7 @@
  6555.         if (isLocked())
  6556.             return null;
  6557.        
  6558. -       L2Object o = L2World.getInstance().getObject(objectId);
  6559. +       L2Object o = World.getInstance().getObject(objectId);
  6560.         if (!(o instanceof ItemInstance))
  6561.             return null;
  6562.        
  6563. @@ -395,7 +395,7 @@
  6564.     private boolean validate()
  6565.     {
  6566.         // Check for Owner validity
  6567. -       if (_owner == null || L2World.getInstance().getPlayer(_owner.getObjectId()) == null)
  6568. +       if (_owner == null || World.getInstance().getPlayer(_owner.getObjectId()) == null)
  6569.             return false;
  6570.        
  6571.         // Check for Item validity
  6572. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/World.java
  6573. ===================================================================
  6574. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/World.java (revision 0)
  6575. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/World.java (working copy)
  6576. @@ -0,0 +1,223 @@
  6577. +/*
  6578. + * This program is free software: you can redistribute it and/or modify it under
  6579. + * the terms of the GNU General Public License as published by the Free Software
  6580. + * Foundation, either version 3 of the License, or (at your option) any later
  6581. + * version.
  6582. + *
  6583. + * This program is distributed in the hope that it will be useful, but WITHOUT
  6584. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  6585. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  6586. + * details.
  6587. + *
  6588. + * You should have received a copy of the GNU General Public License along with
  6589. + * this program. If not, see <http://www.gnu.org/licenses/>.
  6590. + */
  6591. +package net.sf.l2j.gameserver.model;
  6592. +
  6593. +import java.util.Collection;
  6594. +import java.util.Map;
  6595. +import java.util.concurrent.ConcurrentHashMap;
  6596. +import java.util.logging.Logger;
  6597. +
  6598. +import net.sf.l2j.gameserver.datatables.CharNameTable;
  6599. +import net.sf.l2j.gameserver.datatables.SpawnTable;
  6600. +import net.sf.l2j.gameserver.model.actor.L2Npc;
  6601. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  6602. +import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  6603. +
  6604. +public final class World
  6605. +{
  6606. +   private static Logger _log = Logger.getLogger(World.class.getName());
  6607. +  
  6608. +   // Geodata min/max tiles
  6609. +   public static final int TILE_X_MIN = 16;
  6610. +   public static final int TILE_X_MAX = 26;
  6611. +   public static final int TILE_Y_MIN = 10;
  6612. +   public static final int TILE_Y_MAX = 25;
  6613. +  
  6614. +   // Map dimensions
  6615. +   public static final int TILE_SIZE = 32768;
  6616. +   public static final int WORLD_X_MIN = (TILE_X_MIN - 20) * TILE_SIZE;
  6617. +   public static final int WORLD_X_MAX = (TILE_X_MAX - 19) * TILE_SIZE;
  6618. +   public static final int WORLD_Y_MIN = (TILE_Y_MIN - 18) * TILE_SIZE;
  6619. +   public static final int WORLD_Y_MAX = (TILE_Y_MAX - 17) * TILE_SIZE;
  6620. +  
  6621. +   // Regions and offsets
  6622. +   private static final int REGION_SIZE = 4096;
  6623. +   private static final int REGIONS_X = (WORLD_X_MAX - WORLD_X_MIN) / REGION_SIZE;
  6624. +   private static final int REGIONS_Y = (WORLD_Y_MAX - WORLD_Y_MIN) / REGION_SIZE;
  6625. +   private static final int REGION_X_OFFSET = Math.abs(WORLD_X_MIN / REGION_SIZE);
  6626. +   private static final int REGION_Y_OFFSET = Math.abs(WORLD_Y_MIN / REGION_SIZE);
  6627. +  
  6628. +   private final Map<Integer, L2Object> _objects = new ConcurrentHashMap<>();
  6629. +   private final Map<Integer, L2PetInstance> _pets = new ConcurrentHashMap<>();
  6630. +   private final Map<Integer, L2PcInstance> _players = new ConcurrentHashMap<>();
  6631. +  
  6632. +   private final WorldRegion[][] _worldRegions = new WorldRegion[REGIONS_X + 1][REGIONS_Y + 1];
  6633. +  
  6634. +   protected World()
  6635. +   {
  6636. +       for (int i = 0; i <= REGIONS_X; i++)
  6637. +       {
  6638. +           for (int j = 0; j <= REGIONS_Y; j++)
  6639. +               _worldRegions[i][j] = new WorldRegion(i, j);
  6640. +       }
  6641. +      
  6642. +       for (int x = 0; x <= REGIONS_X; x++)
  6643. +       {
  6644. +           for (int y = 0; y <= REGIONS_Y; y++)
  6645. +           {
  6646. +               for (int a = -1; a <= 1; a++)
  6647. +               {
  6648. +                   for (int b = -1; b <= 1; b++)
  6649. +                   {
  6650. +                       if (validRegion(x + a, y + b))
  6651. +                           _worldRegions[x + a][y + b].addSurroundingRegion(_worldRegions[x][y]);
  6652. +                   }
  6653. +               }
  6654. +           }
  6655. +       }
  6656. +       _log.info("World: WorldRegion grid (" + REGIONS_X + " by " + REGIONS_Y + ") is now setted up.");
  6657. +   }
  6658. +  
  6659. +   public void addObject(L2Object object)
  6660. +   {
  6661. +       _objects.putIfAbsent(object.getObjectId(), object);
  6662. +   }
  6663. +  
  6664. +   public void removeObject(L2Object object)
  6665. +   {
  6666. +       _objects.remove(object.getObjectId());
  6667. +   }
  6668. +  
  6669. +   public Collection<L2Object> getObjects()
  6670. +   {
  6671. +       return _objects.values();
  6672. +   }
  6673. +  
  6674. +   public L2Object getObject(int objectId)
  6675. +   {
  6676. +       return _objects.get(objectId);
  6677. +   }
  6678. +  
  6679. +   public void addPlayer(L2PcInstance cha)
  6680. +   {
  6681. +       _players.putIfAbsent(cha.getObjectId(), cha);
  6682. +   }
  6683. +  
  6684. +   public void removePlayer(L2PcInstance cha)
  6685. +   {
  6686. +       _players.remove(cha.getObjectId());
  6687. +   }
  6688. +  
  6689. +   public Collection<L2PcInstance> getPlayers()
  6690. +   {
  6691. +       return _players.values();
  6692. +   }
  6693. +  
  6694. +   public L2PcInstance getPlayer(String name)
  6695. +   {
  6696. +       return _players.get(CharNameTable.getInstance().getPlayerObjectId(name));
  6697. +   }
  6698. +  
  6699. +   public L2PcInstance getPlayer(int objectId)
  6700. +   {
  6701. +       return _players.get(objectId);
  6702. +   }
  6703. +  
  6704. +   public L2PetInstance addPet(int ownerId, L2PetInstance pet)
  6705. +   {
  6706. +       return _pets.putIfAbsent(ownerId, pet);
  6707. +   }
  6708. +  
  6709. +   public void removePet(int ownerId)
  6710. +   {
  6711. +       _pets.remove(ownerId);
  6712. +   }
  6713. +  
  6714. +   public L2PetInstance getPet(int ownerId)
  6715. +   {
  6716. +       return _pets.get(ownerId);
  6717. +   }
  6718. +  
  6719. +   public static int getRegionX(int regionX)
  6720. +   {
  6721. +       return (regionX - REGION_X_OFFSET) * REGION_SIZE;
  6722. +   }
  6723. +  
  6724. +   public static int getRegionY(int regionY)
  6725. +   {
  6726. +       return (regionY - REGION_Y_OFFSET) * REGION_SIZE;
  6727. +   }
  6728. +  
  6729. +   /**
  6730. +    * @param point position of the object.
  6731. +    * @return the current WorldRegion of the object according to its position (x,y).
  6732. +    */
  6733. +   public WorldRegion getRegion(Location point)
  6734. +   {
  6735. +       return getRegion(point.getX(), point.getY());
  6736. +   }
  6737. +  
  6738. +   public WorldRegion getRegion(int x, int y)
  6739. +   {
  6740. +       return _worldRegions[(x - WORLD_X_MIN) / REGION_SIZE][(y - WORLD_Y_MIN) / REGION_SIZE];
  6741. +   }
  6742. +  
  6743. +   /**
  6744. +    * @return the whole 2d array containing the world regions used by ZoneData.java to setup zones inside the world regions
  6745. +    */
  6746. +   public WorldRegion[][] getWorldRegions()
  6747. +   {
  6748. +       return _worldRegions;
  6749. +   }
  6750. +  
  6751. +   /**
  6752. +    * @param x X position of the object
  6753. +    * @param y Y position of the object
  6754. +    * @return True if the given coordinates are valid WorldRegion coordinates.
  6755. +    */
  6756. +   private static boolean validRegion(int x, int y)
  6757. +   {
  6758. +       return (x >= 0 && x <= REGIONS_X && y >= 0 && y <= REGIONS_Y);
  6759. +   }
  6760. +  
  6761. +   /**
  6762. +    * Delete all spawns in the world.
  6763. +    */
  6764. +   public void deleteVisibleNpcSpawns()
  6765. +   {
  6766. +       _log.info("Deleting all visible NPCs.");
  6767. +       for (int i = 0; i <= REGIONS_X; i++)
  6768. +       {
  6769. +           for (int j = 0; j <= REGIONS_Y; j++)
  6770. +           {
  6771. +               for (L2Object obj : _worldRegions[i][j].getObjects())
  6772. +               {
  6773. +                   if (obj instanceof L2Npc)
  6774. +                   {
  6775. +                       ((L2Npc) obj).deleteMe();
  6776. +                      
  6777. +                       final L2Spawn spawn = ((L2Npc) obj).getSpawn();
  6778. +                       if (spawn != null)
  6779. +                       {
  6780. +                           spawn.setRespawnState(false);
  6781. +                           SpawnTable.getInstance().deleteSpawn(spawn, false);
  6782. +                       }
  6783. +                   }
  6784. +               }
  6785. +           }
  6786. +       }
  6787. +       _log.info("All visibles NPCs are now deleted.");
  6788. +   }
  6789. +  
  6790. +   public static World getInstance()
  6791. +   {
  6792. +       return SingletonHolder._instance;
  6793. +   }
  6794. +  
  6795. +   private static class SingletonHolder
  6796. +   {
  6797. +       protected static final World _instance = new World();
  6798. +   }
  6799. +}
  6800. \ No newline at end of file
  6801. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/WorldRegion.java
  6802. ===================================================================
  6803. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/WorldRegion.java   (revision 0)
  6804. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/WorldRegion.java   (working copy)
  6805. @@ -0,0 +1,259 @@
  6806. +/*
  6807. + * This program is free software: you can redistribute it and/or modify it under
  6808. + * the terms of the GNU General Public License as published by the Free Software
  6809. + * Foundation, either version 3 of the License, or (at your option) any later
  6810. + * version.
  6811. + *
  6812. + * This program is distributed in the hope that it will be useful, but WITHOUT
  6813. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  6814. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  6815. + * details.
  6816. + *
  6817. + * You should have received a copy of the GNU General Public License along with
  6818. + * this program. If not, see <http://www.gnu.org/licenses/>.
  6819. + */
  6820. +package net.sf.l2j.gameserver.model;
  6821. +
  6822. +import java.util.ArrayList;
  6823. +import java.util.Collection;
  6824. +import java.util.List;
  6825. +import java.util.Map;
  6826. +import java.util.concurrent.ConcurrentHashMap;
  6827. +import java.util.concurrent.atomic.AtomicInteger;
  6828. +
  6829. +import net.sf.l2j.gameserver.ai.CtrlIntention;
  6830. +import net.sf.l2j.gameserver.model.actor.L2Attackable;
  6831. +import net.sf.l2j.gameserver.model.actor.L2Character;
  6832. +import net.sf.l2j.gameserver.model.actor.L2Npc;
  6833. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  6834. +import net.sf.l2j.gameserver.model.zone.L2ZoneType;
  6835. +import net.sf.l2j.gameserver.model.zone.type.L2DerbyTrackZone;
  6836. +import net.sf.l2j.gameserver.model.zone.type.L2PeaceZone;
  6837. +import net.sf.l2j.gameserver.model.zone.type.L2TownZone;
  6838. +
  6839. +public final class WorldRegion
  6840. +{
  6841. +   private final Map<Integer, L2Object> _objects = new ConcurrentHashMap<>();
  6842. +  
  6843. +   private final List<WorldRegion> _surroundingRegions = new ArrayList<>();
  6844. +   private final List<L2ZoneType> _zones = new ArrayList<>();
  6845. +  
  6846. +   private final int _tileX;
  6847. +   private final int _tileY;
  6848. +  
  6849. +   private boolean _active;
  6850. +   private AtomicInteger _playersCount = new AtomicInteger();
  6851. +  
  6852. +   public WorldRegion(int x, int y)
  6853. +   {
  6854. +       _tileX = x;
  6855. +       _tileY = y;
  6856. +   }
  6857. +  
  6858. +   @Override
  6859. +   public String toString()
  6860. +   {
  6861. +       return "WorldRegion " + _tileX + "_" + _tileY + ", _active=" + _active + ", _playersCount=" + _playersCount.get() + "]";
  6862. +   }
  6863. +  
  6864. +   public Collection<L2Object> getObjects()
  6865. +   {
  6866. +       return _objects.values();
  6867. +   }
  6868. +  
  6869. +   public void addSurroundingRegion(WorldRegion region)
  6870. +   {
  6871. +       _surroundingRegions.add(region);
  6872. +   }
  6873. +  
  6874. +   public List<WorldRegion> getSurroundingRegions()
  6875. +   {
  6876. +       return _surroundingRegions;
  6877. +   }
  6878. +  
  6879. +   public List<L2ZoneType> getZones()
  6880. +   {
  6881. +       return _zones;
  6882. +   }
  6883. +  
  6884. +   public void addZone(L2ZoneType zone)
  6885. +   {
  6886. +       _zones.add(zone);
  6887. +   }
  6888. +  
  6889. +   public void removeZone(L2ZoneType zone)
  6890. +   {
  6891. +       _zones.remove(zone);
  6892. +   }
  6893. +  
  6894. +   public void revalidateZones(L2Character character)
  6895. +   {
  6896. +       // Do NOT update the world region while the character is still in the process of teleporting
  6897. +       if (character.isTeleporting())
  6898. +           return;
  6899. +      
  6900. +       _zones.forEach(z -> z.revalidateInZone(character));
  6901. +   }
  6902. +  
  6903. +   public void removeFromZones(L2Character character)
  6904. +   {
  6905. +       _zones.forEach(z -> z.removeCharacter(character));
  6906. +   }
  6907. +  
  6908. +   public boolean containsZone(int zoneId)
  6909. +   {
  6910. +       for (L2ZoneType z : _zones)
  6911. +       {
  6912. +           if (z.getId() == zoneId)
  6913. +               return true;
  6914. +       }
  6915. +       return false;
  6916. +   }
  6917. +  
  6918. +   public boolean checkEffectRangeInsidePeaceZone(L2Skill skill, final int x, final int y, final int z)
  6919. +   {
  6920. +       final int range = skill.getEffectRange();
  6921. +       final int up = y + range;
  6922. +       final int down = y - range;
  6923. +       final int left = x + range;
  6924. +       final int right = x - range;
  6925. +      
  6926. +       for (L2ZoneType e : _zones)
  6927. +       {
  6928. +           if ((e instanceof L2TownZone && ((L2TownZone) e).isPeaceZone()) || e instanceof L2DerbyTrackZone || e instanceof L2PeaceZone)
  6929. +           {
  6930. +               if (e.isInsideZone(x, up, z))
  6931. +                   return false;
  6932. +              
  6933. +               if (e.isInsideZone(x, down, z))
  6934. +                   return false;
  6935. +              
  6936. +               if (e.isInsideZone(left, y, z))
  6937. +                   return false;
  6938. +              
  6939. +               if (e.isInsideZone(right, y, z))
  6940. +                   return false;
  6941. +              
  6942. +               if (e.isInsideZone(x, y, z))
  6943. +                   return false;
  6944. +           }
  6945. +       }
  6946. +       return true;
  6947. +   }
  6948. +  
  6949. +   public void onDeath(L2Character character)
  6950. +   {
  6951. +       _zones.stream().filter(z -> z.isCharacterInZone(character)).forEach(z -> z.onDieInside(character));
  6952. +   }
  6953. +  
  6954. +   public void onRevive(L2Character character)
  6955. +   {
  6956. +       _zones.stream().filter(z -> z.isCharacterInZone(character)).forEach(z -> z.onReviveInside(character));
  6957. +   }
  6958. +  
  6959. +   public boolean isActive()
  6960. +   {
  6961. +       return _active;
  6962. +   }
  6963. +  
  6964. +   public int getPlayersCount()
  6965. +   {
  6966. +       return _playersCount.get();
  6967. +   }
  6968. +  
  6969. +   /**
  6970. +    * Check if neighbors (including self) aren't inhabited.
  6971. +    * @return true if the above condition is met.
  6972. +    */
  6973. +   public boolean isEmptyNeighborhood()
  6974. +   {
  6975. +       for (WorldRegion neighbor : _surroundingRegions)
  6976. +       {
  6977. +           if (neighbor.getPlayersCount() != 0)
  6978. +               return false;
  6979. +       }
  6980. +       return true;
  6981. +   }
  6982. +  
  6983. +   /**
  6984. +    * This function turns this region's AI on or off.
  6985. +    * @param value : if true, activate hp/mp regen and random animation. If false, clean aggro/attack list, set objects on IDLE and drop their AI tasks.
  6986. +    */
  6987. +   public void setActive(boolean value)
  6988. +   {
  6989. +       if (_active == value)
  6990. +           return;
  6991. +      
  6992. +       _active = value;
  6993. +      
  6994. +       if (!value)
  6995. +       {
  6996. +           for (L2Object o : _objects.values())
  6997. +           {
  6998. +               if (o instanceof L2Attackable)
  6999. +               {
  7000. +                   L2Attackable mob = (L2Attackable) o;
  7001. +                  
  7002. +                   // Set target to null and cancel Attack or Cast
  7003. +                   mob.setTarget(null);
  7004. +                  
  7005. +                   // Stop movement
  7006. +                   mob.stopMove(null);
  7007. +                  
  7008. +                   // Stop all active skills effects in progress on the L2Character
  7009. +                   mob.stopAllEffects();
  7010. +                  
  7011. +                   mob.getAggroList().clear();
  7012. +                   mob.getAttackByList().clear();
  7013. +                  
  7014. +                   // stop the ai tasks
  7015. +                   if (mob.hasAI())
  7016. +                   {
  7017. +                       mob.getAI().setIntention(CtrlIntention.IDLE);
  7018. +                       mob.getAI().stopAITask();
  7019. +                   }
  7020. +               }
  7021. +           }
  7022. +       }
  7023. +       else
  7024. +       {
  7025. +           for (L2Object o : _objects.values())
  7026. +           {
  7027. +               if (o instanceof L2Attackable)
  7028. +                   ((L2Attackable) o).getStatus().startHpMpRegeneration();
  7029. +               else if (o instanceof L2Npc)
  7030. +                   ((L2Npc) o).startRandomAnimationTimer();
  7031. +           }
  7032. +       }
  7033. +   }
  7034. +  
  7035. +   /**
  7036. +    * Put the given object into WorldRegion objects map. If it's a player, increment the counter (used for region activation/desactivation).
  7037. +    * @param object : The object to register into this region.
  7038. +    */
  7039. +   public void addVisibleObject(L2Object object)
  7040. +   {
  7041. +       if (object == null)
  7042. +           return;
  7043. +      
  7044. +       _objects.put(object.getObjectId(), object);
  7045. +      
  7046. +       if (object instanceof L2PcInstance)
  7047. +           _playersCount.incrementAndGet();
  7048. +   }
  7049. +  
  7050. +   /**
  7051. +    * Remove the given object from WorldRegion objects map. If it's a player, decrement the counter (used for region activation/desactivation).
  7052. +    * @param object : The object to remove from this region.
  7053. +    */
  7054. +   public void removeVisibleObject(L2Object object)
  7055. +   {
  7056. +       if (object == null)
  7057. +           return;
  7058. +      
  7059. +       _objects.remove(object.getObjectId());
  7060. +      
  7061. +       if (object instanceof L2PcInstance)
  7062. +           _playersCount.decrementAndGet();
  7063. +   }
  7064. +}
  7065. \ No newline at end of file
  7066. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2BossZone.java
  7067. ===================================================================
  7068. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2BossZone.java  (revision 2)
  7069. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2BossZone.java  (working copy)
  7070. @@ -192,19 +192,15 @@
  7071.                
  7072.                 for (L2Attackable raid : getKnownTypeInside(L2Attackable.class))
  7073.                 {
  7074. -                   if (raid.isRaid())
  7075. -                   {
  7076. -                       if (raid.getSpawn() == null || raid.isDead())
  7077. -                           continue;
  7078. -                      
  7079. -                       if (!raid.isInsideRadius(raid.getSpawn().getLocX(), raid.getSpawn().getLocY(), 150, false))
  7080. -                           raid.returnHome();
  7081. -                   }
  7082. +                   if (!raid.isRaid())
  7083. +                       continue;
  7084. +                  
  7085. +                   raid.returnHome(true);
  7086.                 }
  7087.             }
  7088.         }
  7089. -       else if (character instanceof L2Attackable && character.isRaid() && !character.isDead())
  7090. -           ((L2Attackable) character).returnHome();
  7091. +       else if (character instanceof L2Attackable && character.isRaid())
  7092. +           ((L2Attackable) character).returnHome(true);
  7093.     }
  7094.    
  7095.     /**
  7096. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2DynamicZone.java
  7097. ===================================================================
  7098. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2DynamicZone.java   (revision 2)
  7099. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2DynamicZone.java   (working copy)
  7100. @@ -19,7 +19,7 @@
  7101.  import net.sf.l2j.commons.concurrent.ThreadPool;
  7102.  
  7103.  import net.sf.l2j.gameserver.model.L2Skill;
  7104. -import net.sf.l2j.gameserver.model.L2WorldRegion;
  7105. +import net.sf.l2j.gameserver.model.WorldRegion;
  7106.  import net.sf.l2j.gameserver.model.actor.L2Character;
  7107.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7108.  import net.sf.l2j.gameserver.model.zone.L2ZoneType;
  7109. @@ -30,12 +30,12 @@
  7110.   */
  7111.  public class L2DynamicZone extends L2ZoneType
  7112.  {
  7113. -   private final L2WorldRegion _region;
  7114. +   private final WorldRegion _region;
  7115.     private final L2Character _owner;
  7116.     private Future<?> _task;
  7117.     private final L2Skill _skill;
  7118.    
  7119. -   public L2DynamicZone(L2WorldRegion region, L2Character owner, L2Skill skill)
  7120. +   public L2DynamicZone(WorldRegion region, L2Character owner, L2Skill skill)
  7121.     {
  7122.         super(-1);
  7123.         _region = region;
  7124. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2WaterZone.java
  7125. ===================================================================
  7126. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2WaterZone.java (revision 2)
  7127. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2WaterZone.java (working copy)
  7128. @@ -38,7 +38,7 @@
  7129.             ((L2PcInstance) character).broadcastUserInfo();
  7130.         else if (character instanceof L2Npc)
  7131.         {
  7132. -           for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  7133. +           for (L2PcInstance player : character.getKnownType(L2PcInstance.class))
  7134.             {
  7135.                 if (character.getMoveSpeed() == 0)
  7136.                     player.sendPacket(new ServerObjectInfo((L2Npc) character, player));
  7137. @@ -53,12 +53,11 @@
  7138.     {
  7139.         character.setInsideZone(ZoneId.WATER, false);
  7140.        
  7141. -       // TODO: update to only send speed status when that packet is known
  7142.         if (character instanceof L2PcInstance)
  7143.             ((L2PcInstance) character).broadcastUserInfo();
  7144.         else if (character instanceof L2Npc)
  7145.         {
  7146. -           for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  7147. +           for (L2PcInstance player : character.getKnownType(L2PcInstance.class))
  7148.             {
  7149.                 if (character.getMoveSpeed() == 0)
  7150.                     player.sendPacket(new ServerObjectInfo((L2Npc) character, player));
  7151. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/Action.java
  7152. ===================================================================
  7153. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/Action.java    (revision 2)
  7154. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/Action.java    (working copy)
  7155. @@ -15,7 +15,7 @@
  7156.  package net.sf.l2j.gameserver.network.clientpackets;
  7157.  
  7158.  import net.sf.l2j.gameserver.model.L2Object;
  7159. -import net.sf.l2j.gameserver.model.L2World;
  7160. +import net.sf.l2j.gameserver.model.World;
  7161.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7162.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7163.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  7164. @@ -57,7 +57,7 @@
  7165.             return;
  7166.         }
  7167.        
  7168. -       final L2Object obj = (activeChar.getTargetId() == _objectId) ? activeChar.getTarget() : L2World.getInstance().getObject(_objectId);
  7169. +       final L2Object obj = (activeChar.getTargetId() == _objectId) ? activeChar.getTarget() : World.getInstance().getObject(_objectId);
  7170.         if (obj == null)
  7171.         {
  7172.             activeChar.sendPacket(ActionFailed.STATIC_PACKET);
  7173. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AddTradeItem.java
  7174. ===================================================================
  7175. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AddTradeItem.java  (revision 2)
  7176. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AddTradeItem.java  (working copy)
  7177. @@ -14,7 +14,7 @@
  7178.   */
  7179.  package net.sf.l2j.gameserver.network.clientpackets;
  7180.  
  7181. -import net.sf.l2j.gameserver.model.L2World;
  7182. +import net.sf.l2j.gameserver.model.World;
  7183.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7184.  import net.sf.l2j.gameserver.model.tradelist.TradeItem;
  7185.  import net.sf.l2j.gameserver.model.tradelist.TradeList;
  7186. @@ -56,7 +56,7 @@
  7187.         }
  7188.        
  7189.         final L2PcInstance partner = trade.getPartner();
  7190. -       if (partner == null || L2World.getInstance().getPlayer(partner.getObjectId()) == null || partner.getActiveTradeList() == null)
  7191. +       if (partner == null || World.getInstance().getPlayer(partner.getObjectId()) == null || partner.getActiveTradeList() == null)
  7192.         {
  7193.             // Trade partner not found, cancel trade
  7194.             if (partner != null)
  7195. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AnswerJoinPartyRoom.java
  7196. ===================================================================
  7197. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AnswerJoinPartyRoom.java   (revision 2)
  7198. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AnswerJoinPartyRoom.java   (working copy)
  7199. @@ -14,7 +14,7 @@
  7200.   */
  7201.  package net.sf.l2j.gameserver.network.clientpackets;
  7202.  
  7203. -import net.sf.l2j.gameserver.model.L2World;
  7204. +import net.sf.l2j.gameserver.model.World;
  7205.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7206.  import net.sf.l2j.gameserver.model.partymatching.PartyMatchRoom;
  7207.  import net.sf.l2j.gameserver.model.partymatching.PartyMatchRoomList;
  7208. @@ -47,7 +47,7 @@
  7209.             return;
  7210.        
  7211.         final L2PcInstance partner = player.getActiveRequester();
  7212. -       if (partner == null || L2World.getInstance().getPlayer(partner.getObjectId()) == null)
  7213. +       if (partner == null || World.getInstance().getPlayer(partner.getObjectId()) == null)
  7214.         {
  7215.             // Partner hasn't be found, cancel the invitation
  7216.             player.sendPacket(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME);
  7217. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AnswerTradeRequest.java
  7218. ===================================================================
  7219. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AnswerTradeRequest.java    (revision 2)
  7220. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AnswerTradeRequest.java    (working copy)
  7221. @@ -14,7 +14,7 @@
  7222.   */
  7223.  package net.sf.l2j.gameserver.network.clientpackets;
  7224.  
  7225. -import net.sf.l2j.gameserver.model.L2World;
  7226. +import net.sf.l2j.gameserver.model.World;
  7227.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7228.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7229.  import net.sf.l2j.gameserver.network.serverpackets.SendTradeDone;
  7230. @@ -44,7 +44,7 @@
  7231.         }
  7232.        
  7233.         final L2PcInstance partner = player.getActiveRequester();
  7234. -       if (partner == null || L2World.getInstance().getPlayer(partner.getObjectId()) == null)
  7235. +       if (partner == null || World.getInstance().getPlayer(partner.getObjectId()) == null)
  7236.         {
  7237.             // Trade partner not found, cancel trade
  7238.             player.sendPacket(new SendTradeDone(0));
  7239. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java
  7240. ===================================================================
  7241. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java (revision 2)
  7242. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java (working copy)
  7243. @@ -15,7 +15,7 @@
  7244.  package net.sf.l2j.gameserver.network.clientpackets;
  7245.  
  7246.  import net.sf.l2j.gameserver.model.L2Object;
  7247. -import net.sf.l2j.gameserver.model.L2World;
  7248. +import net.sf.l2j.gameserver.model.World;
  7249.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7250.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7251.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  7252. @@ -58,7 +58,7 @@
  7253.         if (activeChar.getTargetId() == _objectId)
  7254.             target = activeChar.getTarget();
  7255.         else
  7256. -           target = L2World.getInstance().getObject(_objectId);
  7257. +           target = World.getInstance().getObject(_objectId);
  7258.        
  7259.         if (target == null)
  7260.             return;
  7261. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java
  7262. ===================================================================
  7263. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java   (revision 2)
  7264. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java   (working copy)
  7265. @@ -24,7 +24,7 @@
  7266.  import net.sf.l2j.gameserver.idfactory.IdFactory;
  7267.  import net.sf.l2j.gameserver.model.L2ShortCut;
  7268.  import net.sf.l2j.gameserver.model.L2SkillLearn;
  7269. -import net.sf.l2j.gameserver.model.L2World;
  7270. +import net.sf.l2j.gameserver.model.World;
  7271.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7272.  import net.sf.l2j.gameserver.model.actor.template.PcTemplate;
  7273.  import net.sf.l2j.gameserver.model.base.Sex;
  7274. @@ -132,10 +132,10 @@
  7275.         // send acknowledgement
  7276.         sendPacket(CharCreateOk.STATIC_PACKET);
  7277.        
  7278. -       L2World.getInstance().addObject(newChar);
  7279. +       World.getInstance().addObject(newChar);
  7280.        
  7281.         newChar.addAdena("Init", Config.STARTING_ADENA, null, false);
  7282. -       newChar.setXYZInvisible(template.getSpawnX(), template.getSpawnY(), template.getSpawnZ());
  7283. +       newChar.getPosition().set(template.getSpawn());
  7284.         newChar.setTitle("");
  7285.        
  7286.         newChar.registerShortCut(new L2ShortCut(0, 0, 3, 2, -1, 1)); // attack shortcut
  7287. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java
  7288. ===================================================================
  7289. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java (revision 2)
  7290. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java (working copy)
  7291. @@ -14,7 +14,6 @@
  7292.   */
  7293.  package net.sf.l2j.gameserver.network.clientpackets;
  7294.  
  7295. -import net.sf.l2j.Config;
  7296.  import net.sf.l2j.gameserver.model.CharSelectInfoPackage;
  7297.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7298.  import net.sf.l2j.gameserver.network.L2GameClient;
  7299. @@ -54,28 +53,18 @@
  7300.         if (!FloodProtectors.performAction(client, Action.CHARACTER_SELECT))
  7301.             return;
  7302.        
  7303. -       // we should always be able to acquire the lock
  7304. -       // but if we cant lock then nothing should be done (ie repeated packet)
  7305. +       // we should always be able to acquire the lock but if we cant lock then nothing should be done (ie repeated packet)
  7306.         if (client.getActiveCharLock().tryLock())
  7307.         {
  7308.             try
  7309.             {
  7310. -               // should always be null
  7311. -               // but if not then this is repeated packet and nothing should be done here
  7312. +               // should always be null but if not then this is repeated packet and nothing should be done here
  7313.                 if (client.getActiveChar() == null)
  7314.                 {
  7315.                     final CharSelectInfoPackage info = client.getCharSelection(_charSlot);
  7316. -                   if (info == null)
  7317. +                   if (info == null || info.getAccessLevel() < 0)
  7318.                         return;
  7319.                    
  7320. -                   // Selected character is banned. Acts like if nothing occured...
  7321. -                   if (info.getAccessLevel() < 0)
  7322. -                       return;
  7323. -                  
  7324. -                   // The L2PcInstance must be created here, so that it can be attached to the L2GameClient
  7325. -                   if (Config.DEBUG)
  7326. -                       _log.fine("Selected slot: " + _charSlot);
  7327. -                  
  7328.                     // Load up character from disk
  7329.                     final L2PcInstance cha = client.loadCharFromDisk(_charSlot);
  7330.                     if (cha == null)
  7331. @@ -88,8 +77,8 @@
  7332.                     sendPacket(SSQInfo.sendSky());
  7333.                    
  7334.                     client.setState(GameClientState.IN_GAME);
  7335. -                   CharSelected cs = new CharSelected(cha, client.getSessionId().playOkID1);
  7336. -                   sendPacket(cs);
  7337. +                  
  7338. +                   sendPacket(new CharSelected(cha, client.getSessionId().playOkID1));
  7339.                 }
  7340.             }
  7341.             finally
  7342. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/DlgAnswer.java
  7343. ===================================================================
  7344. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/DlgAnswer.java (revision 2)
  7345. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/DlgAnswer.java (working copy)
  7346. @@ -47,7 +47,7 @@
  7347.         else if (_messageId == SystemMessageId.S1_WISHES_TO_SUMMON_YOU_FROM_S2_DO_YOU_ACCEPT.getId())
  7348.             activeChar.teleportAnswer(_answer, _requesterId);
  7349.         else if (_messageId == 1983 && Config.ALLOW_WEDDING)
  7350. -           activeChar.EngageAnswer(_answer);
  7351. +           activeChar.engageAnswer(_answer);
  7352.         else if (_messageId == SystemMessageId.WOULD_YOU_LIKE_TO_OPEN_THE_GATE.getId())
  7353.             activeChar.activateGate(_answer, 1);
  7354.         else if (_messageId == SystemMessageId.WOULD_YOU_LIKE_TO_CLOSE_THE_GATE.getId())
  7355. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  7356. ===================================================================
  7357. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java    (revision 2)
  7358. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java    (working copy)
  7359. @@ -17,6 +17,7 @@
  7360.  import java.sql.Connection;
  7361.  import java.sql.PreparedStatement;
  7362.  import java.sql.ResultSet;
  7363. +import java.util.Map.Entry;
  7364.  import java.util.logging.Level;
  7365.  
  7366.  import net.sf.l2j.Config;
  7367. @@ -35,12 +36,12 @@
  7368.  import net.sf.l2j.gameserver.instancemanager.SiegeManager;
  7369.  import net.sf.l2j.gameserver.model.L2Clan;
  7370.  import net.sf.l2j.gameserver.model.L2Clan.SubPledge;
  7371. -import net.sf.l2j.gameserver.model.L2World;
  7372. +import net.sf.l2j.gameserver.model.World;
  7373.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7374.  import net.sf.l2j.gameserver.model.base.ClassRace;
  7375.  import net.sf.l2j.gameserver.model.entity.ClanHall;
  7376. -import net.sf.l2j.gameserver.model.entity.Couple;
  7377.  import net.sf.l2j.gameserver.model.entity.Siege;
  7378. +import net.sf.l2j.gameserver.model.holder.IntIntHolder;
  7379.  import net.sf.l2j.gameserver.model.olympiad.Olympiad;
  7380.  import net.sf.l2j.gameserver.model.zone.ZoneId;
  7381.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7382. @@ -136,13 +137,13 @@
  7383.             // Send a login notification to sponsor or apprentice, if logged.
  7384.             if (activeChar.getSponsor() != 0)
  7385.             {
  7386. -               final L2PcInstance sponsor = L2World.getInstance().getPlayer(activeChar.getSponsor());
  7387. +               final L2PcInstance sponsor = World.getInstance().getPlayer(activeChar.getSponsor());
  7388.                 if (sponsor != null)
  7389.                     sponsor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN).addPcName(activeChar));
  7390.             }
  7391.             else if (activeChar.getApprentice() != 0)
  7392.             {
  7393. -               final L2PcInstance apprentice = L2World.getInstance().getPlayer(activeChar.getApprentice());
  7394. +               final L2PcInstance apprentice = World.getInstance().getPlayer(activeChar.getApprentice());
  7395.                 if (apprentice != null)
  7396.                     apprentice.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_SPONSOR_S1_HAS_LOGGED_IN).addPcName(activeChar));
  7397.             }
  7398. @@ -198,14 +199,13 @@
  7399.         // Engage and notify partner.
  7400.         if (Config.ALLOW_WEDDING)
  7401.         {
  7402. -           for (Couple cl : CoupleManager.getInstance().getCouples())
  7403. +           for (Entry<Integer, IntIntHolder> coupleEntry : CoupleManager.getInstance().getCouples().entrySet())
  7404.             {
  7405. -               if (cl.getPlayer1Id() == objectId || cl.getPlayer2Id() == objectId)
  7406. +               final IntIntHolder couple = coupleEntry.getValue();
  7407. +               if (couple.getId() == objectId || couple.getValue() == objectId)
  7408.                 {
  7409. -                   if (cl.getMaried())
  7410. -                       activeChar.setMarried(true);
  7411. -                  
  7412. -                   activeChar.setCoupleId(cl.getId());
  7413. +                   activeChar.setCoupleId(coupleEntry.getKey());
  7414. +                   break;
  7415.                 }
  7416.             }
  7417.         }
  7418. @@ -227,6 +227,11 @@
  7419.         activeChar.sendPacket(new ItemList(activeChar, false));
  7420.         activeChar.sendPacket(new ShortCutInit(activeChar));
  7421.         activeChar.sendPacket(new ExStorageMaxCount(activeChar));
  7422. +      
  7423. +       // no broadcast needed since the player will already spawn dead to others
  7424. +       if (activeChar.isAlikeDead())
  7425. +           activeChar.sendPacket(new Die(activeChar));
  7426. +      
  7427.         activeChar.updateEffectIcons();
  7428.         activeChar.sendPacket(new EtcStatusUpdate(activeChar));
  7429.         activeChar.sendSkillList();
  7430. @@ -309,10 +314,6 @@
  7431.        
  7432.         PetitionManager.getInstance().checkPetitionMessages(activeChar);
  7433.        
  7434. -       // no broadcast needed since the player will already spawn dead to others
  7435. -       if (activeChar.isAlikeDead())
  7436. -           sendPacket(new Die(activeChar));
  7437. -      
  7438.         activeChar.onPlayerEnter();
  7439.        
  7440.         sendPacket(new SkillCoolTime(activeChar));
  7441. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestAskJoinPartyRoom.java
  7442. ===================================================================
  7443. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestAskJoinPartyRoom.java   (revision 2)
  7444. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestAskJoinPartyRoom.java   (working copy)
  7445. @@ -14,7 +14,7 @@
  7446.   */
  7447.  package net.sf.l2j.gameserver.network.clientpackets;
  7448.  
  7449. -import net.sf.l2j.gameserver.model.L2World;
  7450. +import net.sf.l2j.gameserver.model.World;
  7451.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7452.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7453.  import net.sf.l2j.gameserver.network.serverpackets.ExAskJoinPartyRoom;
  7454. @@ -38,7 +38,7 @@
  7455.             return;
  7456.        
  7457.         // Send PartyRoom invite request (with activeChar) name to the target
  7458. -       final L2PcInstance target = L2World.getInstance().getPlayer(_name);
  7459. +       final L2PcInstance target = World.getInstance().getPlayer(_name);
  7460.         if (target != null)
  7461.         {
  7462.             if (!target.isProcessingRequest())
  7463. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  7464. ===================================================================
  7465. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 2)
  7466. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
  7467. @@ -23,7 +23,7 @@
  7468.  import net.sf.l2j.gameserver.handler.AdminCommandHandler;
  7469.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  7470.  import net.sf.l2j.gameserver.model.L2Object;
  7471. -import net.sf.l2j.gameserver.model.L2World;
  7472. +import net.sf.l2j.gameserver.model.World;
  7473.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  7474.  import net.sf.l2j.gameserver.model.actor.instance.L2OlympiadManagerInstance;
  7475.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7476. @@ -109,7 +109,7 @@
  7477.                
  7478.                 try
  7479.                 {
  7480. -                   final L2Object object = L2World.getInstance().getObject(Integer.parseInt(id));
  7481. +                   final L2Object object = World.getInstance().getObject(Integer.parseInt(id));
  7482.                    
  7483.                     if (object != null && object instanceof L2Npc && endOfId > 0 && ((L2Npc) object).canInteract(activeChar))
  7484.                         ((L2Npc) object).onBypassFeedback(activeChar, _command.substring(endOfId + 1));
  7485. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCrystallizeItem.java
  7486. ===================================================================
  7487. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCrystallizeItem.java    (revision 2)
  7488. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCrystallizeItem.java    (working copy)
  7489. @@ -15,7 +15,7 @@
  7490.  package net.sf.l2j.gameserver.network.clientpackets;
  7491.  
  7492.  import net.sf.l2j.gameserver.model.L2Skill;
  7493. -import net.sf.l2j.gameserver.model.L2World;
  7494. +import net.sf.l2j.gameserver.model.World;
  7495.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7496.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  7497.  import net.sf.l2j.gameserver.model.item.type.CrystalType;
  7498. @@ -169,7 +169,7 @@
  7499.         activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(createditem.getItemId()).addItemNumber(crystalAmount));
  7500.        
  7501.         activeChar.broadcastUserInfo();
  7502. -       L2World.getInstance().removeObject(removedItem);
  7503. +       World.getInstance().removeObject(removedItem);
  7504.         activeChar.setCrystallizing(false);
  7505.     }
  7506.  }
  7507. \ No newline at end of file
  7508. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestDuelStart.java
  7509. ===================================================================
  7510. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestDuelStart.java  (revision 2)
  7511. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestDuelStart.java  (working copy)
  7512. @@ -16,7 +16,7 @@
  7513.  
  7514.  import net.sf.l2j.gameserver.model.L2CommandChannel;
  7515.  import net.sf.l2j.gameserver.model.L2Party;
  7516. -import net.sf.l2j.gameserver.model.L2World;
  7517. +import net.sf.l2j.gameserver.model.World;
  7518.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7519.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7520.  import net.sf.l2j.gameserver.network.serverpackets.ExDuelAskStart;
  7521. @@ -41,7 +41,7 @@
  7522.         if (activeChar == null)
  7523.             return;
  7524.        
  7525. -       final L2PcInstance targetChar = L2World.getInstance().getPlayer(_player);
  7526. +       final L2PcInstance targetChar = World.getInstance().getPlayer(_player);
  7527.         if (targetChar == null || activeChar == targetChar)
  7528.         {
  7529.             activeChar.sendPacket(SystemMessageId.THERE_IS_NO_OPPONENT_TO_RECEIVE_YOUR_CHALLENGE_FOR_A_DUEL);
  7530. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
  7531. ===================================================================
  7532. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (revision 2)
  7533. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (working copy)
  7534. @@ -20,7 +20,7 @@
  7535.  import net.sf.l2j.gameserver.datatables.ArmorSetsTable;
  7536.  import net.sf.l2j.gameserver.datatables.SkillTable;
  7537.  import net.sf.l2j.gameserver.model.L2Skill;
  7538. -import net.sf.l2j.gameserver.model.L2World;
  7539. +import net.sf.l2j.gameserver.model.World;
  7540.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7541.  import net.sf.l2j.gameserver.model.item.ArmorSet;
  7542.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  7543. @@ -276,7 +276,7 @@
  7544.                     else
  7545.                         activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ENCHANTMENT_FAILED_S1_EVAPORATED).addItemName(item.getItemId()));
  7546.                    
  7547. -                   L2World.getInstance().removeObject(destroyItem);
  7548. +                   World.getInstance().removeObject(destroyItem);
  7549.                     if (crystalId == 0)
  7550.                         activeChar.sendPacket(EnchantResult.UNK_RESULT_4);
  7551.                     else
  7552. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestEvaluate.java
  7553. ===================================================================
  7554. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestEvaluate.java   (revision 2)
  7555. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestEvaluate.java   (working copy)
  7556. @@ -14,7 +14,7 @@
  7557.   */
  7558.  package net.sf.l2j.gameserver.network.clientpackets;
  7559.  
  7560. -import net.sf.l2j.gameserver.model.L2World;
  7561. +import net.sf.l2j.gameserver.model.World;
  7562.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7563.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7564.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  7565. @@ -37,7 +37,7 @@
  7566.         if (activeChar == null)
  7567.             return;
  7568.        
  7569. -       final L2PcInstance target = L2World.getInstance().getPlayer(_targetId);
  7570. +       final L2PcInstance target = World.getInstance().getPlayer(_targetId);
  7571.         if (target == null)
  7572.         {
  7573.             activeChar.sendPacket(SystemMessageId.TARGET_IS_INCORRECT);
  7574. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExAskJoinMPCC.java
  7575. ===================================================================
  7576. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExAskJoinMPCC.java  (revision 2)
  7577. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExAskJoinMPCC.java  (working copy)
  7578. @@ -15,7 +15,7 @@
  7579.  package net.sf.l2j.gameserver.network.clientpackets;
  7580.  
  7581.  import net.sf.l2j.gameserver.model.L2Party;
  7582. -import net.sf.l2j.gameserver.model.L2World;
  7583. +import net.sf.l2j.gameserver.model.World;
  7584.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7585.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7586.  import net.sf.l2j.gameserver.network.serverpackets.ExAskJoinMPCC;
  7587. @@ -42,7 +42,7 @@
  7588.         if (activeChar == null)
  7589.             return;
  7590.        
  7591. -       L2PcInstance player = L2World.getInstance().getPlayer(_name);
  7592. +       L2PcInstance player = World.getInstance().getPlayer(_name);
  7593.         if (player == null)
  7594.             return;
  7595.        
  7596. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExMPCCShowPartyMembersInfo.java
  7597. ===================================================================
  7598. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExMPCCShowPartyMembersInfo.java (revision 2)
  7599. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExMPCCShowPartyMembersInfo.java (working copy)
  7600. @@ -14,7 +14,7 @@
  7601.   */
  7602.  package net.sf.l2j.gameserver.network.clientpackets;
  7603.  
  7604. -import net.sf.l2j.gameserver.model.L2World;
  7605. +import net.sf.l2j.gameserver.model.World;
  7606.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7607.  import net.sf.l2j.gameserver.network.serverpackets.ExMPCCShowPartyMemberInfo;
  7608.  
  7609. @@ -39,7 +39,7 @@
  7610.         if (activeChar == null)
  7611.             return;
  7612.        
  7613. -       L2PcInstance player = L2World.getInstance().getPlayer(_partyLeaderId);
  7614. +       L2PcInstance player = World.getInstance().getPlayer(_partyLeaderId);
  7615.         if (player != null && player.isInParty())
  7616.             activeChar.sendPacket(new ExMPCCShowPartyMemberInfo(player.getParty()));
  7617.     }
  7618. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExOustFromMPCC.java
  7619. ===================================================================
  7620. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExOustFromMPCC.java (revision 2)
  7621. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExOustFromMPCC.java (working copy)
  7622. @@ -15,7 +15,7 @@
  7623.  package net.sf.l2j.gameserver.network.clientpackets;
  7624.  
  7625.  import net.sf.l2j.gameserver.model.L2Party;
  7626. -import net.sf.l2j.gameserver.model.L2World;
  7627. +import net.sf.l2j.gameserver.model.World;
  7628.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7629.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7630.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  7631. @@ -40,7 +40,7 @@
  7632.         if (activeChar == null)
  7633.             return;
  7634.        
  7635. -       final L2PcInstance target = L2World.getInstance().getPlayer(_name);
  7636. +       final L2PcInstance target = World.getInstance().getPlayer(_name);
  7637.         if (target == null)
  7638.         {
  7639.             activeChar.sendPacket(SystemMessageId.TARGET_CANT_FOUND);
  7640. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendDel.java
  7641. ===================================================================
  7642. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendDel.java  (revision 2)
  7643. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendDel.java  (working copy)
  7644. @@ -20,7 +20,7 @@
  7645.  
  7646.  import net.sf.l2j.L2DatabaseFactory;
  7647.  import net.sf.l2j.gameserver.datatables.CharNameTable;
  7648. -import net.sf.l2j.gameserver.model.L2World;
  7649. +import net.sf.l2j.gameserver.model.World;
  7650.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7651.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7652.  import net.sf.l2j.gameserver.network.serverpackets.FriendList;
  7653. @@ -67,7 +67,7 @@
  7654.             activeChar.getFriendList().remove(Integer.valueOf(id));
  7655.             activeChar.sendPacket(new FriendList(activeChar)); // update friendList *heavy method*
  7656.            
  7657. -           L2PcInstance player = L2World.getInstance().getPlayer(_name);
  7658. +           L2PcInstance player = World.getInstance().getPlayer(_name);
  7659.             if (player != null)
  7660.             {
  7661.                 player.getFriendList().remove(Integer.valueOf(activeChar.getObjectId()));
  7662. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java
  7663. ===================================================================
  7664. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java   (revision 2)
  7665. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java   (working copy)
  7666. @@ -15,7 +15,7 @@
  7667.  package net.sf.l2j.gameserver.network.clientpackets;
  7668.  
  7669.  import net.sf.l2j.gameserver.model.BlockList;
  7670. -import net.sf.l2j.gameserver.model.L2World;
  7671. +import net.sf.l2j.gameserver.model.World;
  7672.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7673.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7674.  import net.sf.l2j.gameserver.network.serverpackets.FriendAddRequest;
  7675. @@ -38,7 +38,7 @@
  7676.         if (activeChar == null)
  7677.             return;
  7678.        
  7679. -       final L2PcInstance friend = L2World.getInstance().getPlayer(_name);
  7680. +       final L2PcInstance friend = World.getInstance().getPlayer(_name);
  7681.        
  7682.         // can't use friend invite for locating invisible characters
  7683.         if (friend == null || !friend.isOnline() || friend.getAppearance().getInvisible())
  7684. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendList.java
  7685. ===================================================================
  7686. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendList.java (revision 2)
  7687. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendList.java (working copy)
  7688. @@ -15,7 +15,7 @@
  7689.  package net.sf.l2j.gameserver.network.clientpackets;
  7690.  
  7691.  import net.sf.l2j.gameserver.datatables.CharNameTable;
  7692. -import net.sf.l2j.gameserver.model.L2World;
  7693. +import net.sf.l2j.gameserver.model.World;
  7694.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7695.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7696.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  7697. @@ -43,7 +43,7 @@
  7698.             if (friendName == null)
  7699.                 continue;
  7700.            
  7701. -           final L2PcInstance friend = L2World.getInstance().getPlayer(id);
  7702. +           final L2PcInstance friend = World.getInstance().getPlayer(id);
  7703.            
  7704.             activeChar.sendPacket(SystemMessage.getSystemMessage((friend == null || !friend.isOnline()) ? SystemMessageId.S1_OFFLINE : SystemMessageId.S1_ONLINE).addString(friendName));
  7705.         }
  7706. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGetItemFromPet.java
  7707. ===================================================================
  7708. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGetItemFromPet.java (revision 2)
  7709. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGetItemFromPet.java (working copy)
  7710. @@ -59,7 +59,6 @@
  7711.        
  7712.         final L2PetInstance pet = (L2PetInstance) player.getPet();
  7713.        
  7714. -       if (pet.transferItem("Transfer", _objectId, _amount, player.getInventory(), player, pet) == null)
  7715. -           _log.warning("Invalid item transfer request: " + pet.getName() + "(pet) --> " + player.getName());
  7716. +       pet.transferItem("Transfer", _objectId, _amount, player.getInventory(), player, pet);
  7717.     }
  7718.  }
  7719. \ No newline at end of file
  7720. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGiveItemToPet.java
  7721. ===================================================================
  7722. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGiveItemToPet.java  (revision 2)
  7723. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGiveItemToPet.java  (working copy)
  7724. @@ -19,6 +19,7 @@
  7725.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7726.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  7727.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  7728. +import net.sf.l2j.gameserver.model.item.type.EtcItemType;
  7729.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7730.  import net.sf.l2j.gameserver.network.serverpackets.EnchantResult;
  7731.  import net.sf.l2j.gameserver.util.Util;
  7732. @@ -68,7 +69,7 @@
  7733.         if (item == null || item.isAugmented())
  7734.             return;
  7735.        
  7736. -       if (item.isHeroItem() || !item.isDropable() || !item.isDestroyable() || !item.isTradable())
  7737. +       if (item.isHeroItem() || !item.isDropable() || !item.isDestroyable() || !item.isTradable() || item.getItem().getItemType() == EtcItemType.ARROW || item.getItem().getItemType() == EtcItemType.SHOT)
  7738.         {
  7739.             player.sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS);
  7740.             return;
  7741. @@ -106,7 +107,6 @@
  7742.             player.sendPacket(SystemMessageId.ENCHANT_SCROLL_CANCELLED);
  7743.         }
  7744.        
  7745. -       if (player.transferItem("Transfer", _objectId, _amount, pet.getInventory(), pet) == null)
  7746. -           _log.warning("Invalid item transfer request: " + pet.getName() + "(pet) --> " + player.getName());
  7747. +       player.transferItem("Transfer", _objectId, _amount, pet.getInventory(), pet);
  7748.     }
  7749.  }
  7750. \ No newline at end of file
  7751. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGMCommand.java
  7752. ===================================================================
  7753. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGMCommand.java  (revision 2)
  7754. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGMCommand.java  (working copy)
  7755. @@ -16,7 +16,7 @@
  7756.  
  7757.  import net.sf.l2j.gameserver.datatables.ClanTable;
  7758.  import net.sf.l2j.gameserver.model.L2Clan;
  7759. -import net.sf.l2j.gameserver.model.L2World;
  7760. +import net.sf.l2j.gameserver.model.World;
  7761.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7762.  import net.sf.l2j.gameserver.network.serverpackets.GMViewCharacterInfo;
  7763.  import net.sf.l2j.gameserver.network.serverpackets.GMViewHennaInfo;
  7764. @@ -49,7 +49,7 @@
  7765.         if (!activeChar.isGM() || !activeChar.getAccessLevel().allowAltG())
  7766.             return;
  7767.        
  7768. -       final L2PcInstance target = L2World.getInstance().getPlayer(_targetName);
  7769. +       final L2PcInstance target = World.getInstance().getPlayer(_targetName);
  7770.         final L2Clan clan = ClanTable.getInstance().getClanByName(_targetName);
  7771.        
  7772.         if (target == null && (clan == null || _command != 6))
  7773. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java
  7774. ===================================================================
  7775. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java   (revision 2)
  7776. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java   (working copy)
  7777. @@ -15,7 +15,7 @@
  7778.  package net.sf.l2j.gameserver.network.clientpackets;
  7779.  
  7780.  import net.sf.l2j.gameserver.model.L2Clan;
  7781. -import net.sf.l2j.gameserver.model.L2World;
  7782. +import net.sf.l2j.gameserver.model.World;
  7783.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7784.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7785.  import net.sf.l2j.gameserver.network.serverpackets.AskJoinAlly;
  7786. @@ -45,7 +45,7 @@
  7787.             return;
  7788.         }
  7789.        
  7790. -       final L2PcInstance target = L2World.getInstance().getPlayer(_id);
  7791. +       final L2PcInstance target = World.getInstance().getPlayer(_id);
  7792.         if (target == null)
  7793.         {
  7794.             activeChar.sendPacket(SystemMessageId.YOU_HAVE_INVITED_THE_WRONG_TARGET);
  7795. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java
  7796. ===================================================================
  7797. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java  (revision 2)
  7798. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java  (working copy)
  7799. @@ -17,7 +17,7 @@
  7800.  import net.sf.l2j.Config;
  7801.  import net.sf.l2j.gameserver.model.BlockList;
  7802.  import net.sf.l2j.gameserver.model.L2Party;
  7803. -import net.sf.l2j.gameserver.model.L2World;
  7804. +import net.sf.l2j.gameserver.model.World;
  7805.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7806.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7807.  import net.sf.l2j.gameserver.network.serverpackets.AskJoinParty;
  7808. @@ -45,7 +45,7 @@
  7809.         if (requestor == null)
  7810.             return;
  7811.        
  7812. -       final L2PcInstance target = L2World.getInstance().getPlayer(_name);
  7813. +       final L2PcInstance target = World.getInstance().getPlayer(_name);
  7814.         if (target == null)
  7815.         {
  7816.             requestor.sendPacket(SystemMessageId.FIRST_SELECT_USER_TO_INVITE_TO_PARTY);
  7817. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinPledge.java
  7818. ===================================================================
  7819. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinPledge.java (revision 2)
  7820. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinPledge.java (working copy)
  7821. @@ -15,7 +15,7 @@
  7822.  package net.sf.l2j.gameserver.network.clientpackets;
  7823.  
  7824.  import net.sf.l2j.gameserver.model.L2Clan;
  7825. -import net.sf.l2j.gameserver.model.L2World;
  7826. +import net.sf.l2j.gameserver.model.World;
  7827.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7828.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7829.  import net.sf.l2j.gameserver.network.serverpackets.AskJoinPledge;
  7830. @@ -44,7 +44,7 @@
  7831.         if (clan == null)
  7832.             return;
  7833.        
  7834. -       final L2PcInstance target = L2World.getInstance().getPlayer(_target);
  7835. +       final L2PcInstance target = World.getInstance().getPlayer(_target);
  7836.         if (target == null)
  7837.         {
  7838.             activeChar.sendPacket(SystemMessageId.YOU_HAVE_INVITED_THE_WRONG_TARGET);
  7839. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java
  7840. ===================================================================
  7841. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java  (revision 2)
  7842. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestMagicSkillUse.java  (working copy)
  7843. @@ -85,6 +85,12 @@
  7844.        
  7845.         if (activeChar.isAttackingNow())
  7846.         {
  7847. +           if (skill.isToggle())
  7848. +           {
  7849. +               activeChar.sendPacket(ActionFailed.STATIC_PACKET);
  7850. +               return;
  7851. +           }
  7852. +          
  7853.             activeChar.getAI().setNextAction(new NextAction(CtrlEvent.EVT_READY_TO_ACT, CtrlIntention.CAST, new Runnable()
  7854.             {
  7855.                 @Override
  7856. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestOustFromPartyRoom.java
  7857. ===================================================================
  7858. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestOustFromPartyRoom.java  (revision 2)
  7859. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestOustFromPartyRoom.java  (working copy)
  7860. @@ -15,7 +15,7 @@
  7861.  package net.sf.l2j.gameserver.network.clientpackets;
  7862.  
  7863.  import net.sf.l2j.gameserver.datatables.MapRegionTable;
  7864. -import net.sf.l2j.gameserver.model.L2World;
  7865. +import net.sf.l2j.gameserver.model.World;
  7866.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7867.  import net.sf.l2j.gameserver.model.partymatching.PartyMatchRoom;
  7868.  import net.sf.l2j.gameserver.model.partymatching.PartyMatchRoomList;
  7869. @@ -45,7 +45,7 @@
  7870.         if (activeChar == null)
  7871.             return;
  7872.        
  7873. -       final L2PcInstance member = L2World.getInstance().getPlayer(_charid);
  7874. +       final L2PcInstance member = World.getInstance().getPlayer(_charid);
  7875.         if (member == null)
  7876.             return;
  7877.        
  7878. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPetGetItem.java
  7879. ===================================================================
  7880. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPetGetItem.java (revision 2)
  7881. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPetGetItem.java (working copy)
  7882. @@ -16,7 +16,7 @@
  7883.  
  7884.  import net.sf.l2j.gameserver.ai.CtrlIntention;
  7885.  import net.sf.l2j.gameserver.model.L2Object;
  7886. -import net.sf.l2j.gameserver.model.L2World;
  7887. +import net.sf.l2j.gameserver.model.World;
  7888.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7889.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  7890.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  7891. @@ -38,7 +38,7 @@
  7892.         if (activeChar == null || !activeChar.hasPet())
  7893.             return;
  7894.        
  7895. -       final L2Object item = L2World.getInstance().getObject(_objectId);
  7896. +       final L2Object item = World.getInstance().getObject(_objectId);
  7897.         if (item == null)
  7898.             return;
  7899.        
  7900. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java
  7901. ===================================================================
  7902. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java    (revision 2)
  7903. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java    (working copy)
  7904. @@ -19,7 +19,7 @@
  7905.  
  7906.  import net.sf.l2j.Config;
  7907.  import net.sf.l2j.gameserver.model.ItemRequest;
  7908. -import net.sf.l2j.gameserver.model.L2World;
  7909. +import net.sf.l2j.gameserver.model.World;
  7910.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7911.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.StoreType;
  7912.  import net.sf.l2j.gameserver.model.tradelist.TradeList;
  7913. @@ -69,7 +69,7 @@
  7914.         if (_items == null)
  7915.             return;
  7916.        
  7917. -       L2PcInstance storePlayer = L2World.getInstance().getPlayer(_storePlayerId);
  7918. +       L2PcInstance storePlayer = World.getInstance().getPlayer(_storePlayerId);
  7919.         if (storePlayer == null)
  7920.             return;
  7921.        
  7922. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java
  7923. ===================================================================
  7924. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java   (revision 2)
  7925. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java   (working copy)
  7926. @@ -16,7 +16,7 @@
  7927.  
  7928.  import net.sf.l2j.Config;
  7929.  import net.sf.l2j.gameserver.model.ItemRequest;
  7930. -import net.sf.l2j.gameserver.model.L2World;
  7931. +import net.sf.l2j.gameserver.model.World;
  7932.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7933.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.StoreType;
  7934.  import net.sf.l2j.gameserver.model.tradelist.TradeList;
  7935. @@ -67,7 +67,7 @@
  7936.         if (_items == null)
  7937.             return;
  7938.        
  7939. -       L2PcInstance storePlayer = L2World.getInstance().getPlayer(_storePlayerId);
  7940. +       L2PcInstance storePlayer = World.getInstance().getPlayer(_storePlayerId);
  7941.         if (storePlayer == null)
  7942.             return;
  7943.        
  7944. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java
  7945. ===================================================================
  7946. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java (revision 2)
  7947. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java (working copy)
  7948. @@ -14,7 +14,7 @@
  7949.   */
  7950.  package net.sf.l2j.gameserver.network.clientpackets;
  7951.  
  7952. -import net.sf.l2j.gameserver.model.L2World;
  7953. +import net.sf.l2j.gameserver.model.World;
  7954.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7955.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.StoreType;
  7956.  import net.sf.l2j.gameserver.network.serverpackets.RecipeShopItemInfo;
  7957. @@ -37,7 +37,7 @@
  7958.         if (player == null)
  7959.             return;
  7960.        
  7961. -       final L2PcInstance shop = L2World.getInstance().getPlayer(_playerObjectId);
  7962. +       final L2PcInstance shop = World.getInstance().getPlayer(_playerObjectId);
  7963.         if (shop == null || shop.getStoreType() != StoreType.MANUFACTURE)
  7964.             return;
  7965.        
  7966. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java
  7967. ===================================================================
  7968. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java (revision 2)
  7969. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java (working copy)
  7970. @@ -15,7 +15,7 @@
  7971.  package net.sf.l2j.gameserver.network.clientpackets;
  7972.  
  7973.  import net.sf.l2j.gameserver.datatables.RecipeTable;
  7974. -import net.sf.l2j.gameserver.model.L2World;
  7975. +import net.sf.l2j.gameserver.model.World;
  7976.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  7977.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.StoreType;
  7978.  import net.sf.l2j.gameserver.network.SystemMessageId;
  7979. @@ -48,7 +48,7 @@
  7980.         if (activeChar == null)
  7981.             return;
  7982.        
  7983. -       final L2PcInstance manufacturer = L2World.getInstance().getPlayer(_id);
  7984. +       final L2PcInstance manufacturer = World.getInstance().getPlayer(_id);
  7985.         if (manufacturer == null)
  7986.             return;
  7987.        
  7988. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecordInfo.java
  7989. ===================================================================
  7990. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecordInfo.java (revision 2)
  7991. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecordInfo.java (working copy)
  7992. @@ -32,6 +32,6 @@
  7993.             return;
  7994.        
  7995.         activeChar.sendPacket(new UserInfo(activeChar));
  7996. -       activeChar.getKnownList().refreshInfos();
  7997. +       activeChar.refreshInfos();
  7998.     }
  7999.  }
  8000. \ No newline at end of file
  8001. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestSendFriendMsg.java
  8002. ===================================================================
  8003. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestSendFriendMsg.java  (revision 2)
  8004. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestSendFriendMsg.java  (working copy)
  8005. @@ -19,7 +19,7 @@
  8006.  import java.util.logging.Logger;
  8007.  
  8008.  import net.sf.l2j.Config;
  8009. -import net.sf.l2j.gameserver.model.L2World;
  8010. +import net.sf.l2j.gameserver.model.World;
  8011.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8012.  import net.sf.l2j.gameserver.network.SystemMessageId;
  8013.  import net.sf.l2j.gameserver.network.serverpackets.L2FriendSay;
  8014. @@ -52,7 +52,7 @@
  8015.         if (activeChar == null)
  8016.             return;
  8017.        
  8018. -       final L2PcInstance targetPlayer = L2World.getInstance().getPlayer(_reciever);
  8019. +       final L2PcInstance targetPlayer = World.getInstance().getPlayer(_reciever);
  8020.         if (targetPlayer == null || !targetPlayer.getFriendList().contains(activeChar.getObjectId()))
  8021.         {
  8022.             activeChar.sendPacket(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME);
  8023. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/SnoopQuit.java
  8024. ===================================================================
  8025. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/SnoopQuit.java (revision 2)
  8026. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/SnoopQuit.java (working copy)
  8027. @@ -14,7 +14,7 @@
  8028.   */
  8029.  package net.sf.l2j.gameserver.network.clientpackets;
  8030.  
  8031. -import net.sf.l2j.gameserver.model.L2World;
  8032. +import net.sf.l2j.gameserver.model.World;
  8033.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8034.  
  8035.  /**
  8036. @@ -37,7 +37,7 @@
  8037.         if (activeChar == null)
  8038.             return;
  8039.        
  8040. -       final L2PcInstance target = L2World.getInstance().getPlayer(_snoopID);
  8041. +       final L2PcInstance target = World.getInstance().getPlayer(_snoopID);
  8042.         if (target == null)
  8043.             return;
  8044.        
  8045. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeDone.java
  8046. ===================================================================
  8047. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeDone.java (revision 2)
  8048. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeDone.java (working copy)
  8049. @@ -14,7 +14,7 @@
  8050.   */
  8051.  package net.sf.l2j.gameserver.network.clientpackets;
  8052.  
  8053. -import net.sf.l2j.gameserver.model.L2World;
  8054. +import net.sf.l2j.gameserver.model.World;
  8055.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8056.  import net.sf.l2j.gameserver.model.tradelist.TradeList;
  8057.  import net.sf.l2j.gameserver.network.SystemMessageId;
  8058. @@ -57,7 +57,7 @@
  8059.        
  8060.         // Trade partner not found, cancel trade
  8061.         final L2PcInstance partner = trade.getPartner();
  8062. -       if (partner == null || L2World.getInstance().getPlayer(partner.getObjectId()) == null)
  8063. +       if (partner == null || World.getInstance().getPlayer(partner.getObjectId()) == null)
  8064.         {
  8065.             player.sendPacket(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME);
  8066.             player.cancelActiveTrade();
  8067. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java
  8068. ===================================================================
  8069. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java  (revision 2)
  8070. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java  (working copy)
  8071. @@ -16,7 +16,7 @@
  8072.  
  8073.  import net.sf.l2j.Config;
  8074.  import net.sf.l2j.gameserver.model.BlockList;
  8075. -import net.sf.l2j.gameserver.model.L2World;
  8076. +import net.sf.l2j.gameserver.model.World;
  8077.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  8078.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8079.  import net.sf.l2j.gameserver.network.SystemMessageId;
  8080. @@ -47,8 +47,8 @@
  8081.             return;
  8082.         }
  8083.        
  8084. -       final L2PcInstance target = L2World.getInstance().getPlayer(_objectId);
  8085. -       if (target == null || !player.getKnownList().knowsObject(target) || target.equals(player))
  8086. +       final L2PcInstance target = World.getInstance().getPlayer(_objectId);
  8087. +       if (target == null || !player.getKnownType(L2PcInstance.class).contains(target) || target.equals(player))
  8088.         {
  8089.             player.sendPacket(SystemMessageId.TARGET_IS_INCORRECT);
  8090.             return;
  8091. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/L2GameClient.java
  8092. ===================================================================
  8093. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/L2GameClient.java    (revision 2)
  8094. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/L2GameClient.java    (working copy)
  8095. @@ -40,7 +40,7 @@
  8096.  import net.sf.l2j.gameserver.datatables.ClanTable;
  8097.  import net.sf.l2j.gameserver.model.CharSelectInfoPackage;
  8098.  import net.sf.l2j.gameserver.model.L2Clan;
  8099. -import net.sf.l2j.gameserver.model.L2World;
  8100. +import net.sf.l2j.gameserver.model.World;
  8101.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8102.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  8103.  import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket;
  8104. @@ -395,37 +395,39 @@
  8105.         }
  8106.     }
  8107.    
  8108. -   public L2PcInstance loadCharFromDisk(int charslot)
  8109. +   public L2PcInstance loadCharFromDisk(int slot)
  8110.     {
  8111. -       final int objId = getObjectIdForSlot(charslot);
  8112. -       if (objId < 0)
  8113. +       final int objectId = getObjectIdForSlot(slot);
  8114. +       if (objectId < 0)
  8115.             return null;
  8116.        
  8117. -       L2PcInstance character = L2World.getInstance().getPlayer(objId);
  8118. -       if (character != null)
  8119. +       L2PcInstance player = World.getInstance().getPlayer(objectId);
  8120. +       if (player != null)
  8121.         {
  8122.             // exploit prevention, should not happens in normal way
  8123. -           _log.severe("Attempt of double login: " + character.getName() + "(" + objId + ") " + getAccountName());
  8124. -           if (character.getClient() != null)
  8125. -               character.getClient().closeNow();
  8126. +           _log.severe("Attempt of double login: " + player.getName() + "(" + objectId + ") " + getAccountName());
  8127. +          
  8128. +           if (player.getClient() != null)
  8129. +               player.getClient().closeNow();
  8130.             else
  8131. -               character.deleteMe();
  8132. +               player.deleteMe();
  8133.            
  8134.             return null;
  8135.         }
  8136.        
  8137. -       character = L2PcInstance.restore(objId);
  8138. -       if (character != null)
  8139. +       player = L2PcInstance.restore(objectId);
  8140. +       if (player != null)
  8141.         {
  8142. -           character.setRunning(); // running is default
  8143. -           character.standUp(); // standing is default
  8144. +           player.setRunning(); // running is default
  8145. +           player.standUp(); // standing is default
  8146.            
  8147. -           character.setOnlineStatus(true, false);
  8148. +           player.setOnlineStatus(true, false);
  8149. +           World.getInstance().addPlayer(player);
  8150.         }
  8151.         else
  8152. -           _log.severe("L2GameClient: could not restore in slot: " + charslot);
  8153. +           _log.severe("L2GameClient: could not restore in slot: " + slot);
  8154.        
  8155. -       return character;
  8156. +       return player;
  8157.     }
  8158.    
  8159.     /**
  8160. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/ExRegenMax.java
  8161. ===================================================================
  8162. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/ExRegenMax.java    (revision 0)
  8163. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/ExRegenMax.java    (working copy)
  8164. @@ -0,0 +1,40 @@
  8165. +/*
  8166. + * This program is free software: you can redistribute it and/or modify it under
  8167. + * the terms of the GNU General Public License as published by the Free Software
  8168. + * Foundation, either version 3 of the License, or (at your option) any later
  8169. + * version.
  8170. + *
  8171. + * This program is distributed in the hope that it will be useful, but WITHOUT
  8172. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8173. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  8174. + * details.
  8175. + *
  8176. + * You should have received a copy of the GNU General Public License along with
  8177. + * this program. If not, see <http://www.gnu.org/licenses/>.
  8178. + */
  8179. +package net.sf.l2j.gameserver.network.serverpackets;
  8180. +
  8181. +public final class ExRegenMax extends L2GameServerPacket
  8182. +{
  8183. +   private final int _count;
  8184. +   private final int _time;
  8185. +   private final double _hpRegen;
  8186. +  
  8187. +   public ExRegenMax(int count, int time, double hpRegen)
  8188. +   {
  8189. +       _count = count;
  8190. +       _time = time;
  8191. +       _hpRegen = hpRegen * 0.66;
  8192. +   }
  8193. +  
  8194. +   @Override
  8195. +   protected void writeImpl()
  8196. +   {
  8197. +       writeC(0xFE);
  8198. +       writeH(0x01);
  8199. +       writeD(1);
  8200. +       writeD(_count);
  8201. +       writeD(_time);
  8202. +       writeF(_hpRegen);
  8203. +   }
  8204. +}
  8205. \ No newline at end of file
  8206. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/FriendList.java
  8207. ===================================================================
  8208. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/FriendList.java    (revision 2)
  8209. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/FriendList.java    (working copy)
  8210. @@ -18,7 +18,7 @@
  8211.  import java.util.List;
  8212.  
  8213.  import net.sf.l2j.gameserver.datatables.CharNameTable;
  8214. -import net.sf.l2j.gameserver.model.L2World;
  8215. +import net.sf.l2j.gameserver.model.World;
  8216.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8217.  
  8218.  /**
  8219. @@ -50,7 +50,7 @@
  8220.         for (int objId : player.getFriendList())
  8221.         {
  8222.             final String name = CharNameTable.getInstance().getPlayerName(objId);
  8223. -           final L2PcInstance player1 = L2World.getInstance().getPlayer(objId);
  8224. +           final L2PcInstance player1 = World.getInstance().getPlayer(objId);
  8225.            
  8226.             _info.add(new FriendInfo(objId, name, (player1 != null && player1.isOnline())));
  8227.         }
  8228. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/FriendStatus.java
  8229. ===================================================================
  8230. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/FriendStatus.java  (revision 2)
  8231. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/FriendStatus.java  (working copy)
  8232. @@ -13,7 +13,7 @@
  8233.  package net.sf.l2j.gameserver.network.serverpackets;
  8234.  
  8235.  import net.sf.l2j.gameserver.datatables.CharNameTable;
  8236. -import net.sf.l2j.gameserver.model.L2World;
  8237. +import net.sf.l2j.gameserver.model.World;
  8238.  
  8239.  /**
  8240.   * Support for "Chat with Friends" dialog. <BR>
  8241. @@ -34,7 +34,7 @@
  8242.     {
  8243.         _objid = objId;
  8244.         _name = CharNameTable.getInstance().getPlayerName(objId);
  8245. -       _online = L2World.getInstance().getPlayer(objId) != null;
  8246. +       _online = World.getInstance().getPlayer(objId) != null;
  8247.     }
  8248.    
  8249.     @Override
  8250. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/RecipeBookItemList.java
  8251. ===================================================================
  8252. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/RecipeBookItemList.java    (revision 2)
  8253. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/RecipeBookItemList.java    (working copy)
  8254. @@ -56,7 +56,7 @@
  8255.             for (RecipeList recipe : _recipes)
  8256.             {
  8257.                 writeD(recipe.getId());
  8258. -               writeD(i + 1);
  8259. +               writeD(++i);
  8260.             }
  8261.         }
  8262.     }
  8263. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/RecipeShopManageList.java
  8264. ===================================================================
  8265. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/RecipeShopManageList.java  (revision 2)
  8266. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/RecipeShopManageList.java  (working copy)
  8267. @@ -72,7 +72,7 @@
  8268.             for (RecipeList recipe : _recipes)
  8269.             {
  8270.                 writeD(recipe.getId());
  8271. -               writeD(i + 1);
  8272. +               writeD(++i);
  8273.             }
  8274.         }
  8275.        
  8276. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/SetupGauge.java
  8277. ===================================================================
  8278. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/SetupGauge.java    (revision 2)
  8279. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/SetupGauge.java    (working copy)
  8280. @@ -16,34 +16,38 @@
  8281.  
  8282.  public class SetupGauge extends L2GameServerPacket
  8283.  {
  8284. -   public static final int BLUE = 0;
  8285. -   public static final int RED = 1;
  8286. -   public static final int CYAN = 2;
  8287. +   public enum GaugeColor
  8288. +   {
  8289. +       BLUE,
  8290. +       RED,
  8291. +       CYAN,
  8292. +       GREEN
  8293. +   }
  8294.    
  8295. -   private final int _dat1;
  8296. +   private final GaugeColor _color;
  8297.     private final int _time;
  8298. -   private final int _time2;
  8299. +   private final int _maxTime;
  8300.    
  8301. -   public SetupGauge(int dat1, int time)
  8302. +   public SetupGauge(GaugeColor color, int time)
  8303.     {
  8304. -       _dat1 = dat1;
  8305. +       _color = color;
  8306.         _time = time;
  8307. -       _time2 = time;
  8308. +       _maxTime = time;
  8309.     }
  8310.    
  8311. -   public SetupGauge(int color, int currentTime, int maxTime)
  8312. +   public SetupGauge(GaugeColor color, int currentTime, int maxTime)
  8313.     {
  8314. -       _dat1 = color;
  8315. +       _color = color;
  8316.         _time = currentTime;
  8317. -       _time2 = maxTime;
  8318. +       _maxTime = maxTime;
  8319.     }
  8320.    
  8321.     @Override
  8322.     protected final void writeImpl()
  8323.     {
  8324.         writeC(0x6d);
  8325. -       writeD(_dat1);
  8326. +       writeD(_color.ordinal());
  8327.         writeD(_time);
  8328. -       writeD(_time2);
  8329. +       writeD(_maxTime);
  8330.     }
  8331.  }
  8332. \ No newline at end of file
  8333. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/quests/Q420_LittleWing.java
  8334. ===================================================================
  8335. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/quests/Q420_LittleWing.java    (revision 2)
  8336. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/quests/Q420_LittleWing.java    (working copy)
  8337. @@ -16,6 +16,7 @@
  8338.  
  8339.  import net.sf.l2j.commons.random.Rnd;
  8340.  
  8341. +import net.sf.l2j.gameserver.model.SpawnLocation;
  8342.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  8343.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8344.  import net.sf.l2j.gameserver.scripting.Quest;
  8345. @@ -72,13 +73,23 @@
  8346.     private static final int SHAMHAI = 30752;
  8347.     private static final int COOPER = 30829;
  8348.    
  8349. +   // Spawn Points
  8350. +   private static final SpawnLocation[] LOCATIONS =
  8351. +   {
  8352. +       new SpawnLocation(109816, 40854, -4640, 0),
  8353. +       new SpawnLocation(108940, 41615, -4643, 0),
  8354. +       new SpawnLocation(110395, 41625, -4642, 0)
  8355. +   };
  8356. +  
  8357. +   private static int _counter = 0;
  8358. +  
  8359.     public Q420_LittleWing()
  8360.     {
  8361.         super(420, "Little Wing");
  8362.        
  8363.         setItemsIds(FAIRY_STONE, DELUXE_FAIRY_STONE, FAIRY_STONE_LIST, DELUXE_FAIRY_STONE_LIST, TOAD_LORD_BACK_SKIN, JUICE_OF_MONKSHOOD, SCALE_OF_DRAKE_EXARION, EGG_OF_DRAKE_EXARION, SCALE_OF_DRAKE_ZWOV, EGG_OF_DRAKE_ZWOV, SCALE_OF_DRAKE_KALIBRAN, EGG_OF_DRAKE_KALIBRAN, SCALE_OF_WYVERN_SUZET, EGG_OF_WYVERN_SUZET, SCALE_OF_WYVERN_SHAMHAI, EGG_OF_WYVERN_SHAMHAI);
  8364.        
  8365. -       addStartNpc(COOPER);
  8366. +       addStartNpc(COOPER, MIMYU);
  8367.         addTalkId(MARIA, CRONOS, BYRON, MIMYU, EXARION, ZWOV, KALIBRAN, SUZET, SHAMHAI, COOPER);
  8368.        
  8369.         addKillId(20202, 20231, 20233, 20270, 20551, 20580, 20589, 20590, 20591, 20592, 20593, 20594, 20595, 20596, 20597, 20598, 20599);
  8370. @@ -278,7 +289,17 @@
  8371.         switch (st.getState())
  8372.         {
  8373.             case STATE_CREATED:
  8374. -               htmltext = (player.getLevel() >= 35) ? "30829-01.htm" : "30829-03.htm";
  8375. +               switch (npc.getNpcId())
  8376. +               {
  8377. +                   case COOPER:
  8378. +                       htmltext = (player.getLevel() >= 35) ? "30829-01.htm" : "30829-03.htm";
  8379. +                       break;
  8380. +                  
  8381. +                   case MIMYU:
  8382. +                       _counter += 1;
  8383. +                       npc.teleToLocation(LOCATIONS[_counter % 3], 0);
  8384. +                       return null;
  8385. +               }
  8386.                 break;
  8387.            
  8388.             case STATE_STARTED:
  8389. @@ -384,6 +405,12 @@
  8390.                         }
  8391.                         else if (cond == 7)
  8392.                             htmltext = "30747-11.htm";
  8393. +                       else
  8394. +                       {
  8395. +                           _counter += 1;
  8396. +                           npc.teleToLocation(LOCATIONS[_counter % 3], 0);
  8397. +                           return null;
  8398. +                       }
  8399.                         break;
  8400.                    
  8401.                     case EXARION:
  8402. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/quests/SagasScripts/SagasSuperClass.java
  8403. ===================================================================
  8404. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/quests/SagasScripts/SagasSuperClass.java   (revision 2)
  8405. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/quests/SagasScripts/SagasSuperClass.java   (working copy)
  8406. @@ -26,7 +26,7 @@
  8407.  import net.sf.l2j.gameserver.model.L2Object;
  8408.  import net.sf.l2j.gameserver.model.L2Party;
  8409.  import net.sf.l2j.gameserver.model.L2Skill;
  8410. -import net.sf.l2j.gameserver.model.L2World;
  8411. +import net.sf.l2j.gameserver.model.World;
  8412.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  8413.  import net.sf.l2j.gameserver.model.actor.L2Character;
  8414.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  8415. @@ -183,7 +183,7 @@
  8416.     {
  8417.         if (_SpawnList.containsKey(npc))
  8418.         {
  8419. -           final L2PcInstance player = L2World.getInstance().getPlayer(_SpawnList.get(npc));
  8420. +           final L2PcInstance player = World.getInstance().getPlayer(_SpawnList.get(npc));
  8421.             if (player != null)
  8422.                 return player.getQuestState(getName());
  8423.         }
  8424. @@ -480,7 +480,7 @@
  8425.             else if (event.equalsIgnoreCase("Mob_3 Timer 1"))
  8426.             {
  8427.                 // Search the NPC.
  8428. -               L2Npc Mob_2 = (L2Npc) L2World.getInstance().getObject(st.getInt("Mob_2"));
  8429. +               L2Npc Mob_2 = (L2Npc) World.getInstance().getObject(st.getInt("Mob_2"));
  8430.                 if (Mob_2 == null)
  8431.                     return null;
  8432.                
  8433. @@ -820,7 +820,7 @@
  8434.     {
  8435.         if (_SpawnList.containsKey(npc) && _SpawnList.get(npc) != player.getObjectId())
  8436.         {
  8437. -           L2PcInstance quest_player = L2World.getInstance().getPlayer(_SpawnList.get(npc));
  8438. +           L2PcInstance quest_player = World.getInstance().getPlayer(_SpawnList.get(npc));
  8439.             if (quest_player == null)
  8440.                 return null;
  8441.            
  8442. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/Monastery.java
  8443. ===================================================================
  8444. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/Monastery.java    (revision 2)
  8445. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/Monastery.java    (working copy)
  8446. @@ -25,7 +25,6 @@
  8447.  import net.sf.l2j.gameserver.scripting.EventType;
  8448.  import net.sf.l2j.gameserver.scripting.scripts.ai.L2AttackableAIScript;
  8449.  import net.sf.l2j.gameserver.templates.skills.L2SkillType;
  8450. -import net.sf.l2j.gameserver.util.Util;
  8451.  
  8452.  /**
  8453.   * This script holds MoS monsters behavior. If they see you with an equipped weapon, they will speak and attack you.
  8454. @@ -108,9 +107,9 @@
  8455.     @Override
  8456.     public String onSpawn(L2Npc npc)
  8457.     {
  8458. -       for (L2PcInstance target : npc.getKnownList().getKnownType(L2PcInstance.class))
  8459. +       for (L2PcInstance target : npc.getKnownTypeInRadius(L2PcInstance.class, npc.getTemplate().getAggroRange()))
  8460.         {
  8461. -           if (!target.isDead() && GeoEngine.getInstance().canSeeTarget(npc, target) && Util.checkIfInRange(npc.getTemplate().getAggroRange(), npc, target, true))
  8462. +           if (!target.isDead() && GeoEngine.getInstance().canSeeTarget(npc, target))
  8463.             {
  8464.                 if (target.getActiveWeaponInstance() != null && !npc.isInCombat() && npc.getTarget() == null)
  8465.                 {
  8466. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PlainsOfDion.java
  8467. ===================================================================
  8468. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PlainsOfDion.java (revision 2)
  8469. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PlainsOfDion.java (working copy)
  8470. @@ -70,9 +70,9 @@
  8471.         {
  8472.             npc.broadcastNpcSay(MONSTERS_MSG[Rnd.get(5)].replace("$s1", player.getName()));
  8473.            
  8474. -           for (L2MonsterInstance obj : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 300))
  8475. +           for (L2MonsterInstance obj : npc.getKnownTypeInRadius(L2MonsterInstance.class, 300))
  8476.             {
  8477. -               if (ArraysUtil.contains(MONSTERS, obj.getNpcId()) && !obj.isAttackingNow() && !obj.isDead() && GeoEngine.getInstance().canSeeTarget(npc, obj))
  8478. +               if (!obj.isAttackingNow() && !obj.isDead() && ArraysUtil.contains(MONSTERS, obj.getNpcId()) && GeoEngine.getInstance().canSeeTarget(npc, obj))
  8479.                 {
  8480.                     attack(obj, player);
  8481.                     obj.broadcastNpcSay(MONSTERS_ASSIST_MSG[Rnd.get(3)]);
  8482. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PrimevalIsle.java
  8483. ===================================================================
  8484. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PrimevalIsle.java (revision 2)
  8485. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PrimevalIsle.java (working copy)
  8486. @@ -84,7 +84,7 @@
  8487.         if (event.equalsIgnoreCase("skill"))
  8488.         {
  8489.             int playableCounter = 0;
  8490. -           for (L2Playable playable : npc.getKnownList().getKnownTypeInRadius(L2Playable.class, npc.getTemplate().getAggroRange()))
  8491. +           for (L2Playable playable : npc.getKnownTypeInRadius(L2Playable.class, npc.getTemplate().getAggroRange()))
  8492.             {
  8493.                 if (!playable.isDead())
  8494.                     playableCounter++;
  8495. @@ -136,7 +136,7 @@
  8496.         final L2Playable originalAttacker = (isPet ? attacker.getPet() : attacker);
  8497.        
  8498.         // Make all mobs found in a radius 2k aggressive towards attacker.
  8499. -       for (L2Attackable called : attacker.getKnownList().getKnownTypeInRadius(L2Attackable.class, 2000))
  8500. +       for (L2Attackable called : attacker.getKnownTypeInRadius(L2Attackable.class, 2000))
  8501.         {
  8502.             // Caller hasn't AI or is dead.
  8503.             if (!called.hasAI() || called.isDead())
  8504. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/StakatoNest.java
  8505. ===================================================================
  8506. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/StakatoNest.java  (revision 2)
  8507. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/StakatoNest.java  (working copy)
  8508. @@ -69,7 +69,7 @@
  8509.     {
  8510.         if (npc.getCurrentHp() / npc.getMaxHp() < 0.3 && Rnd.get(100) < 5)
  8511.         {
  8512. -           for (L2MonsterInstance follower : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8513. +           for (L2MonsterInstance follower : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8514.             {
  8515.                 if (follower.getNpcId() == STAKATO_FOLLOWER && !follower.isDead())
  8516.                 {
  8517. @@ -89,7 +89,7 @@
  8518.         switch (npc.getNpcId())
  8519.         {
  8520.             case MALE_SPIKED_STAKATO_1:
  8521. -               for (L2MonsterInstance angryFemale : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8522. +               for (L2MonsterInstance angryFemale : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8523.                 {
  8524.                     if (angryFemale.getNpcId() == FEMALE_SPIKED_STAKATO && !angryFemale.isDead())
  8525.                     {
  8526. @@ -103,7 +103,7 @@
  8527.                 break;
  8528.            
  8529.             case FEMALE_SPIKED_STAKATO:
  8530. -               for (L2MonsterInstance morphingMale : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8531. +               for (L2MonsterInstance morphingMale : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8532.                 {
  8533.                     if (morphingMale.getNpcId() == MALE_SPIKED_STAKATO_1 && !morphingMale.isDead())
  8534.                     {
  8535. @@ -116,7 +116,7 @@
  8536.                 break;
  8537.            
  8538.             case SPIKED_STAKATO_NURSE_1:
  8539. -               for (L2MonsterInstance baby : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8540. +               for (L2MonsterInstance baby : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8541.                 {
  8542.                     if (baby.getNpcId() == SPIKED_STAKATO_BABY && !baby.isDead())
  8543.                     {
  8544. @@ -130,7 +130,7 @@
  8545.                 break;
  8546.            
  8547.             case SPIKED_STAKATO_BABY:
  8548. -               for (L2MonsterInstance morphingNurse : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8549. +               for (L2MonsterInstance morphingNurse : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  8550.                 {
  8551.                     if (morphingNurse.getNpcId() == SPIKED_STAKATO_NURSE_1 && !morphingNurse.isDead())
  8552.                     {
  8553. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Antharas.java
  8554. ===================================================================
  8555. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Antharas.java    (revision 2)
  8556. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Antharas.java    (working copy)
  8557. @@ -328,7 +328,7 @@
  8558.             return;
  8559.        
  8560.         // Pickup a target if no or dead victim. 10% luck he decides to reconsiders his target.
  8561. -       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || Rnd.get(10) == 0)
  8562. +       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownType(L2PcInstance.class).contains(_actualVictim)) || Rnd.get(10) == 0)
  8563.             _actualVictim = getRandomPlayer(npc);
  8564.        
  8565.         // If result is still null, Antharas will roam. Don't go deeper in skill AI.
  8566. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Baium.java
  8567. ===================================================================
  8568. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Baium.java   (revision 2)
  8569. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Baium.java   (working copy)
  8570. @@ -392,7 +392,7 @@
  8571.         int npcId = npc.getNpcId();
  8572.         List<L2Character> result = new ArrayList<>();
  8573.        
  8574. -       for (L2Character obj : npc.getKnownList().getKnownType(L2Character.class))
  8575. +       for (L2Character obj : npc.getKnownType(L2Character.class))
  8576.         {
  8577.             if (obj instanceof L2PcInstance)
  8578.             {
  8579. @@ -435,7 +435,7 @@
  8580.             return;
  8581.        
  8582.         // Pickup a target if no or dead victim. If Baium was hitting an angel, 50% luck he reconsiders his target. 10% luck he decides to reconsiders his target.
  8583. -       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || (_actualVictim instanceof L2MonsterInstance && Rnd.get(10) < 5) || Rnd.get(10) == 0)
  8584. +       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownType(L2PcInstance.class).contains(_actualVictim)) || (_actualVictim instanceof L2MonsterInstance && Rnd.get(10) < 5) || Rnd.get(10) == 0)
  8585.             _actualVictim = getRandomTarget(npc);
  8586.        
  8587.         // If result is null, return directly.
  8588. @@ -474,7 +474,7 @@
  8589.         final int chance = Rnd.get(100); // Remember, it's 0 to 99, not 1 to 100.
  8590.        
  8591.         // If Baium feels surrounded or see 2+ angels, he unleashes his wrath upon heads :).
  8592. -       if (getPlayersCountInRadius(600, npc, false) >= 20 || npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 600).size() >= 2)
  8593. +       if (getPlayersCountInRadius(600, npc, false) >= 20 || npc.getKnownTypeInRadius(L2MonsterInstance.class, 600).size() >= 2)
  8594.         {
  8595.             if (chance < 25)
  8596.                 skill = 4130;
  8597. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/DrChaos.java
  8598. ===================================================================
  8599. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/DrChaos.java (revision 2)
  8600. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/DrChaos.java (working copy)
  8601. @@ -175,7 +175,7 @@
  8602.         {
  8603.             if (GrandBossManager.getInstance().getBossStatus(CHAOS_GOLEM) == NORMAL)
  8604.             {
  8605. -               for (L2PcInstance obj : npc.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 500))
  8606. +               for (L2PcInstance obj : npc.getKnownTypeInRadius(L2PcInstance.class, 500))
  8607.                 {
  8608.                     if (obj.isDead())
  8609.                         continue;
  8610. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Gordon.java
  8611. ===================================================================
  8612. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Gordon.java  (revision 2)
  8613. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Gordon.java  (working copy)
  8614. @@ -119,7 +119,7 @@
  8615.                 return null;
  8616.            
  8617.             // Check if player have Cursed Weapon and is in radius.
  8618. -           for (L2PcInstance pc : npc.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 5000))
  8619. +           for (L2PcInstance pc : npc.getKnownTypeInRadius(L2PcInstance.class, 5000))
  8620.             {
  8621.                 if (pc.isCursedWeaponEquipped())
  8622.                 {
  8623. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Valakas.java
  8624. ===================================================================
  8625. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Valakas.java (revision 2)
  8626. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Valakas.java (working copy)
  8627. @@ -26,7 +26,6 @@
  8628.  import net.sf.l2j.gameserver.model.Location;
  8629.  import net.sf.l2j.gameserver.model.SpawnLocation;
  8630.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  8631. -import net.sf.l2j.gameserver.model.actor.L2Playable;
  8632.  import net.sf.l2j.gameserver.model.actor.instance.L2GrandBossInstance;
  8633.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8634.  import net.sf.l2j.gameserver.model.zone.type.L2BossZone;
  8635. @@ -88,7 +87,7 @@
  8636.     public static final int VALAKAS = 29028;
  8637.    
  8638.     private long _timeTracker = 0; // Time tracker for last attack on Valakas.
  8639. -   private L2Playable _actualVictim; // Actual target of Valakas.
  8640. +   private L2PcInstance _actualVictim; // Actual target of Valakas.
  8641.    
  8642.     public Valakas()
  8643.     {
  8644. @@ -392,7 +391,7 @@
  8645.             return;
  8646.        
  8647.         // Pickup a target if no or dead victim. 10% luck he decides to reconsiders his target.
  8648. -       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || Rnd.get(10) == 0)
  8649. +       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownType(L2PcInstance.class).contains(_actualVictim)) || Rnd.get(10) == 0)
  8650.             _actualVictim = getRandomPlayer(npc);
  8651.        
  8652.         // If result is still null, Valakas will roam. Don't go deeper in skill AI.
  8653. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/L2AttackableAIScript.java
  8654. ===================================================================
  8655. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/L2AttackableAIScript.java   (revision 2)
  8656. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/L2AttackableAIScript.java   (working copy)
  8657. @@ -215,7 +215,7 @@
  8658.     {
  8659.         List<L2PcInstance> result = new ArrayList<>();
  8660.        
  8661. -       for (L2PcInstance player : npc.getKnownList().getKnownType(L2PcInstance.class))
  8662. +       for (L2PcInstance player : npc.getKnownType(L2PcInstance.class))
  8663.         {
  8664.             if (player.isDead())
  8665.                 continue;
  8666. @@ -240,7 +240,7 @@
  8667.     public static int getPlayersCountInRadius(int range, L2Character npc, boolean invisible)
  8668.     {
  8669.         int count = 0;
  8670. -       for (L2PcInstance player : npc.getKnownList().getKnownType(L2PcInstance.class))
  8671. +       for (L2PcInstance player : npc.getKnownTypeInRadius(L2PcInstance.class, range))
  8672.         {
  8673.             if (player.isDead())
  8674.                 continue;
  8675. @@ -248,8 +248,7 @@
  8676.             if (!invisible && player.getAppearance().getInvisible())
  8677.                 continue;
  8678.            
  8679. -           if (Util.checkIfInRange(range, npc, player, true))
  8680. -               count++;
  8681. +           count++;
  8682.         }
  8683.         return count;
  8684.     }
  8685. @@ -268,7 +267,7 @@
  8686.         int backCount = 0;
  8687.         int sideCount = 0;
  8688.        
  8689. -       for (L2PcInstance player : npc.getKnownList().getKnownType(L2PcInstance.class))
  8690. +       for (L2PcInstance player : npc.getKnownType(L2PcInstance.class))
  8691.         {
  8692.             if (player.isDead())
  8693.                 continue;
  8694. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/village_master/SecondClassChange.java
  8695. ===================================================================
  8696. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/village_master/SecondClassChange.java  (revision 2)
  8697. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/village_master/SecondClassChange.java  (working copy)
  8698. @@ -90,8 +90,8 @@
  8699.         });
  8700.         Classes.put("SE", new int[]
  8701.         {
  8702. +           43,
  8703.             42,
  8704. -           43,
  8705.             2,
  8706.             34,
  8707.             35,
  8708. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/tasks/Recommendation.java
  8709. ===================================================================
  8710. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/tasks/Recommendation.java  (revision 2)
  8711. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/tasks/Recommendation.java  (working copy)
  8712. @@ -14,7 +14,7 @@
  8713.   */
  8714.  package net.sf.l2j.gameserver.scripting.tasks;
  8715.  
  8716. -import net.sf.l2j.gameserver.model.L2World;
  8717. +import net.sf.l2j.gameserver.model.World;
  8718.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8719.  import net.sf.l2j.gameserver.network.serverpackets.UserInfo;
  8720.  import net.sf.l2j.gameserver.scripting.ScheduledQuest;
  8721. @@ -32,7 +32,7 @@
  8722.     @Override
  8723.     public final void onStart()
  8724.     {
  8725. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  8726. +       for (L2PcInstance player : World.getInstance().getPlayers())
  8727.         {
  8728.             player.restartRecom();
  8729.             player.sendPacket(new UserInfo(player));
  8730. Index: aCis_gameserver/java/net/sf/l2j/gameserver/Shutdown.java
  8731. ===================================================================
  8732. --- aCis_gameserver/java/net/sf/l2j/gameserver/Shutdown.java    (revision 2)
  8733. +++ aCis_gameserver/java/net/sf/l2j/gameserver/Shutdown.java    (working copy)
  8734. @@ -25,6 +25,7 @@
  8735.  import net.sf.l2j.gameserver.datatables.BufferTable;
  8736.  import net.sf.l2j.gameserver.datatables.ServerMemo;
  8737.  import net.sf.l2j.gameserver.instancemanager.CastleManorManager;
  8738. +import net.sf.l2j.gameserver.instancemanager.CoupleManager;
  8739.  import net.sf.l2j.gameserver.instancemanager.FishingChampionshipManager;
  8740.  import net.sf.l2j.gameserver.instancemanager.FourSepulchersManager;
  8741.  import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
  8742. @@ -32,7 +33,7 @@
  8743.  import net.sf.l2j.gameserver.instancemanager.SevenSigns;
  8744.  import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival;
  8745.  import net.sf.l2j.gameserver.instancemanager.ZoneManager;
  8746. -import net.sf.l2j.gameserver.model.L2World;
  8747. +import net.sf.l2j.gameserver.model.World;
  8748.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8749.  import net.sf.l2j.gameserver.model.entity.Hero;
  8750.  import net.sf.l2j.gameserver.model.olympiad.Olympiad;
  8751. @@ -186,6 +187,13 @@
  8752.             BufferTable.getInstance().saveSchemes();
  8753.             _log.info("BufferTable data has been saved.");
  8754.            
  8755. +           // Couples save.
  8756. +           if (Config.ALLOW_WEDDING)
  8757. +           {
  8758. +               CoupleManager.getInstance().save();
  8759. +               _log.info("CoupleManager data has been saved.");
  8760. +           }
  8761. +          
  8762.             // Save server memos.
  8763.             ServerMemo.getInstance().storeMe();
  8764.             _log.info("ServerMemo data has been saved.");
  8765. @@ -417,7 +425,7 @@
  8766.      */
  8767.     private static void disconnectAllCharacters()
  8768.     {
  8769. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  8770. +       for (L2PcInstance player : World.getInstance().getPlayers())
  8771.         {
  8772.             try
  8773.             {
  8774. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java
  8775. ===================================================================
  8776. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java (revision 2)
  8777. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java (working copy)
  8778. @@ -70,11 +70,11 @@
  8779.         List<L2Character> targetList = new ArrayList<>();
  8780.        
  8781.         // Getting the possible targets
  8782. -       for (L2Object obj : getEffected().getKnownList().getKnownObjects())
  8783. +       for (L2Attackable obj : getEffected().getKnownType(L2Attackable.class))
  8784.         {
  8785.             // Only attackable NPCs are put in the list.
  8786. -           if (obj instanceof L2Attackable && !(obj instanceof L2ChestInstance) && obj != getEffected())
  8787. -               targetList.add((L2Character) obj);
  8788. +           if (!(obj instanceof L2ChestInstance))
  8789. +               targetList.add(obj);
  8790.         }
  8791.        
  8792.         // if there is no target, exit function
  8793. @@ -82,8 +82,7 @@
  8794.             return true;
  8795.        
  8796.         // Choosing randomly a new target
  8797. -       int nextTargetIdx = Rnd.get(targetList.size());
  8798. -       L2Object target = targetList.get(nextTargetIdx);
  8799. +       L2Object target = Rnd.get(targetList);
  8800.        
  8801.         // Attacking the target
  8802.         getEffected().setTarget(target);
  8803. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java
  8804. ===================================================================
  8805. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java  (revision 2)
  8806. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java  (working copy)
  8807. @@ -72,7 +72,7 @@
  8808.         List<L2Character> targetList = new ArrayList<>();
  8809.        
  8810.         // Getting the possible targets
  8811. -       for (L2Object obj : getEffected().getKnownList().getKnownObjects())
  8812. +       for (L2Object obj : getEffected().getKnownType(L2Object.class))
  8813.         {
  8814.             // Attackable NPCs and playable characters (players, summons) are put in the list.
  8815.             if ((obj instanceof L2Attackable || obj instanceof L2Playable) && (obj != getEffected()))
  8816. @@ -86,8 +86,7 @@
  8817.             return true;
  8818.        
  8819.         // Choosing randomly a new target
  8820. -       int nextTargetIdx = Rnd.get(targetList.size());
  8821. -       L2Object target = targetList.get(nextTargetIdx);
  8822. +       L2Object target = Rnd.get(targetList);
  8823.        
  8824.         // Attacking the target
  8825.         getEffected().setTarget(target);
  8826. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectFear.java
  8827. ===================================================================
  8828. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectFear.java   (revision 2)
  8829. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectFear.java   (working copy)
  8830. @@ -101,6 +101,12 @@
  8831.     }
  8832.    
  8833.     @Override
  8834. +   public boolean onSameEffect(L2Effect effect)
  8835. +   {
  8836. +       return false;
  8837. +   }
  8838. +  
  8839. +   @Override
  8840.     public int getEffectFlags()
  8841.     {
  8842.         return L2EffectFlag.FEAR.getMask();
  8843. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectHealOverTime.java
  8844. ===================================================================
  8845. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectHealOverTime.java   (revision 2)
  8846. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectHealOverTime.java   (working copy)
  8847. @@ -16,6 +16,8 @@
  8848.  
  8849.  import net.sf.l2j.gameserver.model.L2Effect;
  8850.  import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  8851. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  8852. +import net.sf.l2j.gameserver.network.serverpackets.ExRegenMax;
  8853.  import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
  8854.  import net.sf.l2j.gameserver.skills.Env;
  8855.  import net.sf.l2j.gameserver.templates.skills.L2EffectType;
  8856. @@ -34,25 +36,37 @@
  8857.     }
  8858.    
  8859.     @Override
  8860. +   public boolean onStart()
  8861. +   {
  8862. +       // If effected is a player, send a hp regen effect packet.
  8863. +       if (getEffected() instanceof L2PcInstance && getTotalCount() > 0 && getPeriod() > 0)
  8864. +           getEffected().sendPacket(new ExRegenMax(getTotalCount() * getPeriod(), getPeriod(), calc()));
  8865. +      
  8866. +       return true;
  8867. +   }
  8868. +  
  8869. +   @Override
  8870.     public boolean onActionTime()
  8871.     {
  8872. -       if (getEffected().isDead())
  8873. +       // Doesn't affect doors and dead characters.
  8874. +       if (getEffected().isDead() || getEffected() instanceof L2DoorInstance)
  8875.             return false;
  8876.        
  8877. -       if (getEffected() instanceof L2DoorInstance)
  8878. -           return false;
  8879. +       // Retrieve maximum hp.
  8880. +       final double maxHp = getEffected().getMaxHp();
  8881.        
  8882. -       double hp = getEffected().getCurrentHp();
  8883. -       double maxhp = getEffected().getMaxHp();
  8884. -       hp += calc();
  8885. -       if (hp > maxhp)
  8886. -       {
  8887. -           hp = maxhp;
  8888. -       }
  8889. -       getEffected().setCurrentHp(hp);
  8890. -       StatusUpdate suhp = new StatusUpdate(getEffected());
  8891. -       suhp.addAttribute(StatusUpdate.CUR_HP, (int) hp);
  8892. -       getEffected().sendPacket(suhp);
  8893. +       // Calculate new hp amount. If higher than max, pick max.
  8894. +       double newHp = getEffected().getCurrentHp() + calc();
  8895. +       if (newHp > maxHp)
  8896. +           newHp = maxHp;
  8897. +      
  8898. +       // Set hp amount.
  8899. +       getEffected().setCurrentHp(newHp);
  8900. +      
  8901. +       // Send status update.
  8902. +       final StatusUpdate su = new StatusUpdate(getEffected());
  8903. +       su.addAttribute(StatusUpdate.CUR_HP, (int) newHp);
  8904. +       getEffected().sendPacket(su);
  8905.         return true;
  8906.     }
  8907. -}
  8908. +}
  8909. \ No newline at end of file
  8910. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectRoot.java
  8911. ===================================================================
  8912. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectRoot.java   (revision 2)
  8913. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectRoot.java   (working copy)
  8914. @@ -55,6 +55,12 @@
  8915.     }
  8916.    
  8917.     @Override
  8918. +   public boolean onSameEffect(L2Effect effect)
  8919. +   {
  8920. +       return false;
  8921. +   }
  8922. +  
  8923. +   @Override
  8924.     public int getEffectFlags()
  8925.     {
  8926.         return L2EffectFlag.ROOTED.getMask();
  8927. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java
  8928. ===================================================================
  8929. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java (revision 2)
  8930. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java (working copy)
  8931. @@ -78,7 +78,7 @@
  8932.         getEffector().reduceCurrentMp(mpConsume);
  8933.        
  8934.         List<L2Character> targets = new ArrayList<>();
  8935. -       for (L2Character cha : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  8936. +       for (L2Character cha : _actor.getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  8937.         {
  8938.             if (_skill.isOffensive() && !L2Skill.checkForAreaOffensiveSkills(getEffector(), cha, _skill, _srcInArena))
  8939.                 continue;
  8940. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java
  8941. ===================================================================
  8942. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java   (revision 2)
  8943. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java   (working copy)
  8944. @@ -58,7 +58,7 @@
  8945.         final int mpConsume = getSkill().getMpConsume();
  8946.         final L2PcInstance caster = (L2PcInstance) getEffector();
  8947.        
  8948. -       for (L2Playable cha : _actor.getKnownList().getKnownTypeInRadius(L2Playable.class, getSkill().getSkillRadius()))
  8949. +       for (L2Playable cha : _actor.getKnownTypeInRadius(L2Playable.class, getSkill().getSkillRadius()))
  8950.         {
  8951.             if (!caster.canAttackCharacter(cha))
  8952.                 continue;
  8953. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java
  8954. ===================================================================
  8955. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java (revision 2)
  8956. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java (working copy)
  8957. @@ -108,7 +108,7 @@
  8958.        
  8959.         List<L2Character> targets = new ArrayList<>();
  8960.        
  8961. -       for (L2Character cha : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  8962. +       for (L2Character cha : _actor.getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  8963.         {
  8964.             if (cha == caster)
  8965.                 continue;
  8966. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java
  8967. ===================================================================
  8968. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java    (revision 2)
  8969. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java    (working copy)
  8970. @@ -54,7 +54,7 @@
  8971.            
  8972.         L2PcInstance caster = (L2PcInstance) getEffector();
  8973.        
  8974. -       for (L2Character target : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  8975. +       for (L2Character target : _actor.getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  8976.         {
  8977.             if (target == caster)
  8978.                 continue;
  8979. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSleep.java
  8980. ===================================================================
  8981. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSleep.java  (revision 2)
  8982. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSleep.java  (working copy)
  8983. @@ -55,6 +55,12 @@
  8984.     }
  8985.    
  8986.     @Override
  8987. +   public boolean onSameEffect(L2Effect effect)
  8988. +   {
  8989. +       return false;
  8990. +   }
  8991. +  
  8992. +   @Override
  8993.     public int getEffectFlags()
  8994.     {
  8995.         return L2EffectFlag.SLEEP.getMask();
  8996. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectStun.java
  8997. ===================================================================
  8998. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectStun.java   (revision 2)
  8999. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectStun.java   (working copy)
  9000. @@ -55,6 +55,12 @@
  9001.     }
  9002.    
  9003.     @Override
  9004. +   public boolean onSameEffect(L2Effect effect)
  9005. +   {
  9006. +       return false;
  9007. +   }
  9008. +  
  9009. +   @Override
  9010.     public int getEffectFlags()
  9011.     {
  9012.         return L2EffectFlag.STUNNED.getMask();
  9013. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSiegeFlag.java
  9014. ===================================================================
  9015. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSiegeFlag.java    (revision 2)
  9016. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSiegeFlag.java    (working copy)
  9017. @@ -104,7 +104,7 @@
  9018.             sm = SystemMessage.getSystemMessage(SystemMessageId.NOT_ANOTHER_HEADQUARTERS);
  9019.         else if (!player.isInsideZone(ZoneId.HQ))
  9020.             sm = SystemMessage.getSystemMessage(SystemMessageId.NOT_SET_UP_BASE_HERE);
  9021. -       else if (!player.getKnownList().getKnownTypeInRadius(L2SiegeFlagInstance.class, 400).isEmpty())
  9022. +       else if (!player.getKnownTypeInRadius(L2SiegeFlagInstance.class, 400).isEmpty())
  9023.             sm = SystemMessage.getSystemMessage(SystemMessageId.HEADQUARTERS_TOO_CLOSE);
  9024.         else
  9025.             return true;
  9026. Index: aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/ItemsOnGroundTaskManager.java
  9027. ===================================================================
  9028. --- aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/ItemsOnGroundTaskManager.java    (revision 2)
  9029. +++ aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/ItemsOnGroundTaskManager.java    (working copy)
  9030. @@ -28,7 +28,7 @@
  9031.  import net.sf.l2j.Config;
  9032.  import net.sf.l2j.L2DatabaseFactory;
  9033.  import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
  9034. -import net.sf.l2j.gameserver.model.L2World;
  9035. +import net.sf.l2j.gameserver.model.World;
  9036.  import net.sf.l2j.gameserver.model.actor.L2Character;
  9037.  import net.sf.l2j.gameserver.model.actor.L2Playable;
  9038.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  9039. @@ -74,7 +74,7 @@
  9040.                
  9041.                 // Create new item.
  9042.                 final ItemInstance item = new ItemInstance(result.getInt(1), result.getInt(2));
  9043. -               L2World.getInstance().addObject(item);
  9044. +               World.getInstance().addObject(item);
  9045.                
  9046.                 // Check and set count.
  9047.                 final int count = result.getInt(3);
  9048. @@ -87,11 +87,7 @@
  9049.                     item.setEnchantLevel(enchant);
  9050.                
  9051.                 // Spawn item in the world.
  9052. -               item.getPosition().set(result.getInt(5), result.getInt(6), result.getInt(7));
  9053. -               item.setRegion(L2World.getInstance().getRegion(item.getPosition()));
  9054. -               item.getRegion().addVisibleObject(item);
  9055. -               item.setIsVisible(true);
  9056. -               L2World.getInstance().addVisibleObject(item, item.getRegion());
  9057. +               item.spawnMe(result.getInt(5), result.getInt(6), result.getInt(7));
  9058.                
  9059.                 // Get interval, add item to the list.
  9060.                 long interval = result.getLong(8);
  9061. @@ -194,9 +190,7 @@
  9062.            
  9063.             // Destroy item and remove from task.
  9064.             final ItemInstance item = entry.getKey();
  9065. -           L2World.getInstance().removeVisibleObject(item, item.getRegion());
  9066. -           L2World.getInstance().removeObject(item);
  9067. -           _items.remove(item);
  9068. +           item.decayMe();
  9069.         }
  9070.     }
  9071.    
  9072. Index: aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/WaterTaskManager.java
  9073. ===================================================================
  9074. --- aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/WaterTaskManager.java    (revision 2)
  9075. +++ aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/WaterTaskManager.java    (working copy)
  9076. @@ -21,11 +21,13 @@
  9077.  
  9078.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  9079.  import net.sf.l2j.gameserver.network.SystemMessageId;
  9080. +import net.sf.l2j.gameserver.network.serverpackets.SetupGauge;
  9081. +import net.sf.l2j.gameserver.network.serverpackets.SetupGauge.GaugeColor;
  9082.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  9083. +import net.sf.l2j.gameserver.skills.Stats;
  9084.  
  9085.  /**
  9086.   * Updates {@link L2PcInstance} drown timer and reduces {@link L2PcInstance} HP, when drowning.
  9087. - * @author Tryskell, Hasha
  9088.   */
  9089.  public final class WaterTaskManager implements Runnable
  9090.  {
  9091. @@ -45,11 +47,17 @@
  9092.     /**
  9093.      * Adds {@link L2PcInstance} to the WaterTask.
  9094.      * @param player : {@link L2PcInstance} to be added and checked.
  9095. -    * @param time : Time in ms, after which the drowning effect is applied.
  9096.      */
  9097. -   public final void add(L2PcInstance player, long time)
  9098. +   public final void add(L2PcInstance player)
  9099.     {
  9100. -       _players.put(player, System.currentTimeMillis() + time);
  9101. +       if (!player.isDead() && !_players.containsKey(player))
  9102. +       {
  9103. +           final int time = (int) player.calcStat(Stats.BREATH, 60000 * player.getRace().getBreathMultiplier(), player, null);
  9104. +          
  9105. +           _players.put(player, System.currentTimeMillis() + time);
  9106. +          
  9107. +           player.sendPacket(new SetupGauge(GaugeColor.CYAN, time));
  9108. +       }
  9109.     }
  9110.    
  9111.     /**
  9112. @@ -58,7 +66,8 @@
  9113.      */
  9114.     public final void remove(L2PcInstance player)
  9115.     {
  9116. -       _players.remove(player);
  9117. +       if (_players.remove(player) != null)
  9118. +           player.sendPacket(new SetupGauge(GaugeColor.CYAN, 0));
  9119.     }
  9120.    
  9121.     @Override
  9122. Index: aCis_gameserver/java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java
  9123. ===================================================================
  9124. --- aCis_gameserver/java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java    (revision 2)
  9125. +++ aCis_gameserver/java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java    (working copy)
  9126. @@ -75,7 +75,6 @@
  9127.     HEAL_STATIC,
  9128.     MANARECHARGE,
  9129.     HEAL_PERCENT,
  9130. -   CPHEAL_PERCENT,
  9131.     MANAHEAL_PERCENT,
  9132.    
  9133.     GIVE_SP,
  9134. Index: aCis_gameserver/java/net/sf/l2j/gameserver/util/Broadcast.java
  9135. ===================================================================
  9136. --- aCis_gameserver/java/net/sf/l2j/gameserver/util/Broadcast.java  (revision 2)
  9137. +++ aCis_gameserver/java/net/sf/l2j/gameserver/util/Broadcast.java  (working copy)
  9138. @@ -15,10 +15,10 @@
  9139.  package net.sf.l2j.gameserver.util;
  9140.  
  9141.  import net.sf.l2j.gameserver.instancemanager.ZoneManager;
  9142. -import net.sf.l2j.gameserver.model.L2World;
  9143. -import net.sf.l2j.gameserver.model.L2WorldRegion;
  9144. +import net.sf.l2j.gameserver.model.L2Object;
  9145. +import net.sf.l2j.gameserver.model.World;
  9146. +import net.sf.l2j.gameserver.model.WorldRegion;
  9147.  import net.sf.l2j.gameserver.model.actor.L2Character;
  9148. -import net.sf.l2j.gameserver.model.actor.L2Playable;
  9149.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  9150.  import net.sf.l2j.gameserver.model.zone.L2ZoneType;
  9151.  import net.sf.l2j.gameserver.network.clientpackets.Say2;
  9152. @@ -41,7 +41,7 @@
  9153.      */
  9154.     public static void toPlayersTargettingMyself(L2Character character, L2GameServerPacket mov)
  9155.     {
  9156. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  9157. +       for (L2PcInstance player : character.getKnownType(L2PcInstance.class))
  9158.         {
  9159.             if (player.getTarget() != character)
  9160.                 continue;
  9161. @@ -64,7 +64,7 @@
  9162.      */
  9163.     public static void toKnownPlayers(L2Character character, L2GameServerPacket mov)
  9164.     {
  9165. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  9166. +       for (L2PcInstance player : character.getKnownType(L2PcInstance.class))
  9167.             player.sendPacket(mov);
  9168.     }
  9169.    
  9170. @@ -86,11 +86,8 @@
  9171.         if (radius < 0)
  9172.             radius = 1500;
  9173.        
  9174. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  9175. -       {
  9176. -           if (character.isInsideRadius(player, radius, false, false))
  9177. -               player.sendPacket(mov);
  9178. -       }
  9179. +       for (L2PcInstance player : character.getKnownTypeInRadius(L2PcInstance.class, radius))
  9180. +           player.sendPacket(mov);
  9181.     }
  9182.    
  9183.     /**
  9184. @@ -119,28 +116,10 @@
  9185.         if (character instanceof L2PcInstance)
  9186.             character.sendPacket(mov);
  9187.        
  9188. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  9189. -       {
  9190. -           if (character.isInsideRadius(player, radius, false, false))
  9191. -               player.sendPacket(mov);
  9192. -       }
  9193. +       for (L2PcInstance player : character.getKnownTypeInRadius(L2PcInstance.class, radius))
  9194. +           player.sendPacket(mov);
  9195.     }
  9196.    
  9197. -   public static void toSelfAndKnownPlayersInRadiusSq(L2Character character, L2GameServerPacket mov, int radiusSq)
  9198. -   {
  9199. -       if (radiusSq < 0)
  9200. -           radiusSq = 360000;
  9201. -      
  9202. -       if (character instanceof L2PcInstance)
  9203. -           character.sendPacket(mov);
  9204. -      
  9205. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  9206. -       {
  9207. -           if (character.getDistanceSq(player) <= radiusSq)
  9208. -               player.sendPacket(mov);
  9209. -       }
  9210. -   }
  9211. -  
  9212.     /**
  9213.      * Send a packet to all L2PcInstance present in the world.<BR>
  9214.      * <BR>
  9215. @@ -153,7 +132,7 @@
  9216.      */
  9217.     public static void toAllOnlinePlayers(L2GameServerPacket mov)
  9218.     {
  9219. -       for (L2PcInstance player : L2World.getInstance().getPlayers())
  9220. +       for (L2PcInstance player : World.getInstance().getPlayers())
  9221.         {
  9222.             if (player.isOnline())
  9223.                 player.sendPacket(mov);
  9224. @@ -165,14 +144,15 @@
  9225.      * @param region : The region to send packets.
  9226.      * @param packets : The packets to send.
  9227.      */
  9228. -   public static void toAllPlayersInRegion(L2WorldRegion region, L2GameServerPacket... packets)
  9229. +   public static void toAllPlayersInRegion(WorldRegion region, L2GameServerPacket... packets)
  9230.     {
  9231. -       for (L2Playable playable : region.getVisiblePlayable().values())
  9232. +       for (L2Object object : region.getObjects())
  9233.         {
  9234. -           if (playable instanceof L2PcInstance)
  9235. +           if (object instanceof L2PcInstance)
  9236.             {
  9237. +               final L2PcInstance player = (L2PcInstance) object;
  9238.                 for (L2GameServerPacket packet : packets)
  9239. -                   playable.sendPacket(packet);
  9240. +                   player.sendPacket(packet);
  9241.             }
  9242.         }
  9243.     }
  9244. Index: aCis_gameserver/java/net/sf/l2j/geodataconverter/GeoDataConverter.java
  9245. ===================================================================
  9246. --- aCis_gameserver/java/net/sf/l2j/geodataconverter/GeoDataConverter.java  (revision 2)
  9247. +++ aCis_gameserver/java/net/sf/l2j/geodataconverter/GeoDataConverter.java  (working copy)
  9248. @@ -31,7 +31,7 @@
  9249.  import net.sf.l2j.gameserver.geoengine.geodata.BlockMultilayer;
  9250.  import net.sf.l2j.gameserver.geoengine.geodata.GeoFormat;
  9251.  import net.sf.l2j.gameserver.geoengine.geodata.GeoStructure;
  9252. -import net.sf.l2j.gameserver.model.L2World;
  9253. +import net.sf.l2j.gameserver.model.World;
  9254.  
  9255.  /**
  9256.   * @author Hasha
  9257. @@ -77,9 +77,9 @@
  9258.         // load geo files according to geoengine config setup
  9259.         final ExProperties props = Config.initProperties(Config.GEOENGINE_FILE);
  9260.         int converted = 0;
  9261. -       for (int rx = L2World.TILE_X_MIN; rx <= L2World.TILE_X_MAX; rx++)
  9262. +       for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
  9263.         {
  9264. -           for (int ry = L2World.TILE_Y_MIN; ry <= L2World.TILE_Y_MAX; ry++)
  9265. +           for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
  9266.             {
  9267.                 if (props.containsKey(String.valueOf(rx) + "_" + String.valueOf(ry)))
  9268.                 {
Add Comment
Please, Sign In to add comment