Guest User

changeset_362

a guest
Jul 22nd, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 224.67 KB | None | 0 0
  1. Index: aCis_datapack/data/html/mods/Wedding_error_friendlist.htm
  2. ===================================================================
  3. --- aCis_datapack/data/html/mods/Wedding_error_friendlist.htm   (révision 568)
  4. +++ aCis_datapack/data/html/mods/Wedding_error_friendlist.htm   (nonexistent)
  5. @@ -1,4 +0,0 @@
  6. -<html><body>
  7. -   This player isn't on your friends list. You must be friends in order to marry.<br>
  8. -   To invite someone as a friend, type /friendinvite Name, where Name is the player's name. He/she has to accept you.
  9. -</body></html>
  10. \ No newline at end of file
  11. Index: aCis_datapack/data/html/mods/Wedding_error_wrongtarget.htm
  12. ===================================================================
  13. --- aCis_datapack/data/html/mods/Wedding_error_wrongtarget.htm  (révision 568)
  14. +++ aCis_datapack/data/html/mods/Wedding_error_wrongtarget.htm  (nonexistent)
  15. @@ -1,4 +0,0 @@
  16. -<html><body>
  17. -   Is there something wrong with you ?<br>
  18. -   You try to marry with yourself ! Target another player.
  19. -</body></html>
  20. \ No newline at end of file
  21. Index: aCis_datapack/data/html/mods/Wedding_notfound.htm
  22. ===================================================================
  23. --- aCis_datapack/data/html/mods/Wedding_notfound.htm   (révision 568)
  24. +++ aCis_datapack/data/html/mods/Wedding_notfound.htm   (nonexistent)
  25. @@ -1,3 +0,0 @@
  26. -<html><body>
  27. -   Your friend must be online to begin the marriage process.
  28. -</body></html>
  29. \ No newline at end of file
  30. Index: aCis_datapack/data/html/mods/Wedding_start.htm
  31. ===================================================================
  32. --- aCis_datapack/data/html/mods/Wedding_start.htm  (révision 568)
  33. +++ aCis_datapack/data/html/mods/Wedding_start.htm  (nonexistent)
  34. @@ -1,16 +0,0 @@
  35. -<html><body>
  36. -   Hi there !<br>
  37. -   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>
  38. -   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>
  39. -  
  40. -   <table width=270>
  41. -       <tr>
  42. -           <td width=130><font color="LEVEL">I want to bind my life to</font></td>
  43. -           <td width=100><edit var="beloved" width=100 height=15></td>
  44. -           <td width=40><button value="Accept" action="bypass -h npc_%objectId%_AskWedding $beloved" width=40 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
  45. -       </tr>
  46. -   </table>
  47. -  
  48. -   <br><center><img src="L2UI_CH3.herotower_deco" width=256 height=32></center><br>
  49. -   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.
  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   (révision 568)
  55. +++ aCis_datapack/data/html/mods/Wedding_error_alreadymarried.htm   (nonexistent)
  56. @@ -1,4 +0,0 @@
  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_start2.htm
  63. ===================================================================
  64. --- aCis_datapack/data/html/mods/Wedding_start2.htm (révision 568)
  65. +++ aCis_datapack/data/html/mods/Wedding_start2.htm (nonexistent)
  66. @@ -1,6 +0,0 @@
  67. -<html><body>
  68. -   Hello there, how can I help you on this beautiful day ?<br>
  69. -   <center><a action="bypass -h npc_%objectId%_GoToLove">Teleport me near my beloved.</a>
  70. -   <br>
  71. -   <a action="bypass -h npc_%objectId%_Divorce">I want to divorce.</a></center>
  72. -</body></html>
  73. \ No newline at end of file
  74. Index: aCis_datapack/data/html/mods/Wedding_error_adena.htm
  75. ===================================================================
  76. --- aCis_datapack/data/html/mods/Wedding_error_adena.htm    (révision 568)
  77. +++ aCis_datapack/data/html/mods/Wedding_error_adena.htm    (nonexistent)
  78. @@ -1,4 +0,0 @@
  79. -<html><body>
  80. -   You or your partner haven't enough adenas.<br>
  81. -   You need <font color="LEVEL">%adenasCost% adenas</font> to pay marriage fees.
  82. -</body></html>
  83. \ No newline at end of file
  84. Index: aCis_datapack/data/html/mods/Wedding_error_noformal.htm
  85. ===================================================================
  86. --- aCis_datapack/data/html/mods/Wedding_error_noformal.htm (révision 568)
  87. +++ aCis_datapack/data/html/mods/Wedding_error_noformal.htm (nonexistent)
  88. @@ -1,4 +0,0 @@
  89. -<html><body>
  90. -   You or your partner aren't wearing a Formal wear, so go find one and come back later !<br>
  91. -   I heard <font color="LEVEL">Trader Alexis</font> in Aden town can help you, if you don't know how to get one.
  92. -</body></html>
  93. \ No newline at end of file
  94. Index: aCis_datapack/data/html/mods/Wedding_disabled.htm
  95. ===================================================================
  96. --- aCis_datapack/data/html/mods/Wedding_disabled.htm   (révision 568)
  97. +++ aCis_datapack/data/html/mods/Wedding_disabled.htm   (nonexistent)
  98. @@ -1,5 +0,0 @@
  99. -<html><body>
  100. -   The Wedding Manager is currently disabled.<br>
  101. -   Contact an administrator in order to enable it via configuration files. It can be found in <font color="LEVEL">events.properties</font>.<br>
  102. -   <font color="LEVEL">AllowWedding</font> have to be set on <font color="LEVEL">True</font> (False by default).
  103. -</body></html>
  104. \ No newline at end of file
  105. Index: aCis_datapack/data/html/mods/Wedding_waitforpartner.htm
  106. ===================================================================
  107. --- aCis_datapack/data/html/mods/Wedding_waitforpartner.htm (révision 568)
  108. +++ aCis_datapack/data/html/mods/Wedding_waitforpartner.htm (nonexistent)
  109. @@ -1,4 +0,0 @@
  110. -<html><body>
  111. -   You or your partner asked to marry ! If you're the requestor, wait until your partner accepted or declined your request.<br>
  112. -   If you're the requested, what are you waiting for to say "Yes" or "No" ? I won't answer for you !
  113. -</body></html>
  114. \ No newline at end of file
  115. Index: aCis_datapack/data/html/mods/Wedding_error_sex.htm
  116. ===================================================================
  117. --- aCis_datapack/data/html/mods/Wedding_error_sex.htm  (révision 568)
  118. +++ aCis_datapack/data/html/mods/Wedding_error_sex.htm  (nonexistent)
  119. @@ -1,4 +0,0 @@
  120. -<html><body>
  121. -   Homosexual marriages aren't allowed.<br>
  122. -   Your partner has to be from opposite sex in order I accept your request.
  123. -</body></html>
  124. \ No newline at end of file
  125. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/FriendlyMobKnownList.java
  126. ===================================================================
  127. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/FriendlyMobKnownList.java  (révision 568)
  128. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/FriendlyMobKnownList.java  (nonexistent)
  129. @@ -1,79 +0,0 @@
  130. -/*
  131. - * This program is free software: you can redistribute it and/or modify it under
  132. - * the terms of the GNU General Public License as published by the Free Software
  133. - * Foundation, either version 3 of the License, or (at your option) any later
  134. - * version.
  135. - *
  136. - * This program is distributed in the hope that it will be useful, but WITHOUT
  137. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  138. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  139. - * details.
  140. - *
  141. - * You should have received a copy of the GNU General Public License along with
  142. - * this program. If not, see <http://www.gnu.org/licenses/>.
  143. - */
  144. -package net.sf.l2j.gameserver.model.actor.knownlist;
  145. -
  146. -import net.sf.l2j.gameserver.ai.CtrlEvent;
  147. -import net.sf.l2j.gameserver.ai.CtrlIntention;
  148. -import net.sf.l2j.gameserver.model.L2Object;
  149. -import net.sf.l2j.gameserver.model.actor.L2Character;
  150. -import net.sf.l2j.gameserver.model.actor.instance.L2FriendlyMobInstance;
  151. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  152. -
  153. -public class FriendlyMobKnownList extends AttackableKnownList
  154. -{
  155. -   public FriendlyMobKnownList(L2FriendlyMobInstance activeChar)
  156. -   {
  157. -       super(activeChar);
  158. -   }
  159. -  
  160. -   @Override
  161. -   public boolean addKnownObject(L2Object object)
  162. -   {
  163. -       if (!super.addKnownObject(object))
  164. -           return false;
  165. -      
  166. -       // object is player
  167. -       if (object instanceof L2PcInstance)
  168. -       {
  169. -           // get friendly monster
  170. -           final L2FriendlyMobInstance monster = (L2FriendlyMobInstance) _activeObject;
  171. -          
  172. -           // AI is idle, set AI
  173. -           if (monster.getAI().getIntention() == CtrlIntention.IDLE)
  174. -               monster.getAI().setIntention(CtrlIntention.ACTIVE, null);
  175. -       }
  176. -      
  177. -       return true;
  178. -   }
  179. -  
  180. -   @Override
  181. -   public boolean removeKnownObject(L2Object object)
  182. -   {
  183. -       if (!super.removeKnownObject(object))
  184. -           return false;
  185. -      
  186. -       if (!(object instanceof L2Character))
  187. -           return true;
  188. -      
  189. -       // get friendly monster
  190. -       final L2FriendlyMobInstance monster = (L2FriendlyMobInstance) _activeObject;
  191. -      
  192. -       if (monster.hasAI())
  193. -       {
  194. -           monster.getAI().notifyEvent(CtrlEvent.EVT_FORGET_OBJECT, object);
  195. -           if (monster.getTarget() == (L2Character) object)
  196. -               monster.setTarget(null);
  197. -       }
  198. -      
  199. -       if (monster.isVisible() && getKnownType(L2PcInstance.class).isEmpty())
  200. -       {
  201. -           monster.getAggroList().clear();
  202. -           if (monster.hasAI())
  203. -               monster.getAI().setIntention(CtrlIntention.IDLE, null);
  204. -       }
  205. -      
  206. -       return true;
  207. -   }
  208. -}
  209. \ No newline at end of file
  210. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/AttackableKnownList.java
  211. ===================================================================
  212. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/AttackableKnownList.java   (révision 568)
  213. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/AttackableKnownList.java   (nonexistent)
  214. @@ -1,71 +0,0 @@
  215. -/*
  216. - * This program is free software: you can redistribute it and/or modify it under
  217. - * the terms of the GNU General Public License as published by the Free Software
  218. - * Foundation, either version 3 of the License, or (at your option) any later
  219. - * version.
  220. - *
  221. - * This program is distributed in the hope that it will be useful, but WITHOUT
  222. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  223. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  224. - * details.
  225. - *
  226. - * You should have received a copy of the GNU General Public License along with
  227. - * this program. If not, see <http://www.gnu.org/licenses/>.
  228. - */
  229. -package net.sf.l2j.gameserver.model.actor.knownlist;
  230. -
  231. -import net.sf.l2j.gameserver.ai.CtrlIntention;
  232. -import net.sf.l2j.gameserver.model.L2Object;
  233. -import net.sf.l2j.gameserver.model.actor.L2Attackable;
  234. -import net.sf.l2j.gameserver.model.actor.L2Character;
  235. -import net.sf.l2j.gameserver.model.actor.L2Playable;
  236. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  237. -
  238. -public class AttackableKnownList extends NpcKnownList
  239. -{
  240. -   public AttackableKnownList(L2Attackable activeChar)
  241. -   {
  242. -       super(activeChar);
  243. -   }
  244. -  
  245. -   @Override
  246. -   public boolean removeKnownObject(L2Object object)
  247. -   {
  248. -       if (!super.removeKnownObject(object))
  249. -           return false;
  250. -      
  251. -       // get attackable
  252. -       final L2Attackable attackable = (L2Attackable) _activeObject;
  253. -      
  254. -       // remove object from agro list
  255. -       if (object instanceof L2Character)
  256. -           attackable.getAggroList().remove(object);
  257. -      
  258. -       // check AI for players and set AI to idle
  259. -       if (attackable.hasAI() && getKnownType(L2PcInstance.class).isEmpty())
  260. -           attackable.getAI().setIntention(CtrlIntention.IDLE, null);
  261. -      
  262. -       return true;
  263. -   }
  264. -  
  265. -   @Override
  266. -   public int getDistanceToWatchObject(L2Object object)
  267. -   {
  268. -       if (!(object instanceof L2Character))
  269. -           return 0;
  270. -      
  271. -       if (object instanceof L2Playable)
  272. -           return object.getKnownList().getDistanceToWatchObject(_activeObject);
  273. -      
  274. -       // get attackable
  275. -       final L2Attackable attackable = (L2Attackable) _activeObject;
  276. -      
  277. -       return Math.max(300, Math.max(attackable.getTemplate().getAggroRange(), attackable.getTemplate().getClanRange()));
  278. -   }
  279. -  
  280. -   @Override
  281. -   public int getDistanceToForgetObject(L2Object object)
  282. -   {
  283. -       return (int) (getDistanceToWatchObject(object) * 1.5);
  284. -   }
  285. -}
  286. \ No newline at end of file
  287. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/CharKnownList.java
  288. ===================================================================
  289. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/CharKnownList.java (révision 568)
  290. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/CharKnownList.java (nonexistent)
  291. @@ -1,61 +0,0 @@
  292. -/*
  293. - * This program is free software: you can redistribute it and/or modify it under
  294. - * the terms of the GNU General Public License as published by the Free Software
  295. - * Foundation, either version 3 of the License, or (at your option) any later
  296. - * version.
  297. - *
  298. - * This program is distributed in the hope that it will be useful, but WITHOUT
  299. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  300. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  301. - * details.
  302. - *
  303. - * You should have received a copy of the GNU General Public License along with
  304. - * this program. If not, see <http://www.gnu.org/licenses/>.
  305. - */
  306. -package net.sf.l2j.gameserver.model.actor.knownlist;
  307. -
  308. -import net.sf.l2j.gameserver.model.L2Object;
  309. -import net.sf.l2j.gameserver.model.actor.L2Character;
  310. -
  311. -public class CharKnownList extends ObjectKnownList
  312. -{
  313. -   public CharKnownList(L2Character activeChar)
  314. -   {
  315. -       super(activeChar);
  316. -   }
  317. -  
  318. -   @Override
  319. -   public boolean removeKnownObject(L2Object object)
  320. -   {
  321. -       if (!super.removeKnownObject(object))
  322. -           return false;
  323. -      
  324. -       // get character
  325. -       final L2Character character = (L2Character) _activeObject;
  326. -      
  327. -       // If object is targeted by the L2Character, cancel Attack or Cast
  328. -       if (object == character.getTarget())
  329. -           character.setTarget(null);
  330. -      
  331. -       return true;
  332. -   }
  333. -  
  334. -   /**
  335. -    * Remove all objects from known list, cancel target and inform AI.
  336. -    */
  337. -   @Override
  338. -   public final void removeAllKnownObjects()
  339. -   {
  340. -       super.removeAllKnownObjects();
  341. -      
  342. -       // get character
  343. -       final L2Character character = (L2Character) _activeObject;
  344. -      
  345. -       // set target to null
  346. -       character.setTarget(null);
  347. -      
  348. -       // cancel AI task
  349. -       if (character.hasAI())
  350. -           character.setAI(null);
  351. -   }
  352. -}
  353. \ No newline at end of file
  354. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/SummonKnownList.java
  355. ===================================================================
  356. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/SummonKnownList.java   (révision 568)
  357. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/SummonKnownList.java   (nonexistent)
  358. @@ -1,45 +0,0 @@
  359. -/*
  360. - * This program is free software: you can redistribute it and/or modify it under
  361. - * the terms of the GNU General Public License as published by the Free Software
  362. - * Foundation, either version 3 of the License, or (at your option) any later
  363. - * version.
  364. - *
  365. - * This program is distributed in the hope that it will be useful, but WITHOUT
  366. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  367. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  368. - * details.
  369. - *
  370. - * You should have received a copy of the GNU General Public License along with
  371. - * this program. If not, see <http://www.gnu.org/licenses/>.
  372. - */
  373. -package net.sf.l2j.gameserver.model.actor.knownlist;
  374. -
  375. -import net.sf.l2j.gameserver.model.L2Object;
  376. -import net.sf.l2j.gameserver.model.actor.L2Summon;
  377. -
  378. -public class SummonKnownList extends CharKnownList
  379. -{
  380. -   public SummonKnownList(L2Summon activeChar)
  381. -   {
  382. -       super(activeChar);
  383. -   }
  384. -  
  385. -   @Override
  386. -   public int getDistanceToWatchObject(L2Object object)
  387. -   {
  388. -       return 1500;
  389. -   }
  390. -  
  391. -   @Override
  392. -   public int getDistanceToForgetObject(L2Object object)
  393. -   {
  394. -       // get summon
  395. -       final L2Summon summon = (L2Summon) _activeObject;
  396. -      
  397. -       // object is owner or taget, use extended range
  398. -       if (object == summon.getOwner() || object == summon.getTarget())
  399. -           return 6000;
  400. -      
  401. -       return 3000;
  402. -   }
  403. -}
  404. \ No newline at end of file
  405. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/SiegeGuardKnownList.java
  406. ===================================================================
  407. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/SiegeGuardKnownList.java   (révision 568)
  408. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/SiegeGuardKnownList.java   (nonexistent)
  409. @@ -1,56 +0,0 @@
  410. -/*
  411. - * This program is free software: you can redistribute it and/or modify it under
  412. - * the terms of the GNU General Public License as published by the Free Software
  413. - * Foundation, either version 3 of the License, or (at your option) any later
  414. - * version.
  415. - *
  416. - * This program is distributed in the hope that it will be useful, but WITHOUT
  417. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  418. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  419. - * details.
  420. - *
  421. - * You should have received a copy of the GNU General Public License along with
  422. - * this program. If not, see <http://www.gnu.org/licenses/>.
  423. - */
  424. -package net.sf.l2j.gameserver.model.actor.knownlist;
  425. -
  426. -import net.sf.l2j.gameserver.ai.CtrlIntention;
  427. -import net.sf.l2j.gameserver.model.L2Object;
  428. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  429. -import net.sf.l2j.gameserver.model.actor.instance.L2SiegeGuardInstance;
  430. -import net.sf.l2j.gameserver.model.entity.Castle;
  431. -
  432. -public class SiegeGuardKnownList extends AttackableKnownList
  433. -{
  434. -   public SiegeGuardKnownList(L2SiegeGuardInstance activeChar)
  435. -   {
  436. -       super(activeChar);
  437. -   }
  438. -  
  439. -   @Override
  440. -   public boolean addKnownObject(L2Object object)
  441. -   {
  442. -       if (!super.addKnownObject(object))
  443. -           return false;
  444. -      
  445. -       // get siege guard
  446. -       final L2SiegeGuardInstance guard = (L2SiegeGuardInstance) _activeObject;
  447. -      
  448. -       // Check if siege is in progress
  449. -       final Castle castle = guard.getCastle();
  450. -       if (castle != null && castle.getZone().isActive())
  451. -       {
  452. -           // get player
  453. -           final L2PcInstance player = object.getActingPlayer();
  454. -          
  455. -           // check player's clan is in siege attacker list
  456. -           if (player != null && (player.getClan() == null || castle.getSiege().getAttackerClan(player.getClan()) != null))
  457. -           {
  458. -               // try to set AI to attack
  459. -               if (guard.getAI().getIntention() == CtrlIntention.IDLE)
  460. -                   guard.getAI().setIntention(CtrlIntention.ACTIVE, null);
  461. -           }
  462. -       }
  463. -       return true;
  464. -   }
  465. -}
  466. \ No newline at end of file
  467. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/VehicleKnownList.java
  468. ===================================================================
  469. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/VehicleKnownList.java  (révision 568)
  470. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/VehicleKnownList.java  (nonexistent)
  471. @@ -1,45 +0,0 @@
  472. -/*
  473. - * This program is free software: you can redistribute it and/or modify it under
  474. - * the terms of the GNU General Public License as published by the Free Software
  475. - * Foundation, either version 3 of the License, or (at your option) any later
  476. - * version.
  477. - *
  478. - * This program is distributed in the hope that it will be useful, but WITHOUT
  479. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  480. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  481. - * details.
  482. - *
  483. - * You should have received a copy of the GNU General Public License along with
  484. - * this program. If not, see <http://www.gnu.org/licenses/>.
  485. - */
  486. -package net.sf.l2j.gameserver.model.actor.knownlist;
  487. -
  488. -import net.sf.l2j.gameserver.model.L2Object;
  489. -import net.sf.l2j.gameserver.model.actor.L2Character;
  490. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  491. -
  492. -public class VehicleKnownList extends CharKnownList
  493. -{
  494. -   public VehicleKnownList(L2Character activeChar)
  495. -   {
  496. -       super(activeChar);
  497. -   }
  498. -  
  499. -   @Override
  500. -   public int getDistanceToWatchObject(L2Object object)
  501. -   {
  502. -       if (!(object instanceof L2PcInstance))
  503. -           return 0;
  504. -      
  505. -       return object.getKnownList().getDistanceToWatchObject(_activeObject);
  506. -   }
  507. -  
  508. -   @Override
  509. -   public int getDistanceToForgetObject(L2Object object)
  510. -   {
  511. -       if (!(object instanceof L2PcInstance))
  512. -           return 0;
  513. -      
  514. -       return object.getKnownList().getDistanceToForgetObject(_activeObject);
  515. -   }
  516. -}
  517. \ No newline at end of file
  518. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/NpcKnownList.java
  519. ===================================================================
  520. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/NpcKnownList.java  (révision 568)
  521. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/NpcKnownList.java  (nonexistent)
  522. @@ -1,56 +0,0 @@
  523. -/*
  524. - * This program is free software: you can redistribute it and/or modify it under
  525. - * the terms of the GNU General Public License as published by the Free Software
  526. - * Foundation, either version 3 of the License, or (at your option) any later
  527. - * version.
  528. - *
  529. - * This program is distributed in the hope that it will be useful, but WITHOUT
  530. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  531. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  532. - * details.
  533. - *
  534. - * You should have received a copy of the GNU General Public License along with
  535. - * this program. If not, see <http://www.gnu.org/licenses/>.
  536. - */
  537. -package net.sf.l2j.gameserver.model.actor.knownlist;
  538. -
  539. -import net.sf.l2j.gameserver.model.L2Object;
  540. -import net.sf.l2j.gameserver.model.actor.L2Character;
  541. -import net.sf.l2j.gameserver.model.actor.L2Npc;
  542. -import net.sf.l2j.gameserver.model.actor.L2Playable;
  543. -import net.sf.l2j.gameserver.model.actor.instance.L2FestivalGuideInstance;
  544. -import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
  545. -
  546. -public class NpcKnownList extends CharKnownList
  547. -{
  548. -   public NpcKnownList(L2Npc activeChar)
  549. -   {
  550. -       super(activeChar);
  551. -   }
  552. -  
  553. -   @Override
  554. -   public int getDistanceToWatchObject(L2Object object)
  555. -   {
  556. -       // object is not L2Character or object is L2NpcInstance, skip
  557. -       if (object instanceof L2NpcInstance || !(object instanceof L2Character))
  558. -           return 0;
  559. -      
  560. -       if (object instanceof L2Playable)
  561. -       {
  562. -           // known list owner if L2FestivalGuide, use extended range
  563. -           if (_activeObject instanceof L2FestivalGuideInstance)
  564. -               return 4000;
  565. -          
  566. -           // default range to keep players
  567. -           return 1500;
  568. -       }
  569. -      
  570. -       return 500;
  571. -   }
  572. -  
  573. -   @Override
  574. -   public int getDistanceToForgetObject(L2Object object)
  575. -   {
  576. -       return 2 * getDistanceToWatchObject(object);
  577. -   }
  578. -}
  579. \ No newline at end of file
  580. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/GuardKnownList.java
  581. ===================================================================
  582. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/GuardKnownList.java    (révision 568)
  583. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/GuardKnownList.java    (nonexistent)
  584. @@ -1,80 +0,0 @@
  585. -/*
  586. - * This program is free software: you can redistribute it and/or modify it under
  587. - * the terms of the GNU General Public License as published by the Free Software
  588. - * Foundation, either version 3 of the License, or (at your option) any later
  589. - * version.
  590. - *
  591. - * This program is distributed in the hope that it will be useful, but WITHOUT
  592. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  593. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  594. - * details.
  595. - *
  596. - * You should have received a copy of the GNU General Public License along with
  597. - * this program. If not, see <http://www.gnu.org/licenses/>.
  598. - */
  599. -package net.sf.l2j.gameserver.model.actor.knownlist;
  600. -
  601. -import net.sf.l2j.Config;
  602. -import net.sf.l2j.gameserver.ai.CtrlIntention;
  603. -import net.sf.l2j.gameserver.model.L2Object;
  604. -import net.sf.l2j.gameserver.model.actor.instance.L2GuardInstance;
  605. -import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
  606. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  607. -
  608. -public class GuardKnownList extends AttackableKnownList
  609. -{
  610. -   public GuardKnownList(L2GuardInstance activeChar)
  611. -   {
  612. -       super(activeChar);
  613. -   }
  614. -  
  615. -   @Override
  616. -   public boolean addKnownObject(L2Object object)
  617. -   {
  618. -       if (!super.addKnownObject(object))
  619. -           return false;
  620. -      
  621. -       // get guard
  622. -       final L2GuardInstance guard = (L2GuardInstance) _activeObject;
  623. -      
  624. -       if (object instanceof L2PcInstance)
  625. -       {
  626. -           // Check if the object added is a L2PcInstance that owns Karma
  627. -           if (((L2PcInstance) object).getKarma() > 0)
  628. -           {
  629. -               // Set the L2GuardInstance Intention to ACTIVE
  630. -               if (guard.getAI().getIntention() == CtrlIntention.IDLE)
  631. -                   guard.getAI().setIntention(CtrlIntention.ACTIVE, null);
  632. -           }
  633. -       }
  634. -       else if ((Config.GUARD_ATTACK_AGGRO_MOB && guard.isInActiveRegion()) && object instanceof L2MonsterInstance)
  635. -       {
  636. -           // Check if the object added is an aggressive L2MonsterInstance
  637. -           if (((L2MonsterInstance) object).isAggressive())
  638. -           {
  639. -               // Set the L2GuardInstance Intention to ACTIVE
  640. -               if (guard.getAI().getIntention() == CtrlIntention.IDLE)
  641. -                   guard.getAI().setIntention(CtrlIntention.ACTIVE, null);
  642. -           }
  643. -       }
  644. -       return true;
  645. -   }
  646. -  
  647. -   @Override
  648. -   public boolean removeKnownObject(L2Object object)
  649. -   {
  650. -       if (!super.removeKnownObject(object))
  651. -           return false;
  652. -      
  653. -       // get guard
  654. -       final L2GuardInstance guard = (L2GuardInstance) _activeObject;
  655. -      
  656. -       // If the _aggroList of the L2GuardInstance is empty, set to IDLE
  657. -       if (guard.getAggroList().isEmpty())
  658. -       {
  659. -           if (guard.hasAI())
  660. -               guard.getAI().setIntention(CtrlIntention.IDLE, null);
  661. -       }
  662. -       return true;
  663. -   }
  664. -}
  665. \ No newline at end of file
  666. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/PcKnownList.java
  667. ===================================================================
  668. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/PcKnownList.java   (révision 568)
  669. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/PcKnownList.java   (nonexistent)
  670. @@ -1,156 +0,0 @@
  671. -/*
  672. - * This program is free software: you can redistribute it and/or modify it under
  673. - * the terms of the GNU General Public License as published by the Free Software
  674. - * Foundation, either version 3 of the License, or (at your option) any later
  675. - * version.
  676. - *
  677. - * This program is distributed in the hope that it will be useful, but WITHOUT
  678. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  679. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  680. - * details.
  681. - *
  682. - * You should have received a copy of the GNU General Public License along with
  683. - * this program. If not, see <http://www.gnu.org/licenses/>.
  684. - */
  685. -package net.sf.l2j.gameserver.model.actor.knownlist;
  686. -
  687. -import net.sf.l2j.gameserver.model.L2Object;
  688. -import net.sf.l2j.gameserver.model.L2Object.PolyType;
  689. -import net.sf.l2j.gameserver.model.actor.L2Character;
  690. -import net.sf.l2j.gameserver.model.actor.L2Vehicle;
  691. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  692. -import net.sf.l2j.gameserver.network.serverpackets.DeleteObject;
  693. -import net.sf.l2j.gameserver.network.serverpackets.SpawnItem;
  694. -
  695. -public class PcKnownList extends CharKnownList
  696. -{
  697. -   public PcKnownList(L2PcInstance activeChar)
  698. -   {
  699. -       super(activeChar);
  700. -   }
  701. -  
  702. -   /**
  703. -    * Add a visible L2Object to L2PcInstance _knownObjects and _knownPlayer (if necessary) and send Server-Client Packets needed to inform the L2PcInstance of its state and actions in progress.<BR>
  704. -    * <BR>
  705. -    * <B><U> object is a ItemInstance </U> :</B><BR>
  706. -    * <BR>
  707. -    * <li>Send Server-Client Packet DropItem/SpawnItem to the L2PcInstance</li><BR>
  708. -    * <BR>
  709. -    * <B><U> object is a L2DoorInstance </U> :</B><BR>
  710. -    * <BR>
  711. -    * <li>Send Server-Client Packets DoorInfo and DoorStatusUpdate to the L2PcInstance</li> <li>Send Server->Client packet MoveToPawn/MoveToLocation and AutoAttackStart to the L2PcInstance</li><BR>
  712. -    * <BR>
  713. -    * <B><U> object is a L2Npc </U> :</B><BR>
  714. -    * <BR>
  715. -    * <li>Send Server-Client Packet NpcInfo to the L2PcInstance</li> <li>Send Server->Client packet MoveToPawn/MoveToLocation and AutoAttackStart to the L2PcInstance</li><BR>
  716. -    * <BR>
  717. -    * <B><U> object is a L2Summon </U> :</B><BR>
  718. -    * <BR>
  719. -    * <li>Send Server-Client Packet NpcInfo/PetItemList (if the L2PcInstance is the owner) to the L2PcInstance</li> <li>Send Server->Client packet MoveToPawn/MoveToLocation and AutoAttackStart to the L2PcInstance</li><BR>
  720. -    * <BR>
  721. -    * <B><U> object is a L2PcInstance </U> :</B><BR>
  722. -    * <BR>
  723. -    * <li>Send Server-Client Packet CharInfo to the L2PcInstance</li> <li>If the object has a private store, Send Server-Client Packet PrivateStoreMsgSell to the L2PcInstance</li> <li>Send Server->Client packet MoveToPawn/MoveToLocation and AutoAttackStart to the L2PcInstance</li><BR>
  724. -    * <BR>
  725. -    * @param object The L2Object to add to _knownObjects and _knownPlayer
  726. -    */
  727. -   @Override
  728. -   public boolean addKnownObject(L2Object object)
  729. -   {
  730. -       if (!super.addKnownObject(object))
  731. -           return false;
  732. -      
  733. -       sendInfoFrom(object);
  734. -       return true;
  735. -   }
  736. -  
  737. -   /**
  738. -    * Remove a L2Object from L2PcInstance _knownObjects and _knownPlayer (if necessary) and send Server-Client Packet DeleteObject to the L2PcInstance.<BR>
  739. -    * <BR>
  740. -    * @param object The L2Object to remove from _knownObjects and _knownPlayer
  741. -    */
  742. -   @Override
  743. -   public boolean removeKnownObject(L2Object object)
  744. -   {
  745. -       if (!super.removeKnownObject(object))
  746. -           return false;
  747. -      
  748. -       // get player
  749. -       final L2PcInstance player = (L2PcInstance) _activeObject;
  750. -      
  751. -       // send Server-Client Packet DeleteObject to the L2PcInstance
  752. -       player.sendPacket(new DeleteObject(object, (object instanceof L2PcInstance) && ((L2PcInstance) object).isSeated()));
  753. -       return true;
  754. -   }
  755. -  
  756. -   @Override
  757. -   public int getDistanceToWatchObject(L2Object object)
  758. -   {
  759. -       if (object instanceof L2Vehicle)
  760. -           return 9000;
  761. -      
  762. -       final int knownlistSize = getKnownObjects().size();
  763. -       if (knownlistSize <= 25)
  764. -           return 3400;
  765. -      
  766. -       if (knownlistSize <= 35)
  767. -           return 2900;
  768. -      
  769. -       if (knownlistSize <= 70)
  770. -           return 2300;
  771. -      
  772. -       return 1700;
  773. -   }
  774. -  
  775. -   @Override
  776. -   public int getDistanceToForgetObject(L2Object object)
  777. -   {
  778. -       if (object instanceof L2Vehicle)
  779. -           return 10000;
  780. -      
  781. -       final int knownlistSize = getKnownObjects().size();
  782. -       if (knownlistSize <= 25)
  783. -           return 4000;
  784. -      
  785. -       if (knownlistSize <= 35)
  786. -           return 3500;
  787. -      
  788. -       if (knownlistSize <= 70)
  789. -           return 2910;
  790. -      
  791. -       return 2310;
  792. -   }
  793. -  
  794. -   public final void refreshInfos()
  795. -   {
  796. -       for (L2Object object : _knownObjects.values())
  797. -       {
  798. -           if (object instanceof L2PcInstance && ((L2PcInstance) object).inObserverMode())
  799. -               continue;
  800. -          
  801. -           sendInfoFrom(object);
  802. -       }
  803. -   }
  804. -  
  805. -   private final void sendInfoFrom(L2Object object)
  806. -   {
  807. -       // get player
  808. -       final L2PcInstance player = (L2PcInstance) _activeObject;
  809. -      
  810. -       if (object.getPolyType() == PolyType.ITEM)
  811. -           player.sendPacket(new SpawnItem(object));
  812. -       else
  813. -       {
  814. -           // send object info to player
  815. -           object.sendInfo(player);
  816. -          
  817. -           if (object instanceof L2Character)
  818. -           {
  819. -               // Update the state of the L2Character object client side by sending Server->Client packet MoveToPawn/MoveToLocation and AutoAttackStart to the L2PcInstance
  820. -               L2Character obj = (L2Character) object;
  821. -               if (obj.hasAI())
  822. -                   obj.getAI().describeStateToPlayer(player);
  823. -           }
  824. -       }
  825. -   }
  826. -}
  827. \ No newline at end of file
  828. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/DoorKnownList.java
  829. ===================================================================
  830. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/DoorKnownList.java (révision 568)
  831. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/DoorKnownList.java (nonexistent)
  832. @@ -1,52 +0,0 @@
  833. -/*
  834. - * This program is free software: you can redistribute it and/or modify it under
  835. - * the terms of the GNU General Public License as published by the Free Software
  836. - * Foundation, either version 3 of the License, or (at your option) any later
  837. - * version.
  838. - *
  839. - * This program is distributed in the hope that it will be useful, but WITHOUT
  840. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  841. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  842. - * details.
  843. - *
  844. - * You should have received a copy of the GNU General Public License along with
  845. - * this program. If not, see <http://www.gnu.org/licenses/>.
  846. - */
  847. -package net.sf.l2j.gameserver.model.actor.knownlist;
  848. -
  849. -import net.sf.l2j.gameserver.model.L2Object;
  850. -import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  851. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  852. -import net.sf.l2j.gameserver.model.actor.instance.L2SiegeGuardInstance;
  853. -
  854. -public class DoorKnownList extends CharKnownList
  855. -{
  856. -   public DoorKnownList(L2DoorInstance activeChar)
  857. -   {
  858. -       super(activeChar);
  859. -   }
  860. -  
  861. -   @Override
  862. -   public int getDistanceToWatchObject(L2Object object)
  863. -   {
  864. -       if (object instanceof L2SiegeGuardInstance)
  865. -           return 600;
  866. -      
  867. -       if (object instanceof L2PcInstance)
  868. -           return 3500;
  869. -      
  870. -       return 0;
  871. -   }
  872. -  
  873. -   @Override
  874. -   public int getDistanceToForgetObject(L2Object object)
  875. -   {
  876. -       if (object instanceof L2SiegeGuardInstance)
  877. -           return 800;
  878. -      
  879. -       if (object instanceof L2PcInstance)
  880. -           return 4000;
  881. -      
  882. -       return 0;
  883. -   }
  884. -}
  885. \ No newline at end of file
  886. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/RaceManagerKnownList.java
  887. ===================================================================
  888. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/RaceManagerKnownList.java  (révision 568)
  889. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/RaceManagerKnownList.java  (nonexistent)
  890. @@ -1,61 +0,0 @@
  891. -/*
  892. - * This program is free software: you can redistribute it and/or modify it under
  893. - * the terms of the GNU General Public License as published by the Free Software
  894. - * Foundation, either version 3 of the License, or (at your option) any later
  895. - * version.
  896. - *
  897. - * This program is distributed in the hope that it will be useful, but WITHOUT
  898. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  899. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  900. - * details.
  901. - *
  902. - * You should have received a copy of the GNU General Public License along with
  903. - * this program. If not, see <http://www.gnu.org/licenses/>.
  904. - */
  905. -package net.sf.l2j.gameserver.model.actor.knownlist;
  906. -
  907. -import net.sf.l2j.gameserver.instancemanager.games.MonsterRace;
  908. -import net.sf.l2j.gameserver.model.L2Object;
  909. -import net.sf.l2j.gameserver.model.actor.L2Npc;
  910. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  911. -import net.sf.l2j.gameserver.model.actor.instance.L2RaceManagerInstance;
  912. -import net.sf.l2j.gameserver.network.serverpackets.DeleteObject;
  913. -
  914. -public class RaceManagerKnownList extends NpcKnownList
  915. -{
  916. -   public RaceManagerKnownList(L2RaceManagerInstance activeChar)
  917. -   {
  918. -       super(activeChar);
  919. -   }
  920. -  
  921. -   @Override
  922. -   public boolean addKnownObject(L2Object object)
  923. -   {
  924. -       if (!super.addKnownObject(object))
  925. -           return false;
  926. -      
  927. -       if (object instanceof L2PcInstance)
  928. -           ((L2PcInstance) object).sendPacket(MonsterRace.getInstance().getRacePacket());
  929. -      
  930. -       return true;
  931. -   }
  932. -  
  933. -   @Override
  934. -   public boolean removeKnownObject(L2Object object)
  935. -   {
  936. -       if (!super.removeKnownObject(object))
  937. -           return false;
  938. -      
  939. -       if (object instanceof L2PcInstance)
  940. -       {
  941. -           // get player
  942. -           final L2PcInstance player = ((L2PcInstance) object);
  943. -          
  944. -           // for all monster race NPCs
  945. -           for (L2Npc npc : MonsterRace.getInstance().getMonsters())
  946. -               player.sendPacket(new DeleteObject(npc));
  947. -       }
  948. -      
  949. -       return true;
  950. -   }
  951. -}
  952. \ No newline at end of file
  953. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/ObjectKnownList.java
  954. ===================================================================
  955. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/ObjectKnownList.java   (révision 568)
  956. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/ObjectKnownList.java   (nonexistent)
  957. @@ -1,189 +0,0 @@
  958. -/*
  959. - * This program is free software: you can redistribute it and/or modify it under
  960. - * the terms of the GNU General Public License as published by the Free Software
  961. - * Foundation, either version 3 of the License, or (at your option) any later
  962. - * version.
  963. - *
  964. - * This program is distributed in the hope that it will be useful, but WITHOUT
  965. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  966. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  967. - * details.
  968. - *
  969. - * You should have received a copy of the GNU General Public License along with
  970. - * this program. If not, see <http://www.gnu.org/licenses/>.
  971. - */
  972. -package net.sf.l2j.gameserver.model.actor.knownlist;
  973. -
  974. -import java.util.ArrayList;
  975. -import java.util.Collection;
  976. -import java.util.List;
  977. -import java.util.Map;
  978. -import java.util.concurrent.ConcurrentHashMap;
  979. -
  980. -import net.sf.l2j.gameserver.model.L2Object;
  981. -import net.sf.l2j.gameserver.util.Util;
  982. -
  983. -public class ObjectKnownList
  984. -{
  985. -   protected final L2Object _activeObject;
  986. -   protected final Map<Integer, L2Object> _knownObjects;
  987. -  
  988. -   public ObjectKnownList(L2Object activeObject)
  989. -   {
  990. -       _activeObject = activeObject;
  991. -       _knownObjects = new ConcurrentHashMap<>();
  992. -   }
  993. -  
  994. -   /**
  995. -    * Add object to known list.<br>
  996. -    * <b>Is overridden by children in most cases.</b>
  997. -    * @param object : {@link L2Object} to be added.
  998. -    * @return boolean : True, when object was successfully added.
  999. -    */
  1000. -   public boolean addKnownObject(L2Object object)
  1001. -   {
  1002. -       // object must exist, cannot add self
  1003. -       if (knowsObject(object))
  1004. -           return false;
  1005. -      
  1006. -       // object must be inside distance to watch
  1007. -       if (!Util.checkIfInShortRadius(getDistanceToWatchObject(object), _activeObject, object, true))
  1008. -           return false;
  1009. -      
  1010. -       // add object to known list and check if object already existed there
  1011. -       return _knownObjects.put(object.getObjectId(), object) == null;
  1012. -   }
  1013. -  
  1014. -   /**
  1015. -    * Remove object from known list.<br>
  1016. -    * <b>Is overridden by children in most cases.</b>
  1017. -    * @param object : {@link L2Object} to be removed.
  1018. -    * @return boolean : True, when object was successfully removed.
  1019. -    */
  1020. -   public boolean removeKnownObject(L2Object object)
  1021. -   {
  1022. -       // object must exist.
  1023. -       if (object == null)
  1024. -           return false;
  1025. -      
  1026. -       // remove object from known list and check if object existed in there
  1027. -       return _knownObjects.remove(object.getObjectId()) != null;
  1028. -   }
  1029. -  
  1030. -   /**
  1031. -    * Remove object from known list, which are beyond distance to forget.
  1032. -    */
  1033. -   public final void forgetObjects()
  1034. -   {
  1035. -       // for all objects in known list
  1036. -       for (L2Object object : _knownObjects.values())
  1037. -       {
  1038. -           // object is not visible or out of distance to forget, remove from known list
  1039. -           if (!object.isVisible() || !Util.checkIfInShortRadius(getDistanceToForgetObject(object), _activeObject, object, true))
  1040. -               removeKnownObject(object);
  1041. -       }
  1042. -   }
  1043. -  
  1044. -   /**
  1045. -    * Remove all objects from known list.
  1046. -    */
  1047. -   public void removeAllKnownObjects()
  1048. -   {
  1049. -       _knownObjects.clear();
  1050. -   }
  1051. -  
  1052. -   /**
  1053. -    * Check if object is in known list.
  1054. -    * @param object : {@link L2Object} to be checked.
  1055. -    * @return boolean : True, when object is in known list.
  1056. -    */
  1057. -   public final boolean knowsObject(L2Object object)
  1058. -   {
  1059. -       // object does not exist, false
  1060. -       if (object == null)
  1061. -           return false;
  1062. -      
  1063. -       // object is known list owner or is in known list
  1064. -       return _activeObject == object || _knownObjects.containsKey(object.getObjectId());
  1065. -   }
  1066. -  
  1067. -   /**
  1068. -    * Return the known list.
  1069. -    * @return Collection<L2Object> : The known list.
  1070. -    */
  1071. -   public final Collection<L2Object> getKnownObjects()
  1072. -   {
  1073. -       return _knownObjects.values();
  1074. -   }
  1075. -  
  1076. -   /**
  1077. -    * Return the known list of given object type.
  1078. -    * @param <A> : Object type must be instance of {@link L2Object}.
  1079. -    * @param type : Class specifying object type.
  1080. -    * @return List<A> : Known list of given object type.
  1081. -    */
  1082. -   @SuppressWarnings("unchecked")
  1083. -   public final <A> List<A> getKnownType(Class<A> type)
  1084. -   {
  1085. -       // create result list
  1086. -       List<A> result = new ArrayList<>();
  1087. -      
  1088. -       // for all objects in known list
  1089. -       for (L2Object obj : _knownObjects.values())
  1090. -       {
  1091. -           // object type is correct, add to the list
  1092. -           if (type.isAssignableFrom(obj.getClass()))
  1093. -               result.add((A) obj);
  1094. -       }
  1095. -      
  1096. -       // return result
  1097. -       return result;
  1098. -   }
  1099. -  
  1100. -   /**
  1101. -    * Return the known list of given object type within specified radius.
  1102. -    * @param <A> : Object type must be instance of {@link L2Object}.
  1103. -    * @param type : Class specifying object type.
  1104. -    * @param radius : Radius to in which object must be located.
  1105. -    * @return List<A> : Known list of given object type.
  1106. -    */
  1107. -   @SuppressWarnings("unchecked")
  1108. -   public final <A> List<A> getKnownTypeInRadius(Class<A> type, int radius)
  1109. -   {
  1110. -       // create result list
  1111. -       List<A> result = new ArrayList<>();
  1112. -      
  1113. -       // for all objects in known list
  1114. -       for (L2Object obj : _knownObjects.values())
  1115. -       {
  1116. -           // object type is correct and object in given radius, add to the list
  1117. -           if (type.isAssignableFrom(obj.getClass()) && Util.checkIfInRange(radius, _activeObject, obj, true))
  1118. -               result.add((A) obj);
  1119. -       }
  1120. -      
  1121. -       // return result
  1122. -       return result;
  1123. -   }
  1124. -  
  1125. -   /**
  1126. -    * Returns the distance to watch object, aka distance to add object to known list.<br>
  1127. -    * <b>Is overridden by children in most cases.</b>
  1128. -    * @param object : {@link L2Object} to be checked.
  1129. -    * @return int : Distance.
  1130. -    */
  1131. -   public int getDistanceToWatchObject(L2Object object)
  1132. -   {
  1133. -       return 0;
  1134. -   }
  1135. -  
  1136. -   /**
  1137. -    * Returns the distance to forget object, aka distance to remove object from known list.<br>
  1138. -    * <b>Is overridden by children in most cases.</b>
  1139. -    * @param object : {@link L2Object} to be checked.
  1140. -    * @return int : Distance.
  1141. -    */
  1142. -   public int getDistanceToForgetObject(L2Object object)
  1143. -   {
  1144. -       return 0;
  1145. -   }
  1146. -}
  1147. \ No newline at end of file
  1148. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/MonsterKnownList.java
  1149. ===================================================================
  1150. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/MonsterKnownList.java  (révision 568)
  1151. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/knownlist/MonsterKnownList.java  (nonexistent)
  1152. @@ -1,74 +0,0 @@
  1153. -/*
  1154. - * This program is free software: you can redistribute it and/or modify it under
  1155. - * the terms of the GNU General Public License as published by the Free Software
  1156. - * Foundation, either version 3 of the License, or (at your option) any later
  1157. - * version.
  1158. - *
  1159. - * This program is distributed in the hope that it will be useful, but WITHOUT
  1160. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1161. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1162. - * details.
  1163. - *
  1164. - * You should have received a copy of the GNU General Public License along with
  1165. - * this program. If not, see <http://www.gnu.org/licenses/>.
  1166. - */
  1167. -package net.sf.l2j.gameserver.model.actor.knownlist;
  1168. -
  1169. -import net.sf.l2j.gameserver.ai.CtrlEvent;
  1170. -import net.sf.l2j.gameserver.ai.CtrlIntention;
  1171. -import net.sf.l2j.gameserver.ai.model.L2CharacterAI;
  1172. -import net.sf.l2j.gameserver.model.L2Object;
  1173. -import net.sf.l2j.gameserver.model.actor.L2Character;
  1174. -import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
  1175. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1176. -
  1177. -public class MonsterKnownList extends AttackableKnownList
  1178. -{
  1179. -   public MonsterKnownList(L2MonsterInstance activeChar)
  1180. -   {
  1181. -       super(activeChar);
  1182. -   }
  1183. -  
  1184. -   @Override
  1185. -   public boolean addKnownObject(L2Object object)
  1186. -   {
  1187. -       if (!super.addKnownObject(object))
  1188. -           return false;
  1189. -      
  1190. -       // object is player
  1191. -       if (object instanceof L2PcInstance)
  1192. -       {
  1193. -           // get monster AI
  1194. -           final L2CharacterAI ai = ((L2MonsterInstance) _activeObject).getAI();
  1195. -          
  1196. -           // AI exists and is idle, set active
  1197. -           if (ai != null && ai.getIntention() == CtrlIntention.IDLE)
  1198. -               ai.setIntention(CtrlIntention.ACTIVE, null);
  1199. -       }
  1200. -      
  1201. -       return true;
  1202. -   }
  1203. -  
  1204. -   @Override
  1205. -   public boolean removeKnownObject(L2Object object)
  1206. -   {
  1207. -       if (!super.removeKnownObject(object))
  1208. -           return false;
  1209. -      
  1210. -       if (!(object instanceof L2Character))
  1211. -           return true;
  1212. -      
  1213. -       // get monster
  1214. -       final L2MonsterInstance monster = (L2MonsterInstance) _activeObject;
  1215. -      
  1216. -       // monster has AI, inform about lost object
  1217. -       if (monster.hasAI())
  1218. -           monster.getAI().notifyEvent(CtrlEvent.EVT_FORGET_OBJECT, object);
  1219. -      
  1220. -       // clear agro list
  1221. -       if (monster.isVisible() && getKnownType(L2PcInstance.class).isEmpty())
  1222. -           monster.getAggroList().clear();
  1223. -      
  1224. -       return true;
  1225. -   }
  1226. -}
  1227. \ No newline at end of file
  1228. Index: aCis_datapack/data/html/mods/wedding/start.htm
  1229. ===================================================================
  1230. --- aCis_datapack/data/html/mods/wedding/start.htm  (nonexistent)
  1231. +++ aCis_datapack/data/html/mods/wedding/start.htm  (révision 578)
  1232. @@ -0,0 +1,16 @@
  1233. +<html><body>
  1234. +   Hi there !<br>
  1235. +   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>
  1236. +   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>
  1237. +  
  1238. +   <table width=270>
  1239. +       <tr>
  1240. +           <td width=130><font color="LEVEL">I want to bind my life to</font></td>
  1241. +           <td width=100><edit var="beloved" width=100 height=15></td>
  1242. +           <td width=40><button value="Accept" action="bypass -h npc_%objectId%_AskWedding $beloved" width=40 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
  1243. +       </tr>
  1244. +   </table>
  1245. +  
  1246. +   <br><center><img src="L2UI_CH3.herotower_deco" width=256 height=32></center><br>
  1247. +   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.
  1248. +</body></html>
  1249. \ No newline at end of file
  1250. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  1251. ===================================================================
  1252. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (révision 568)
  1253. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (révision 578)
  1254. @@ -94,7 +94,6 @@
  1255. import net.sf.l2j.gameserver.model.L2Skill;
  1256. import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType;
  1257. import net.sf.l2j.gameserver.model.L2SkillLearn;
  1258. -import net.sf.l2j.gameserver.model.World;
  1259. import net.sf.l2j.gameserver.model.Location;
  1260. import net.sf.l2j.gameserver.model.MacroList;
  1261. import net.sf.l2j.gameserver.model.PetDataEntry;
  1262. @@ -101,6 +100,7 @@
  1263. import net.sf.l2j.gameserver.model.ShortCuts;
  1264. import net.sf.l2j.gameserver.model.ShotType;
  1265. import net.sf.l2j.gameserver.model.SpawnLocation;
  1266. +import net.sf.l2j.gameserver.model.World;
  1267. import net.sf.l2j.gameserver.model.actor.L2Attackable;
  1268. import net.sf.l2j.gameserver.model.actor.L2Character;
  1269. import net.sf.l2j.gameserver.model.actor.L2Npc;
  1270. @@ -108,7 +108,6 @@
  1271. import net.sf.l2j.gameserver.model.actor.L2Summon;
  1272. import net.sf.l2j.gameserver.model.actor.L2Vehicle;
  1273. import net.sf.l2j.gameserver.model.actor.appearance.PcAppearance;
  1274. -import net.sf.l2j.gameserver.model.actor.knownlist.PcKnownList;
  1275. import net.sf.l2j.gameserver.model.actor.stat.PcStat;
  1276. import net.sf.l2j.gameserver.model.actor.status.PcStatus;
  1277. import net.sf.l2j.gameserver.model.actor.template.PcTemplate;
  1278. @@ -160,6 +159,7 @@
  1279. import net.sf.l2j.gameserver.network.serverpackets.ChangeWaitType;
  1280. import net.sf.l2j.gameserver.network.serverpackets.CharInfo;
  1281. import net.sf.l2j.gameserver.network.serverpackets.ConfirmDlg;
  1282. +import net.sf.l2j.gameserver.network.serverpackets.DeleteObject;
  1283. import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
  1284. import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot;
  1285. import net.sf.l2j.gameserver.network.serverpackets.ExDuelUpdateUserInfo;
  1286. @@ -206,6 +206,7 @@
  1287. import net.sf.l2j.gameserver.network.serverpackets.SkillCoolTime;
  1288. import net.sf.l2j.gameserver.network.serverpackets.SkillList;
  1289. import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  1290. +import net.sf.l2j.gameserver.network.serverpackets.SpawnItem;
  1291. import net.sf.l2j.gameserver.network.serverpackets.StaticObject;
  1292. import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
  1293. import net.sf.l2j.gameserver.network.serverpackets.StopMove;
  1294. @@ -764,18 +765,6 @@
  1295.     }
  1296.    
  1297.     @Override
  1298. -   public void initKnownList()
  1299. -   {
  1300. -       setKnownList(new PcKnownList(this));
  1301. -   }
  1302. -  
  1303. -   @Override
  1304. -   public final PcKnownList getKnownList()
  1305. -   {
  1306. -       return (PcKnownList) super.getKnownList();
  1307. -   }
  1308. -  
  1309. -   @Override
  1310.     public void initCharStat()
  1311.     {
  1312.         setStat(new PcStat(this));
  1313. @@ -3316,7 +3305,7 @@
  1314.    
  1315.     public final void broadcastCharInfo()
  1316.     {
  1317. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  1318. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  1319.         {
  1320.             player.sendPacket(new CharInfo(this));
  1321.            
  1322. @@ -3960,7 +3949,7 @@
  1323.         if (_fusionSkill != null)
  1324.             abortCast();
  1325.        
  1326. -       for (L2Character character : getKnownList().getKnownType(L2Character.class))
  1327. +       for (L2Character character : getKnownType(L2Character.class))
  1328.             if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  1329.                 character.abortCast();
  1330.        
  1331. @@ -5262,10 +5251,9 @@
  1332.     }
  1333.    
  1334.     /**
  1335. -    * Retrieve a L2PcInstance from the characters table of the database and add it in _allObjects of the L2world.
  1336. +    * Retrieve a L2PcInstance from the characters table of the database.
  1337.      * <ul>
  1338.      * <li>Retrieve the L2PcInstance from the characters table of the database</li>
  1339. -    * <li>Add the L2PcInstance object in _allObjects</li>
  1340.      * <li>Set the x,y,z position of the L2PcInstance and make it invisible</li>
  1341.      * <li>Update the overloaded status of the L2PcInstance</li>
  1342.      * </ul>
  1343. @@ -5398,7 +5386,7 @@
  1344.                 player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));
  1345.                
  1346.                 // Set the x,y,z position of the L2PcInstance and make it invisible
  1347. -               player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
  1348. +               player.getPosition().set(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
  1349.                
  1350.                 // Set Hero status if it applies
  1351.                 if (Hero.getInstance().isActiveHero(objectId))
  1352. @@ -7632,7 +7620,6 @@
  1353.         getAppearance().setInvisible();
  1354.        
  1355.         sendPacket(new ObservationMode(x, y, z));
  1356. -       getKnownList().removeAllKnownObjects(); // reinit knownlist
  1357.         setXYZ(x, y, z);
  1358.        
  1359.         broadcastUserInfo();
  1360. @@ -7668,7 +7655,6 @@
  1361.     public void leaveObserverMode()
  1362.     {
  1363.         setTarget(null);
  1364. -       getKnownList().removeAllKnownObjects(); // reinit knownlist
  1365.         setXYZ(_savedLocation.getX(), _savedLocation.getY(), _savedLocation.getZ());
  1366.         setIsParalyzed(false);
  1367.         stopParalyze(false);
  1368. @@ -8282,7 +8268,7 @@
  1369.             abortCast();
  1370.            
  1371.             // Stop casting for any player that may be casting a force buff on this l2pcinstance.
  1372. -           for (L2Character character : getKnownList().getKnownType(L2Character.class))
  1373. +           for (L2Character character : getKnownType(L2Character.class))
  1374.                 if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  1375.                     character.abortCast();
  1376.            
  1377. @@ -8873,7 +8859,7 @@
  1378.             stopAllTimers();
  1379.            
  1380.             // Cancel the cast of eventual fusion skill users on this target.
  1381. -           for (L2Character character : getKnownList().getKnownType(L2Character.class))
  1382. +           for (L2Character character : getKnownType(L2Character.class))
  1383.                 if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  1384.                     character.abortCast();
  1385.            
  1386. @@ -8929,10 +8915,9 @@
  1387.             if (isGM())
  1388.                 GmListTable.getInstance().deleteGm(this);
  1389.            
  1390. -           // Check if the L2PcInstance is in observer mode to set its position to its position
  1391. -           // before entering in observer mode
  1392. +           // Check if the L2PcInstance is in observer mode to set its position to its position before entering in observer mode
  1393.             if (inObserverMode())
  1394. -               setXYZInvisible(_savedLocation.getX(), _savedLocation.getY(), _savedLocation.getZ());
  1395. +               setXYZInvisible(_savedLocation);
  1396.            
  1397.             // Oust player from boat
  1398.             if (getVehicle() != null)
  1399. @@ -8951,9 +8936,6 @@
  1400.             if (isCursedWeaponEquipped())
  1401.                 CursedWeaponsManager.getInstance().getCursedWeapon(_cursedWeaponEquippedId).setPlayer(null);
  1402.            
  1403. -           // Remove all L2Object from _knownObjects and _knownPlayer of the L2Character then cancel Attak or Cast and notify AI
  1404. -           getKnownList().removeAllKnownObjects();
  1405. -          
  1406.             if (getClanId() > 0)
  1407.                 getClan().broadcastToOtherOnlineMembers(new PledgeShowMemberListUpdate(this), this);
  1408.            
  1409. @@ -10372,7 +10354,7 @@
  1410.     @Override
  1411.     public void broadcastRelationsChanges()
  1412.     {
  1413. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  1414. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  1415.         {
  1416.             final int relation = getRelation(player);
  1417.             final boolean isAutoAttackable = isAutoAttackable(player);
  1418. @@ -10511,9 +10493,47 @@
  1419.     }
  1420.    
  1421.     @Override
  1422. -   protected void badCoords()
  1423. +   public void addKnownObject(L2Object object)
  1424.     {
  1425. -       teleToLocation(0, 0, 0, 0);
  1426. -       sendMessage("Error with your coords, Please ask a GM for help!");
  1427. +       sendInfoFrom(object);
  1428.     }
  1429. +  
  1430. +   @Override
  1431. +   public void removeKnownObject(L2Object object)
  1432. +   {
  1433. +       super.removeKnownObject(object);
  1434. +      
  1435. +       // send Server-Client Packet DeleteObject to the L2PcInstance
  1436. +       sendPacket(new DeleteObject(object, (object instanceof L2PcInstance) && ((L2PcInstance) object).isSeated()));
  1437. +   }
  1438. +  
  1439. +   public final void refreshInfos()
  1440. +   {
  1441. +       for (L2Object object : getKnownType(L2Object.class))
  1442. +       {
  1443. +           if (object instanceof L2PcInstance && ((L2PcInstance) object).inObserverMode())
  1444. +               continue;
  1445. +          
  1446. +           sendInfoFrom(object);
  1447. +       }
  1448. +   }
  1449. +  
  1450. +   private final void sendInfoFrom(L2Object object)
  1451. +   {
  1452. +       if (object.getPolyType() == PolyType.ITEM)
  1453. +           sendPacket(new SpawnItem(object));
  1454. +       else
  1455. +       {
  1456. +           // send object info to player
  1457. +           object.sendInfo(this);
  1458. +          
  1459. +           if (object instanceof L2Character)
  1460. +           {
  1461. +               // Update the state of the L2Character object client side by sending Server->Client packet MoveToPawn/MoveToLocation and AutoAttackStart to the L2PcInstance
  1462. +               L2Character obj = (L2Character) object;
  1463. +               if (obj.hasAI())
  1464. +                   obj.getAI().describeStateToPlayer(this);
  1465. +           }
  1466. +       }
  1467. +   }
  1468. }
  1469. \ No newline at end of file
  1470. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2DoorInstance.java
  1471. ===================================================================
  1472. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2DoorInstance.java (révision 568)
  1473. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2DoorInstance.java (révision 578)
  1474. @@ -31,7 +31,6 @@
  1475. import net.sf.l2j.gameserver.model.actor.L2Character;
  1476. import net.sf.l2j.gameserver.model.actor.L2Npc;
  1477. import net.sf.l2j.gameserver.model.actor.L2Playable;
  1478. -import net.sf.l2j.gameserver.model.actor.knownlist.DoorKnownList;
  1479. import net.sf.l2j.gameserver.model.actor.stat.DoorStat;
  1480. import net.sf.l2j.gameserver.model.actor.status.DoorStatus;
  1481. import net.sf.l2j.gameserver.model.actor.template.DoorTemplate;
  1482. @@ -200,18 +199,6 @@
  1483.     }
  1484.    
  1485.     @Override
  1486. -   public void initKnownList()
  1487. -   {
  1488. -       setKnownList(new DoorKnownList(this));
  1489. -   }
  1490. -  
  1491. -   @Override
  1492. -   public final DoorKnownList getKnownList()
  1493. -   {
  1494. -       return (DoorKnownList) super.getKnownList();
  1495. -   }
  1496. -  
  1497. -   @Override
  1498.     public void initCharStat()
  1499.     {
  1500.         setStat(new DoorStat(this));
  1501. @@ -427,7 +414,7 @@
  1502.     @Override
  1503.     public void broadcastStatusUpdate()
  1504.     {
  1505. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  1506. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  1507.             player.sendPacket(new DoorStatusUpdate(this, player));
  1508.     }
  1509.    
  1510. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Character.java
  1511. ===================================================================
  1512. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Character.java (révision 568)
  1513. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Character.java (révision 578)
  1514. @@ -46,17 +46,16 @@
  1515. import net.sf.l2j.gameserver.model.L2Party;
  1516. import net.sf.l2j.gameserver.model.L2Skill;
  1517. import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType;
  1518. -import net.sf.l2j.gameserver.model.World;
  1519. -import net.sf.l2j.gameserver.model.WorldRegion;
  1520. import net.sf.l2j.gameserver.model.Location;
  1521. import net.sf.l2j.gameserver.model.ShotType;
  1522. import net.sf.l2j.gameserver.model.SpawnLocation;
  1523. +import net.sf.l2j.gameserver.model.World;
  1524. +import net.sf.l2j.gameserver.model.WorldRegion;
  1525. import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  1526. import net.sf.l2j.gameserver.model.actor.instance.L2NpcWalkerInstance;
  1527. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1528. import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  1529. import net.sf.l2j.gameserver.model.actor.instance.L2RiftInvaderInstance;
  1530. -import net.sf.l2j.gameserver.model.actor.knownlist.CharKnownList;
  1531. import net.sf.l2j.gameserver.model.actor.stat.CharStat;
  1532. import net.sf.l2j.gameserver.model.actor.status.CharStatus;
  1533. import net.sf.l2j.gameserver.model.actor.template.CharTemplate;
  1534. @@ -151,7 +150,6 @@
  1535.     private CharStat _stat;
  1536.     private CharStatus _status;
  1537.     private CharTemplate _template; // The link on the L2CharTemplate object containing generic and static properties
  1538. -   private CharKnownList _knownList;
  1539.    
  1540.     private String _title;
  1541.     private double _hpUpdateIncCheck = .0;
  1542. @@ -197,7 +195,6 @@
  1543.     public L2Character(int objectId, CharTemplate template)
  1544.     {
  1545.         super(objectId);
  1546. -       initKnownList();
  1547.         initCharStat();
  1548.         initCharStatus();
  1549.        
  1550. @@ -247,9 +244,8 @@
  1551.     /**
  1552.      * Remove the L2Character from the world when the decay task is launched.<BR>
  1553.      * <BR>
  1554. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR>
  1555. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players</B></FONT><BR>
  1556. -    * <BR>
  1557. +    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _objects of World.</B></FONT><BR>
  1558. +    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players.</B></FONT>
  1559.      */
  1560.     public void onDecay()
  1561.     {
  1562. @@ -530,7 +526,7 @@
  1563.        
  1564.         if (!isAlikeDead())
  1565.         {
  1566. -           if (this instanceof L2Npc && target.isAlikeDead() || !getKnownList().knowsObject(target))
  1567. +           if (this instanceof L2Npc && target.isAlikeDead() || !getKnownType(L2Character.class).contains(target))
  1568.             {
  1569.                 getAI().setIntention(CtrlIntention.ACTIVE);
  1570.                 sendPacket(ActionFailed.STATIC_PACKET);
  1571. @@ -634,9 +630,6 @@
  1572.             }
  1573.         }
  1574.        
  1575. -       // Add the L2PcInstance to _knownObjects and _knownPlayer of the target
  1576. -       target.getKnownList().addKnownObject(this);
  1577. -      
  1578.         // Recharge any active auto soulshot tasks for current L2Character instance.
  1579.         rechargeShots(true, false);
  1580.        
  1581. @@ -918,7 +911,7 @@
  1582.         boolean hitted = doAttackHitSimple(attack, target, 100, sAtk);
  1583.         double attackpercent = 85;
  1584.        
  1585. -       for (L2Character obj : getKnownList().getKnownType(L2Character.class))
  1586. +       for (L2Character obj : getKnownType(L2Character.class))
  1587.         {
  1588.             if (obj == target || obj.isAlikeDead())
  1589.                 continue;
  1590. @@ -1859,7 +1852,7 @@
  1591.             ((L2Summon) this).broadcastStatusUpdate();
  1592.         else if (this instanceof L2Npc)
  1593.         {
  1594. -           for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  1595. +           for (L2PcInstance player : getKnownType(L2PcInstance.class))
  1596.             {
  1597.                 if (getMoveSpeed() == 0)
  1598.                     player.sendPacket(new ServerObjectInfo((L2Npc) this, player));
  1599. @@ -1911,22 +1904,6 @@
  1600.         return false;
  1601.     }
  1602.    
  1603. -   public void initKnownList()
  1604. -   {
  1605. -       setKnownList(new CharKnownList(this));
  1606. -   }
  1607. -  
  1608. -   @Override
  1609. -   public CharKnownList getKnownList()
  1610. -   {
  1611. -       return _knownList;
  1612. -   }
  1613. -  
  1614. -   public void setKnownList(CharKnownList value)
  1615. -   {
  1616. -       _knownList = value;
  1617. -   }
  1618. -  
  1619.     public void initCharStat()
  1620.     {
  1621.         _stat = new CharStat(this);
  1622. @@ -2889,7 +2866,7 @@
  1623.         {
  1624.             if (broadcastFull)
  1625.             {
  1626. -               for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  1627. +               for (L2PcInstance player : getKnownType(L2PcInstance.class))
  1628.                 {
  1629.                     if (getMoveSpeed() == 0)
  1630.                         player.sendPacket(new ServerObjectInfo((L2Npc) this, player));
  1631. @@ -3218,18 +3195,12 @@
  1632.     }
  1633.    
  1634.     /**
  1635. -    * Stop movement of the L2Character (Called by AI Accessor only).<BR>
  1636. -    * <BR>
  1637. -    * <B><U> Actions</U> :</B>
  1638. +    * Stop movement of the L2Character (called by AI Accessor only).
  1639.      * <ul>
  1640.      * <li>Delete movement data of the L2Character</li>
  1641. -    * <li>Set the current position (x,y,z), its current L2WorldRegion if necessary and its heading</li>
  1642. -    * <li>Remove the L2Object object from _gmList** of GmListTable</li>
  1643. -    * <li>Remove object from _knownObjects and _knownPlayer* of all surrounding L2WorldRegion L2Characters</li>
  1644. +    * <li>Set the current position and refresh the region if necessary</li>
  1645.      * </ul>
  1646. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T send Server->Client packet StopMove/StopRotation </B></FONT><BR>
  1647. -    * <BR>
  1648. -    * @param loc
  1649. +    * @param loc : The SpawnLocation where the character must stop.
  1650.      */
  1651.     public void stopMove(SpawnLocation loc)
  1652.     {
  1653. @@ -3236,8 +3207,7 @@
  1654.         // Delete movement data of the L2Character
  1655.         _move = null;
  1656.        
  1657. -       // Set the current position (x,y,z), its current L2WorldRegion if necessary and its heading
  1658. -       // All data are contained in a L2CharPosition object
  1659. +       // Set the current position and refresh the region if necessary.
  1660.         if (loc != null)
  1661.         {
  1662.             setXYZ(loc.getX(), loc.getY(), loc.getZ());
  1663. @@ -3282,18 +3252,8 @@
  1664.      */
  1665.     public void setTarget(L2Object object)
  1666.     {
  1667. -       if (object != null)
  1668. -       {
  1669. -           if (!object.isVisible())
  1670. -               object = null;
  1671. -           else if (object != _target)
  1672. -           {
  1673. -               getKnownList().addKnownObject(object);
  1674. -              
  1675. -               if (object.getKnownList() != null)
  1676. -                   object.getKnownList().addKnownObject(this);
  1677. -           }
  1678. -       }
  1679. +       if (object != null && !object.isVisible())
  1680. +           object = null;
  1681.        
  1682.         _target = object;
  1683.     }
  1684. @@ -3303,10 +3263,7 @@
  1685.      */
  1686.     public final int getTargetId()
  1687.     {
  1688. -       if (_target != null)
  1689. -           return _target.getObjectId();
  1690. -      
  1691. -       return -1;
  1692. +       return (_target != null) ? _target.getObjectId() : -1;
  1693.     }
  1694.    
  1695.     /**
  1696. @@ -3828,7 +3785,7 @@
  1697.             return;
  1698.         }
  1699.        
  1700. -       if ((this instanceof L2Npc && target.isAlikeDead()) || target.isDead() || (!getKnownList().knowsObject(target) && !(this instanceof L2DoorInstance)))
  1701. +       if ((this instanceof L2Npc && target.isAlikeDead()) || target.isDead() || (!getKnownType(L2Character.class).contains(target) && !(this instanceof L2DoorInstance)))
  1702.         {
  1703.             getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
  1704.            
  1705. @@ -4953,7 +4910,7 @@
  1706.                 }
  1707.                
  1708.                 // Mobs in range 1000 see spell
  1709. -               for (L2Npc npcMob : player.getKnownList().getKnownTypeInRadius(L2Npc.class, 1000))
  1710. +               for (L2Npc npcMob : player.getKnownTypeInRadius(L2Npc.class, 1000))
  1711.                 {
  1712.                     List<Quest> quests = npcMob.getTemplate().getEventQuests(EventType.ON_SKILL_SEE);
  1713.                     if (quests != null)
  1714. @@ -5522,12 +5479,6 @@
  1715.     }
  1716.    
  1717.     @Override
  1718. -   protected void badCoords()
  1719. -   {
  1720. -       decayMe();
  1721. -   }
  1722. -  
  1723. -   @Override
  1724.     public final void setRegion(WorldRegion value)
  1725.     {
  1726.         // confirm revalidation of old region's zones
  1727. @@ -5541,4 +5492,12 @@
  1728.        
  1729.         super.setRegion(value);
  1730.     }
  1731. +  
  1732. +   @Override
  1733. +   public void removeKnownObject(L2Object object)
  1734. +   {
  1735. +       // If object is targeted by the L2Character, cancel Attack or Cast
  1736. +       if (object == getTarget())
  1737. +           setTarget(null);
  1738. +   }
  1739.  }
  1740. \ No newline at end of file
  1741. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/template/PcTemplate.java
  1742. ===================================================================
  1743. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/template/PcTemplate.java (révision 568)
  1744. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/template/PcTemplate.java (révision 578)
  1745. @@ -18,6 +18,7 @@
  1746.  import java.util.List;
  1747.  
  1748.  import net.sf.l2j.gameserver.datatables.ItemTable;
  1749. +import net.sf.l2j.gameserver.model.Location;
  1750.  import net.sf.l2j.gameserver.model.base.ClassId;
  1751.  import net.sf.l2j.gameserver.model.base.ClassRace;
  1752.  import net.sf.l2j.gameserver.model.base.Sex;
  1753. @@ -24,9 +25,6 @@
  1754.  import net.sf.l2j.gameserver.model.item.kind.Item;
  1755.  import net.sf.l2j.gameserver.templates.StatsSet;
  1756.  
  1757. -/**
  1758. - * @author mkizub
  1759. - */
  1760.  public class PcTemplate extends CharTemplate
  1761.  {
  1762.     private final ClassId _classId;
  1763. @@ -38,9 +36,7 @@
  1764.     private final double _collisionRadiusFemale;
  1765.     private final double _collisionHeightFemale;
  1766.    
  1767. -   private final int _spawnX;
  1768. -   private final int _spawnY;
  1769. -   private final int _spawnZ;
  1770. +   private final Location _spawn;
  1771.    
  1772.     private final int _classBaseLevel;
  1773.    
  1774. @@ -63,9 +59,7 @@
  1775.         _collisionRadiusFemale = set.getDouble("radiusFemale");
  1776.         _collisionHeightFemale = set.getDouble("heightFemale");
  1777.        
  1778. -       _spawnX = set.getInteger("spawnX");
  1779. -       _spawnY = set.getInteger("spawnY");
  1780. -       _spawnZ = set.getInteger("spawnZ");
  1781. +       _spawn = new Location(set.getInteger("spawnX"), set.getInteger("spawnY"), set.getInteger("spawnZ"));
  1782.        
  1783.         _classBaseLevel = set.getInteger("baseLvl");
  1784.        
  1785. @@ -153,21 +147,11 @@
  1786.         return (sex == Sex.MALE) ? _collisionHeight : _collisionHeightFemale;
  1787.     }
  1788.    
  1789. -   public final int getSpawnX()
  1790. +   public final Location getSpawn()
  1791.     {
  1792. -       return _spawnX;
  1793. +       return _spawn;
  1794.     }
  1795.    
  1796. -   public final int getSpawnY()
  1797. -   {
  1798. -       return _spawnY;
  1799. -   }
  1800. -  
  1801. -   public final int getSpawnZ()
  1802. -   {
  1803. -       return _spawnZ;
  1804. -   }
  1805. -  
  1806.     public final int getClassBaseLevel()
  1807.     {
  1808.         return _classBaseLevel;
  1809. Index: aCis_datapack/data/html/mods/wedding/error_alreadymarried.htm
  1810. ===================================================================
  1811. --- aCis_datapack/data/html/mods/wedding/error_alreadymarried.htm   (nonexistent)
  1812. +++ aCis_datapack/data/html/mods/wedding/error_alreadymarried.htm   (révision 578)
  1813. @@ -0,0 +1,4 @@
  1814. +<html><body>
  1815. +   I'm sorry, but this player is already married.<br>
  1816. +   Find another belover, or ask him/her to divorce first.
  1817. +</body></html>
  1818. \ No newline at end of file
  1819. Index: aCis_datapack/data/html/mods/wedding/start2.htm
  1820. ===================================================================
  1821. --- aCis_datapack/data/html/mods/wedding/start2.htm (nonexistent)
  1822. +++ aCis_datapack/data/html/mods/wedding/start2.htm (révision 578)
  1823. @@ -0,0 +1,6 @@
  1824. +<html><body>
  1825. +   Hello there, how can I help you on this beautiful day ?<br>
  1826. +   <center><a action="bypass -h npc_%objectId%_GoToLove">Teleport me near my beloved.</a>
  1827. +   <br>
  1828. +   <a action="bypass -h npc_%objectId%_Divorce">I want to divorce.</a></center>
  1829. +</body></html>
  1830. \ No newline at end of file
  1831. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Vehicle.java
  1832. ===================================================================
  1833. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Vehicle.java   (révision 568)
  1834. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Vehicle.java   (révision 578)
  1835. @@ -28,7 +28,6 @@
  1836. import net.sf.l2j.gameserver.model.SpawnLocation;
  1837. import net.sf.l2j.gameserver.model.VehiclePathPoint;
  1838. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1839. -import net.sf.l2j.gameserver.model.actor.knownlist.VehicleKnownList;
  1840. import net.sf.l2j.gameserver.model.actor.stat.VehicleStat;
  1841. import net.sf.l2j.gameserver.model.actor.template.CharTemplate;
  1842. import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  1843. @@ -158,12 +157,6 @@
  1844.     }
  1845.    
  1846.     @Override
  1847. -   public void initKnownList()
  1848. -   {
  1849. -       setKnownList(new VehicleKnownList(this));
  1850. -   }
  1851. -  
  1852. -   @Override
  1853.     public VehicleStat getStat()
  1854.     {
  1855.         return (VehicleStat) super.getStat();
  1856. @@ -212,7 +205,7 @@
  1857.         if (player.isOnline())
  1858.             player.teleToLocation(loc.getX(), loc.getY(), loc.getZ(), 0);
  1859.         else
  1860. -           player.setXYZInvisible(loc.getX(), loc.getY(), loc.getZ()); // disconnects handling
  1861. +           player.setXYZInvisible(loc); // disconnects handling
  1862.     }
  1863.    
  1864.     public boolean addPassenger(L2PcInstance player)
  1865. @@ -264,7 +257,7 @@
  1866.      */
  1867.     public void payForRide(int itemId, int count, Location loc)
  1868.     {
  1869. -       for (L2PcInstance player : getKnownList().getKnownTypeInRadius(L2PcInstance.class, 1000))
  1870. +       for (L2PcInstance player : getKnownTypeInRadius(L2PcInstance.class, 1000))
  1871.         {
  1872.             if (player.isInBoat() && player.getBoat() == this)
  1873.             {
  1874. @@ -356,9 +349,6 @@
  1875.         // Decay the vehicle.
  1876.         decayMe();
  1877.        
  1878. -       // Remove from knownlist.
  1879. -       getKnownList().removeAllKnownObjects();
  1880. -      
  1881.         super.deleteMe();
  1882.     }
  1883.    
  1884. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java
  1885. ===================================================================
  1886. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java  (révision 568)
  1887. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java  (révision 578)
  1888. @@ -23,11 +23,13 @@
  1889. import net.sf.l2j.gameserver.instancemanager.games.MonsterRace;
  1890. import net.sf.l2j.gameserver.instancemanager.games.MonsterRace.HistoryInfo;
  1891. import net.sf.l2j.gameserver.instancemanager.games.MonsterRace.RaceState;
  1892. -import net.sf.l2j.gameserver.model.actor.knownlist.RaceManagerKnownList;
  1893. +import net.sf.l2j.gameserver.model.L2Object;
  1894. +import net.sf.l2j.gameserver.model.actor.L2Npc;
  1895. import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  1896. import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  1897. import net.sf.l2j.gameserver.network.SystemMessageId;
  1898. import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  1899. +import net.sf.l2j.gameserver.network.serverpackets.DeleteObject;
  1900. import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  1901. import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  1902.  
  1903. @@ -51,18 +53,6 @@
  1904.     }
  1905.    
  1906.     @Override
  1907. -   public void initKnownList()
  1908. -   {
  1909. -       setKnownList(new RaceManagerKnownList(this));
  1910. -   }
  1911. -  
  1912. -   @Override
  1913. -   public final RaceManagerKnownList getKnownList()
  1914. -   {
  1915. -       return (RaceManagerKnownList) super.getKnownList();
  1916. -   }
  1917. -  
  1918. -   @Override
  1919.     public void onBypassFeedback(L2PcInstance player, String command)
  1920.     {
  1921.         if (command.startsWith("BuyTicket"))
  1922. @@ -345,4 +335,25 @@
  1923.         else
  1924.             super.onBypassFeedback(player, command);
  1925.     }
  1926. +  
  1927. +   @Override
  1928. +   public void addKnownObject(L2Object object)
  1929. +   {
  1930. +       if (object instanceof L2PcInstance)
  1931. +           ((L2PcInstance) object).sendPacket(MonsterRace.getInstance().getRacePacket());
  1932. +   }
  1933. +  
  1934. +   @Override
  1935. +   public void removeKnownObject(L2Object object)
  1936. +   {
  1937. +       super.removeKnownObject(object);
  1938. +      
  1939. +       if (object instanceof L2PcInstance)
  1940. +       {
  1941. +           final L2PcInstance player = ((L2PcInstance) object);
  1942. +          
  1943. +           for (L2Npc npc : MonsterRace.getInstance().getMonsters())
  1944. +               player.sendPacket(new DeleteObject(npc));
  1945. +       }
  1946. +   }
  1947. }
  1948. \ No newline at end of file
  1949. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java
  1950. ===================================================================
  1951. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java   (révision 568)
  1952. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java   (révision 578)
  1953. @@ -1390,7 +1390,7 @@
  1954.                     final L2PcInstance sourcePlayer = activeChar.getActingPlayer();
  1955.                    
  1956.                     targetList.add(activeChar);
  1957. -                   for (L2Character obj : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, _skillRadius))
  1958. +                   for (L2Character obj : activeChar.getKnownTypeInRadius(L2Character.class, _skillRadius))
  1959.                     {
  1960.                         if (!(obj == activeChar || obj == sourcePlayer || obj instanceof L2Npc || obj instanceof L2Attackable))
  1961.                             continue;
  1962. @@ -1402,7 +1402,7 @@
  1963.                 {
  1964.                     final boolean srcInArena = activeChar.isInArena();
  1965.                    
  1966. -                   for (L2Character obj : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, _skillRadius))
  1967. +                   for (L2Character obj : activeChar.getKnownTypeInRadius(L2Character.class, _skillRadius))
  1968.                     {
  1969.                         if (obj instanceof L2Attackable || obj instanceof L2Playable)
  1970.                         {
  1971. @@ -1448,7 +1448,7 @@
  1972.                 final boolean srcInArena = activeChar.isInArena();
  1973.                 List<L2Character> targetList = new ArrayList<>();
  1974.                
  1975. -               for (L2Character obj : target.getKnownList().getKnownType(L2Character.class))
  1976. +               for (L2Character obj : target.getKnownType(L2Character.class))
  1977.                 {
  1978.                     if (obj == null || obj == target || obj == activeChar)
  1979.                         continue;
  1980. @@ -1501,7 +1501,7 @@
  1981.                 else
  1982.                     origin = activeChar;
  1983.                
  1984. -               for (L2Character obj : activeChar.getKnownList().getKnownType(L2Character.class))
  1985. +               for (L2Character obj : activeChar.getKnownType(L2Character.class))
  1986.                 {
  1987.                     if (!(obj instanceof L2Attackable || obj instanceof L2Playable))
  1988.                         continue;
  1989. @@ -1657,7 +1657,7 @@
  1990.                
  1991.                 if (player.getClan() != null)
  1992.                 {
  1993. -                   for (L2PcInstance obj : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  1994. +                   for (L2PcInstance obj : activeChar.getKnownTypeInRadius(L2PcInstance.class, radius))
  1995.                     {
  1996.                         if ((obj.getAllyId() == 0 || obj.getAllyId() != player.getAllyId()) && (obj.getClan() == null || obj.getClanId() != player.getClanId()))
  1997.                             continue;
  1998. @@ -1703,7 +1703,7 @@
  1999.                
  2000.                 if (player.getClan() != null)
  2001.                 {
  2002. -                   for (L2PcInstance obj : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  2003. +                   for (L2PcInstance obj : activeChar.getKnownTypeInRadius(L2PcInstance.class, radius))
  2004.                     {
  2005.                         if (!obj.isDead())
  2006.                             continue;
  2007. @@ -1786,7 +1786,7 @@
  2008.                 else if (activeChar instanceof L2Npc)
  2009.                 {
  2010.                     targetList.add(activeChar);
  2011. -                   for (L2Npc newTarget : activeChar.getKnownList().getKnownTypeInRadius(L2Npc.class, _castRange))
  2012. +                   for (L2Npc newTarget : activeChar.getKnownTypeInRadius(L2Npc.class, _castRange))
  2013.                     {
  2014.                         if (newTarget.isDead() || !ArraysUtil.contains(((L2Npc) activeChar).getTemplate().getClans(), newTarget.getTemplate().getClans()))
  2015.                             continue;
  2016. @@ -1912,7 +1912,7 @@
  2017.                
  2018.                 final boolean srcInArena = activeChar.isInArena();
  2019.                
  2020. -               for (L2Character obj : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, _skillRadius))
  2021. +               for (L2Character obj : activeChar.getKnownTypeInRadius(L2Character.class, _skillRadius))
  2022.                 {
  2023.                     if (!(obj instanceof L2Attackable || obj instanceof L2Playable))
  2024.                         continue;
  2025. @@ -1962,7 +1962,7 @@
  2026.             {
  2027.                 List<L2Character> targetList = new ArrayList<>();
  2028.                
  2029. -               for (L2Character obj : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, _skillRadius))
  2030. +               for (L2Character obj : activeChar.getKnownTypeInRadius(L2Character.class, _skillRadius))
  2031.                 {
  2032.                     if (obj instanceof L2Npc || obj instanceof L2SummonInstance)
  2033.                         target = obj;
  2034. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java
  2035. ===================================================================
  2036. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java   (révision 568)
  2037. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java   (révision 578)
  2038. @@ -58,7 +58,7 @@
  2039.         final int mpConsume = getSkill().getMpConsume();
  2040.         final L2PcInstance caster = (L2PcInstance) getEffector();
  2041.        
  2042. -       for (L2Playable cha : _actor.getKnownList().getKnownTypeInRadius(L2Playable.class, getSkill().getSkillRadius()))
  2043. +       for (L2Playable cha : _actor.getKnownTypeInRadius(L2Playable.class, getSkill().getSkillRadius()))
  2044.         {
  2045.             if (!caster.canAttackCharacter(cha))
  2046.                 continue;
  2047. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
  2048. ===================================================================
  2049. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java    (révision 568)
  2050. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java    (révision 578)
  2051. @@ -22,7 +22,6 @@
  2052. import net.sf.l2j.gameserver.model.actor.L2Attackable;
  2053. import net.sf.l2j.gameserver.model.actor.L2Character;
  2054. import net.sf.l2j.gameserver.model.actor.L2Npc;
  2055. -import net.sf.l2j.gameserver.model.actor.knownlist.GuardKnownList;
  2056. import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  2057. import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  2058. import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;
  2059. @@ -45,18 +44,6 @@
  2060.     }
  2061.    
  2062.     @Override
  2063. -   public void initKnownList()
  2064. -   {
  2065. -       setKnownList(new GuardKnownList(this));
  2066. -   }
  2067. -  
  2068. -   @Override
  2069. -   public final GuardKnownList getKnownList()
  2070. -   {
  2071. -       return (GuardKnownList) super.getKnownList();
  2072. -   }
  2073. -  
  2074. -   @Override
  2075.     public boolean isAutoAttackable(L2Character attacker)
  2076.     {
  2077.         return attacker instanceof L2MonsterInstance;
  2078. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2MonsterInstance.java
  2079. ===================================================================
  2080. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2MonsterInstance.java  (révision 568)
  2081. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2MonsterInstance.java  (révision 578)
  2082. @@ -17,7 +17,6 @@
  2083. import net.sf.l2j.gameserver.model.MinionList;
  2084. import net.sf.l2j.gameserver.model.actor.L2Attackable;
  2085. import net.sf.l2j.gameserver.model.actor.L2Character;
  2086. -import net.sf.l2j.gameserver.model.actor.knownlist.MonsterKnownList;
  2087. import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  2088.  
  2089. /**
  2090. @@ -49,18 +48,6 @@
  2091.     }
  2092.    
  2093.     @Override
  2094. -   public void initKnownList()
  2095. -   {
  2096. -       setKnownList(new MonsterKnownList(this));
  2097. -   }
  2098. -  
  2099. -   @Override
  2100. -   public final MonsterKnownList getKnownList()
  2101. -   {
  2102. -       return (MonsterKnownList) super.getKnownList();
  2103. -   }
  2104. -  
  2105. -   @Override
  2106.     public boolean isAutoAttackable(L2Character attacker)
  2107.     {
  2108.         // FIXME: to test to allow monsters hit others monsters
  2109. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PetInstance.java
  2110. ===================================================================
  2111. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PetInstance.java  (révision 568)
  2112. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PetInstance.java  (révision 578)
  2113. @@ -38,8 +38,8 @@
  2114. import net.sf.l2j.gameserver.model.L2Object;
  2115. import net.sf.l2j.gameserver.model.L2Party;
  2116. import net.sf.l2j.gameserver.model.L2Skill;
  2117. +import net.sf.l2j.gameserver.model.PetDataEntry;
  2118. import net.sf.l2j.gameserver.model.World;
  2119. -import net.sf.l2j.gameserver.model.PetDataEntry;
  2120. import net.sf.l2j.gameserver.model.actor.L2Character;
  2121. import net.sf.l2j.gameserver.model.actor.L2Summon;
  2122. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.TimeStamp;
  2123. @@ -174,39 +174,17 @@
  2124.         }
  2125.     }
  2126.    
  2127. -   public synchronized static L2PetInstance spawnPet(NpcTemplate template, L2PcInstance owner, ItemInstance control)
  2128. -   {
  2129. -       // Owner has a pet listed in world.
  2130. -       if (World.getInstance().getPet(owner.getObjectId()) != null)
  2131. -           return null;
  2132. -      
  2133. -       // Add the pet instance to world.
  2134. -       final L2PetInstance pet = restore(control, template, owner);
  2135. -       if (pet != null)
  2136. -       {
  2137. -           pet.setTitle(owner.getName());
  2138. -           World.getInstance().addPet(owner.getObjectId(), pet);
  2139. -       }
  2140. -      
  2141. -       return pet;
  2142. -   }
  2143. -  
  2144.     public L2PetInstance(int objectId, NpcTemplate template, L2PcInstance owner, ItemInstance control)
  2145.     {
  2146.         super(objectId, template, owner);
  2147.        
  2148. +       getPosition().set(owner.getX() + 50, owner.getY() + 100, owner.getZ());
  2149. +      
  2150.         _controlItemId = control.getObjectId();
  2151.        
  2152. -       if (template.getNpcId() == 12564)
  2153. -           getStat().setLevel((byte) getOwner().getLevel());
  2154. -       else
  2155. -           getStat().setLevel(template.getLevel());
  2156. -      
  2157.         _inventory = new PetInventory(this);
  2158. -       _inventory.restore();
  2159.        
  2160.         _mountable = isMountable(template.getNpcId());
  2161. -       _petData = getTemplate().getPetDataEntry(getLevel());
  2162.     }
  2163.    
  2164.     @Override
  2165. @@ -396,6 +374,13 @@
  2166.             return;
  2167.         }
  2168.        
  2169. +       // Can't pickup shots and arrows.
  2170. +       if (target.getItem().getItemType() == EtcItemType.ARROW || target.getItem().getItemType() == EtcItemType.SHOT)
  2171. +       {
  2172. +           getOwner().sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS);
  2173. +           return;
  2174. +       }
  2175. +      
  2176.         synchronized (target)
  2177.         {
  2178.             if (!target.isVisible())
  2179. @@ -562,9 +547,6 @@
  2180.             petIU.addRemovedItem(oldItem);
  2181.         sendPacket(petIU);
  2182.        
  2183. -       // Update pet current load aswell
  2184. -       updateAndBroadcastStatus(1);
  2185. -      
  2186.         // Send player inventory update packet
  2187.         InventoryUpdate playerIU = new InventoryUpdate();
  2188.         if (newItem.getCount() > count)
  2189. @@ -657,7 +639,7 @@
  2190.         return _mountable;
  2191.     }
  2192.    
  2193. -   private static L2PetInstance restore(ItemInstance control, NpcTemplate template, L2PcInstance owner)
  2194. +   public static L2PetInstance restore(ItemInstance control, NpcTemplate template, L2PcInstance owner)
  2195.     {
  2196.         try (Connection con = L2DatabaseFactory.getInstance().getConnection())
  2197.         {
  2198. @@ -674,6 +656,14 @@
  2199.             {
  2200.                 rset.close();
  2201.                 statement.close();
  2202. +              
  2203. +               pet.getStat().setLevel((template.getNpcId() == 12564) ? (byte) pet.getOwner().getLevel() : template.getLevel());
  2204. +               pet.getStat().setExp(pet.getExpForThisLevel());
  2205. +               pet.getStatus().setCurrentHp(pet.getMaxHp());
  2206. +               pet.getStatus().setCurrentMp(pet.getMaxMp());
  2207. +               pet.setCurrentFed(pet.getPetData().getMaxMeal());
  2208. +               pet.store();
  2209. +              
  2210.                 return pet;
  2211.             }
  2212.            
  2213. @@ -686,7 +676,6 @@
  2214.            
  2215.             pet.getStatus().setCurrentHp(rset.getDouble("curHp"));
  2216.             pet.getStatus().setCurrentMp(rset.getDouble("curMp"));
  2217. -           pet.getStatus().setCurrentCp(pet.getMaxCp());
  2218.             if (rset.getDouble("curHp") < 0.5)
  2219.             {
  2220.                 pet.setIsDead(true);
  2221. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CabaleBufferInstance.java
  2222. ===================================================================
  2223. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CabaleBufferInstance.java (révision 568)
  2224. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2CabaleBufferInstance.java (révision 578)
  2225. @@ -139,7 +139,7 @@
  2226.             final List<L2PcInstance> playersList = new ArrayList<>();
  2227.             final List<L2PcInstance> gmsList = new ArrayList<>();
  2228.            
  2229. -           for (L2PcInstance player : getKnownList().getKnownTypeInRadius(L2PcInstance.class, 900))
  2230. +           for (L2PcInstance player : getKnownTypeInRadius(L2PcInstance.class, 900))
  2231.             {
  2232.                 if (player.isGM())
  2233.                     gmsList.add(player);
  2234. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SiegeGuardInstance.java
  2235. ===================================================================
  2236. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SiegeGuardInstance.java   (révision 568)
  2237. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SiegeGuardInstance.java   (révision 578)
  2238. @@ -20,7 +20,6 @@
  2239.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  2240.  import net.sf.l2j.gameserver.model.actor.L2Character;
  2241.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  2242. -import net.sf.l2j.gameserver.model.actor.knownlist.SiegeGuardKnownList;
  2243.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  2244.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  2245.  import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;
  2246. @@ -36,18 +35,6 @@
  2247.     }
  2248.    
  2249.     @Override
  2250. -   public void initKnownList()
  2251. -   {
  2252. -       setKnownList(new SiegeGuardKnownList(this));
  2253. -   }
  2254. -  
  2255. -   @Override
  2256. -   public final SiegeGuardKnownList getKnownList()
  2257. -   {
  2258. -       return (SiegeGuardKnownList) super.getKnownList();
  2259. -   }
  2260. -  
  2261. -   @Override
  2262.     public L2CharacterAI getAI()
  2263.     {
  2264.         L2CharacterAI ai = _ai;
  2265. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java
  2266. ===================================================================
  2267. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java  (révision 568)
  2268. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java  (révision 578)
  2269. @@ -72,7 +72,7 @@
  2270.         List<L2Character> targetList = new ArrayList<>();
  2271.        
  2272.         // Getting the possible targets
  2273. -       for (L2Object obj : getEffected().getKnownList().getKnownObjects())
  2274. +       for (L2Object obj : getEffected().getKnownType(L2Object.class))
  2275.         {
  2276.             // Attackable NPCs and playable characters (players, summons) are put in the list.
  2277.             if ((obj instanceof L2Attackable || obj instanceof L2Playable) && (obj != getEffected()))
  2278. @@ -86,8 +86,7 @@
  2279.             return true;
  2280.        
  2281.         // Choosing randomly a new target
  2282. -       int nextTargetIdx = Rnd.get(targetList.size());
  2283. -       L2Object target = targetList.get(nextTargetIdx);
  2284. +       L2Object target = Rnd.get(targetList);
  2285.        
  2286.         // Attacking the target
  2287.         getEffected().setTarget(target);
  2288. Index: aCis_datapack/data/html/mods/wedding/error_adena.htm
  2289. ===================================================================
  2290. --- aCis_datapack/data/html/mods/wedding/error_adena.htm    (nonexistent)
  2291. +++ aCis_datapack/data/html/mods/wedding/error_adena.htm    (révision 578)
  2292. @@ -0,0 +1,4 @@
  2293. +<html><body>
  2294. +   You or your partner haven't enough adenas.<br>
  2295. +   You need <font color="LEVEL">%adenasCost% adenas</font> to pay marriage fees.
  2296. +</body></html>
  2297. \ No newline at end of file
  2298. Index: aCis_datapack/data/html/mods/wedding/error_noformal.htm
  2299. ===================================================================
  2300. --- aCis_datapack/data/html/mods/wedding/error_noformal.htm (nonexistent)
  2301. +++ aCis_datapack/data/html/mods/wedding/error_noformal.htm (révision 578)
  2302. @@ -0,0 +1,4 @@
  2303. +<html><body>
  2304. +   You or your partner aren't wearing a Formal wear, so go find one and come back later !<br>
  2305. +   I heard <font color="LEVEL">Trader Alexis</font> in Aden town can help you, if you don't know how to get one.
  2306. +</body></html>
  2307. \ No newline at end of file
  2308. Index: aCis_datapack/data/html/mods/wedding/disabled.htm
  2309. ===================================================================
  2310. --- aCis_datapack/data/html/mods/wedding/disabled.htm   (nonexistent)
  2311. +++ aCis_datapack/data/html/mods/wedding/disabled.htm   (révision 578)
  2312. @@ -0,0 +1,5 @@
  2313. +<html><body>
  2314. +   The Wedding Manager is currently disabled.<br>
  2315. +   Contact an administrator in order to enable it via configuration files. It can be found in <font color="LEVEL">events.properties</font>.<br>
  2316. +   <font color="LEVEL">AllowWedding</font> have to be set on <font color="LEVEL">True</font> (False by default).
  2317. +</body></html>
  2318. \ No newline at end of file
  2319. Index: aCis_datapack/data/html/mods/wedding/waitforpartner.htm
  2320. ===================================================================
  2321. --- aCis_datapack/data/html/mods/wedding/waitforpartner.htm (nonexistent)
  2322. +++ aCis_datapack/data/html/mods/wedding/waitforpartner.htm (révision 578)
  2323. @@ -0,0 +1,4 @@
  2324. +<html><body>
  2325. +   You or your partner asked to marry ! If you're the requestor, wait until your partner accepted or declined your request.<br>
  2326. +   If you're the requested, what are you waiting for to say "Yes" or "No" ? I won't answer for you !
  2327. +</body></html>
  2328. \ No newline at end of file
  2329. Index: aCis_datapack/data/html/mods/wedding/error_sex.htm
  2330. ===================================================================
  2331. --- aCis_datapack/data/html/mods/wedding/error_sex.htm  (nonexistent)
  2332. +++ aCis_datapack/data/html/mods/wedding/error_sex.htm  (révision 578)
  2333. @@ -0,0 +1,4 @@
  2334. +<html><body>
  2335. +   Homosexual marriages aren't allowed.<br>
  2336. +   Your partner has to be from opposite sex in order I accept your request.
  2337. +</body></html>
  2338. \ No newline at end of file
  2339. Index: aCis_datapack/data/html/mods/wedding/error_friendlist.htm
  2340. ===================================================================
  2341. --- aCis_datapack/data/html/mods/wedding/error_friendlist.htm   (nonexistent)
  2342. +++ aCis_datapack/data/html/mods/wedding/error_friendlist.htm   (révision 578)
  2343. @@ -0,0 +1,4 @@
  2344. +<html><body>
  2345. +   This player isn't on your friends list. You must be friends in order to marry.<br>
  2346. +   To invite someone as a friend, type /friendinvite Name, where Name is the player's name. He/she has to accept you.
  2347. +</body></html>
  2348. \ No newline at end of file
  2349. Index: aCis_datapack/data/html/mods/wedding/error_wrongtarget.htm
  2350. ===================================================================
  2351. --- aCis_datapack/data/html/mods/wedding/error_wrongtarget.htm  (nonexistent)
  2352. +++ aCis_datapack/data/html/mods/wedding/error_wrongtarget.htm  (révision 578)
  2353. @@ -0,0 +1,4 @@
  2354. +<html><body>
  2355. +   Is there something wrong with you ?<br>
  2356. +   You try to marry with yourself ! Target another player.
  2357. +</body></html>
  2358. \ No newline at end of file
  2359. Index: aCis_datapack/data/html/mods/wedding/notfound.htm
  2360. ===================================================================
  2361. --- aCis_datapack/data/html/mods/wedding/notfound.htm   (nonexistent)
  2362. +++ aCis_datapack/data/html/mods/wedding/notfound.htm   (révision 578)
  2363. @@ -0,0 +1,3 @@
  2364. +<html><body>
  2365. +   Your friend must be online to begin the marriage process.
  2366. +</body></html>
  2367. \ No newline at end of file
  2368. Index: aCis_datapack/data/html/admin/knownlist.htm
  2369. ===================================================================
  2370. --- aCis_datapack/data/html/admin/knownlist.htm (révision 568)
  2371. +++ aCis_datapack/data/html/admin/knownlist.htm (révision 578)
  2372. @@ -1,8 +1,11 @@
  2373. <html><body>
  2374.     <center>Knownlist for <font color="LEVEL">%target%</font></center><br>
  2375. -   Knownlist is <font color="LEVEL">%type%</font>, has <font color="LEVEL">%size%</font> objects.
  2376. +   Knownlist has <font color="LEVEL">%size%</font> objects.
  2377.     <table width=270>
  2378. -       <tr><td width=170></td><td width=100></td></tr>
  2379. +       <tr><td width=150></td><td width=120></td></tr>
  2380.         %knownlist%
  2381. +   </table><br>
  2382. +   <table width=270 bgcolor=444444>
  2383. +       <tr><td width=270>Page: %pages%</td></tr>
  2384.     </table>
  2385. </body></html>
  2386. \ No newline at end of file
  2387. Index: aCis_datapack/data/xml/npcs/31000-31999.xml
  2388. ===================================================================
  2389. --- aCis_datapack/data/xml/npcs/31000-31999.xml (révision 568)
  2390. +++ aCis_datapack/data/xml/npcs/31000-31999.xml (révision 578)
  2391. @@ -27339,7 +27339,7 @@
  2392.         <set name="walkSpd" val="80"/>
  2393.         <set name="runSpd" val="120"/>
  2394.         <set name="dropHerbGroup" val="0"/>
  2395. -       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" clan="all_elemental_clan" clanRange="300" canMove="true" seedable="false"/>
  2396. +       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="1000" clan="all_elemental_clan" clanRange="300" canMove="true" seedable="false"/>
  2397.         <skills>
  2398.             <skill id="4045" level="1"/>
  2399.             <skill id="4416" level="13"/>
  2400. @@ -27409,7 +27409,7 @@
  2401.         <set name="walkSpd" val="12"/>
  2402.         <set name="runSpd" val="12"/>
  2403.         <set name="dropHerbGroup" val="0"/>
  2404. -       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" clan="all_elemental2_clan" clanRange="300" canMove="true" seedable="false"/>
  2405. +       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="1000" clan="all_elemental2_clan" clanRange="300" canMove="true" seedable="false"/>
  2406.         <skills>
  2407.             <skill id="4045" level="1"/>
  2408.             <skill id="4416" level="7"/>
  2409. @@ -27444,7 +27444,7 @@
  2410.         <set name="walkSpd" val="12"/>
  2411.         <set name="runSpd" val="12"/>
  2412.         <set name="dropHerbGroup" val="0"/>
  2413. -       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" clan="all_elemental_clan" clanRange="300" canMove="true" seedable="false"/>
  2414. +       <ai type="DEFAULT" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="1000" clan="all_elemental_clan" clanRange="300" canMove="true" seedable="false"/>
  2415.         <skills>
  2416.             <skill id="4045" level="1"/>
  2417.             <skill id="4416" level="7"/>
  2418. Index: aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/GeoEngine.java
  2419. ===================================================================
  2420. --- aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/GeoEngine.java (révision 568)
  2421. +++ aCis_gameserver/java/net/sf/l2j/gameserver/geoengine/GeoEngine.java (révision 578)
  2422. @@ -43,8 +43,8 @@
  2423. import net.sf.l2j.gameserver.geoengine.geodata.IGeoObject;
  2424. import net.sf.l2j.gameserver.idfactory.IdFactory;
  2425. import net.sf.l2j.gameserver.model.L2Object;
  2426. +import net.sf.l2j.gameserver.model.Location;
  2427. import net.sf.l2j.gameserver.model.World;
  2428. -import net.sf.l2j.gameserver.model.Location;
  2429. import net.sf.l2j.gameserver.model.actor.L2Character;
  2430. import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  2431. import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  2432. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Object.java
  2433. ===================================================================
  2434. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Object.java  (révision 568)
  2435. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Object.java  (révision 578)
  2436. @@ -14,8 +14,13 @@
  2437.  */
  2438. package net.sf.l2j.gameserver.model;
  2439.  
  2440. +import java.util.ArrayList;
  2441. +import java.util.Collections;
  2442. +import java.util.List;
  2443. import java.util.logging.Logger;
  2444.  
  2445. +import net.sf.l2j.commons.math.MathUtil;
  2446. +
  2447. import net.sf.l2j.gameserver.datatables.ItemTable;
  2448. import net.sf.l2j.gameserver.datatables.NpcTable;
  2449. import net.sf.l2j.gameserver.idfactory.IdFactory;
  2450. @@ -22,10 +27,10 @@
  2451. import net.sf.l2j.gameserver.model.actor.L2Character;
  2452. import net.sf.l2j.gameserver.model.actor.L2Npc;
  2453. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2454. -import net.sf.l2j.gameserver.model.actor.knownlist.ObjectKnownList;
  2455. import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  2456. import net.sf.l2j.gameserver.model.zone.ZoneId;
  2457. import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  2458. +import net.sf.l2j.gameserver.util.Util;
  2459.  
  2460. /**
  2461.  * Mother class of all interactive objects in the world (PC, NPC, Item...)
  2462. @@ -56,8 +61,6 @@
  2463.     public L2Object(int objectId)
  2464.     {
  2465.         _objectId = objectId;
  2466. -      
  2467. -       setRegion(World.getInstance().getRegion(_position));
  2468.     }
  2469.    
  2470.     public void onAction(L2PcInstance player)
  2471. @@ -84,18 +87,8 @@
  2472.      */
  2473.     public void decayMe()
  2474.     {
  2475. -       assert _region != null;
  2476. +       setRegion(null);
  2477.        
  2478. -       final WorldRegion region = _region;
  2479. -      
  2480. -       synchronized (this)
  2481. -       {
  2482. -           _isVisible = false;
  2483. -           setRegion(null);
  2484. -       }
  2485. -      
  2486. -       // Out of synchronized to avoid deadlocks
  2487. -       World.getInstance().removeVisibleObject(this, region);
  2488.         World.getInstance().removeObject(this);
  2489.     }
  2490.    
  2491. @@ -111,69 +104,22 @@
  2492.      */
  2493.     public final void spawnMe()
  2494.     {
  2495. -       assert _region == null;
  2496. +       _isVisible = true;
  2497.        
  2498. -       synchronized (this)
  2499. -       {
  2500. -           // Set the x,y,z position of the L2Object spawn and update its _worldregion
  2501. -           _isVisible = true;
  2502. -           setRegion(World.getInstance().getRegion(_position));
  2503. -       }
  2504. +       setRegion(World.getInstance().getRegion(_position));
  2505.        
  2506. -       // Add the L2Object spawn in the _allobjects of L2World
  2507.         World.getInstance().addObject(this);
  2508.        
  2509. -       // Add the L2Object spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion
  2510. -       _region.addVisibleObject(this);
  2511. -      
  2512. -       // Add the L2Object spawn in the world as a visible object -- out of synchronized to avoid deadlocks
  2513. -       World.getInstance().addVisibleObject(this, _region);
  2514. -      
  2515.         onSpawn();
  2516.     }
  2517.    
  2518.     public final void spawnMe(int x, int y, int z)
  2519.     {
  2520. -       assert _region == null;
  2521. +       _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);
  2522.        
  2523. -       synchronized (this)
  2524. -       {
  2525. -           // Set the x,y,z position of the L2Object spawn and update its _worldregion
  2526. -           _isVisible = true;
  2527. -          
  2528. -           if (x > World.WORLD_X_MAX)
  2529. -               x = World.WORLD_X_MAX - 5000;
  2530. -           if (x < World.WORLD_X_MIN)
  2531. -               x = World.WORLD_X_MIN + 5000;
  2532. -           if (y > World.WORLD_Y_MAX)
  2533. -               y = World.WORLD_Y_MAX - 5000;
  2534. -           if (y < World.WORLD_Y_MIN)
  2535. -               y = World.WORLD_Y_MIN + 5000;
  2536. -          
  2537. -           _position.set(x, y, z);
  2538. -           setRegion(World.getInstance().getRegion(_position));
  2539. -       }
  2540. -      
  2541. -       // Add the L2Object spawn in the _allobjects of L2World
  2542. -       World.getInstance().addObject(this);
  2543. -      
  2544. -       // Add the L2Object spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion
  2545. -       _region.addVisibleObject(this);
  2546. -      
  2547. -       // Add the L2Object spawn in the world as a visible object
  2548. -       World.getInstance().addVisibleObject(this, _region);
  2549. -      
  2550. -       onSpawn();
  2551. +       spawnMe();
  2552.     }
  2553.    
  2554. -   public void toggleVisible()
  2555. -   {
  2556. -       if (isVisible())
  2557. -           decayMe();
  2558. -       else
  2559. -           spawnMe();
  2560. -   }
  2561. -  
  2562.     public boolean isAttackable()
  2563.     {
  2564.         return false;
  2565. @@ -202,11 +148,6 @@
  2566.             setRegion(null);
  2567.     }
  2568.    
  2569. -   public ObjectKnownList getKnownList()
  2570. -   {
  2571. -       return null;
  2572. -   }
  2573. -  
  2574.     public final String getName()
  2575.     {
  2576.         return _name;
  2577. @@ -343,41 +284,17 @@
  2578.      */
  2579.     public final void setXYZ(int x, int y, int z)
  2580.     {
  2581. -       assert _region != null;
  2582. -      
  2583.         _position.set(x, y, z);
  2584.        
  2585. -       try
  2586. -       {
  2587. -           if (!isVisible())
  2588. -               return;
  2589. -          
  2590. -           final WorldRegion region = World.getInstance().getRegion(_position);
  2591. -           if (region != _region)
  2592. -           {
  2593. -               _region.removeVisibleObject(this);
  2594. -              
  2595. -               setRegion(region);
  2596. -              
  2597. -               // Add the L2Oject spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion
  2598. -               _region.addVisibleObject(this);
  2599. -           }
  2600. -       }
  2601. -       catch (Exception e)
  2602. -       {
  2603. -           _log.warning("Object Id at bad coords: (x: " + getX() + ", y: " + getY() + ", z: " + getZ() + ").");
  2604. -           badCoords();
  2605. -       }
  2606. +       if (!isVisible())
  2607. +           return;
  2608. +      
  2609. +       final WorldRegion region = World.getInstance().getRegion(_position);
  2610. +       if (region != _region)
  2611. +           setRegion(region);
  2612.     }
  2613.    
  2614.     /**
  2615. -    * Called on setXYZ exception.
  2616. -    */
  2617. -   protected void badCoords()
  2618. -   {
  2619. -   }
  2620. -  
  2621. -   /**
  2622.      * 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
  2623.      * @param x
  2624.      * @param y
  2625. @@ -385,48 +302,28 @@
  2626.      */
  2627.     public final void setXYZInvisible(int x, int y, int z)
  2628.     {
  2629. -       assert _region == null;
  2630. +       _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);
  2631.        
  2632. -       if (x > World.WORLD_X_MAX)
  2633. -           x = World.WORLD_X_MAX - 5000;
  2634. -       if (x < World.WORLD_X_MIN)
  2635. -           x = World.WORLD_X_MIN + 5000;
  2636. -       if (y > World.WORLD_Y_MAX)
  2637. -           y = World.WORLD_Y_MAX - 5000;
  2638. -       if (y < World.WORLD_Y_MIN)
  2639. -           y = World.WORLD_Y_MIN + 5000;
  2640. -      
  2641. -       _position.set(x, y, z);
  2642.         setIsVisible(false);
  2643.     }
  2644.    
  2645. -   /**
  2646. -    * @return the x position of the L2Object.
  2647. -    */
  2648. +   public final void setXYZInvisible(Location loc)
  2649. +   {
  2650. +       setXYZInvisible(loc.getX(), loc.getY(), loc.getZ());
  2651. +   }
  2652. +  
  2653.     public final int getX()
  2654.     {
  2655. -       assert _region != null || _isVisible;
  2656. -      
  2657.         return _position.getX();
  2658.     }
  2659.    
  2660. -   /**
  2661. -    * @return the y position of the L2Object.
  2662. -    */
  2663.     public final int getY()
  2664.     {
  2665. -       assert _region != null || _isVisible;
  2666. -      
  2667.         return _position.getY();
  2668.     }
  2669.    
  2670. -   /**
  2671. -    * @return the z position of the L2Object.
  2672. -    */
  2673.     public final int getZ()
  2674.     {
  2675. -       assert _region != null || _isVisible;
  2676. -      
  2677.         return _position.getZ();
  2678.     }
  2679.    
  2680. @@ -440,8 +337,145 @@
  2681.         return _region;
  2682.     }
  2683.    
  2684. -   public void setRegion(WorldRegion value)
  2685. +   /**
  2686. +    * Update current and surrounding regions, based on both current region and region setted as parameter.
  2687. +    * @param newRegion : null to remove the object, or the new region.
  2688. +    */
  2689. +   public void setRegion(WorldRegion newRegion)
  2690.     {
  2691. -       _region = value;
  2692. +       List<WorldRegion> oldAreas = Collections.emptyList();
  2693. +      
  2694. +       if (_region != null)
  2695. +       {
  2696. +           _region.removeVisibleObject(this);
  2697. +           oldAreas = _region.getSurroundingRegions();
  2698. +       }
  2699. +      
  2700. +       List<WorldRegion> newAreas = Collections.emptyList();
  2701. +      
  2702. +       if (newRegion != null)
  2703. +       {
  2704. +           newRegion.addVisibleObject(this);
  2705. +           newAreas = newRegion.getSurroundingRegions();
  2706. +       }
  2707. +      
  2708. +       // For every old surrounding area NOT SHARED with new surrounding areas.
  2709. +       for (WorldRegion region : oldAreas)
  2710. +       {
  2711. +           if (!newAreas.contains(region))
  2712. +           {
  2713. +               // Update all objects.
  2714. +               for (L2Object obj : region.getObjects())
  2715. +               {
  2716. +                   if (obj == this)
  2717. +                       continue;
  2718. +                  
  2719. +                   obj.removeKnownObject(this);
  2720. +                   removeKnownObject(obj);
  2721. +               }
  2722. +              
  2723. +               // Desactivate the old neighbor region.
  2724. +               if (this instanceof L2PcInstance && region.isEmptyNeighborhood())
  2725. +                   region.setActive(false);
  2726. +           }
  2727. +       }
  2728. +      
  2729. +       // For every new surrounding area NOT SHARED with old surrounding areas.
  2730. +       for (WorldRegion region : newAreas)
  2731. +       {
  2732. +           if (!oldAreas.contains(region))
  2733. +           {
  2734. +               // Update all objects.
  2735. +               for (L2Object obj : region.getObjects())
  2736. +               {
  2737. +                   if (obj == this)
  2738. +                       continue;
  2739. +                  
  2740. +                   obj.addKnownObject(this);
  2741. +                   addKnownObject(obj);
  2742. +               }
  2743. +              
  2744. +               // Activate the new neighbor region.
  2745. +               if (this instanceof L2PcInstance)
  2746. +                   region.setActive(true);
  2747. +           }
  2748. +       }
  2749. +      
  2750. +       _region = newRegion;
  2751.     }
  2752. +  
  2753. +   /**
  2754. +    * Add object to known list.
  2755. +    * @param object : {@link L2Object} to be added.
  2756. +    */
  2757. +   public void addKnownObject(L2Object object)
  2758. +   {
  2759. +   }
  2760. +  
  2761. +   /**
  2762. +    * Remove object from known list.
  2763. +    * @param object : {@link L2Object} to be removed.
  2764. +    */
  2765. +   public void removeKnownObject(L2Object object)
  2766. +   {
  2767. +   }
  2768. +  
  2769. +   /**
  2770. +    * Return the known list of given object type.
  2771. +    * @param <A> : Object type must be instance of {@link L2Object}.
  2772. +    * @param type : Class specifying object type.
  2773. +    * @return List<A> : Known list of given object type.
  2774. +    */
  2775. +   @SuppressWarnings("unchecked")
  2776. +   public final <A> List<A> getKnownType(Class<A> type)
  2777. +   {
  2778. +       final WorldRegion region = _region;
  2779. +       if (region == null)
  2780. +           return Collections.emptyList();
  2781. +      
  2782. +       final List<A> result = new ArrayList<>();
  2783. +      
  2784. +       for (WorldRegion reg : region.getSurroundingRegions())
  2785. +       {
  2786. +           for (L2Object obj : reg.getObjects())
  2787. +           {
  2788. +               if (obj == this || !type.isAssignableFrom(obj.getClass()))
  2789. +                   continue;
  2790. +              
  2791. +               result.add((A) obj);
  2792. +           }
  2793. +       }
  2794. +      
  2795. +       return result;
  2796. +   }
  2797. +  
  2798. +   /**
  2799. +    * Return the known list of given object type within specified radius.
  2800. +    * @param <A> : Object type must be instance of {@link L2Object}.
  2801. +    * @param type : Class specifying object type.
  2802. +    * @param radius : Radius to in which object must be located.
  2803. +    * @return List<A> : Known list of given object type.
  2804. +    */
  2805. +   @SuppressWarnings("unchecked")
  2806. +   public final <A> List<A> getKnownTypeInRadius(Class<A> type, int radius)
  2807. +   {
  2808. +       final WorldRegion region = _region;
  2809. +       if (region == null)
  2810. +           return Collections.emptyList();
  2811. +      
  2812. +       final List<A> result = new ArrayList<>();
  2813. +      
  2814. +       for (WorldRegion reg : region.getSurroundingRegions())
  2815. +       {
  2816. +           for (L2Object obj : reg.getObjects())
  2817. +           {
  2818. +               if (obj == this || !type.isAssignableFrom(obj.getClass()) || !Util.checkIfInRange(radius, this, obj, true))
  2819. +                   continue;
  2820. +              
  2821. +               result.add((A) obj);
  2822. +           }
  2823. +       }
  2824. +      
  2825. +       return result;
  2826. +   }
  2827. }
  2828. \ No newline at end of file
  2829. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/World.java
  2830. ===================================================================
  2831. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/World.java (révision 568)
  2832. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/World.java (révision 578)
  2833. @@ -14,9 +14,7 @@
  2834.  */
  2835. package net.sf.l2j.gameserver.model;
  2836.  
  2837. -import java.util.ArrayList;
  2838. import java.util.Collection;
  2839. -import java.util.List;
  2840. import java.util.Map;
  2841. import java.util.concurrent.ConcurrentHashMap;
  2842. import java.util.logging.Logger;
  2843. @@ -79,7 +77,7 @@
  2844.                 }
  2845.             }
  2846.         }
  2847. -       _log.info("L2World: WorldRegion grid (" + REGIONS_X + " by " + REGIONS_Y + ") is now setted up.");
  2848. +       _log.info("World: WorldRegion grid (" + REGIONS_X + " by " + REGIONS_Y + ") is now setted up.");
  2849.     }
  2850.    
  2851.     public void addObject(L2Object object)
  2852. @@ -142,184 +140,6 @@
  2853.         return _pets.get(ownerId);
  2854.     }
  2855.    
  2856. -   /**
  2857. -    * Add a L2Object in the world.<BR>
  2858. -    * <BR>
  2859. -    * <B><U> Concept</U> :</B><BR>
  2860. -    * <BR>
  2861. -    * L2Object (including L2PcInstance) are identified in <B>_visibleObjects</B> of his current L2WorldRegion and in <B>_knownObjects</B> of other surrounding L2Characters <BR>
  2862. -    * L2PcInstance are identified in <B>_allPlayers</B> of L2World, in <B>_allPlayers</B> of his current L2WorldRegion and in <B>_knownPlayer</B> of other surrounding L2Characters <BR>
  2863. -    * <BR>
  2864. -    * <B><U> Actions</U> :</B><BR>
  2865. -    * <BR>
  2866. -    * <li>Add the L2Object object in _allPlayers* of L2World</li> <li>Add the L2Object object in _gmList** of GmListTable</li> <li>Add object in _knownObjects and _knownPlayer* of all surrounding L2WorldRegion L2Characters</li><BR>
  2867. -    * <li>If object is a L2Character, add all surrounding L2Object in its _knownObjects and all surrounding L2PcInstance in its _knownPlayer</li><BR>
  2868. -    * <I>* only if object is a L2PcInstance</I><BR>
  2869. -    * <I>** only if object is a GM L2PcInstance</I><BR>
  2870. -    * <BR>
  2871. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T ADD the object in _visibleObjects and _allPlayers* of L2WorldRegion (need synchronisation)</B></FONT><BR>
  2872. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T ADD the object to _allObjects and _allPlayers* of L2World (need synchronisation)</B></FONT><BR>
  2873. -    * <BR>
  2874. -    * <B><U> Example of use </U> :</B><BR>
  2875. -    * <BR>
  2876. -    * <li>Drop an Item</li> <li>Spawn a L2Character</li> <li>Apply Death Penalty of a L2PcInstance</li><BR>
  2877. -    * <BR>
  2878. -    * @param object L2object to add in the world
  2879. -    * @param newRegion L2WorldRegion in wich the object will be add (not used)
  2880. -    */
  2881. -   public void addVisibleObject(L2Object object, WorldRegion newRegion)
  2882. -   {
  2883. -       if (object instanceof L2PcInstance)
  2884. -       {
  2885. -           L2PcInstance player = (L2PcInstance) object;
  2886. -          
  2887. -           if (!player.isTeleporting())
  2888. -           {
  2889. -               L2PcInstance tmp = _players.get(player.getObjectId());
  2890. -               if (tmp != null)
  2891. -               {
  2892. -                   _log.warning("Duplicate character!? Closing both characters (" + player.getName() + ")");
  2893. -                   player.logout();
  2894. -                   tmp.logout();
  2895. -                   return;
  2896. -               }
  2897. -               _players.putIfAbsent(player.getObjectId(), player);
  2898. -           }
  2899. -       }
  2900. -      
  2901. -       if (!newRegion.isActive())
  2902. -           return;
  2903. -      
  2904. -       final boolean objectHasKnownlist = (object.getKnownList() != null);
  2905. -      
  2906. -       // tell the player about the surroundings
  2907. -       // Go through the visible objects contained in the circular area
  2908. -       for (L2Object visible : getVisibleObjects(object, 2000))
  2909. -       {
  2910. -           // Add the object in L2ObjectHashSet(L2Object) _knownObjects of the visible L2Character according to conditions :
  2911. -           // - L2Character is visible
  2912. -           // - object is not already known
  2913. -           // - object is in the watch distance
  2914. -           // If L2Object is a L2PcInstance, add L2Object in L2ObjectHashSet(L2PcInstance) _knownPlayer of the visible L2Character
  2915. -           if (visible.getKnownList() != null)
  2916. -               visible.getKnownList().addKnownObject(object);
  2917. -          
  2918. -           // Add the visible L2Object in L2ObjectHashSet(L2Object) _knownObjects of the object according to conditions
  2919. -           // If visible L2Object is a L2PcInstance, add visible L2Object in L2ObjectHashSet(L2PcInstance) _knownPlayer of the object
  2920. -           if (objectHasKnownlist)
  2921. -               object.getKnownList().addKnownObject(visible);
  2922. -       }
  2923. -   }
  2924. -  
  2925. -   /**
  2926. -    * Remove a L2Object from the world.<BR>
  2927. -    * <BR>
  2928. -    * <B><U> Concept</U> :</B><BR>
  2929. -    * <BR>
  2930. -    * L2Object (including L2PcInstance) are identified in <B>_visibleObjects</B> of his current L2WorldRegion and in <B>_knownObjects</B> of other surrounding L2Characters <BR>
  2931. -    * L2PcInstance are identified in <B>_allPlayers</B> of L2World, in <B>_allPlayers</B> of his current L2WorldRegion and in <B>_knownPlayer</B> of other surrounding L2Characters <BR>
  2932. -    * <BR>
  2933. -    * <B><U> Actions</U> :</B><BR>
  2934. -    * <BR>
  2935. -    * <li>Remove the L2Object object from _allPlayers* of L2World</li> <li>Remove the L2Object object from _visibleObjects and _allPlayers* of L2WorldRegion</li> <li>Remove the L2Object object from _gmList** of GmListTable</li> <li>Remove object from _knownObjects and _knownPlayer* of all
  2936. -    * surrounding L2WorldRegion L2Characters</li><BR>
  2937. -    * <li>If object is a L2Character, remove all L2Object from its _knownObjects and all L2PcInstance from its _knownPlayer</li><BR>
  2938. -    * <BR>
  2939. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World</B></FONT><BR>
  2940. -    * <BR>
  2941. -    * <I>* only if object is a L2PcInstance</I><BR>
  2942. -    * <I>** only if object is a GM L2PcInstance</I><BR>
  2943. -    * <BR>
  2944. -    * <B><U> Example of use </U> :</B><BR>
  2945. -    * <BR>
  2946. -    * <li>Pickup an Item</li> <li>Decay a L2Character</li><BR>
  2947. -    * <BR>
  2948. -    * @param object L2object to remove from the world
  2949. -    * @param oldRegion L2WorldRegion in wich the object was before removing
  2950. -    */
  2951. -   public void removeVisibleObject(L2Object object, WorldRegion oldRegion)
  2952. -   {
  2953. -       if (object == null || oldRegion == null)
  2954. -           return;
  2955. -      
  2956. -       // Remove the object from the L2ObjectHashSet(L2Object) _visibleObjects of L2WorldRegion
  2957. -       // If object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayers of this L2WorldRegion
  2958. -       oldRegion.removeVisibleObject(object);
  2959. -      
  2960. -       final boolean objectHasKnownlist = (object.getKnownList() != null);
  2961. -      
  2962. -       // Go through all surrounding L2WorldRegion L2Characters
  2963. -       for (WorldRegion reg : oldRegion.getSurroundingRegions())
  2964. -       {
  2965. -           for (L2Object obj : reg.getObjects())
  2966. -           {
  2967. -               if (obj.getKnownList() != null)
  2968. -                   obj.getKnownList().removeKnownObject(object);
  2969. -              
  2970. -               if (objectHasKnownlist)
  2971. -                   object.getKnownList().removeKnownObject(obj);
  2972. -           }
  2973. -       }
  2974. -      
  2975. -       // If object is a L2Character :
  2976. -       // Remove all L2Object from L2ObjectHashSet(L2Object) containing all L2Object detected by the L2Character
  2977. -       // Remove all L2PcInstance from L2ObjectHashSet(L2PcInstance) containing all player ingame detected by the L2Character
  2978. -       if (objectHasKnownlist)
  2979. -           object.getKnownList().removeAllKnownObjects();
  2980. -      
  2981. -       // If selected L2Object is a L2PcIntance, remove it from L2ObjectHashSet(L2PcInstance) _allPlayers of L2World
  2982. -       if (object instanceof L2PcInstance)
  2983. -       {
  2984. -           if (!((L2PcInstance) object).isTeleporting())
  2985. -               removePlayer((L2PcInstance) object);
  2986. -       }
  2987. -   }
  2988. -  
  2989. -   /**
  2990. -    * <B><U> Concept</U> :</B><BR>
  2991. -    * <BR>
  2992. -    * All visible object are identified in <B>_visibleObjects</B> of their current L2WorldRegion <BR>
  2993. -    * All surrounding L2WorldRegion are identified in <B>_surroundingRegions</B> of the selected L2WorldRegion in order to scan a large area around a L2Object
  2994. -    * @param object L2object that determine the center of the circular area
  2995. -    * @param radius Radius of the circular area
  2996. -    * @return all visible objects of the L2WorldRegions in the circular area (radius) centered on the object.
  2997. -    */
  2998. -   public static List<L2Object> getVisibleObjects(L2Object object, int radius)
  2999. -   {
  3000. -       if (object == null || !object.isVisible())
  3001. -           return new ArrayList<>();
  3002. -      
  3003. -       int x = object.getX();
  3004. -       int y = object.getY();
  3005. -       int sqRadius = radius * radius;
  3006. -      
  3007. -       // Create an FastList in order to contain all visible L2Object
  3008. -       List<L2Object> result = new ArrayList<>();
  3009. -      
  3010. -       // Go through the FastList of region
  3011. -       for (WorldRegion regi : object.getRegion().getSurroundingRegions())
  3012. -       {
  3013. -           // Go through visible objects of the selected region
  3014. -           for (L2Object _object : regi.getObjects())
  3015. -           {
  3016. -               if (_object == null || _object.equals(object))
  3017. -                   continue; // skip our own character
  3018. -                  
  3019. -               int x1 = _object.getX();
  3020. -               int y1 = _object.getY();
  3021. -              
  3022. -               double dx = x1 - x;
  3023. -               double dy = y1 - y;
  3024. -              
  3025. -               // If the visible object is inside the circular area add the object to the FastList result
  3026. -               if (dx * dx + dy * dy < sqRadius)
  3027. -                   result.add(_object);
  3028. -           }
  3029. -       }
  3030. -      
  3031. -       return result;
  3032. -   }
  3033. -  
  3034.     public static int getRegionX(int regionX)
  3035.     {
  3036.         return (regionX - REGION_X_OFFSET) * REGION_SIZE;
  3037. @@ -332,7 +152,7 @@
  3038.    
  3039.     /**
  3040.      * @param point position of the object.
  3041. -    * @return the current L2WorldRegion of the object according to its position (x,y).
  3042. +    * @return the current WorldRegion of the object according to its position (x,y).
  3043.      */
  3044.     public WorldRegion getRegion(Location point)
  3045.     {
  3046. @@ -353,10 +173,9 @@
  3047.     }
  3048.    
  3049.     /**
  3050. -    * Check if the current L2WorldRegions of the object is valid according to its position (x,y).
  3051.      * @param x X position of the object
  3052.      * @param y Y position of the object
  3053. -    * @return True if the L2WorldRegion is valid
  3054. +    * @return True if the given coordinates are valid WorldRegion coordinates.
  3055.      */
  3056.     private static boolean validRegion(int x, int y)
  3057.     {
  3058. @@ -364,7 +183,7 @@
  3059.     }
  3060.    
  3061.     /**
  3062. -    * Deleted all spawns in the world.
  3063. +    * Delete all spawns in the world.
  3064.      */
  3065.     public void deleteVisibleNpcSpawns()
  3066.     {
  3067. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2WaterZone.java
  3068. ===================================================================
  3069. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2WaterZone.java (révision 568)
  3070. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2WaterZone.java (révision 578)
  3071. @@ -38,7 +38,7 @@
  3072.             ((L2PcInstance) character).broadcastUserInfo();
  3073.         else if (character instanceof L2Npc)
  3074.         {
  3075. -           for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  3076. +           for (L2PcInstance player : character.getKnownType(L2PcInstance.class))
  3077.             {
  3078.                 if (character.getMoveSpeed() == 0)
  3079.                     player.sendPacket(new ServerObjectInfo((L2Npc) character, player));
  3080. @@ -57,7 +57,7 @@
  3081.             ((L2PcInstance) character).broadcastUserInfo();
  3082.         else if (character instanceof L2Npc)
  3083.         {
  3084. -           for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  3085. +           for (L2PcInstance player : character.getKnownType(L2PcInstance.class))
  3086.             {
  3087.                 if (character.getMoveSpeed() == 0)
  3088.                     player.sendPacket(new ServerObjectInfo((L2Npc) character, player));
  3089. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Party.java
  3090. ===================================================================
  3091. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Party.java   (révision 568)
  3092. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Party.java   (révision 578)
  3093. @@ -402,7 +402,7 @@
  3094.         if (player.getFusionSkill() != null)
  3095.             player.abortCast();
  3096.        
  3097. -       for (L2Character character : player.getKnownList().getKnownType(L2Character.class))
  3098. +       for (L2Character character : player.getKnownType(L2Character.class))
  3099.             if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == player)
  3100.                 character.abortCast();
  3101.        
  3102. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java
  3103. ===================================================================
  3104. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java (révision 568)
  3105. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java (révision 578)
  3106. @@ -70,11 +70,11 @@
  3107.         List<L2Character> targetList = new ArrayList<>();
  3108.        
  3109.         // Getting the possible targets
  3110. -       for (L2Object obj : getEffected().getKnownList().getKnownObjects())
  3111. +       for (L2Attackable obj : getEffected().getKnownType(L2Attackable.class))
  3112.         {
  3113.             // Only attackable NPCs are put in the list.
  3114. -           if (obj instanceof L2Attackable && !(obj instanceof L2ChestInstance) && obj != getEffected())
  3115. -               targetList.add((L2Character) obj);
  3116. +           if (!(obj instanceof L2ChestInstance))
  3117. +               targetList.add(obj);
  3118.         }
  3119.        
  3120.         // if there is no target, exit function
  3121. @@ -82,8 +82,7 @@
  3122.             return true;
  3123.        
  3124.         // Choosing randomly a new target
  3125. -       int nextTargetIdx = Rnd.get(targetList.size());
  3126. -       L2Object target = targetList.get(nextTargetIdx);
  3127. +       L2Object target = Rnd.get(targetList);
  3128.        
  3129.         // Attacking the target
  3130.         getEffected().setTarget(target);
  3131. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java
  3132. ===================================================================
  3133. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java (révision 568)
  3134. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java (révision 578)
  3135. @@ -78,7 +78,7 @@
  3136.         getEffector().reduceCurrentMp(mpConsume);
  3137.        
  3138.         List<L2Character> targets = new ArrayList<>();
  3139. -       for (L2Character cha : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  3140. +       for (L2Character cha : _actor.getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  3141.         {
  3142.             if (_skill.isOffensive() && !L2Skill.checkForAreaOffensiveSkills(getEffector(), cha, _skill, _srcInArena))
  3143.                 continue;
  3144. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java
  3145. ===================================================================
  3146. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java   (révision 568)
  3147. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java   (révision 578)
  3148. @@ -24,8 +24,8 @@
  3149.  
  3150.  import net.sf.l2j.Config;
  3151.  import net.sf.l2j.L2DatabaseFactory;
  3152. +import net.sf.l2j.gameserver.model.Location;
  3153.  import net.sf.l2j.gameserver.model.World;
  3154. -import net.sf.l2j.gameserver.model.Location;
  3155.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3156.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3157.  import net.sf.l2j.gameserver.model.zone.type.L2OlympiadStadiumZone;
  3158. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/AggroInfo.java
  3159. ===================================================================
  3160. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/AggroInfo.java (révision 568)
  3161. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/AggroInfo.java (révision 578)
  3162. @@ -48,7 +48,7 @@
  3163.    
  3164.     public int checkHate(L2Character owner)
  3165.     {
  3166. -       if (_attacker.isAlikeDead() || !_attacker.isVisible() || !owner.getKnownList().knowsObject(_attacker))
  3167. +       if (_attacker.isAlikeDead() || !_attacker.isVisible() || !owner.getKnownType(L2Character.class).contains(_attacker))
  3168.             _hate = 0;
  3169.        
  3170.         return _hate;
  3171. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/PetInventory.java
  3172. ===================================================================
  3173. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/PetInventory.java    (révision 568)
  3174. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/itemcontainer/PetInventory.java    (révision 578)
  3175. @@ -14,12 +14,12 @@
  3176.   */
  3177.  package net.sf.l2j.gameserver.model.itemcontainer;
  3178.  
  3179. -import net.sf.l2j.gameserver.datatables.ItemTable;
  3180. +import net.sf.l2j.commons.random.Rnd;
  3181. +
  3182.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3183.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  3184.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  3185.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance.ItemLocation;
  3186. -import net.sf.l2j.gameserver.model.item.kind.Item;
  3187.  import net.sf.l2j.gameserver.model.item.type.EtcItemType;
  3188.  
  3189.  public class PetInventory extends Inventory
  3190. @@ -61,6 +61,7 @@
  3191.     {
  3192.         super.refreshWeight();
  3193.         getOwner().updateAndBroadcastStatus(1);
  3194. +       getOwner().sendPetInfosToOwner();
  3195.     }
  3196.    
  3197.     public boolean validateCapacity(ItemInstance item)
  3198. @@ -79,16 +80,9 @@
  3199.         return (_items.size() + slots <= _owner.getInventoryLimit());
  3200.     }
  3201.    
  3202. -   public boolean validateWeight(ItemInstance item, long count)
  3203. +   public boolean validateWeight(ItemInstance item, int count)
  3204.     {
  3205. -       int weight = 0;
  3206. -      
  3207. -       Item template = ItemTable.getInstance().getTemplate(item.getItemId());
  3208. -       if (template == null)
  3209. -           return false;
  3210. -      
  3211. -       weight += count * template.getWeight();
  3212. -       return validateWeight(weight);
  3213. +       return validateWeight(count * item.getItem().getWeight());
  3214.     }
  3215.    
  3216.     @Override
  3217. @@ -110,22 +104,6 @@
  3218.     }
  3219.    
  3220.     @Override
  3221. -   public void restore()
  3222. -   {
  3223. -       super.restore();
  3224. -      
  3225. -       // check for equipped items from other pets
  3226. -       for (ItemInstance item : _items)
  3227. -       {
  3228. -           if (item.isEquipped())
  3229. -           {
  3230. -               if (!item.getItem().checkCondition(getOwner(), getOwner(), false))
  3231. -                   unEquipItemInSlot(item.getLocationSlot());
  3232. -           }
  3233. -       }
  3234. -   }
  3235. -  
  3236. -   @Override
  3237.     public void deleteMe()
  3238.     {
  3239.         final L2PcInstance petOwner = getOwner().getOwner();
  3240. @@ -132,7 +110,16 @@
  3241.         if (petOwner != null)
  3242.         {
  3243.             for (ItemInstance item : _items)
  3244. -               getOwner().transferItem("return", item.getObjectId(), item.getCount(), petOwner.getInventory(), petOwner, getOwner());
  3245. +           {
  3246. +               if (petOwner.getInventory().validateCapacity(1))
  3247. +                   getOwner().transferItem("return", item.getObjectId(), item.getCount(), petOwner.getInventory(), petOwner, getOwner());
  3248. +               else
  3249. +               {
  3250. +                   final ItemInstance droppedItem = dropItem("drop", item.getObjectId(), item.getCount(), petOwner, getOwner());
  3251. +                   droppedItem.dropMe(getOwner(), getOwner().getX() + Rnd.get(-70, 70), getOwner().getY() + Rnd.get(-70, 70), getOwner().getZ() + 30);
  3252. +               }
  3253. +              
  3254. +           }
  3255.         }
  3256.         _items.clear();
  3257.     }
  3258. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/WorldRegion.java
  3259. ===================================================================
  3260. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/WorldRegion.java   (révision 568)
  3261. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/WorldRegion.java   (révision 578)
  3262. @@ -15,18 +15,16 @@
  3263.  package net.sf.l2j.gameserver.model;
  3264.  
  3265.  import java.util.ArrayList;
  3266. +import java.util.Collection;
  3267.  import java.util.List;
  3268. -import java.util.concurrent.ScheduledFuture;
  3269. -import java.util.concurrent.locks.Lock;
  3270. -import java.util.concurrent.locks.ReentrantLock;
  3271. +import java.util.Map;
  3272. +import java.util.concurrent.ConcurrentHashMap;
  3273. +import java.util.concurrent.atomic.AtomicInteger;
  3274.  
  3275. -import net.sf.l2j.commons.concurrent.ThreadPool;
  3276. -
  3277.  import net.sf.l2j.gameserver.ai.CtrlIntention;
  3278.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  3279.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3280.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  3281. -import net.sf.l2j.gameserver.model.actor.L2Vehicle;
  3282.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3283.  import net.sf.l2j.gameserver.model.zone.L2ZoneType;
  3284.  import net.sf.l2j.gameserver.model.zone.type.L2DerbyTrackZone;
  3285. @@ -35,7 +33,8 @@
  3286.  
  3287.  public final class WorldRegion
  3288.  {
  3289. -   private final List<L2Object> _objects = new ArrayList<>();
  3290. +   private final Map<Integer, L2Object> _objects = new ConcurrentHashMap<>();
  3291. +  
  3292.     private final List<WorldRegion> _surroundingRegions = new ArrayList<>();
  3293.     private final List<L2ZoneType> _zones = new ArrayList<>();
  3294.    
  3295. @@ -42,11 +41,8 @@
  3296.     private final int _tileX;
  3297.     private final int _tileY;
  3298.    
  3299. -   private final Lock _lock = new ReentrantLock();
  3300. -  
  3301.     private boolean _active;
  3302. -   private ScheduledFuture<?> _activateTask;
  3303. -   private int _playersCount;
  3304. +   private AtomicInteger _playersCount = new AtomicInteger();
  3305.    
  3306.     public WorldRegion(int x, int y)
  3307.     {
  3308. @@ -57,12 +53,12 @@
  3309.     @Override
  3310.     public String toString()
  3311.     {
  3312. -       return "WorldRegion [_tileX=" + _tileX + ", _tileY=" + _tileY + ", _active=" + _active + ", _playersCount=" + _playersCount + "]";
  3313. +       return "WorldRegion " + _tileX + "_" + _tileY + ", _active=" + _active + ", _playersCount=" + _playersCount.get() + "]";
  3314.     }
  3315.    
  3316. -   public List<L2Object> getObjects()
  3317. +   public Collection<L2Object> getObjects()
  3318.     {
  3319. -       return _objects;
  3320. +       return _objects.values();
  3321.     }
  3322.    
  3323.     public void addSurroundingRegion(WorldRegion region)
  3324. @@ -162,33 +158,26 @@
  3325.    
  3326.     public int getPlayersCount()
  3327.     {
  3328. -       return _playersCount;
  3329. +       return _playersCount.get();
  3330.     }
  3331.    
  3332.     /**
  3333. -    * Check if all 9 neighbors (including self) are inactive or active but with no players.
  3334. +    * Check if neighbors (including self) aren't inhabited.
  3335.      * @return true if the above condition is met.
  3336.      */
  3337. -   public boolean areNeighborsEmpty()
  3338. +   public boolean isEmptyNeighborhood()
  3339.     {
  3340. -       // if this region is occupied, return false.
  3341. -       if (isActive() && _playersCount != 0)
  3342. -           return false;
  3343. -      
  3344. -       // if any one of the neighbors is occupied, return false
  3345.         for (WorldRegion neighbor : _surroundingRegions)
  3346.         {
  3347. -           if (neighbor.isActive() && neighbor.getPlayersCount() != 0)
  3348. +           if (neighbor.getPlayersCount() != 0)
  3349.                 return false;
  3350.         }
  3351. -      
  3352. -       // in all other cases, return true.
  3353.         return true;
  3354.     }
  3355.    
  3356.     /**
  3357. -    * This function turns this region's AI and geodata on or off
  3358. -    * @param value
  3359. +    * This function turns this region's AI on or off.
  3360. +    * @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.
  3361.      */
  3362.     public void setActive(boolean value)
  3363.     {
  3364. @@ -197,10 +186,9 @@
  3365.        
  3366.         _active = value;
  3367.        
  3368. -       // turn the AI on or off to match the region's activation.
  3369.         if (!value)
  3370.         {
  3371. -           for (L2Object o : _objects)
  3372. +           for (L2Object o : _objects.values())
  3373.             {
  3374.                 if (o instanceof L2Attackable)
  3375.                 {
  3376. @@ -217,7 +205,6 @@
  3377.                    
  3378.                     mob.getAggroList().clear();
  3379.                     mob.getAttackByList().clear();
  3380. -                   mob.getKnownList().removeAllKnownObjects();
  3381.                    
  3382.                     // stop the ai tasks
  3383.                     if (mob.hasAI())
  3384. @@ -226,13 +213,11 @@
  3385.                         mob.getAI().stopAITask();
  3386.                     }
  3387.                 }
  3388. -               else if (o instanceof L2Vehicle)
  3389. -                   ((L2Vehicle) o).getKnownList().removeAllKnownObjects();
  3390.             }
  3391.         }
  3392.         else
  3393.         {
  3394. -           for (L2Object o : _objects)
  3395. +           for (L2Object o : _objects.values())
  3396.             {
  3397.                 if (o instanceof L2Attackable)
  3398.                     ((L2Attackable) o).getStatus().startHpMpRegeneration();
  3399. @@ -242,97 +227,33 @@
  3400.         }
  3401.     }
  3402.    
  3403. +   /**
  3404. +    * Put the given object into WorldRegion objects map. If it's a player, increment the counter (used for region activation/desactivation).
  3405. +    * @param object : The object to register into this region.
  3406. +    */
  3407.     public void addVisibleObject(L2Object object)
  3408.     {
  3409.         if (object == null)
  3410.             return;
  3411.        
  3412. -       _lock.lock();
  3413. -       try
  3414. -       {
  3415. -           _objects.add(object);
  3416. -          
  3417. -           if (object instanceof L2PcInstance)
  3418. -           {
  3419. -               // if this is the first player to enter the region, activate self & neighbors
  3420. -               if (_playersCount++ == 0)
  3421. -               {
  3422. -                   // first set self to active and do self-tasks...
  3423. -                   setActive(true);
  3424. -                  
  3425. -                   // if the timer to deactivate neighbors is running, cancel it.
  3426. -                   if (_activateTask != null)
  3427. -                       _activateTask.cancel(true);
  3428. -                  
  3429. -                   // then, set a timer to activate the neighbors
  3430. -                   _activateTask = ThreadPool.schedule(new ActivateTask(true), 1000);
  3431. -               }
  3432. -           }
  3433. -       }
  3434. -       finally
  3435. -       {
  3436. -           _lock.unlock();
  3437. -       }
  3438. +       _objects.put(object.getObjectId(), object);
  3439. +      
  3440. +       if (object instanceof L2PcInstance)
  3441. +           _playersCount.incrementAndGet();
  3442.     }
  3443.    
  3444. +   /**
  3445. +    * Remove the given object from WorldRegion objects map. If it's a player, decrement the counter (used for region activation/desactivation).
  3446. +    * @param object : The object to remove from this region.
  3447. +    */
  3448.     public void removeVisibleObject(L2Object object)
  3449.     {
  3450.         if (object == null)
  3451.             return;
  3452.        
  3453. -       _lock.lock();
  3454. -       try
  3455. -       {
  3456. -           _objects.remove(object);
  3457. -          
  3458. -           if (object instanceof L2PcInstance)
  3459. -           {
  3460. -               if (--_playersCount == 0)
  3461. -               {
  3462. -                   // if the timer to activate neighbors is running, cancel it.
  3463. -                   if (_activateTask != null)
  3464. -                       _activateTask.cancel(true);
  3465. -                  
  3466. -                   // start a timer to "suggest" a deactivate to self and neighbors.
  3467. -                   // suggest means: first check if a neighbor has L2PcInstances in it. If not, deactivate.
  3468. -                   _activateTask = ThreadPool.schedule(new ActivateTask(false), 60000);
  3469. -               }
  3470. -           }
  3471. -       }
  3472. -       finally
  3473. -       {
  3474. -           _lock.unlock();
  3475. -       }
  3476. -   }
  3477. -  
  3478. -   public class ActivateTask implements Runnable
  3479. -   {
  3480. -       private final boolean _isActivating;
  3481. +       _objects.remove(object.getObjectId());
  3482.        
  3483. -       public ActivateTask(boolean isActivating)
  3484. -       {
  3485. -           _isActivating = isActivating;
  3486. -       }
  3487. -      
  3488. -       @Override
  3489. -       public void run()
  3490. -       {
  3491. -           if (_isActivating)
  3492. -           {
  3493. -               // for each neighbor, if it's not active, activate.
  3494. -               for (WorldRegion neighbor : getSurroundingRegions())
  3495. -                   neighbor.setActive(true);
  3496. -           }
  3497. -           else
  3498. -           {
  3499. -               if (areNeighborsEmpty())
  3500. -                   setActive(false);
  3501. -              
  3502. -               // check and deactivate
  3503. -               for (WorldRegion neighbor : getSurroundingRegions())
  3504. -                   if (neighbor.areNeighborsEmpty())
  3505. -                       neighbor.setActive(false);
  3506. -           }
  3507. -       }
  3508. +       if (object instanceof L2PcInstance)
  3509. +           _playersCount.decrementAndGet();
  3510.     }
  3511.  }
  3512. \ No newline at end of file
  3513. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java
  3514. ===================================================================
  3515. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java    (révision 568)
  3516. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java    (révision 578)
  3517. @@ -35,8 +35,6 @@
  3518.  import net.sf.l2j.gameserver.instancemanager.MercTicketManager;
  3519.  import net.sf.l2j.gameserver.model.L2Augmentation;
  3520.  import net.sf.l2j.gameserver.model.L2Object;
  3521. -import net.sf.l2j.gameserver.model.World;
  3522. -import net.sf.l2j.gameserver.model.WorldRegion;
  3523.  import net.sf.l2j.gameserver.model.Location;
  3524.  import net.sf.l2j.gameserver.model.ShotType;
  3525.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3526. @@ -921,7 +919,7 @@
  3527.     /**
  3528.      * Init a dropped ItemInstance and add it in the world as a visible object.<BR>
  3529.      * <BR>
  3530. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T ADD the object to _allObjects of L2World </B></FONT><BR>
  3531. +    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T ADD the object to _objects of World </B></FONT><BR>
  3532.      * <BR>
  3533.      * @param dropper : the character who dropped the item.
  3534.      * @param x : X location of the item.
  3535. @@ -961,20 +959,9 @@
  3536.                 _z = dropDest.getZ();
  3537.             }
  3538.            
  3539. -           synchronized (_itm)
  3540. -           {
  3541. -               // Set the x,y,z position of the ItemInstance dropped and update its _worldregion
  3542. -               _itm.setIsVisible(true);
  3543. -               _itm.getPosition().set(_x, _y, _z);
  3544. -               _itm.setRegion(World.getInstance().getRegion(getPosition()));
  3545. -           }
  3546. -          
  3547. -           _itm.getRegion().addVisibleObject(_itm);
  3548.             _itm.setDropperObjectId(_dropper != null ? _dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
  3549. +           _itm.spawnMe(_x, _y, _z);
  3550.            
  3551. -           // Add the ItemInstance dropped in the world as a visible object
  3552. -           World.getInstance().addVisibleObject(_itm, _itm.getRegion());
  3553. -          
  3554.             ItemsOnGroundTaskManager.getInstance().add(_itm, _dropper);
  3555.            
  3556.             _itm.setDropperObjectId(0); // Set the dropper Id back to 0 so it no longer shows the drop packet
  3557. @@ -982,34 +969,20 @@
  3558.     }
  3559.    
  3560.     /**
  3561. -    * Remove a ItemInstance from the world and send server->client GetItem packets.<BR>
  3562. +    * Remove a ItemInstance from the visible world and send server->client GetItem packets.<BR>
  3563.      * <BR>
  3564. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR>
  3565. +    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _objects of World.</B></FONT><BR>
  3566.      * <BR>
  3567.      * @param player Player that pick up the item
  3568.      */
  3569.     public final void pickupMe(L2Character player)
  3570.     {
  3571. -       assert getRegion() != null;
  3572. -      
  3573. -       WorldRegion oldregion = getRegion();
  3574. -      
  3575. -       // Create a server->client GetItem packet to pick up the ItemInstance
  3576.         player.broadcastPacket(new GetItem(this, player.getObjectId()));
  3577.        
  3578. -       synchronized (this)
  3579. -       {
  3580. -           setIsVisible(false);
  3581. -           setRegion(null);
  3582. -       }
  3583. -      
  3584. -       // if this item is a mercenary ticket, remove the spawns!
  3585. -       int itemId = getItemId();
  3586. -      
  3587. -       if (MercTicketManager.getTicketCastleId(itemId) > 0)
  3588. +       if (MercTicketManager.getTicketCastleId(_itemId) > 0)
  3589.             MercTicketManager.getInstance().removeTicket(this);
  3590.        
  3591. -       if (!Config.DISABLE_TUTORIAL && (itemId == 57 || itemId == 6353))
  3592. +       if (!Config.DISABLE_TUTORIAL && (_itemId == 57 || _itemId == 6353))
  3593.         {
  3594.             L2PcInstance actor = player.getActingPlayer();
  3595.             if (actor != null)
  3596. @@ -1016,12 +989,12 @@
  3597.             {
  3598.                 QuestState qs = actor.getQuestState("Tutorial");
  3599.                 if (qs != null)
  3600. -                   qs.getQuest().notifyEvent("CE" + itemId + "", null, actor);
  3601. +                   qs.getQuest().notifyEvent("CE" + _itemId + "", null, actor);
  3602.             }
  3603.         }
  3604.        
  3605. -       // Remove the ItemInstance from the world (out of synchro, to avoid deadlocks)
  3606. -       World.getInstance().removeVisibleObject(this, oldregion);
  3607. +       // Calls directly setRegion(null), we don't have to care about.
  3608. +       setIsVisible(false);
  3609.     }
  3610.    
  3611.     /**
  3612. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/item/kind/Weapon.java
  3613. ===================================================================
  3614. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/item/kind/Weapon.java  (révision 568)
  3615. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/item/kind/Weapon.java  (révision 578)
  3616. @@ -373,7 +373,7 @@
  3617.         if (caster instanceof L2PcInstance)
  3618.         {
  3619.             // Mobs in range 1000 see spell
  3620. -           for (L2Npc npcMob : caster.getKnownList().getKnownTypeInRadius(L2Npc.class, 1000))
  3621. +           for (L2Npc npcMob : caster.getKnownTypeInRadius(L2Npc.class, 1000))
  3622.             {
  3623.                 List<Quest> quests = npcMob.getTemplate().getEventQuests(EventType.ON_SKILL_SEE);
  3624.                 if (quests != null)
  3625. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java
  3626. ===================================================================
  3627. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java    (révision 568)
  3628. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java    (révision 578)
  3629. @@ -44,7 +44,6 @@
  3630.  import net.sf.l2j.gameserver.model.RewardInfo;
  3631.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3632.  import net.sf.l2j.gameserver.model.actor.instance.L2SummonInstance;
  3633. -import net.sf.l2j.gameserver.model.actor.knownlist.AttackableKnownList;
  3634.  import net.sf.l2j.gameserver.model.actor.status.AttackableStatus;
  3635.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3636.  import net.sf.l2j.gameserver.model.holder.IntIntHolder;
  3637. @@ -94,18 +93,6 @@
  3638.     }
  3639.    
  3640.     @Override
  3641. -   public void initKnownList()
  3642. -   {
  3643. -       setKnownList(new AttackableKnownList(this));
  3644. -   }
  3645. -  
  3646. -   @Override
  3647. -   public AttackableKnownList getKnownList()
  3648. -   {
  3649. -       return (AttackableKnownList) super.getKnownList();
  3650. -   }
  3651. -  
  3652. -   @Override
  3653.     public void initCharStatus()
  3654.     {
  3655.         setStatus(new AttackableStatus(this));
  3656. @@ -311,7 +298,7 @@
  3657.             if (attackerParty == null)
  3658.             {
  3659.                 // Calculate Exp and SP rewards.
  3660. -               if (attacker.getKnownList().knowsObject(this) && !attacker.isDead())
  3661. +               if (!attacker.isDead() && attacker.getKnownType(L2Attackable.class).contains(this))
  3662.                 {
  3663.                     // Calculate the difference of level between this attacker and the L2Attackable.
  3664.                     final int levelDiff = attacker.getLevel() - getLevel();
  3665. @@ -1636,4 +1623,21 @@
  3666.             _quest.notifyKill(_attackable, _killer, _isPet);
  3667.         }
  3668.     }
  3669. +  
  3670. +   @Override
  3671. +   public void addKnownObject(L2Object object)
  3672. +   {
  3673. +       if (object instanceof L2PcInstance && getAI().getIntention() == CtrlIntention.IDLE)
  3674. +           getAI().setIntention(CtrlIntention.ACTIVE, null);
  3675. +   }
  3676. +  
  3677. +   @Override
  3678. +   public void removeKnownObject(L2Object object)
  3679. +   {
  3680. +       super.removeKnownObject(object);
  3681. +      
  3682. +       // remove object from agro list
  3683. +       if (object instanceof L2Character)
  3684. +           getAggroList().remove(object);
  3685. +   }
  3686.  }
  3687. \ No newline at end of file
  3688. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PetStat.java
  3689. ===================================================================
  3690. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PetStat.java    (révision 568)
  3691. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PetStat.java    (révision 578)
  3692. @@ -80,9 +80,7 @@
  3693.     {
  3694.         getActiveChar().setPetData(getActiveChar().getTemplate().getPetDataEntry(value));
  3695.        
  3696. -       getActiveChar().stopFeed();
  3697.         super.setLevel(value); // Set level.
  3698. -       getActiveChar().startFeed();
  3699.        
  3700.         // If a control item exists and its level is different of the new level.
  3701.         final ItemInstance controlItem = getActiveChar().getControlItem();
  3702. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Summon.java
  3703. ===================================================================
  3704. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Summon.java    (révision 568)
  3705. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Summon.java    (révision 578)
  3706. @@ -33,7 +33,6 @@
  3707.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3708.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  3709.  import net.sf.l2j.gameserver.model.actor.instance.L2SummonInstance;
  3710. -import net.sf.l2j.gameserver.model.actor.knownlist.SummonKnownList;
  3711.  import net.sf.l2j.gameserver.model.actor.stat.SummonStat;
  3712.  import net.sf.l2j.gameserver.model.actor.status.SummonStatus;
  3713.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3714. @@ -75,24 +74,9 @@
  3715.        
  3716.         _showSummonAnimation = true;
  3717.         _owner = owner;
  3718. -       _ai = new L2SummonAI(this);
  3719. -      
  3720. -       setXYZInvisible(owner.getX() + 50, owner.getY() + 100, owner.getZ() + 100);
  3721.     }
  3722.    
  3723.     @Override
  3724. -   public void initKnownList()
  3725. -   {
  3726. -       setKnownList(new SummonKnownList(this));
  3727. -   }
  3728. -  
  3729. -   @Override
  3730. -   public final SummonKnownList getKnownList()
  3731. -   {
  3732. -       return (SummonKnownList) super.getKnownList();
  3733. -   }
  3734. -  
  3735. -   @Override
  3736.     public void initCharStat()
  3737.     {
  3738.         setStat(new SummonStat(this));
  3739. @@ -145,7 +129,7 @@
  3740.     @Override
  3741.     public void updateAbnormalEffect()
  3742.     {
  3743. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  3744. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  3745.             player.sendPacket(new SummonInfo(this, player, 1));
  3746.     }
  3747.    
  3748. @@ -343,7 +327,6 @@
  3749.         owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
  3750.        
  3751.         decayMe();
  3752. -       getKnownList().removeAllKnownObjects();
  3753.         owner.setPet(null);
  3754.         super.deleteMe();
  3755.     }
  3756. @@ -371,7 +354,6 @@
  3757.            
  3758.             decayMe();
  3759.            
  3760. -           getKnownList().removeAllKnownObjects();
  3761.             setTarget(null);
  3762.            
  3763.             // Disable beastshots
  3764. @@ -796,17 +778,14 @@
  3765.         sendPacket(new PetStatusUpdate(this));
  3766.        
  3767.         if (isVisible())
  3768. -           broadcastNpcInfo(val);
  3769. -   }
  3770. -  
  3771. -   public void broadcastNpcInfo(int val)
  3772. -   {
  3773. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  3774.         {
  3775. -           if (player == getOwner())
  3776. -               continue;
  3777. -          
  3778. -           player.sendPacket(new SummonInfo(this, player, val));
  3779. +           for (L2PcInstance player : getKnownType(L2PcInstance.class))
  3780. +           {
  3781. +               if (player == getOwner())
  3782. +                   continue;
  3783. +              
  3784. +               player.sendPacket(new SummonInfo(this, player, val));
  3785. +           }
  3786.         }
  3787.     }
  3788.    
  3789. @@ -826,7 +805,7 @@
  3790.     @Override
  3791.     public void broadcastRelationsChanges()
  3792.     {
  3793. -       for (L2PcInstance player : getOwner().getKnownList().getKnownType(L2PcInstance.class))
  3794. +       for (L2PcInstance player : getOwner().getKnownType(L2PcInstance.class))
  3795.             player.sendPacket(new RelationChanged(this, getOwner().getRelation(player), isAutoAttackable(player)));
  3796.     }
  3797.    
  3798. @@ -834,7 +813,7 @@
  3799.     public void sendInfo(L2PcInstance activeChar)
  3800.     {
  3801.         // Check if the L2PcInstance is the owner of the Pet
  3802. -       if (activeChar.equals(getOwner()))
  3803. +       if (activeChar == getOwner())
  3804.         {
  3805.             activeChar.sendPacket(new PetInfo(this, 0));
  3806.            
  3807. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Npc.java
  3808. ===================================================================
  3809. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Npc.java   (révision 568)
  3810. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/L2Npc.java   (révision 578)
  3811. @@ -51,7 +51,6 @@
  3812.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3813.  import net.sf.l2j.gameserver.model.actor.instance.L2TeleporterInstance;
  3814.  import net.sf.l2j.gameserver.model.actor.instance.L2WarehouseInstance;
  3815. -import net.sf.l2j.gameserver.model.actor.knownlist.NpcKnownList;
  3816.  import net.sf.l2j.gameserver.model.actor.stat.NpcStat;
  3817.  import net.sf.l2j.gameserver.model.actor.status.NpcStatus;
  3818.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3819. @@ -191,18 +190,6 @@
  3820.     }
  3821.    
  3822.     @Override
  3823. -   public void initKnownList()
  3824. -   {
  3825. -       setKnownList(new NpcKnownList(this));
  3826. -   }
  3827. -  
  3828. -   @Override
  3829. -   public NpcKnownList getKnownList()
  3830. -   {
  3831. -       return (NpcKnownList) super.getKnownList();
  3832. -   }
  3833. -  
  3834. -   @Override
  3835.     public void initCharStat()
  3836.     {
  3837.         setStat(new NpcStat(this));
  3838. @@ -280,7 +267,7 @@
  3839.     public void updateAbnormalEffect()
  3840.     {
  3841.         // Send NpcInfo with state of abnormal effect to all L2PcInstance in the _KnownPlayers of the L2Npc
  3842. -       for (L2PcInstance player : getKnownList().getKnownType(L2PcInstance.class))
  3843. +       for (L2PcInstance player : getKnownType(L2PcInstance.class))
  3844.         {
  3845.             if (getMoveSpeed() == 0)
  3846.                 player.sendPacket(new ServerObjectInfo(this, player));
  3847. @@ -1340,17 +1327,6 @@
  3848.                 quest.notifySpawn(this);
  3849.     }
  3850.    
  3851. -   /**
  3852. -    * Remove the L2Npc from the world and update its spawn object (for a complete removal use the deleteMe method).<BR>
  3853. -    * <BR>
  3854. -    * <B><U> Actions</U> :</B><BR>
  3855. -    * <BR>
  3856. -    * <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>
  3857. -    * <BR>
  3858. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR>
  3859. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players</B></FONT><BR>
  3860. -    * <BR>
  3861. -    */
  3862.     @Override
  3863.     public void onDecay()
  3864.     {
  3865. @@ -1372,16 +1348,6 @@
  3866.             _spawn.doRespawn();
  3867.     }
  3868.    
  3869. -   /**
  3870. -    * Remove PROPERLY the L2Npc from the world.<BR>
  3871. -    * <BR>
  3872. -    * <B><U> Actions</U> :</B><BR>
  3873. -    * <BR>
  3874. -    * <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>
  3875. -    * <BR>
  3876. -    * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players</B></FONT><BR>
  3877. -    * <BR>
  3878. -    */
  3879.     @Override
  3880.     public void deleteMe()
  3881.     {
  3882. @@ -1388,9 +1354,6 @@
  3883.         // Decay
  3884.         onDecay();
  3885.        
  3886. -       // Remove all L2Object from _knownObjects and _knownPlayer of the L2Character then cancel Attak or Cast and notify AI
  3887. -       getKnownList().removeAllKnownObjects();
  3888. -      
  3889.         super.deleteMe();
  3890.     }
  3891.    
  3892. @@ -1574,7 +1537,7 @@
  3893.                 return;
  3894.            
  3895.             _currentSsCount--;
  3896. -           Broadcast.toSelfAndKnownPlayersInRadiusSq(this, new MagicSkillUse(this, this, 2154, 1, 0, 0), 360000);
  3897. +           Broadcast.toSelfAndKnownPlayersInRadius(this, new MagicSkillUse(this, this, 2154, 1, 0, 0), 600);
  3898.             setChargedShot(ShotType.SOULSHOT, true);
  3899.         }
  3900.        
  3901. @@ -1587,7 +1550,7 @@
  3902.                 return;
  3903.            
  3904.             _currentSpsCount--;
  3905. -           Broadcast.toSelfAndKnownPlayersInRadiusSq(this, new MagicSkillUse(this, this, 2061, 1, 0, 0), 360000);
  3906. +           Broadcast.toSelfAndKnownPlayersInRadius(this, new MagicSkillUse(this, this, 2061, 1, 0, 0), 600);
  3907.             setChargedShot(ShotType.SPIRITSHOT, true);
  3908.         }
  3909.     }
  3910. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2XmassTreeInstance.java
  3911. ===================================================================
  3912. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2XmassTreeInstance.java    (révision 568)
  3913. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2XmassTreeInstance.java    (révision 578)
  3914. @@ -62,7 +62,7 @@
  3915.                 return;
  3916.             }
  3917.            
  3918. -           for (L2PcInstance player : getKnownList().getKnownTypeInRadius(L2PcInstance.class, 200))
  3919. +           for (L2PcInstance player : getKnownTypeInRadius(L2PcInstance.class, 200))
  3920.             {
  3921.                 if (player.getFirstEffect(_skill.getId()) == null)
  3922.                     _skill.getEffects(player, player);
  3923. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2FriendlyMobInstance.java
  3924. ===================================================================
  3925. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2FriendlyMobInstance.java  (révision 568)
  3926. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2FriendlyMobInstance.java  (révision 578)
  3927. @@ -16,11 +16,11 @@
  3928.  
  3929.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  3930.  import net.sf.l2j.gameserver.model.actor.L2Character;
  3931. -import net.sf.l2j.gameserver.model.actor.knownlist.FriendlyMobKnownList;
  3932.  import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  3933.  
  3934.  /**
  3935. - * 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
  3936. + * This class represents Friendly Mobs lying over the world.<br>
  3937. + * These friendly mobs should only attack players with karma > 0 and it is always aggro, since it just attacks players with karma.
  3938.   */
  3939.  public class L2FriendlyMobInstance extends L2Attackable
  3940.  {
  3941. @@ -30,24 +30,9 @@
  3942.     }
  3943.    
  3944.     @Override
  3945. -   public void initKnownList()
  3946. -   {
  3947. -       setKnownList(new FriendlyMobKnownList(this));
  3948. -   }
  3949. -  
  3950. -   @Override
  3951. -   public final FriendlyMobKnownList getKnownList()
  3952. -   {
  3953. -       return (FriendlyMobKnownList) super.getKnownList();
  3954. -   }
  3955. -  
  3956. -   @Override
  3957.     public boolean isAutoAttackable(L2Character attacker)
  3958.     {
  3959. -       if (attacker instanceof L2PcInstance)
  3960. -           return ((L2PcInstance) attacker).getKarma() > 0;
  3961. -      
  3962. -       return false;
  3963. +       return attacker instanceof L2PcInstance && ((L2PcInstance) attacker).getKarma() > 0;
  3964.     }
  3965.    
  3966.     @Override
  3967. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SummonInstance.java
  3968. ===================================================================
  3969. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SummonInstance.java   (révision 568)
  3970. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2SummonInstance.java   (révision 578)
  3971. @@ -49,7 +49,6 @@
  3972.     public L2SummonInstance(int objectId, NpcTemplate template, L2PcInstance owner, L2Skill skill)
  3973.     {
  3974.         super(objectId, template, owner);
  3975. -       setShowSummonAnimation(true);
  3976.        
  3977.         if (skill != null)
  3978.         {
  3979. @@ -161,7 +160,7 @@
  3980.             return false;
  3981.        
  3982.         // Send aggro of mobs to summoner.
  3983. -       for (L2Attackable mob : getKnownList().getKnownType(L2Attackable.class))
  3984. +       for (L2Attackable mob : getKnownType(L2Attackable.class))
  3985.         {
  3986.             if (mob.isDead())
  3987.                 continue;
  3988. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2WeddingManagerInstance.java
  3989. ===================================================================
  3990. --- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2WeddingManagerInstance.java   (révision 568)
  3991. +++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2WeddingManagerInstance.java   (révision 578)
  3992. @@ -63,18 +63,18 @@
  3993.                
  3994.                 // Shouldn't be able to see wedding content if the mod isn't activated on configs
  3995.                 if (!Config.ALLOW_WEDDING)
  3996. -                   sendHtmlMessage(player, "data/html/mods/Wedding_disabled.htm");
  3997. +                   sendHtmlMessage(player, "data/html/mods/wedding/disabled.htm");
  3998.                 else
  3999.                 {
  4000.                     // Married people got access to another menu
  4001.                     if (player.getCoupleId() > 0)
  4002. -                       sendHtmlMessage(player, "data/html/mods/Wedding_start2.htm");
  4003. +                       sendHtmlMessage(player, "data/html/mods/wedding/start2.htm");
  4004.                     // "Under marriage acceptance" people go to this one
  4005.                     else if (player.isUnderMarryRequest())
  4006. -                       sendHtmlMessage(player, "data/html/mods/Wedding_waitforpartner.htm");
  4007. +                       sendHtmlMessage(player, "data/html/mods/wedding/waitforpartner.htm");
  4008.                     // And normal players go here :)
  4009.                     else
  4010. -                       sendHtmlMessage(player, "data/html/mods/Wedding_start.htm");
  4011. +                       sendHtmlMessage(player, "data/html/mods/wedding/start.htm");
  4012.                 }
  4013.             }
  4014.         }
  4015. @@ -93,7 +93,7 @@
  4016.                 final L2PcInstance partner = World.getInstance().getPlayer(st.nextToken());
  4017.                 if (partner == null)
  4018.                 {
  4019. -                   sendHtmlMessage(player, "data/html/mods/Wedding_notfound.htm");
  4020. +                   sendHtmlMessage(player, "data/html/mods/wedding/notfound.htm");
  4021.                     return;
  4022.                 }
  4023.                
  4024. @@ -110,7 +110,7 @@
  4025.                 partner.sendPacket(new ConfirmDlg(1983).addString(player.getName() + " asked you to marry. Do you want to start a new relationship ?"));
  4026.             }
  4027.             else
  4028. -               sendHtmlMessage(player, "data/html/mods/Wedding_notfound.htm");
  4029. +               sendHtmlMessage(player, "data/html/mods/wedding/notfound.htm");
  4030.         }
  4031.         else if (command.startsWith("Divorce"))
  4032.             CoupleManager.getInstance().deleteCouple(player.getCoupleId());
  4033. @@ -173,7 +173,7 @@
  4034.         // Check if player target himself
  4035.         if (partner.getObjectId() == requester.getObjectId())
  4036.         {
  4037. -           sendHtmlMessage(requester, "data/html/mods/Wedding_error_wrongtarget.htm");
  4038. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_wrongtarget.htm");
  4039.             return false;
  4040.         }
  4041.        
  4042. @@ -180,7 +180,7 @@
  4043.         // Sex check
  4044.         if (!Config.WEDDING_SAMESEX && partner.getAppearance().getSex() == requester.getAppearance().getSex())
  4045.         {
  4046. -           sendHtmlMessage(requester, "data/html/mods/Wedding_error_sex.htm");
  4047. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_sex.htm");
  4048.             return false;
  4049.         }
  4050.        
  4051. @@ -187,7 +187,7 @@
  4052.         // Check if player has the target on friendlist
  4053.         if (!requester.getFriendList().contains(partner.getObjectId()))
  4054.         {
  4055. -           sendHtmlMessage(requester, "data/html/mods/Wedding_error_friendlist.htm");
  4056. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_friendlist.htm");
  4057.             return false;
  4058.         }
  4059.        
  4060. @@ -194,7 +194,7 @@
  4061.         // Target mustn't be already married
  4062.         if (partner.getCoupleId() > 0)
  4063.         {
  4064. -           sendHtmlMessage(requester, "data/html/mods/Wedding_error_alreadymarried.htm");
  4065. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_alreadymarried.htm");
  4066.             return false;
  4067.         }
  4068.        
  4069. @@ -201,7 +201,7 @@
  4070.         // Check for Formal Wear
  4071.         if (Config.WEDDING_FORMALWEAR && !wearsFormalWear(requester, partner))
  4072.         {
  4073. -           sendHtmlMessage(requester, "data/html/mods/Wedding_error_noformal.htm");
  4074. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_noformal.htm");
  4075.             return false;
  4076.         }
  4077.        
  4078. @@ -208,7 +208,7 @@
  4079.         // Check and reduce wedding price
  4080.         if (requester.getAdena() < Config.WEDDING_PRICE || partner.getAdena() < Config.WEDDING_PRICE)
  4081.         {
  4082. -           sendHtmlMessage(requester, "data/html/mods/Wedding_error_adena.htm");
  4083. +           sendHtmlMessage(requester, "data/html/mods/wedding/error_adena.htm");
  4084.             return false;
  4085.         }
  4086.        
  4087. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java
  4088. ===================================================================
  4089. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java    (révision 568)
  4090. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java    (révision 578)
  4091. @@ -54,7 +54,7 @@
  4092.            
  4093.         L2PcInstance caster = (L2PcInstance) getEffector();
  4094.        
  4095. -       for (L2Character target : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  4096. +       for (L2Character target : _actor.getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  4097.         {
  4098.             if (target == caster)
  4099.                 continue;
  4100. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java
  4101. ===================================================================
  4102. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java (révision 568)
  4103. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java (révision 578)
  4104. @@ -108,7 +108,7 @@
  4105.        
  4106.         List<L2Character> targets = new ArrayList<>();
  4107.        
  4108. -       for (L2Character cha : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  4109. +       for (L2Character cha : _actor.getKnownTypeInRadius(L2Character.class, getSkill().getSkillRadius()))
  4110.         {
  4111.             if (cha == caster)
  4112.                 continue;
  4113. Index: aCis_gameserver/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSiegeFlag.java
  4114. ===================================================================
  4115. --- aCis_gameserver/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSiegeFlag.java    (révision 568)
  4116. +++ aCis_gameserver/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSiegeFlag.java    (révision 578)
  4117. @@ -104,7 +104,7 @@
  4118.             sm = SystemMessage.getSystemMessage(SystemMessageId.NOT_ANOTHER_HEADQUARTERS);
  4119.         else if (!player.isInsideZone(ZoneId.HQ))
  4120.             sm = SystemMessage.getSystemMessage(SystemMessageId.NOT_SET_UP_BASE_HERE);
  4121. -       else if (!player.getKnownList().getKnownTypeInRadius(L2SiegeFlagInstance.class, 400).isEmpty())
  4122. +       else if (!player.getKnownTypeInRadius(L2SiegeFlagInstance.class, 400).isEmpty())
  4123.             sm = SystemMessage.getSystemMessage(SystemMessageId.HEADQUARTERS_TOO_CLOSE);
  4124.         else
  4125.             return true;
  4126. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Valakas.java
  4127. ===================================================================
  4128. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Valakas.java (révision 568)
  4129. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Valakas.java (révision 578)
  4130. @@ -26,7 +26,6 @@
  4131.  import net.sf.l2j.gameserver.model.Location;
  4132.  import net.sf.l2j.gameserver.model.SpawnLocation;
  4133.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  4134. -import net.sf.l2j.gameserver.model.actor.L2Playable;
  4135.  import net.sf.l2j.gameserver.model.actor.instance.L2GrandBossInstance;
  4136.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4137.  import net.sf.l2j.gameserver.model.zone.type.L2BossZone;
  4138. @@ -88,7 +87,7 @@
  4139.     public static final int VALAKAS = 29028;
  4140.    
  4141.     private long _timeTracker = 0; // Time tracker for last attack on Valakas.
  4142. -   private L2Playable _actualVictim; // Actual target of Valakas.
  4143. +   private L2PcInstance _actualVictim; // Actual target of Valakas.
  4144.    
  4145.     public Valakas()
  4146.     {
  4147. @@ -392,7 +391,7 @@
  4148.             return;
  4149.        
  4150.         // Pickup a target if no or dead victim. 10% luck he decides to reconsiders his target.
  4151. -       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || Rnd.get(10) == 0)
  4152. +       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownType(L2PcInstance.class).contains(_actualVictim)) || Rnd.get(10) == 0)
  4153.             _actualVictim = getRandomPlayer(npc);
  4154.        
  4155.         // If result is still null, Valakas will roam. Don't go deeper in skill AI.
  4156. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/Monastery.java
  4157. ===================================================================
  4158. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/Monastery.java    (révision 568)
  4159. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/Monastery.java    (révision 578)
  4160. @@ -25,7 +25,6 @@
  4161.  import net.sf.l2j.gameserver.scripting.EventType;
  4162.  import net.sf.l2j.gameserver.scripting.scripts.ai.L2AttackableAIScript;
  4163.  import net.sf.l2j.gameserver.templates.skills.L2SkillType;
  4164. -import net.sf.l2j.gameserver.util.Util;
  4165.  
  4166.  /**
  4167.   * This script holds MoS monsters behavior. If they see you with an equipped weapon, they will speak and attack you.
  4168. @@ -108,9 +107,9 @@
  4169.     @Override
  4170.     public String onSpawn(L2Npc npc)
  4171.     {
  4172. -       for (L2PcInstance target : npc.getKnownList().getKnownType(L2PcInstance.class))
  4173. +       for (L2PcInstance target : npc.getKnownTypeInRadius(L2PcInstance.class, npc.getTemplate().getAggroRange()))
  4174.         {
  4175. -           if (!target.isDead() && GeoEngine.getInstance().canSeeTarget(npc, target) && Util.checkIfInRange(npc.getTemplate().getAggroRange(), npc, target, true))
  4176. +           if (!target.isDead() && GeoEngine.getInstance().canSeeTarget(npc, target))
  4177.             {
  4178.                 if (target.getActiveWeaponInstance() != null && !npc.isInCombat() && npc.getTarget() == null)
  4179.                 {
  4180. Index: aCis_gameserver/java/net/sf/l2j/gameserver/datatables/DoorTable.java
  4181. ===================================================================
  4182. --- aCis_gameserver/java/net/sf/l2j/gameserver/datatables/DoorTable.java    (révision 568)
  4183. +++ aCis_gameserver/java/net/sf/l2j/gameserver/datatables/DoorTable.java    (révision 578)
  4184. @@ -267,7 +267,7 @@
  4185.                             // create door instance
  4186.                             final L2DoorInstance door = new L2DoorInstance(IdFactory.getInstance().getNextId(), template);
  4187.                             door.setCurrentHpMp(door.getMaxHp(), door.getMaxMp());
  4188. -                           door.setXYZInvisible(posX, posY, posZ);
  4189. +                           door.getPosition().set(posX, posY, posZ);
  4190.                            
  4191.                             _doors.put(door.getDoorId(), door);
  4192.                         }
  4193. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java
  4194. ===================================================================
  4195. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java (révision 568)
  4196. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java (révision 578)
  4197. @@ -70,6 +70,6 @@
  4198.        
  4199.         activeChar.sendPacket(SystemMessageId.ENABLED_SPIRITSHOT);
  4200.         activeChar.setChargedShot(ShotType.SPIRITSHOT, true);
  4201. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 360000);
  4202. +       Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 600);
  4203.     }
  4204.  }
  4205. \ No newline at end of file
  4206. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShot.java
  4207. ===================================================================
  4208. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShot.java  (révision 568)
  4209. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShot.java  (révision 578)
  4210. @@ -74,6 +74,6 @@
  4211.        
  4212.         activeOwner.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PET_USES_S1).addItemName(item.getItemId()));
  4213.         activePet.setChargedShot(ShotType.SOULSHOT, true);
  4214. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 360000);
  4215. +       Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 600);
  4216.     }
  4217.  }
  4218. \ No newline at end of file
  4219. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Antharas.java
  4220. ===================================================================
  4221. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Antharas.java    (révision 568)
  4222. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Antharas.java    (révision 578)
  4223. @@ -328,7 +328,7 @@
  4224.             return;
  4225.        
  4226.         // Pickup a target if no or dead victim. 10% luck he decides to reconsiders his target.
  4227. -       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || Rnd.get(10) == 0)
  4228. +       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownType(L2PcInstance.class).contains(_actualVictim)) || Rnd.get(10) == 0)
  4229.             _actualVictim = getRandomPlayer(npc);
  4230.        
  4231.         // If result is still null, Antharas will roam. Don't go deeper in skill AI.
  4232. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Baium.java
  4233. ===================================================================
  4234. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Baium.java   (révision 568)
  4235. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Baium.java   (révision 578)
  4236. @@ -392,7 +392,7 @@
  4237.         int npcId = npc.getNpcId();
  4238.         List<L2Character> result = new ArrayList<>();
  4239.        
  4240. -       for (L2Character obj : npc.getKnownList().getKnownType(L2Character.class))
  4241. +       for (L2Character obj : npc.getKnownType(L2Character.class))
  4242.         {
  4243.             if (obj instanceof L2PcInstance)
  4244.             {
  4245. @@ -435,7 +435,7 @@
  4246.             return;
  4247.        
  4248.         // 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.
  4249. -       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || (_actualVictim instanceof L2MonsterInstance && Rnd.get(10) < 5) || Rnd.get(10) == 0)
  4250. +       if (_actualVictim == null || _actualVictim.isDead() || !(npc.getKnownType(L2PcInstance.class).contains(_actualVictim)) || (_actualVictim instanceof L2MonsterInstance && Rnd.get(10) < 5) || Rnd.get(10) == 0)
  4251.             _actualVictim = getRandomTarget(npc);
  4252.        
  4253.         // If result is null, return directly.
  4254. @@ -474,7 +474,7 @@
  4255.         final int chance = Rnd.get(100); // Remember, it's 0 to 99, not 1 to 100.
  4256.        
  4257.         // If Baium feels surrounded or see 2+ angels, he unleashes his wrath upon heads :).
  4258. -       if (getPlayersCountInRadius(600, npc, false) >= 20 || npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 600).size() >= 2)
  4259. +       if (getPlayersCountInRadius(600, npc, false) >= 20 || npc.getKnownTypeInRadius(L2MonsterInstance.class, 600).size() >= 2)
  4260.         {
  4261.             if (chance < 25)
  4262.                 skill = 4130;
  4263. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/StakatoNest.java
  4264. ===================================================================
  4265. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/StakatoNest.java  (révision 568)
  4266. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/StakatoNest.java  (révision 578)
  4267. @@ -69,7 +69,7 @@
  4268.     {
  4269.         if (npc.getCurrentHp() / npc.getMaxHp() < 0.3 && Rnd.get(100) < 5)
  4270.         {
  4271. -           for (L2MonsterInstance follower : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4272. +           for (L2MonsterInstance follower : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4273.             {
  4274.                 if (follower.getNpcId() == STAKATO_FOLLOWER && !follower.isDead())
  4275.                 {
  4276. @@ -89,7 +89,7 @@
  4277.         switch (npc.getNpcId())
  4278.         {
  4279.             case MALE_SPIKED_STAKATO_1:
  4280. -               for (L2MonsterInstance angryFemale : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4281. +               for (L2MonsterInstance angryFemale : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4282.                 {
  4283.                     if (angryFemale.getNpcId() == FEMALE_SPIKED_STAKATO && !angryFemale.isDead())
  4284.                     {
  4285. @@ -103,7 +103,7 @@
  4286.                 break;
  4287.            
  4288.             case FEMALE_SPIKED_STAKATO:
  4289. -               for (L2MonsterInstance morphingMale : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4290. +               for (L2MonsterInstance morphingMale : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4291.                 {
  4292.                     if (morphingMale.getNpcId() == MALE_SPIKED_STAKATO_1 && !morphingMale.isDead())
  4293.                     {
  4294. @@ -116,7 +116,7 @@
  4295.                 break;
  4296.            
  4297.             case SPIKED_STAKATO_NURSE_1:
  4298. -               for (L2MonsterInstance baby : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4299. +               for (L2MonsterInstance baby : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4300.                 {
  4301.                     if (baby.getNpcId() == SPIKED_STAKATO_BABY && !baby.isDead())
  4302.                     {
  4303. @@ -130,7 +130,7 @@
  4304.                 break;
  4305.            
  4306.             case SPIKED_STAKATO_BABY:
  4307. -               for (L2MonsterInstance morphingNurse : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4308. +               for (L2MonsterInstance morphingNurse : npc.getKnownTypeInRadius(L2MonsterInstance.class, 400))
  4309.                 {
  4310.                     if (morphingNurse.getNpcId() == SPIKED_STAKATO_NURSE_1 && !morphingNurse.isDead())
  4311.                     {
  4312. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java
  4313. ===================================================================
  4314. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java  (révision 568)
  4315. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java  (révision 578)
  4316. @@ -77,6 +77,6 @@
  4317.        
  4318.         weaponInst.setChargedShot(ShotType.SOULSHOT, true);
  4319.         activeChar.sendPacket(SystemMessageId.ENABLED_SOULSHOT);
  4320. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 360000);
  4321. +       Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 600);
  4322.     }
  4323.  }
  4324. \ No newline at end of file
  4325. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShot.java
  4326. ===================================================================
  4327. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShot.java    (révision 568)
  4328. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSpiritShot.java    (révision 578)
  4329. @@ -76,6 +76,6 @@
  4330.        
  4331.         activeOwner.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PET_USES_S1).addItemName(itemId));
  4332.         activePet.setChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOT : ShotType.SPIRITSHOT, true);
  4333. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeOwner, new MagicSkillUse(activePet, activePet, (isBlessed ? 2009 : 2008), 1, 0, 0), 360000);
  4334. +       Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, (isBlessed ? 2009 : 2008), 1, 0, 0), 600);
  4335.     }
  4336.  }
  4337. \ No newline at end of file
  4338. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEffects.java
  4339. ===================================================================
  4340. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEffects.java   (révision 568)
  4341. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEffects.java   (révision 578)
  4342. @@ -183,7 +183,7 @@
  4343.         }
  4344.         else if (command.startsWith("admin_para_all"))
  4345.         {
  4346. -           for (L2PcInstance player : activeChar.getKnownList().getKnownType(L2PcInstance.class))
  4347. +           for (L2PcInstance player : activeChar.getKnownType(L2PcInstance.class))
  4348.             {
  4349.                 if (!player.isGM())
  4350.                 {
  4351. @@ -195,7 +195,7 @@
  4352.         }
  4353.         else if (command.startsWith("admin_unpara_all"))
  4354.         {
  4355. -           for (L2PcInstance player : activeChar.getKnownList().getKnownType(L2PcInstance.class))
  4356. +           for (L2PcInstance player : activeChar.getKnownType(L2PcInstance.class))
  4357.             {
  4358.                 player.stopAbnormalEffect(0x0800);
  4359.                 player.setIsParalyzed(false);
  4360. @@ -255,31 +255,16 @@
  4361.                 String oldName = "null";
  4362.                
  4363.                 L2Object target = activeChar.getTarget();
  4364. -               L2Character player = null;
  4365.                
  4366. -               if (target instanceof L2Character)
  4367. -               {
  4368. -                   player = (L2Character) target;
  4369. -                   oldName = player.getName();
  4370. -               }
  4371. -               else
  4372. -               {
  4373. -                   player = activeChar;
  4374. -                   oldName = activeChar.getName();
  4375. -               }
  4376. +               if (!(target instanceof L2Npc))
  4377. +                   return false;
  4378.                
  4379. -               if (player instanceof L2PcInstance)
  4380. -                   World.getInstance().removePlayer((L2PcInstance) player);
  4381. +               oldName = target.getName();
  4382.                
  4383. -               player.setName(name);
  4384. +               target.setName(name);
  4385.                
  4386. -               if (player instanceof L2PcInstance)
  4387. -               {
  4388. -                   World.getInstance().addVisibleObject(player, null);
  4389. -                   ((L2PcInstance) player).broadcastUserInfo();
  4390. -               }
  4391. -               else if (player instanceof L2Npc)
  4392. -                   player.broadcastPacket(new NpcInfo((L2Npc) player, null));
  4393. +               if (target instanceof L2Npc)
  4394. +                   ((L2Npc) target).broadcastPacket(new NpcInfo((L2Npc) target, null));
  4395.                
  4396.                 activeChar.sendMessage("Changed name from " + oldName + " to " + name + ".");
  4397.             }
  4398. @@ -310,7 +295,7 @@
  4399.                         {
  4400.                             final int radius = Integer.parseInt(targetOrRadius);
  4401.                            
  4402. -                           for (L2Object object : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  4403. +                           for (L2Character object : activeChar.getKnownTypeInRadius(L2Character.class, radius))
  4404.                                 performSocial(social, object);
  4405.                            
  4406.                             activeChar.sendMessage(radius + " units radius was affected by your social request.");
  4407. @@ -359,7 +344,7 @@
  4408.                         {
  4409.                             final int radius = Integer.parseInt(targetOrRadius);
  4410.                            
  4411. -                           for (L2Object object : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  4412. +                           for (L2Character object : activeChar.getKnownTypeInRadius(L2Character.class, radius))
  4413.                                 performAbnormal(abnormal, object);
  4414.                            
  4415.                             activeChar.sendMessage(radius + " units radius was affected by your abnormal request.");
  4416. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/L2AttackableAIScript.java
  4417. ===================================================================
  4418. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/L2AttackableAIScript.java   (révision 568)
  4419. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/L2AttackableAIScript.java   (révision 578)
  4420. @@ -215,7 +215,7 @@
  4421.     {
  4422.         List<L2PcInstance> result = new ArrayList<>();
  4423.        
  4424. -       for (L2PcInstance player : npc.getKnownList().getKnownType(L2PcInstance.class))
  4425. +       for (L2PcInstance player : npc.getKnownType(L2PcInstance.class))
  4426.         {
  4427.             if (player.isDead())
  4428.                 continue;
  4429. @@ -240,7 +240,7 @@
  4430.     public static int getPlayersCountInRadius(int range, L2Character npc, boolean invisible)
  4431.     {
  4432.         int count = 0;
  4433. -       for (L2PcInstance player : npc.getKnownList().getKnownType(L2PcInstance.class))
  4434. +       for (L2PcInstance player : npc.getKnownTypeInRadius(L2PcInstance.class, range))
  4435.         {
  4436.             if (player.isDead())
  4437.                 continue;
  4438. @@ -248,8 +248,7 @@
  4439.             if (!invisible && player.getAppearance().getInvisible())
  4440.                 continue;
  4441.            
  4442. -           if (Util.checkIfInRange(range, npc, player, true))
  4443. -               count++;
  4444. +           count++;
  4445.         }
  4446.         return count;
  4447.     }
  4448. @@ -268,7 +267,7 @@
  4449.         int backCount = 0;
  4450.         int sideCount = 0;
  4451.        
  4452. -       for (L2PcInstance player : npc.getKnownList().getKnownType(L2PcInstance.class))
  4453. +       for (L2PcInstance player : npc.getKnownType(L2PcInstance.class))
  4454.         {
  4455.             if (player.isDead())
  4456.                 continue;
  4457. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Gordon.java
  4458. ===================================================================
  4459. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Gordon.java  (révision 568)
  4460. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Gordon.java  (révision 578)
  4461. @@ -119,7 +119,7 @@
  4462.                 return null;
  4463.            
  4464.             // Check if player have Cursed Weapon and is in radius.
  4465. -           for (L2PcInstance pc : npc.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 5000))
  4466. +           for (L2PcInstance pc : npc.getKnownTypeInRadius(L2PcInstance.class, 5000))
  4467.             {
  4468.                 if (pc.isCursedWeaponEquipped())
  4469.                 {
  4470. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PrimevalIsle.java
  4471. ===================================================================
  4472. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PrimevalIsle.java (révision 568)
  4473. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PrimevalIsle.java (révision 578)
  4474. @@ -84,7 +84,7 @@
  4475.         if (event.equalsIgnoreCase("skill"))
  4476.         {
  4477.             int playableCounter = 0;
  4478. -           for (L2Playable playable : npc.getKnownList().getKnownTypeInRadius(L2Playable.class, npc.getTemplate().getAggroRange()))
  4479. +           for (L2Playable playable : npc.getKnownTypeInRadius(L2Playable.class, npc.getTemplate().getAggroRange()))
  4480.             {
  4481.                 if (!playable.isDead())
  4482.                     playableCounter++;
  4483. @@ -136,7 +136,7 @@
  4484.         final L2Playable originalAttacker = (isPet ? attacker.getPet() : attacker);
  4485.        
  4486.         // Make all mobs found in a radius 2k aggressive towards attacker.
  4487. -       for (L2Attackable called : attacker.getKnownList().getKnownTypeInRadius(L2Attackable.class, 2000))
  4488. +       for (L2Attackable called : attacker.getKnownTypeInRadius(L2Attackable.class, 2000))
  4489.         {
  4490.             // Caller hasn't AI or is dead.
  4491.             if (!called.hasAI() || called.isDead())
  4492. Index: aCis_gameserver/java/net/sf/l2j/gameserver/util/Broadcast.java
  4493. ===================================================================
  4494. --- aCis_gameserver/java/net/sf/l2j/gameserver/util/Broadcast.java  (révision 568)
  4495. +++ aCis_gameserver/java/net/sf/l2j/gameserver/util/Broadcast.java  (révision 578)
  4496. @@ -41,7 +41,7 @@
  4497.      */
  4498.     public static void toPlayersTargettingMyself(L2Character character, L2GameServerPacket mov)
  4499.     {
  4500. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  4501. +       for (L2PcInstance player : character.getKnownType(L2PcInstance.class))
  4502.         {
  4503.             if (player.getTarget() != character)
  4504.                 continue;
  4505. @@ -64,7 +64,7 @@
  4506.      */
  4507.     public static void toKnownPlayers(L2Character character, L2GameServerPacket mov)
  4508.     {
  4509. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  4510. +       for (L2PcInstance player : character.getKnownType(L2PcInstance.class))
  4511.             player.sendPacket(mov);
  4512.     }
  4513.    
  4514. @@ -86,11 +86,8 @@
  4515.         if (radius < 0)
  4516.             radius = 1500;
  4517.        
  4518. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  4519. -       {
  4520. -           if (character.isInsideRadius(player, radius, false, false))
  4521. -               player.sendPacket(mov);
  4522. -       }
  4523. +       for (L2PcInstance player : character.getKnownTypeInRadius(L2PcInstance.class, radius))
  4524. +           player.sendPacket(mov);
  4525.     }
  4526.    
  4527.     /**
  4528. @@ -119,28 +116,10 @@
  4529.         if (character instanceof L2PcInstance)
  4530.             character.sendPacket(mov);
  4531.        
  4532. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  4533. -       {
  4534. -           if (character.isInsideRadius(player, radius, false, false))
  4535. -               player.sendPacket(mov);
  4536. -       }
  4537. +       for (L2PcInstance player : character.getKnownTypeInRadius(L2PcInstance.class, radius))
  4538. +           player.sendPacket(mov);
  4539.     }
  4540.    
  4541. -   public static void toSelfAndKnownPlayersInRadiusSq(L2Character character, L2GameServerPacket mov, int radiusSq)
  4542. -   {
  4543. -       if (radiusSq < 0)
  4544. -           radiusSq = 360000;
  4545. -      
  4546. -       if (character instanceof L2PcInstance)
  4547. -           character.sendPacket(mov);
  4548. -      
  4549. -       for (L2PcInstance player : character.getKnownList().getKnownType(L2PcInstance.class))
  4550. -       {
  4551. -           if (character.getDistanceSq(player) <= radiusSq)
  4552. -               player.sendPacket(mov);
  4553. -       }
  4554. -   }
  4555. -  
  4556.     /**
  4557.      * Send a packet to all L2PcInstance present in the world.<BR>
  4558.      * <BR>
  4559. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java
  4560. ===================================================================
  4561. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java    (révision 568)
  4562. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java    (révision 578)
  4563. @@ -29,6 +29,7 @@
  4564.  import net.sf.l2j.gameserver.handler.IItemHandler;
  4565.  import net.sf.l2j.gameserver.model.L2Object;
  4566.  import net.sf.l2j.gameserver.model.L2Spawn;
  4567. +import net.sf.l2j.gameserver.model.World;
  4568.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  4569.  import net.sf.l2j.gameserver.model.actor.L2Playable;
  4570.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4571. @@ -40,7 +41,6 @@
  4572.  import net.sf.l2j.gameserver.network.SystemMessageId;
  4573.  import net.sf.l2j.gameserver.network.serverpackets.MagicSkillLaunched;
  4574.  import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
  4575. -import net.sf.l2j.gameserver.network.serverpackets.PetItemList;
  4576.  import net.sf.l2j.gameserver.network.serverpackets.SetupGauge;
  4577.  import net.sf.l2j.gameserver.network.serverpackets.SetupGauge.GaugeColor;
  4578.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  4579. @@ -97,7 +97,7 @@
  4580.             case 0: // static summons (like Christmas tree)
  4581.                 try
  4582.                 {
  4583. -                   for (L2XmassTreeInstance ch : activeChar.getKnownList().getKnownTypeInRadius(L2XmassTreeInstance.class, 1200))
  4584. +                   for (L2XmassTreeInstance ch : activeChar.getKnownTypeInRadius(L2XmassTreeInstance.class, 1200)) // FIXME pointless
  4585.                     {
  4586.                         if (npcTemplate.getNpcId() == L2XmassTreeInstance.SPECIAL_TREE_ID)
  4587.                         {
  4588. @@ -165,35 +165,24 @@
  4589.                 if (_item == null || _item.getOwnerId() != _activeChar.getObjectId() || _item.getLocation() != ItemInstance.ItemLocation.INVENTORY)
  4590.                     return;
  4591.                
  4592. -               final L2PetInstance pet = L2PetInstance.spawnPet(_npcTemplate, _activeChar, _item);
  4593. +               // Owner has a pet listed in world.
  4594. +               if (World.getInstance().getPet(_activeChar.getObjectId()) != null)
  4595. +                   return;
  4596. +              
  4597. +               // Add the pet instance to world.
  4598. +               final L2PetInstance pet = L2PetInstance.restore(_item, _npcTemplate, _activeChar);
  4599.                 if (pet == null)
  4600.                     return;
  4601.                
  4602. -               pet.setShowSummonAnimation(true);
  4603. +               World.getInstance().addPet(_activeChar.getObjectId(), pet);
  4604.                
  4605. -               if (!pet.isRespawned())
  4606. -               {
  4607. -                   pet.setCurrentHp(pet.getMaxHp());
  4608. -                   pet.setCurrentMp(pet.getMaxMp());
  4609. -                   pet.getStat().setExp(pet.getExpForThisLevel());
  4610. -                   pet.setCurrentFed(pet.getPetData().getMaxMeal());
  4611. -               }
  4612. +               _activeChar.setPet(pet);
  4613.                
  4614.                 pet.setRunning();
  4615. -              
  4616. -               if (!pet.isRespawned())
  4617. -                   pet.store();
  4618. -              
  4619. -               _activeChar.setPet(pet);
  4620. -              
  4621. -               pet.spawnMe(_activeChar.getX() + 50, _activeChar.getY() + 100, _activeChar.getZ());
  4622. +               pet.setTitle(_activeChar.getName());
  4623. +               pet.spawnMe();
  4624.                 pet.startFeed();
  4625. -               _item.setEnchantLevel(pet.getLevel());
  4626. -              
  4627.                 pet.setFollowStatus(true);
  4628. -              
  4629. -               pet.getOwner().sendPacket(new PetItemList(pet));
  4630. -               pet.broadcastStatusUpdate();
  4631.             }
  4632.             catch (Exception e)
  4633.             {
  4634. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBuffs.java
  4635. ===================================================================
  4636. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBuffs.java (révision 568)
  4637. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBuffs.java (révision 578)
  4638. @@ -109,11 +109,8 @@
  4639.                 String val = st.nextToken();
  4640.                 int radius = Integer.parseInt(val);
  4641.                
  4642. -               for (L2PcInstance knownChar : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  4643. -               {
  4644. -                   if (!knownChar.equals(activeChar))
  4645. -                       knownChar.stopAllEffects();
  4646. -               }
  4647. +               for (L2PcInstance knownChar : activeChar.getKnownTypeInRadius(L2PcInstance.class, radius))
  4648. +                   knownChar.stopAllEffects();
  4649.                
  4650.                 activeChar.sendMessage("All effects canceled within radius " + radius + ".");
  4651.                 return true;
  4652. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/DrChaos.java
  4653. ===================================================================
  4654. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/DrChaos.java (révision 568)
  4655. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/DrChaos.java (révision 578)
  4656. @@ -175,7 +175,7 @@
  4657.         {
  4658.             if (GrandBossManager.getInstance().getBossStatus(CHAOS_GOLEM) == NORMAL)
  4659.             {
  4660. -               for (L2PcInstance obj : npc.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 500))
  4661. +               for (L2PcInstance obj : npc.getKnownTypeInRadius(L2PcInstance.class, 500))
  4662.                 {
  4663.                     if (obj.isDead())
  4664.                         continue;
  4665. Index: aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PlainsOfDion.java
  4666. ===================================================================
  4667. --- aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PlainsOfDion.java (révision 568)
  4668. +++ aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/group/PlainsOfDion.java (révision 578)
  4669. @@ -70,9 +70,9 @@
  4670.         {
  4671.             npc.broadcastNpcSay(MONSTERS_MSG[Rnd.get(5)].replace("$s1", player.getName()));
  4672.            
  4673. -           for (L2MonsterInstance obj : npc.getKnownList().getKnownTypeInRadius(L2MonsterInstance.class, 300))
  4674. +           for (L2MonsterInstance obj : npc.getKnownTypeInRadius(L2MonsterInstance.class, 300))
  4675.             {
  4676. -               if (ArraysUtil.contains(MONSTERS, obj.getNpcId()) && !obj.isAttackingNow() && !obj.isDead() && GeoEngine.getInstance().canSeeTarget(npc, obj))
  4677. +               if (!obj.isAttackingNow() && !obj.isDead() && ArraysUtil.contains(MONSTERS, obj.getNpcId()) && GeoEngine.getInstance().canSeeTarget(npc, obj))
  4678.                 {
  4679.                     attack(obj, player);
  4680.                     obj.broadcastNpcSay(MONSTERS_ASSIST_MSG[Rnd.get(3)]);
  4681. Index: aCis_gameserver/java/net/sf/l2j/gameserver/datatables/ItemTable.java
  4682. ===================================================================
  4683. --- aCis_gameserver/java/net/sf/l2j/gameserver/datatables/ItemTable.java    (révision 568)
  4684. +++ aCis_gameserver/java/net/sf/l2j/gameserver/datatables/ItemTable.java    (révision 578)
  4685. @@ -166,7 +166,7 @@
  4686.                 item.setDropProtection(actor.getObjectId(), false);
  4687.         }
  4688.        
  4689. -       // Add the ItemInstance object to _allObjects of L2world
  4690. +       // Add the ItemInstance object to _objects of World.
  4691.         World.getInstance().addObject(item);
  4692.        
  4693.         // Set Item parameters
  4694. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java
  4695. ===================================================================
  4696. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java  (révision 568)
  4697. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java  (révision 578)
  4698. @@ -72,6 +72,6 @@
  4699.        
  4700.         activeChar.sendPacket(SystemMessageId.ENABLED_SPIRITSHOT);
  4701.         activeChar.setChargedShot(ShotType.BLESSED_SPIRITSHOT, true);
  4702. -       Broadcast.toSelfAndKnownPlayersInRadiusSq(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 360000);
  4703. +       Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getId(), 1, 0, 0), 600);
  4704.     }
  4705.  }
  4706. \ No newline at end of file
  4707. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
  4708. ===================================================================
  4709. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java    (révision 568)
  4710. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java    (révision 578)
  4711. @@ -35,7 +35,7 @@
  4712.             return;
  4713.        
  4714.         final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  4715. -       for (L2PcInstance player : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 1250))
  4716. +       for (L2PcInstance player : activeChar.getKnownTypeInRadius(L2PcInstance.class, 1250))
  4717.         {
  4718.             if (!BlockList.isBlocked(player, activeChar))
  4719.                 player.sendPacket(cs);
  4720. Index: aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/KnownListUpdateTaskManager.java
  4721. ===================================================================
  4722. --- aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/KnownListUpdateTaskManager.java  (révision 568)
  4723. +++ aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/KnownListUpdateTaskManager.java  (nonexistent)
  4724. @@ -1,118 +0,0 @@
  4725. -/*
  4726. - * This program is free software: you can redistribute it and/or modify it under
  4727. - * the terms of the GNU General Public License as published by the Free Software
  4728. - * Foundation, either version 3 of the License, or (at your option) any later
  4729. - * version.
  4730. - *
  4731. - * This program is distributed in the hope that it will be useful, but WITHOUT
  4732. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  4733. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  4734. - * details.
  4735. - *
  4736. - * You should have received a copy of the GNU General Public License along with
  4737. - * this program. If not, see <http://www.gnu.org/licenses/>.
  4738. - */
  4739. -package net.sf.l2j.gameserver.taskmanager;
  4740. -
  4741. -import net.sf.l2j.commons.concurrent.ThreadPool;
  4742. -
  4743. -import net.sf.l2j.Config;
  4744. -import net.sf.l2j.gameserver.model.L2Object;
  4745. -import net.sf.l2j.gameserver.model.World;
  4746. -import net.sf.l2j.gameserver.model.WorldRegion;
  4747. -import net.sf.l2j.gameserver.model.actor.L2Attackable;
  4748. -import net.sf.l2j.gameserver.model.actor.L2Character;
  4749. -import net.sf.l2j.gameserver.model.actor.L2Playable;
  4750. -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4751. -
  4752. -/**
  4753. - * Periodically updates known list of all existing {@link L2Character}.<br>
  4754. - * Special scope is used for {@link WorldRegion} without {@link L2PcInstance} inside.
  4755. - * @author Hasha
  4756. - */
  4757. -public final class KnownListUpdateTaskManager implements Runnable
  4758. -{
  4759. -   // Update for NPCs is performed each FULL_UPDATE tick interval.
  4760. -   private static final int FULL_UPDATE = 10;
  4761. -  
  4762. -   private boolean _flagForgetAdd = true;
  4763. -   private int _timer = FULL_UPDATE;
  4764. -  
  4765. -   public static final KnownListUpdateTaskManager getInstance()
  4766. -   {
  4767. -       return SingletonHolder._instance;
  4768. -   }
  4769. -  
  4770. -   protected KnownListUpdateTaskManager()
  4771. -   {
  4772. -       ThreadPool.scheduleAtFixedRate(this, Config.KNOWNLIST_UPDATE_INTERVAL, Config.KNOWNLIST_UPDATE_INTERVAL);
  4773. -   }
  4774. -  
  4775. -   @Override
  4776. -   public final void run()
  4777. -   {
  4778. -       // Decrease and reset full iteration timer.
  4779. -       if (--_timer == 0)
  4780. -           _timer = FULL_UPDATE;
  4781. -      
  4782. -       // When iteration timer is 1, 2, perform forget and add for NPCs.
  4783. -       final boolean fullUpdate = _timer < 3;
  4784. -      
  4785. -       // Swap forget/add flag for this iteration.
  4786. -       _flagForgetAdd = !_flagForgetAdd;
  4787. -      
  4788. -       // Go through all world regions.
  4789. -       for (WorldRegion regions[] : World.getInstance().getWorldRegions())
  4790. -       {
  4791. -           for (WorldRegion region : regions)
  4792. -           {
  4793. -               // Skip inactive regions unless full update (knownlist can be still updated regardless AI active or detached).
  4794. -               if (!region.isActive() && !fullUpdate)
  4795. -                   continue;
  4796. -              
  4797. -               // Go through all visible objects.
  4798. -               for (L2Object object : region.getObjects())
  4799. -               {
  4800. -                   // don't busy about objects lower than L2Character.
  4801. -                   if (!(object instanceof L2Character) || !object.isVisible())
  4802. -                       continue;
  4803. -                  
  4804. -                   final boolean isPlayable = object instanceof L2Playable;
  4805. -                   final boolean isAttackable = object instanceof L2Attackable;
  4806. -                  
  4807. -                   // When one of these conditions below is passed performs forget objects (which are beyond forget distance) or add objects from surrounding regions (which are closer than detect distance)
  4808. -                   // 1) object is non-attackable and non-playable (NPCs) -> each FULL_UPDATE_TIMER iterations
  4809. -                   // 2) object is playable (players, summons, pets) -> each iteration
  4810. -                   // 3) object is attackable (monsters, raids, etc) -> each iteration
  4811. -                   if (fullUpdate || isPlayable || isAttackable)
  4812. -                   {
  4813. -                       // One iteration performs object forget.
  4814. -                       if (_flagForgetAdd)
  4815. -                           object.getKnownList().forgetObjects();
  4816. -                       // The other iteration performs object add.
  4817. -                       else
  4818. -                       {
  4819. -                           for (WorldRegion surroundingRegion : region.getSurroundingRegions())
  4820. -                           {
  4821. -                               // Object is a monster and surrounding region does not contain playable, skip.
  4822. -                               if (isAttackable && !surroundingRegion.isActive())
  4823. -                                   continue;
  4824. -                              
  4825. -                               for (L2Object o : surroundingRegion.getObjects())
  4826. -                               {
  4827. -                                   if (o != object)
  4828. -                                       object.getKnownList().addKnownObject(o);
  4829. -                               }
  4830. -                           }
  4831. -                       }
  4832. -                   }
  4833. -               }
  4834. -           }
  4835. -       }
  4836. -   }
  4837. -  
  4838. -   private static class SingletonHolder
  4839. -   {
  4840. -       protected static final KnownListUpdateTaskManager _instance = new KnownListUpdateTaskManager();
  4841. -   }
  4842. -}
  4843. \ No newline at end of file
  4844. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java
  4845. ===================================================================
  4846. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java    (révision 568)
  4847. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminCreateItem.java    (révision 578)
  4848. @@ -15,6 +15,7 @@
  4849.  package net.sf.l2j.gameserver.handler.admincommandhandlers;
  4850.  
  4851.  import java.util.Collection;
  4852. +import java.util.List;
  4853.  import java.util.StringTokenizer;
  4854.  
  4855.  import net.sf.l2j.gameserver.datatables.ArmorSetsTable;
  4856. @@ -176,23 +177,15 @@
  4857.        
  4858.         if (radius > 0)
  4859.         {
  4860. -           int counter = 0;
  4861. -          
  4862. -           for (L2PcInstance obj : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  4863. +           final List<L2PcInstance> players = activeChar.getKnownTypeInRadius(L2PcInstance.class, radius);
  4864. +           for (L2PcInstance obj : players)
  4865.             {
  4866. -               if (!(obj.equals(activeChar)))
  4867. -               {
  4868. -                   obj.getInventory().addItem("Admin", id, num, obj, activeChar);
  4869. -                   obj.sendMessage("A GM spawned " + num + " " + template.getName() + " in your inventory.");
  4870. -                   counter++;
  4871. -                  
  4872. -                   // Send whole item list and open inventory window
  4873. -                   obj.sendPacket(new ItemList(obj, true));
  4874. -               }
  4875. +               obj.addItem("Admin", id, num, activeChar, false);
  4876. +               obj.sendMessage("A GM spawned " + num + " " + template.getName() + " in your inventory.");
  4877.             }
  4878.            
  4879.             if (sendGmMessage)
  4880. -               activeChar.sendMessage(counter + " players rewarded with " + num + " " + template.getName() + " in a " + radius + " radius.");
  4881. +               activeChar.sendMessage(players.size() + " players rewarded with " + num + " " + template.getName() + " in a " + radius + " radius.");
  4882.         }
  4883.         else
  4884.         {
  4885. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHeal.java
  4886. ===================================================================
  4887. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHeal.java  (révision 568)
  4888. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHeal.java  (révision 578)
  4889. @@ -82,7 +82,7 @@
  4890.                 try
  4891.                 {
  4892.                     int radius = Integer.parseInt(player);
  4893. -                   for (L2Character character : activeChar.getKnownList().getKnownType(L2Character.class))
  4894. +                   for (L2Character character : activeChar.getKnownType(L2Character.class))
  4895.                     {
  4896.                         character.setCurrentHpMp(character.getMaxHp(), character.getMaxMp());
  4897.                         if (character instanceof L2PcInstance)
  4898. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGiveItemToPet.java
  4899. ===================================================================
  4900. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGiveItemToPet.java  (révision 568)
  4901. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGiveItemToPet.java  (révision 578)
  4902. @@ -19,6 +19,7 @@
  4903.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4904.  import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  4905.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  4906. +import net.sf.l2j.gameserver.model.item.type.EtcItemType;
  4907.  import net.sf.l2j.gameserver.network.SystemMessageId;
  4908.  import net.sf.l2j.gameserver.network.serverpackets.EnchantResult;
  4909.  import net.sf.l2j.gameserver.util.Util;
  4910. @@ -68,7 +69,7 @@
  4911.         if (item == null || item.isAugmented())
  4912.             return;
  4913.        
  4914. -       if (item.isHeroItem() || !item.isDropable() || !item.isDestroyable() || !item.isTradable())
  4915. +       if (item.isHeroItem() || !item.isDropable() || !item.isDestroyable() || !item.isTradable() || item.getItem().getItemType() == EtcItemType.ARROW || item.getItem().getItemType() == EtcItemType.SHOT)
  4916.         {
  4917.             player.sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS);
  4918.             return;
  4919. @@ -106,7 +107,6 @@
  4920.             player.sendPacket(SystemMessageId.ENCHANT_SCROLL_CANCELLED);
  4921.         }
  4922.        
  4923. -       if (player.transferItem("Transfer", _objectId, _amount, pet.getInventory(), pet) == null)
  4924. -           _log.warning("Invalid item transfer request: " + pet.getName() + "(pet) --> " + player.getName());
  4925. +       player.transferItem("Transfer", _objectId, _amount, pet.getInventory(), pet);
  4926.     }
  4927.  }
  4928. \ No newline at end of file
  4929. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java
  4930. ===================================================================
  4931. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java  (révision 568)
  4932. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java  (révision 578)
  4933. @@ -48,7 +48,7 @@
  4934.         }
  4935.        
  4936.         final L2PcInstance target = World.getInstance().getPlayer(_objectId);
  4937. -       if (target == null || !player.getKnownList().knowsObject(target) || target.equals(player))
  4938. +       if (target == null || !player.getKnownType(L2PcInstance.class).contains(target) || target.equals(player))
  4939.         {
  4940.             player.sendPacket(SystemMessageId.TARGET_IS_INCORRECT);
  4941.             return;
  4942. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/AbstractAI.java
  4943. ===================================================================
  4944. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/AbstractAI.java (révision 568)
  4945. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/AbstractAI.java (révision 578)
  4946. @@ -283,9 +283,6 @@
  4947.             case EVT_ARRIVED_BLOCKED:
  4948.                 onEvtArrivedBlocked((SpawnLocation) arg0);
  4949.                 break;
  4950. -           case EVT_FORGET_OBJECT:
  4951. -               onEvtForgetObject((L2Object) arg0);
  4952. -               break;
  4953.             case EVT_CANCEL:
  4954.                 onEvtCancel();
  4955.                 break;
  4956. @@ -354,8 +351,6 @@
  4957.    
  4958.     protected abstract void onEvtArrivedBlocked(SpawnLocation loc);
  4959.    
  4960. -   protected abstract void onEvtForgetObject(L2Object object);
  4961. -  
  4962.     protected abstract void onEvtCancel();
  4963.    
  4964.     protected abstract void onEvtDead();
  4965. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGeoEngine.java
  4966. ===================================================================
  4967. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGeoEngine.java (révision 568)
  4968. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminGeoEngine.java (révision 578)
  4969. @@ -21,8 +21,8 @@
  4970.  import net.sf.l2j.gameserver.geoengine.geodata.GeoStructure;
  4971.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  4972.  import net.sf.l2j.gameserver.model.L2Object;
  4973. +import net.sf.l2j.gameserver.model.Location;
  4974.  import net.sf.l2j.gameserver.model.World;
  4975. -import net.sf.l2j.gameserver.model.Location;
  4976.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4977.  import net.sf.l2j.gameserver.network.SystemMessageId;
  4978.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  4979. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/L2GameClient.java
  4980. ===================================================================
  4981. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/L2GameClient.java    (révision 568)
  4982. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/L2GameClient.java    (révision 578)
  4983. @@ -395,37 +395,39 @@
  4984.         }
  4985.     }
  4986.    
  4987. -   public L2PcInstance loadCharFromDisk(int charslot)
  4988. +   public L2PcInstance loadCharFromDisk(int slot)
  4989.     {
  4990. -       final int objId = getObjectIdForSlot(charslot);
  4991. -       if (objId < 0)
  4992. +       final int objectId = getObjectIdForSlot(slot);
  4993. +       if (objectId < 0)
  4994.             return null;
  4995.        
  4996. -       L2PcInstance character = World.getInstance().getPlayer(objId);
  4997. -       if (character != null)
  4998. +       L2PcInstance player = World.getInstance().getPlayer(objectId);
  4999. +       if (player != null)
  5000.         {
  5001.             // exploit prevention, should not happens in normal way
  5002. -           _log.severe("Attempt of double login: " + character.getName() + "(" + objId + ") " + getAccountName());
  5003. -           if (character.getClient() != null)
  5004. -               character.getClient().closeNow();
  5005. +           _log.severe("Attempt of double login: " + player.getName() + "(" + objectId + ") " + getAccountName());
  5006. +          
  5007. +           if (player.getClient() != null)
  5008. +               player.getClient().closeNow();
  5009.             else
  5010. -               character.deleteMe();
  5011. +               player.deleteMe();
  5012.            
  5013.             return null;
  5014.         }
  5015.        
  5016. -       character = L2PcInstance.restore(objId);
  5017. -       if (character != null)
  5018. +       player = L2PcInstance.restore(objectId);
  5019. +       if (player != null)
  5020.         {
  5021. -           character.setRunning(); // running is default
  5022. -           character.standUp(); // standing is default
  5023. +           player.setRunning(); // running is default
  5024. +           player.standUp(); // standing is default
  5025.            
  5026. -           character.setOnlineStatus(true, false);
  5027. +           player.setOnlineStatus(true, false);
  5028. +           World.getInstance().addPlayer(player);
  5029.         }
  5030.         else
  5031. -           _log.severe("L2GameClient: could not restore in slot: " + charslot);
  5032. +           _log.severe("L2GameClient: could not restore in slot: " + slot);
  5033.        
  5034. -       return character;
  5035. +       return player;
  5036.     }
  5037.    
  5038.     /**
  5039. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java
  5040. ===================================================================
  5041. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java (révision 568)
  5042. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java (révision 578)
  5043. @@ -14,7 +14,6 @@
  5044.   */
  5045.  package net.sf.l2j.gameserver.network.clientpackets;
  5046.  
  5047. -import net.sf.l2j.Config;
  5048.  import net.sf.l2j.gameserver.model.CharSelectInfoPackage;
  5049.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5050.  import net.sf.l2j.gameserver.network.L2GameClient;
  5051. @@ -54,28 +53,18 @@
  5052.         if (!FloodProtectors.performAction(client, Action.CHARACTER_SELECT))
  5053.             return;
  5054.        
  5055. -       // we should always be able to acquire the lock
  5056. -       // but if we cant lock then nothing should be done (ie repeated packet)
  5057. +       // we should always be able to acquire the lock but if we cant lock then nothing should be done (ie repeated packet)
  5058.         if (client.getActiveCharLock().tryLock())
  5059.         {
  5060.             try
  5061.             {
  5062. -               // should always be null
  5063. -               // but if not then this is repeated packet and nothing should be done here
  5064. +               // should always be null but if not then this is repeated packet and nothing should be done here
  5065.                 if (client.getActiveChar() == null)
  5066.                 {
  5067.                     final CharSelectInfoPackage info = client.getCharSelection(_charSlot);
  5068. -                   if (info == null)
  5069. +                   if (info == null || info.getAccessLevel() < 0)
  5070.                         return;
  5071.                    
  5072. -                   // Selected character is banned. Acts like if nothing occured...
  5073. -                   if (info.getAccessLevel() < 0)
  5074. -                       return;
  5075. -                  
  5076. -                   // The L2PcInstance must be created here, so that it can be attached to the L2GameClient
  5077. -                   if (Config.DEBUG)
  5078. -                       _log.fine("Selected slot: " + _charSlot);
  5079. -                  
  5080.                     // Load up character from disk
  5081.                     final L2PcInstance cha = client.loadCharFromDisk(_charSlot);
  5082.                     if (cha == null)
  5083. @@ -88,8 +77,8 @@
  5084.                     sendPacket(SSQInfo.sendSky());
  5085.                    
  5086.                     client.setState(GameClientState.IN_GAME);
  5087. -                   CharSelected cs = new CharSelected(cha, client.getSessionId().playOkID1);
  5088. -                   sendPacket(cs);
  5089. +                  
  5090. +                   sendPacket(new CharSelected(cha, client.getSessionId().playOkID1));
  5091.                 }
  5092.             }
  5093.             finally
  5094. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2DoorAI.java
  5095. ===================================================================
  5096. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2DoorAI.java   (révision 568)
  5097. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2DoorAI.java   (révision 578)
  5098. @@ -129,11 +129,6 @@
  5099.     }
  5100.    
  5101.     @Override
  5102. -   protected void onEvtForgetObject(L2Object object)
  5103. -   {
  5104. -   }
  5105. -  
  5106. -   @Override
  5107.     protected void onEvtCancel()
  5108.     {
  5109.     }
  5110. @@ -157,7 +152,7 @@
  5111.         @Override
  5112.         public void run()
  5113.         {
  5114. -           for (L2SiegeGuardInstance guard : _door.getKnownList().getKnownType(L2SiegeGuardInstance.class))
  5115. +           for (L2SiegeGuardInstance guard : _door.getKnownType(L2SiegeGuardInstance.class))
  5116.             {
  5117.                 if (_actor.isInsideRadius(guard, guard.getTemplate().getClanRange(), false, true) && Math.abs(_attacker.getZ() - guard.getZ()) < 200)
  5118.                     guard.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, _attacker, 15);
  5119. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java
  5120. ===================================================================
  5121. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (révision 568)
  5122. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (révision 578)
  5123. @@ -106,7 +106,7 @@
  5124.                     if (StringUtil.isDigit(secondParam))
  5125.                     {
  5126.                         int radius = Integer.parseInt(secondParam);
  5127. -                       for (L2Character knownChar : player.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  5128. +                       for (L2Character knownChar : player.getKnownTypeInRadius(L2Character.class, radius))
  5129.                         {
  5130.                             if (knownChar.equals(activeChar))
  5131.                                 continue;
  5132. @@ -124,13 +124,9 @@
  5133.             else if (StringUtil.isDigit(firstParam))
  5134.             {
  5135.                 int radius = Integer.parseInt(firstParam);
  5136. -               for (L2Character knownChar : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  5137. -               {
  5138. -                   if (knownChar.equals(activeChar))
  5139. -                       continue;
  5140. -                  
  5141. +               for (L2Character knownChar : activeChar.getKnownTypeInRadius(L2Character.class, radius))
  5142.                     kill(activeChar, knownChar);
  5143. -               }
  5144. +              
  5145.                 activeChar.sendMessage("Killed all characters within a " + radius + " unit radius.");
  5146.             }
  5147.         }
  5148. Index: aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
  5149. ===================================================================
  5150. --- aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java  (révision 568)
  5151. +++ aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java  (révision 578)
  5152. @@ -20,7 +20,6 @@
  5153.  import java.io.InputStream;
  5154.  import java.net.InetAddress;
  5155.  import java.net.UnknownHostException;
  5156. -import java.util.Calendar;
  5157.  import java.util.logging.Level;
  5158.  import java.util.logging.LogManager;
  5159.  import java.util.logging.Logger;
  5160. @@ -116,7 +115,6 @@
  5161.  import net.sf.l2j.gameserver.taskmanager.DecayTaskManager;
  5162.  import net.sf.l2j.gameserver.taskmanager.GameTimeTaskManager;
  5163.  import net.sf.l2j.gameserver.taskmanager.ItemsOnGroundTaskManager;
  5164. -import net.sf.l2j.gameserver.taskmanager.KnownListUpdateTaskManager;
  5165.  import net.sf.l2j.gameserver.taskmanager.MovementTaskManager;
  5166.  import net.sf.l2j.gameserver.taskmanager.PvpFlagTaskManager;
  5167.  import net.sf.l2j.gameserver.taskmanager.RandomAnimationTaskManager;
  5168. @@ -135,7 +133,6 @@
  5169.     private final DeadLockDetector _deadDetectThread;
  5170.     public static GameServer gameServer;
  5171.     private final LoginServerThread _loginThread;
  5172. -   public static final Calendar dateTimeServerStarted = Calendar.getInstance();
  5173.    
  5174.     public long getUsedMemoryMB()
  5175.     {
  5176. @@ -223,7 +220,6 @@
  5177.         DecayTaskManager.getInstance();
  5178.         GameTimeTaskManager.getInstance();
  5179.         ItemsOnGroundTaskManager.getInstance();
  5180. -       KnownListUpdateTaskManager.getInstance();
  5181.         MovementTaskManager.getInstance();
  5182.         PvpFlagTaskManager.getInstance();
  5183.         RandomAnimationTaskManager.getInstance();
  5184. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java
  5185. ===================================================================
  5186. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java   (révision 568)
  5187. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java   (révision 578)
  5188. @@ -135,7 +135,7 @@
  5189.         World.getInstance().addObject(newChar);
  5190.        
  5191.         newChar.addAdena("Init", Config.STARTING_ADENA, null, false);
  5192. -       newChar.setXYZInvisible(template.getSpawnX(), template.getSpawnY(), template.getSpawnZ());
  5193. +       newChar.getPosition().set(template.getSpawn());
  5194.         newChar.setTitle("");
  5195.        
  5196.         newChar.registerShortCut(new L2ShortCut(0, 0, 3, 2, -1, 1)); // attack shortcut
  5197. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/CtrlEvent.java
  5198. ===================================================================
  5199. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/CtrlEvent.java    (révision 568)
  5200. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/CtrlEvent.java    (révision 578)
  5201. @@ -43,8 +43,6 @@
  5202.     EVT_ARRIVED,
  5203.     /** The actor cannot move anymore. */
  5204.     EVT_ARRIVED_BLOCKED,
  5205. -   /** Forgets an object (if it's used as attack target, follow target and so on. */
  5206. -   EVT_FORGET_OBJECT,
  5207.     /**
  5208.      * 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
  5209.      * cancel a cast/bow attack and so on.
  5210. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2CharacterAI.java
  5211. ===================================================================
  5212. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2CharacterAI.java  (révision 568)
  5213. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2CharacterAI.java  (révision 578)
  5214. @@ -619,59 +619,6 @@
  5215.     }
  5216.    
  5217.     /**
  5218. -    * Launch actions corresponding to the Event ForgetObject.
  5219. -    * <ul>
  5220. -    * <li>If the object was targeted and the Intention was INTERACT or PICK_UP, set the Intention to ACTIVE</li>
  5221. -    * <li>If the object was targeted to attack, stop the auto-attack, cancel target and set the Intention to ACTIVE</li>
  5222. -    * <li>If the object was targeted to cast, cancel target and set the Intention to ACTIVE</li>
  5223. -    * <li>If the object was targeted to follow, stop the movement, cancel AI Follow Task and set the Intention to ACTIVE</li>
  5224. -    * <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>
  5225. -    * </ul>
  5226. -    */
  5227. -   @Override
  5228. -   protected void onEvtForgetObject(L2Object object)
  5229. -   {
  5230. -       // Check if the object was targeted to attack
  5231. -       if (getTarget() == object)
  5232. -       {
  5233. -           // Cancel attack target
  5234. -           setTarget(null);
  5235. -          
  5236. -           // Set the Intention of this AbstractAI to ACTIVE
  5237. -           setIntention(CtrlIntention.ACTIVE);
  5238. -       }
  5239. -      
  5240. -       // Check if the object was targeted to follow
  5241. -       if (getFollowTarget() == object)
  5242. -       {
  5243. -           // Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation (broadcast)
  5244. -           clientStopMoving(null);
  5245. -          
  5246. -           // Stop an AI Follow Task
  5247. -           stopFollow();
  5248. -          
  5249. -           // Set the Intention of this AbstractAI to ACTIVE
  5250. -           setIntention(CtrlIntention.ACTIVE);
  5251. -       }
  5252. -      
  5253. -       // Check if the targeted object was the actor
  5254. -       if (_actor == object)
  5255. -       {
  5256. -           // Cancel AI target
  5257. -           setTarget(null);
  5258. -          
  5259. -           // Stop an AI Follow Task
  5260. -           stopFollow();
  5261. -          
  5262. -           // Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation (broadcast)
  5263. -           clientStopMoving(null);
  5264. -          
  5265. -           // Set the Intention of this AbstractAI to IDLE
  5266. -           changeIntention(CtrlIntention.IDLE, null, null);
  5267. -       }
  5268. -   }
  5269. -  
  5270. -   /**
  5271.      * Launch actions corresponding to the Event Cancel.
  5272.      * <ul>
  5273.      * <li>Stop an AI Follow Task</li>
  5274. @@ -918,7 +865,7 @@
  5275.     {
  5276.         if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AURA)
  5277.         {
  5278. -           for (L2Object target : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5279. +           for (L2Object target : _actor.getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5280.             {
  5281.                 if (target == getTarget())
  5282.                     return true;
  5283. @@ -934,7 +881,7 @@
  5284.             if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AURA)
  5285.             {
  5286.                 boolean cancast = true;
  5287. -               for (L2Character target : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5288. +               for (L2Character target : _actor.getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5289.                 {
  5290.                     if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  5291.                         continue;
  5292. @@ -952,7 +899,7 @@
  5293.             else if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AREA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AREA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AREA)
  5294.             {
  5295.                 boolean cancast = true;
  5296. -               for (L2Character target : ((L2Character) getTarget()).getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5297. +               for (L2Character target : ((L2Character) getTarget()).getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5298.                 {
  5299.                     if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  5300.                         continue;
  5301. @@ -973,7 +920,7 @@
  5302.             if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AURA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AURA)
  5303.             {
  5304.                 boolean cancast = false;
  5305. -               for (L2Character target : _actor.getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5306. +               for (L2Character target : _actor.getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5307.                 {
  5308.                     if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  5309.                         continue;
  5310. @@ -991,7 +938,7 @@
  5311.             else if (sk.getTargetType() == L2Skill.SkillTargetType.TARGET_AREA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_BEHIND_AREA || sk.getTargetType() == L2Skill.SkillTargetType.TARGET_FRONT_AREA)
  5312.             {
  5313.                 boolean cancast = true;
  5314. -               for (L2Character target : ((L2Character) getTarget()).getKnownList().getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5315. +               for (L2Character target : ((L2Character) getTarget()).getKnownTypeInRadius(L2Character.class, sk.getSkillRadius()))
  5316.                 {
  5317.                     if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  5318.                         continue;
  5319. @@ -1019,7 +966,7 @@
  5320.         int ccount = 0;
  5321.        
  5322.         final String[] actorClans = ((L2Npc) _actor).getTemplate().getClans();
  5323. -       for (L2Attackable target : _actor.getKnownList().getKnownTypeInRadius(L2Attackable.class, sk.getSkillRadius()))
  5324. +       for (L2Attackable target : _actor.getKnownTypeInRadius(L2Attackable.class, sk.getSkillRadius()))
  5325.         {
  5326.             if (!GeoEngine.getInstance().canSeeTarget(_actor, target))
  5327.                 continue;
  5328. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKnownlist.java
  5329. ===================================================================
  5330. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKnownlist.java (révision 568)
  5331. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminKnownlist.java (révision 578)
  5332. @@ -14,27 +14,29 @@
  5333.   */
  5334.  package net.sf.l2j.gameserver.handler.admincommandhandlers;
  5335.  
  5336. -import java.util.Collection;
  5337. +import java.util.List;
  5338.  import java.util.StringTokenizer;
  5339.  
  5340.  import net.sf.l2j.commons.lang.StringUtil;
  5341. +import net.sf.l2j.commons.math.MathUtil;
  5342.  
  5343.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  5344.  import net.sf.l2j.gameserver.model.L2Object;
  5345.  import net.sf.l2j.gameserver.model.World;
  5346.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5347. -import net.sf.l2j.gameserver.model.actor.knownlist.ObjectKnownList;
  5348.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  5349.  
  5350.  /**
  5351.   * Handles visibility over target's knownlist, offering details about current target's vicinity.
  5352. - * @author Tryskell
  5353.   */
  5354.  public class AdminKnownlist implements IAdminCommandHandler
  5355.  {
  5356. +   private static final int PAGE_LIMIT = 15;
  5357. +  
  5358.     private static final String[] ADMIN_COMMANDS =
  5359.     {
  5360. -       "admin_knownlist"
  5361. +       "admin_knownlist",
  5362. +       "admin_knownlist_page",
  5363.     };
  5364.    
  5365.     @Override
  5366. @@ -71,25 +73,72 @@
  5367.                     target = activeChar;
  5368.             }
  5369.            
  5370. -           final ObjectKnownList knownlist = target.getKnownList();
  5371. -           final Collection<L2Object> list = knownlist.getKnownObjects();
  5372. +           int page = 1;
  5373.            
  5374. -           // Generate data.
  5375. -           final StringBuilder sb = new StringBuilder(list.size() * 150);
  5376. -           for (L2Object object : list)
  5377. -               StringUtil.append(sb, "<tr><td>", object.getName(), "</td><td>", object.getClass().getSimpleName(), "</td></tr>");
  5378. +           if (command.startsWith("admin_knownlist_page") && st.hasMoreTokens())
  5379. +           {
  5380. +               try
  5381. +               {
  5382. +                   page = Integer.parseInt(st.nextToken());
  5383. +               }
  5384. +               catch (NumberFormatException nfe)
  5385. +               {
  5386. +               }
  5387. +           }
  5388.            
  5389. -           final NpcHtmlMessage html = new NpcHtmlMessage(0);
  5390. -           html.setFile("data/html/admin/knownlist.htm");
  5391. -           html.replace("%target%", target.getName());
  5392. -           html.replace("%type%", knownlist.getClass().getSimpleName());
  5393. -           html.replace("%size%", list.size());
  5394. -           html.replace("%knownlist%", sb.toString());
  5395. -           activeChar.sendPacket(html);
  5396. +           showKnownlist(activeChar, target, page);
  5397.         }
  5398.         return true;
  5399.     }
  5400.    
  5401. +   private static void showKnownlist(L2PcInstance activeChar, L2Object target, int page)
  5402. +   {
  5403. +       List<L2Object> knownlist = target.getKnownType(L2Object.class);
  5404. +      
  5405. +       // Load static Htm.
  5406. +       final NpcHtmlMessage html = new NpcHtmlMessage(0);
  5407. +       html.setFile("data/html/admin/knownlist.htm");
  5408. +       html.replace("%target%", target.getName());
  5409. +       html.replace("%size%", knownlist.size());
  5410. +      
  5411. +       if (knownlist.isEmpty())
  5412. +       {
  5413. +           html.replace("%knownlist%", "<tr><td>No objects in vicinity.</td></tr>");
  5414. +           html.replace("%pages%", 0);
  5415. +           activeChar.sendPacket(html);
  5416. +           return;
  5417. +       }
  5418. +      
  5419. +       final int max = MathUtil.countPagesNumber(knownlist.size(), PAGE_LIMIT);
  5420. +       if (page > max)
  5421. +           page = max;
  5422. +      
  5423. +       knownlist = knownlist.subList((page - 1) * PAGE_LIMIT, Math.min(page * PAGE_LIMIT, knownlist.size()));
  5424. +      
  5425. +       // Generate data.
  5426. +       final StringBuilder sb = new StringBuilder(knownlist.size() * 150);
  5427. +       for (L2Object object : knownlist)
  5428. +           StringUtil.append(sb, "<tr><td>", object.getName(), "</td><td>", object.getClass().getSimpleName(), "</td></tr>");
  5429. +      
  5430. +       html.replace("%knownlist%", sb.toString());
  5431. +      
  5432. +       sb.setLength(0);
  5433. +      
  5434. +       // End of table, open a new table for pages system.
  5435. +       for (int i = 0; i < max; i++)
  5436. +       {
  5437. +           final int pagenr = i + 1;
  5438. +           if (page == pagenr)
  5439. +               StringUtil.append(sb, pagenr, "&nbsp;");
  5440. +           else
  5441. +               StringUtil.append(sb, "<a action=\"bypass -h admin_knownlist_page ", target.getObjectId(), " ", pagenr, "\">", pagenr, "</a>&nbsp;");
  5442. +       }
  5443. +      
  5444. +       html.replace("%pages%", sb.toString());
  5445. +      
  5446. +       activeChar.sendPacket(html);
  5447. +   }
  5448. +  
  5449.     @Override
  5450.     public String[] getAdminCommandList()
  5451.     {
  5452. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminRes.java
  5453. ===================================================================
  5454. --- aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminRes.java   (révision 568)
  5455. +++ aCis_gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminRes.java   (révision 578)
  5456. @@ -83,7 +83,7 @@
  5457.                 {
  5458.                     int radius = Integer.parseInt(resParam);
  5459.                    
  5460. -                   for (L2PcInstance knownPlayer : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, radius))
  5461. +                   for (L2PcInstance knownPlayer : activeChar.getKnownTypeInRadius(L2PcInstance.class, radius))
  5462.                         doResurrect(knownPlayer);
  5463.                    
  5464.                     activeChar.sendMessage("Resurrected all players within a " + radius + " unit radius.");
  5465. @@ -123,7 +123,7 @@
  5466.             {
  5467.                 radius = Integer.parseInt(radiusStr);
  5468.                
  5469. -               for (L2Character knownChar : activeChar.getKnownList().getKnownTypeInRadius(L2Character.class, radius))
  5470. +               for (L2Character knownChar : activeChar.getKnownTypeInRadius(L2Character.class, radius))
  5471.                     if (!(knownChar instanceof L2PcInstance))
  5472.                         doResurrect(knownChar);
  5473.                
  5474. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGetItemFromPet.java
  5475. ===================================================================
  5476. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGetItemFromPet.java (révision 568)
  5477. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestGetItemFromPet.java (révision 578)
  5478. @@ -59,7 +59,6 @@
  5479.        
  5480.         final L2PetInstance pet = (L2PetInstance) player.getPet();
  5481.        
  5482. -       if (pet.transferItem("Transfer", _objectId, _amount, player.getInventory(), player, pet) == null)
  5483. -           _log.warning("Invalid item transfer request: " + pet.getName() + "(pet) --> " + player.getName());
  5484. +       pet.transferItem("Transfer", _objectId, _amount, player.getInventory(), player, pet);
  5485.     }
  5486.  }
  5487. \ No newline at end of file
  5488. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecordInfo.java
  5489. ===================================================================
  5490. --- aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecordInfo.java (révision 568)
  5491. +++ aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestRecordInfo.java (révision 578)
  5492. @@ -32,6 +32,6 @@
  5493.             return;
  5494.        
  5495.         activeChar.sendPacket(new UserInfo(activeChar));
  5496. -       activeChar.getKnownList().refreshInfos();
  5497. +       activeChar.refreshInfos();
  5498.     }
  5499.  }
  5500. \ No newline at end of file
  5501. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2AttackableAI.java
  5502. ===================================================================
  5503. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2AttackableAI.java (révision 568)
  5504. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2AttackableAI.java (révision 578)
  5505. @@ -242,7 +242,7 @@
  5506.             if (!npc.isAlikeDead())
  5507.             {
  5508.                 // If its _knownPlayer isn't empty set the Intention to ACTIVE
  5509. -               if (!npc.getKnownList().getKnownType(L2PcInstance.class).isEmpty())
  5510. +               if (!npc.getKnownType(L2PcInstance.class).isEmpty())
  5511.                     intention = CtrlIntention.ACTIVE;
  5512.                 else
  5513.                 {
  5514. @@ -342,7 +342,7 @@
  5515.         if (_globalAggro >= 0)
  5516.         {
  5517.             // Get all visible objects inside its Aggro Range
  5518. -           for (L2Character target : npc.getKnownList().getKnownType(L2Character.class))
  5519. +           for (L2Character target : npc.getKnownType(L2Character.class))
  5520.             {
  5521.                 // 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.
  5522.                 if (npc instanceof L2FestivalMonsterInstance && target instanceof L2PcInstance)
  5523. @@ -618,7 +618,7 @@
  5524.                     if (sk.getTargetType() == SkillTargetType.TARGET_ONE)
  5525.                     {
  5526.                         final String[] actorClans = npc.getTemplate().getClans();
  5527. -                       for (L2Attackable obj : npc.getKnownList().getKnownTypeInRadius(L2Attackable.class, sk.getCastRange() + actorCollision))
  5528. +                       for (L2Attackable obj : npc.getKnownTypeInRadius(L2Attackable.class, sk.getCastRange() + actorCollision))
  5529.                         {
  5530.                             if (obj.isDead())
  5531.                                 continue;
  5532. @@ -741,9 +741,9 @@
  5533.        
  5534.         if (Rnd.get(100) <= 3)
  5535.         {
  5536. -           for (L2Object nearby : npc.getKnownList().getKnownObjects())
  5537. +           for (L2Attackable nearby : npc.getKnownTypeInRadius(L2Attackable.class, actorCollision))
  5538.             {
  5539. -               if (nearby instanceof L2Attackable && npc.isInsideRadius(nearby, actorCollision, false, false) && nearby != attackTarget)
  5540. +               if (nearby != attackTarget)
  5541.                 {
  5542.                     int newX = combinedCollision + Rnd.get(40);
  5543.                     if (Rnd.nextBoolean())
  5544. @@ -903,7 +903,7 @@
  5545.                
  5546.                 if (sk.getTargetType() == SkillTargetType.TARGET_ONE)
  5547.                 {
  5548. -                   for (L2Attackable obj : caster.getKnownList().getKnownTypeInRadius(L2Attackable.class, (int) (sk.getCastRange() + caster.getCollisionRadius())))
  5549. +                   for (L2Attackable obj : caster.getKnownTypeInRadius(L2Attackable.class, (int) (sk.getCastRange() + caster.getCollisionRadius())))
  5550.                     {
  5551.                         if (obj.isDead())
  5552.                             continue;
  5553. @@ -927,7 +927,7 @@
  5554.                
  5555.                 if (sk.getTargetType() == SkillTargetType.TARGET_PARTY)
  5556.                 {
  5557. -                   for (L2Attackable obj : caster.getKnownList().getKnownTypeInRadius(L2Attackable.class, (int) (sk.getSkillRadius() + caster.getCollisionRadius())))
  5558. +                   for (L2Attackable obj : caster.getKnownTypeInRadius(L2Attackable.class, (int) (sk.getSkillRadius() + caster.getCollisionRadius())))
  5559.                     {
  5560.                         if (!ArraysUtil.contains(caster.getTemplate().getClans(), obj.getTemplate().getClans()))
  5561.                             continue;
  5562. @@ -1286,7 +1286,7 @@
  5563.         // If hate list gave nothing, then verify first if the actor is aggressive, and then pickup a victim from his knownlist.
  5564.         if (actor.isAggressive())
  5565.         {
  5566. -           for (L2Character target : actor.getKnownList().getKnownTypeInRadius(L2Character.class, actor.getTemplate().getAggroRange()))
  5567. +           for (L2Character target : actor.getKnownTypeInRadius(L2Character.class, actor.getTemplate().getAggroRange()))
  5568.             {
  5569.                 if (!autoAttackCondition(target))
  5570.                     continue;
  5571. @@ -1426,7 +1426,7 @@
  5572.             final String[] actorClans = me.getTemplate().getClans();
  5573.             if (actorClans != null && me.getAttackByList().contains(attacker))
  5574.             {
  5575. -               for (L2Attackable called : me.getKnownList().getKnownTypeInRadius(L2Attackable.class, me.getTemplate().getClanRange()))
  5576. +               for (L2Attackable called : me.getKnownTypeInRadius(L2Attackable.class, me.getTemplate().getClanRange()))
  5577.                 {
  5578.                     // Caller hasn't AI or is dead.
  5579.                     if (!called.hasAI() || called.isDead())
  5580. @@ -1515,7 +1515,7 @@
  5581.         final String[] actorClans = me.getTemplate().getClans();
  5582.         if (actorClans != null && me.getAttackByList().contains(target))
  5583.         {
  5584. -           for (L2Attackable called : me.getKnownList().getKnownTypeInRadius(L2Attackable.class, me.getTemplate().getClanRange()))
  5585. +           for (L2Attackable called : me.getKnownTypeInRadius(L2Attackable.class, me.getTemplate().getClanRange()))
  5586.             {
  5587.                 // Caller hasn't AI or is dead.
  5588.                 if (!called.hasAI() || called.isDead())
  5589. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2SiegeGuardAI.java
  5590. ===================================================================
  5591. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2SiegeGuardAI.java (révision 568)
  5592. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2SiegeGuardAI.java (révision 578)
  5593. @@ -22,7 +22,6 @@
  5594.  
  5595.  import net.sf.l2j.gameserver.ai.CtrlIntention;
  5596.  import net.sf.l2j.gameserver.geoengine.GeoEngine;
  5597. -import net.sf.l2j.gameserver.model.L2Object;
  5598.  import net.sf.l2j.gameserver.model.L2Skill;
  5599.  import net.sf.l2j.gameserver.model.Location;
  5600.  import net.sf.l2j.gameserver.model.actor.L2Attackable;
  5601. @@ -94,7 +93,7 @@
  5602.             if (!_actor.isAlikeDead())
  5603.             {
  5604.                 // If its _knownPlayer isn't empty, set the Intention to ACTIVE
  5605. -               if (!getActiveChar().getKnownList().getKnownType(L2PcInstance.class).isEmpty())
  5606. +               if (!getActiveChar().getKnownType(L2PcInstance.class).isEmpty())
  5607.                     intention = CtrlIntention.ACTIVE;
  5608.             }
  5609.            
  5610. @@ -149,7 +148,7 @@
  5611.         if (_globalAggro >= 0)
  5612.         {
  5613.             final L2Attackable npc = (L2Attackable) _actor;
  5614. -           for (L2Character target : npc.getKnownList().getKnownTypeInRadius(L2Character.class, npc.getTemplate().getClanRange()))
  5615. +           for (L2Character target : npc.getKnownTypeInRadius(L2Character.class, npc.getTemplate().getClanRange()))
  5616.             {
  5617.                 if (autoAttackCondition(target)) // check aggression
  5618.                 {
  5619. @@ -264,7 +263,7 @@
  5620.                 final String[] clans = actor.getTemplate().getClans();
  5621.                
  5622.                 // Go through all characters around the actor that belongs to its faction.
  5623. -               for (L2Character cha : actor.getKnownList().getKnownTypeInRadius(L2Character.class, 1000))
  5624. +               for (L2Character cha : actor.getKnownTypeInRadius(L2Character.class, 1000))
  5625.                 {
  5626.                     // Don't bother about dead, not visible, or healthy characters.
  5627.                     if (cha.isAlikeDead() || !GeoEngine.getInstance().canSeeTarget(actor, cha) || (cha.getCurrentHp() / cha.getMaxHp() > 0.75))
  5628. @@ -382,9 +381,9 @@
  5629.        
  5630.         if (Rnd.get(100) <= 3)
  5631.         {
  5632. -           for (L2Object nearby : actor.getKnownList().getKnownObjects())
  5633. +           for (L2Attackable nearby : actor.getKnownTypeInRadius(L2Attackable.class, actorCollision))
  5634.             {
  5635. -               if (nearby instanceof L2Attackable && actor.isInsideRadius(nearby, actorCollision, false, false) && nearby != attackTarget)
  5636. +               if (nearby != attackTarget)
  5637.                 {
  5638.                     int newX = combinedCollision + Rnd.get(40);
  5639.                     if (Rnd.nextBoolean())
  5640. Index: aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/ItemsOnGroundTaskManager.java
  5641. ===================================================================
  5642. --- aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/ItemsOnGroundTaskManager.java    (révision 568)
  5643. +++ aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/ItemsOnGroundTaskManager.java    (révision 578)
  5644. @@ -87,11 +87,7 @@
  5645.                     item.setEnchantLevel(enchant);
  5646.                
  5647.                 // Spawn item in the world.
  5648. -               item.getPosition().set(result.getInt(5), result.getInt(6), result.getInt(7));
  5649. -               item.setRegion(World.getInstance().getRegion(item.getPosition()));
  5650. -               item.getRegion().addVisibleObject(item);
  5651. -               item.setIsVisible(true);
  5652. -               World.getInstance().addVisibleObject(item, item.getRegion());
  5653. +               item.spawnMe(result.getInt(5), result.getInt(6), result.getInt(7));
  5654.                
  5655.                 // Get interval, add item to the list.
  5656.                 long interval = result.getLong(8);
  5657. @@ -194,9 +190,7 @@
  5658.            
  5659.             // Destroy item and remove from task.
  5660.             final ItemInstance item = entry.getKey();
  5661. -           World.getInstance().removeVisibleObject(item, item.getRegion());
  5662. -           World.getInstance().removeObject(item);
  5663. -           _items.remove(item);
  5664. +           item.decayMe();
  5665.         }
  5666.     }
  5667.    
  5668. Index: aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2VehicleAI.java
  5669. ===================================================================
  5670. --- aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2VehicleAI.java    (révision 568)
  5671. +++ aCis_gameserver/java/net/sf/l2j/gameserver/ai/model/L2VehicleAI.java    (révision 578)
  5672. @@ -123,11 +123,6 @@
  5673.     }
  5674.    
  5675.     @Override
  5676. -   protected void onEvtForgetObject(L2Object object)
  5677. -   {
  5678. -   }
  5679. -  
  5680. -   @Override
  5681.     protected void onEvtCancel()
  5682.     {
  5683.     }
  5684. Index: aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/WaterTaskManager.java
  5685. ===================================================================
  5686. --- aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/WaterTaskManager.java    (révision 568)
  5687. +++ aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/WaterTaskManager.java    (révision 578)
  5688. @@ -22,8 +22,8 @@
  5689.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5690.  import net.sf.l2j.gameserver.network.SystemMessageId;
  5691.  import net.sf.l2j.gameserver.network.serverpackets.SetupGauge;
  5692. +import net.sf.l2j.gameserver.network.serverpackets.SetupGauge.GaugeColor;
  5693.  import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  5694. -import net.sf.l2j.gameserver.network.serverpackets.SetupGauge.GaugeColor;
  5695.  import net.sf.l2j.gameserver.skills.Stats;
  5696.  
  5697.  /**
  5698. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java
  5699. ===================================================================
  5700. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java (révision 568)
  5701. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java (révision 578)
  5702. @@ -579,7 +579,7 @@
  5703.     }
  5704.    
  5705.     /**
  5706. -    * Remove all debug items from l2world
  5707. +    * Remove all debug items from the world.
  5708.      */
  5709.     public void clearDebugItems()
  5710.     {
  5711. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/BoatManager.java
  5712. ===================================================================
  5713. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/BoatManager.java (révision 568)
  5714. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/BoatManager.java (révision 578)
  5715. @@ -18,8 +18,8 @@
  5716.  import java.util.Map;
  5717.  
  5718.  import net.sf.l2j.gameserver.idfactory.IdFactory;
  5719. +import net.sf.l2j.gameserver.model.VehiclePathPoint;
  5720.  import net.sf.l2j.gameserver.model.World;
  5721. -import net.sf.l2j.gameserver.model.VehiclePathPoint;
  5722.  import net.sf.l2j.gameserver.model.actor.L2Vehicle;
  5723.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5724.  import net.sf.l2j.gameserver.model.actor.template.CharTemplate;
  5725. @@ -89,8 +89,7 @@
  5726.         _boats.put(boat.getObjectId(), boat);
  5727.        
  5728.         boat.setHeading(heading);
  5729. -       boat.setXYZInvisible(x, y, z);
  5730. -       boat.spawnMe();
  5731. +       boat.spawnMe(x, y, z);
  5732.        
  5733.         return boat;
  5734.     }
  5735. Index: aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSignsFestival.java
  5736. ===================================================================
  5737. --- aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSignsFestival.java  (révision 568)
  5738. +++ aCis_gameserver/java/net/sf/l2j/gameserver/instancemanager/SevenSignsFestival.java  (révision 578)
  5739. @@ -41,8 +41,8 @@
  5740.  import net.sf.l2j.gameserver.model.L2Party;
  5741.  import net.sf.l2j.gameserver.model.L2Party.MessageType;
  5742.  import net.sf.l2j.gameserver.model.L2Spawn;
  5743. +import net.sf.l2j.gameserver.model.Location;
  5744.  import net.sf.l2j.gameserver.model.World;
  5745. -import net.sf.l2j.gameserver.model.Location;
  5746.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  5747.  import net.sf.l2j.gameserver.model.actor.instance.L2FestivalMonsterInstance;
  5748.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
Add Comment
Please, Sign In to add comment