PcInventory.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j.gameserver.model;
  16. import java.sql.PreparedStatement;
  17. import java.sql.ResultSet;
  18. import java.util.List;
  19. import java.util.logging.Level;
  20. import javolution.util.FastList;
  21. import net.sf.l2j.L2DatabaseFactory;
  22. import net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation;
  23. import net.sf.l2j.gameserver.model.TradeList.TradeItem;
  24. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  25. import net.sf.l2j.gameserver.templates.L2EtcItemType;
  26. public class PcInventory extends Inventory
  27. {
  28. public static final int ADENA_ID = 57;
  29. public static final int ANCIENT_ADENA_ID = 5575;
  30. private final L2PcInstance _owner;
  31. private L2ItemInstance _adena;
  32. private L2ItemInstance _ancientAdena;
  33. public PcInventory(L2PcInstance owner)
  34. {
  35. _owner = owner;
  36. }
  37. @Override
  38. public L2PcInstance getOwner() { return _owner; }
  39. @Override
  40. protected ItemLocation getBaseLocation() { return ItemLocation.INVENTORY; }
  41. @Override
  42. protected ItemLocation getEquipLocation() { return ItemLocation.PAPERDOLL; }
  43. public L2ItemInstance getAdenaInstance() {return _adena;}
  44. @Override
  45. public int getAdena() {return _adena != null ? _adena.getCount() : 0;}
  46. public L2ItemInstance getAncientAdenaInstance()
  47. {
  48. return _ancientAdena;
  49. }
  50. public int getAncientAdena()
  51. {
  52. return (_ancientAdena != null) ? _ancientAdena.getCount() : 0;
  53. }
  54. /**
  55. * Returns the list of items in inventory available for transaction
  56. * @return L2ItemInstance : items in inventory
  57. */
  58. public L2ItemInstance[] getUniqueItems(boolean allowAdena, boolean allowAncientAdena)
  59. {
  60. return getUniqueItems(allowAdena, allowAncientAdena, true);
  61. }
  62. public L2ItemInstance[] getUniqueItems(boolean allowAdena, boolean allowAncientAdena, boolean onlyAvailable)
  63. {
  64. List<L2ItemInstance> list = new FastList<L2ItemInstance>();
  65. for (L2ItemInstance item : _items)
  66. {
  67. if ((!allowAdena && item.getItemId() == 57))
  68. continue;
  69. if ((!allowAncientAdena && item.getItemId() == 5575))
  70. continue;
  71. boolean isDuplicate = false;
  72. for (L2ItemInstance litem : list)
  73. {
  74. if (litem.getItemId() == item.getItemId())
  75. {
  76. isDuplicate = true;
  77. break;
  78. }
  79. }
  80. if (!isDuplicate && (!onlyAvailable || (item.getItem().isSellable() && item.isAvailable(getOwner(), false)))) list.add(item);
  81. }
  82. return list.toArray(new L2ItemInstance[list.size()]);
  83. }
  84. /**
  85. * Returns the list of items in inventory available for transaction
  86. * Allows an item to appear twice if and only if there is a difference in enchantment level.
  87. * @return L2ItemInstance : items in inventory
  88. */
  89. public L2ItemInstance[] getUniqueItemsByEnchantLevel(boolean allowAdena, boolean allowAncientAdena)
  90. {
  91. return getUniqueItemsByEnchantLevel(allowAdena, allowAncientAdena, true);
  92. }
  93. public L2ItemInstance[] getUniqueItemsByEnchantLevel(boolean allowAdena, boolean allowAncientAdena, boolean onlyAvailable)
  94. {
  95. List<L2ItemInstance> list = new FastList<L2ItemInstance>();
  96. for (L2ItemInstance item : _items)
  97. {
  98. if ((!allowAdena && item.getItemId() == 57))
  99. continue;
  100. if ((!allowAncientAdena && item.getItemId() == 5575))
  101. continue;
  102. boolean isDuplicate = false;
  103. for (L2ItemInstance litem : list)
  104. if( (litem.getItemId() == item.getItemId()) && (litem.getEnchantLevel() == item.getEnchantLevel()))
  105. {
  106. isDuplicate = true;
  107. break;
  108. }
  109. if (!isDuplicate && (!onlyAvailable || (item.getItem().isSellable() && item.isAvailable(getOwner(), false)))) list.add(item);
  110. }
  111. return list.toArray(new L2ItemInstance[list.size()]);
  112. }
  113. /**
  114. * Returns the list of all items in inventory that have a given item id.
  115. * @return L2ItemInstance[] : matching items from inventory
  116. */
  117. public L2ItemInstance[] getAllItemsByItemId(int itemId)
  118. {
  119. List<L2ItemInstance> list = new FastList<L2ItemInstance>();
  120. for (L2ItemInstance item : _items)
  121. {
  122. if (item.getItemId() == itemId)
  123. list.add(item);
  124. }
  125. return list.toArray(new L2ItemInstance[list.size()]);
  126. }
  127. /**
  128. * Returns the list of all items in inventory that have a given item id AND a given enchantment level.
  129. * @return L2ItemInstance[] : matching items from inventory
  130. */
  131. public L2ItemInstance[] getAllItemsByItemId(int itemId, int enchantment)
  132. {
  133. List<L2ItemInstance> list = new FastList<L2ItemInstance>();
  134. for (L2ItemInstance item : _items)
  135. {
  136. if ((item.getItemId() == itemId) && (item.getEnchantLevel() == enchantment))
  137. list.add(item);
  138. }
  139. return list.toArray(new L2ItemInstance[list.size()]);
  140. }
  141. /**
  142. * Returns the list of items in inventory available for transaction
  143. * @return L2ItemInstance : items in inventory
  144. */
  145. public L2ItemInstance[] getAvailableItems(boolean allowAdena)
  146. {
  147. List<L2ItemInstance> list = new FastList<L2ItemInstance>();
  148. for (L2ItemInstance item : _items)
  149. if (item != null && item.isAvailable(getOwner(), allowAdena)) list.add(item);
  150. return list.toArray(new L2ItemInstance[list.size()]);
  151. }
  152. /**
  153. * Get all augmented items
  154. * @return
  155. */
  156. public L2ItemInstance[] getAugmentedItems()
  157. {
  158. List<L2ItemInstance> list = new FastList<L2ItemInstance>();
  159. for (L2ItemInstance item : _items)
  160. if (item != null && item.isAugmented()) list.add(item);
  161. return list.toArray(new L2ItemInstance[list.size()]);
  162. }
  163. /**
  164. * Returns the list of items in inventory available for transaction adjusted by tradeList
  165. * @return L2ItemInstance : items in inventory
  166. */
  167. public TradeList.TradeItem[] getAvailableItems(TradeList tradeList)
  168. {
  169. List<TradeList.TradeItem> list = new FastList<TradeList.TradeItem>();
  170. for (L2ItemInstance item : _items)
  171. if (item.isAvailable(getOwner(), false))
  172. {
  173. TradeList.TradeItem adjItem = tradeList.adjustAvailableItem(item);
  174. if (adjItem != null) list.add(adjItem);
  175. }
  176. return list.toArray(new TradeList.TradeItem[list.size()]);
  177. }
  178. /**
  179. * Adjust TradeItem according his status in inventory
  180. * @param item : L2ItemInstance to be adjusten
  181. * @return TradeItem representing adjusted item
  182. */
  183. public void adjustAvailableItem(TradeItem item)
  184. {
  185. boolean notAllEquipped = false;
  186. for(L2ItemInstance adjItem: getItemsByItemId(item.getItem().getItemId()))
  187. {
  188. if(adjItem.isEquipable())
  189. {
  190. if(!adjItem.isEquipped())
  191. notAllEquipped |= true;
  192. }else{
  193. notAllEquipped |= true;
  194. break;
  195. }
  196. }
  197. if(notAllEquipped)
  198. {
  199. L2ItemInstance adjItem = getItemByItemId(item.getItem().getItemId());
  200. item.setObjectId(adjItem.getObjectId());
  201. item.setEnchant(adjItem.getEnchantLevel());
  202. if (adjItem.getCount() < item.getCount())
  203. item.setCount(adjItem.getCount());
  204. return;
  205. }
  206. item.setCount(0);
  207. }
  208. /**
  209. * Adds adena to PCInventory
  210. * @param process : String Identifier of process triggering this action
  211. * @param count : int Quantity of adena to be added
  212. * @param actor : L2PcInstance Player requesting the item add
  213. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  214. */
  215. public void addAdena(String process, int count, L2PcInstance actor, L2Object reference)
  216. {
  217. if (count > 0)
  218. addItem(process, ADENA_ID, count, actor, reference);
  219. }
  220. /**
  221. * Removes adena to PCInventory
  222. * @param process : String Identifier of process triggering this action
  223. * @param count : int Quantity of adena to be removed
  224. * @param actor : L2PcInstance Player requesting the item add
  225. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  226. */
  227. public void reduceAdena(String process, int count, L2PcInstance actor, L2Object reference)
  228. {
  229. if (count > 0)
  230. destroyItemByItemId(process, ADENA_ID, count, actor, reference);
  231. }
  232. /**
  233. * Adds specified amount of ancient adena to player inventory.
  234. * @param process : String Identifier of process triggering this action
  235. * @param count : int Quantity of adena to be added
  236. * @param actor : L2PcInstance Player requesting the item add
  237. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  238. */
  239. public void addAncientAdena(String process, int count, L2PcInstance actor, L2Object reference)
  240. {
  241. if (count > 0)
  242. addItem(process, ANCIENT_ADENA_ID, count, actor, reference);
  243. }
  244. /**
  245. * Removes specified amount of ancient adena from player inventory.
  246. * @param process : String Identifier of process triggering this action
  247. * @param count : int Quantity of adena to be removed
  248. * @param actor : L2PcInstance Player requesting the item add
  249. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  250. */
  251. public void reduceAncientAdena(String process, int count, L2PcInstance actor, L2Object reference)
  252. {
  253. if (count > 0)
  254. destroyItemByItemId(process, ANCIENT_ADENA_ID, count, actor, reference);
  255. }
  256. /**
  257. * Adds item in inventory and checks _adena and _ancientAdena
  258. * @param process : String Identifier of process triggering this action
  259. * @param item : L2ItemInstance to be added
  260. * @param actor : L2PcInstance Player requesting the item add
  261. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  262. * @return L2ItemInstance corresponding to the new item or the updated item in inventory
  263. */
  264. @Override
  265. public L2ItemInstance addItem(String process, L2ItemInstance item, L2PcInstance actor, L2Object reference)
  266. {
  267. item = super.addItem(process, item, actor, reference);
  268. if (item != null && item.getItemId() == ADENA_ID && !item.equals(_adena))
  269. _adena = item;
  270. if (item != null && item.getItemId() == ANCIENT_ADENA_ID && !item.equals(_ancientAdena))
  271. _ancientAdena = item;
  272. return item;
  273. }
  274. /**
  275. * Adds item in inventory and checks _adena and _ancientAdena
  276. * @param process : String Identifier of process triggering this action
  277. * @param itemId : int Item Identifier of the item to be added
  278. * @param count : int Quantity of items to be added
  279. * @param actor : L2PcInstance Player requesting the item creation
  280. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  281. * @return L2ItemInstance corresponding to the new item or the updated item in inventory
  282. */
  283. @Override
  284. public L2ItemInstance addItem(String process, int itemId, int count, L2PcInstance actor, L2Object reference)
  285. {
  286. L2ItemInstance item = super.addItem(process, itemId, count, actor, reference);
  287. if (item != null && item.getItemId() == ADENA_ID && !item.equals(_adena))
  288. _adena = item;
  289. if (item != null && item.getItemId() == ANCIENT_ADENA_ID && !item.equals(_ancientAdena))
  290. _ancientAdena = item;
  291. return item;
  292. }
  293. /**
  294. * Transfers item to another inventory and checks _adena and _ancientAdena
  295. * @param process : String Identifier of process triggering this action
  296. * @param itemId : int Item Identifier of the item to be transfered
  297. * @param count : int Quantity of items to be transfered
  298. * @param actor : L2PcInstance Player requesting the item transfer
  299. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  300. * @return L2ItemInstance corresponding to the new item or the updated item in inventory
  301. */
  302. @Override
  303. public L2ItemInstance transferItem(String process, int objectId, int count, ItemContainer target, L2PcInstance actor, L2Object reference)
  304. {
  305. L2ItemInstance item = super.transferItem(process, objectId, count, target, actor, reference);
  306. if (_adena != null && (_adena.getCount() <= 0 || _adena.getOwnerId() != getOwnerId()))
  307. _adena = null;
  308. if (_ancientAdena != null && (_ancientAdena.getCount() <= 0 || _ancientAdena.getOwnerId() != getOwnerId()))
  309. _ancientAdena = null;
  310. return item;
  311. }
  312. /**
  313. * Destroy item from inventory and checks _adena and _ancientAdena
  314. * @param process : String Identifier of process triggering this action
  315. * @param item : L2ItemInstance to be destroyed
  316. * @param actor : L2PcInstance Player requesting the item destroy
  317. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  318. * @return L2ItemInstance corresponding to the destroyed item or the updated item in inventory
  319. */
  320. @Override
  321. public L2ItemInstance destroyItem(String process, L2ItemInstance item, L2PcInstance actor, L2Object reference)
  322. {
  323. return this.destroyItem(process, item, item.getCount(), actor, reference);
  324. }
  325. /**
  326. * Destroy item from inventory and checks _adena and _ancientAdena
  327. * @param process : String Identifier of process triggering this action
  328. * @param item : L2ItemInstance to be destroyed
  329. * @param actor : L2PcInstance Player requesting the item destroy
  330. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  331. * @return L2ItemInstance corresponding to the destroyed item or the updated item in inventory
  332. */
  333. @Override
  334. public L2ItemInstance destroyItem(String process, L2ItemInstance item, int count, L2PcInstance actor, L2Object reference)
  335. {
  336. item = super.destroyItem(process, item, count, actor, reference);
  337. if (_adena != null && _adena.getCount() <= 0)
  338. _adena = null;
  339. if (_ancientAdena != null && _ancientAdena.getCount() <= 0)
  340. _ancientAdena = null;
  341. return item;
  342. }
  343. /**
  344. * Destroys item from inventory and checks _adena and _ancientAdena
  345. * @param process : String Identifier of process triggering this action
  346. * @param objectId : int Item Instance identifier of the item to be destroyed
  347. * @param count : int Quantity of items to be destroyed
  348. * @param actor : L2PcInstance Player requesting the item destroy
  349. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  350. * @return L2ItemInstance corresponding to the destroyed item or the updated item in inventory
  351. */
  352. @Override
  353. public L2ItemInstance destroyItem(String process, int objectId, int count, L2PcInstance actor, L2Object reference)
  354. {
  355. L2ItemInstance item = getItemByObjectId(objectId);
  356. if (item == null)
  357. {
  358. return null;
  359. }
  360. return this.destroyItem(process, item, count, actor, reference);
  361. }
  362. /**
  363. * Destroy item from inventory by using its <B>itemId</B> and checks _adena and _ancientAdena
  364. * @param process : String Identifier of process triggering this action
  365. * @param itemId : int Item identifier of the item to be destroyed
  366. * @param count : int Quantity of items to be destroyed
  367. * @param actor : L2PcInstance Player requesting the item destroy
  368. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  369. * @return L2ItemInstance corresponding to the destroyed item or the updated item in inventory
  370. */
  371. @Override
  372. public L2ItemInstance destroyItemByItemId(String process, int itemId, int count, L2PcInstance actor, L2Object reference)
  373. {
  374. L2ItemInstance item = getItemByItemId(itemId);
  375. if (item == null)
  376. {
  377. return null;
  378. }
  379. return this.destroyItem(process, item, count, actor, reference);
  380. }
  381. /**
  382. * Drop item from inventory and checks _adena and _ancientAdena
  383. * @param process : String Identifier of process triggering this action
  384. * @param item : L2ItemInstance to be dropped
  385. * @param actor : L2PcInstance Player requesting the item drop
  386. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  387. * @return L2ItemInstance corresponding to the destroyed item or the updated item in inventory
  388. */
  389. @Override
  390. public L2ItemInstance dropItem(String process, L2ItemInstance item, L2PcInstance actor, L2Object reference)
  391. {
  392. item = super.dropItem(process, item, actor, reference);
  393. if (_adena != null && (_adena.getCount() <= 0 || _adena.getOwnerId() != getOwnerId()))
  394. _adena = null;
  395. if (_ancientAdena != null && (_ancientAdena.getCount() <= 0 || _ancientAdena.getOwnerId() != getOwnerId()))
  396. _ancientAdena = null;
  397. return item;
  398. }
  399. /**
  400. * Drop item from inventory by using its <B>objectID</B> and checks _adena and _ancientAdena
  401. * @param process : String Identifier of process triggering this action
  402. * @param objectId : int Item Instance identifier of the item to be dropped
  403. * @param count : int Quantity of items to be dropped
  404. * @param actor : L2PcInstance Player requesting the item drop
  405. * @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
  406. * @return L2ItemInstance corresponding to the destroyed item or the updated item in inventory
  407. */
  408. @Override
  409. public L2ItemInstance dropItem(String process, int objectId, int count, L2PcInstance actor, L2Object reference)
  410. {
  411. L2ItemInstance item = super.dropItem(process, objectId, count, actor, reference);
  412. if (_adena != null && (_adena.getCount() <= 0 || _adena.getOwnerId() != getOwnerId()))
  413. _adena = null;
  414. if (_ancientAdena != null && (_ancientAdena.getCount() <= 0 || _ancientAdena.getOwnerId() != getOwnerId()))
  415. _ancientAdena = null;
  416. return item;
  417. }
  418. /**
  419. * <b>Overloaded</b>, when removes item from inventory, remove also owner shortcuts.
  420. * @param item : L2ItemInstance to be removed from inventory
  421. */
  422. @Override
  423. protected boolean removeItem(L2ItemInstance item)
  424. {
  425. // Removes any reference to the item from Shortcut bar
  426. getOwner().removeItemFromShortCut(item.getObjectId());
  427. // Removes active Enchant Scroll
  428. if(item.equals(getOwner().getActiveEnchantItem()))
  429. getOwner().setActiveEnchantItem(null);
  430. if (item.getItemId() == ADENA_ID)
  431. _adena = null;
  432. else if (item.getItemId() == ANCIENT_ADENA_ID)
  433. _ancientAdena = null;
  434. return super.removeItem(item);
  435. }
  436. /**
  437. * Refresh the weight of equipment loaded
  438. */
  439. @Override
  440. public void refreshWeight()
  441. {
  442. super.refreshWeight();
  443. getOwner().refreshOverloaded();
  444. }
  445. /**
  446. * Get back items in inventory from database
  447. */
  448. @Override
  449. public void restore()
  450. {
  451. super.restore();
  452. _adena = getItemByItemId(ADENA_ID);
  453. _ancientAdena = getItemByItemId(ANCIENT_ADENA_ID);
  454. }
  455. public static int[][] restoreVisibleInventory(int objectId)
  456. {
  457. int[][] paperdoll = new int[25][3];
  458. java.sql.Connection con = null;
  459. try
  460. {
  461. con = L2DatabaseFactory.getInstance().getConnection();
  462. PreparedStatement statement2 = con.prepareStatement(
  463. "SELECT object_id,item_id,loc_data,enchant_level FROM items WHERE owner_id=? AND loc='PAPERDOLL'");
  464. statement2.setInt(1, objectId);
  465. ResultSet invdata = statement2.executeQuery();
  466. while (invdata.next())
  467. {
  468. int slot = invdata.getInt("loc_data");
  469. paperdoll[slot][0] = invdata.getInt("object_id");
  470. paperdoll[slot][1] = invdata.getInt("item_id");
  471. paperdoll[slot][2] = invdata.getInt("enchant_level");
  472. if (slot == Inventory.PAPERDOLL_LRHAND)
  473. {
  474. paperdoll[Inventory.PAPERDOLL_RHAND][0] = invdata.getInt("object_id");
  475. paperdoll[Inventory.PAPERDOLL_RHAND][1] = invdata.getInt("item_id");
  476. paperdoll[Inventory.PAPERDOLL_RHAND][2] = invdata.getInt("enchant_level");
  477. }
  478. }
  479. invdata.close();
  480. statement2.close();
  481. }
  482. catch (Exception e) {
  483. _log.log(Level.WARNING, "could not restore inventory:", e);
  484. }
  485. finally {
  486. try { con.close(); } catch (Exception e) { _log.warning(""); }
  487. }
  488. return paperdoll;
  489. }
  490. public boolean validateCapacity(L2ItemInstance item)
  491. {
  492. int slots = 0;
  493. if (!(item.isStackable() && getItemByItemId(item.getItemId()) != null) && item.getItemType() != L2EtcItemType.HERB)
  494. slots++;
  495. return validateCapacity(slots);
  496. }
  497. public boolean validateCapacity(List<L2ItemInstance> items)
  498. {
  499. int slots = 0;
  500. for (L2ItemInstance item : items)
  501. if (!(item.isStackable() && getItemByItemId(item.getItemId()) != null))
  502. slots++;
  503. return validateCapacity(slots);
  504. }
  505. public boolean validateCapacityByItemId(int ItemId)
  506. {
  507. int slots = 0;
  508. L2ItemInstance invItem = getItemByItemId(ItemId);
  509. if (!(invItem != null && invItem.isStackable()))
  510. slots++;
  511. return validateCapacity(slots);
  512. }
  513. @Override
  514. public boolean validateCapacity(int slots)
  515. {
  516. return (_items.size() + slots <= _owner.getInventoryLimit());
  517. }
  518. @Override
  519. public boolean validateWeight(int weight)
  520. {
  521. return (_totalWeight + weight <= _owner.getMaxLoad());
  522. }
  523. }