ItemInfo.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C) 2004-2014 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.model.multisell;
  20. import com.l2jserver.gameserver.model.Elementals;
  21. import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  22. /**
  23. * @author DS
  24. */
  25. public class ItemInfo
  26. {
  27. private final int _enchantLevel, _augmentId;
  28. private final byte _elementId;
  29. private final int _elementPower;
  30. private final int[] _elementals = new int[6];
  31. public ItemInfo(L2ItemInstance item)
  32. {
  33. _enchantLevel = item.getEnchantLevel();
  34. _augmentId = item.getAugmentation() != null ? item.getAugmentation().getAugmentationId() : 0;
  35. _elementId = item.getAttackElementType();
  36. _elementPower = item.getAttackElementPower();
  37. _elementals[0] = item.getElementDefAttr(Elementals.FIRE);
  38. _elementals[1] = item.getElementDefAttr(Elementals.WATER);
  39. _elementals[2] = item.getElementDefAttr(Elementals.WIND);
  40. _elementals[3] = item.getElementDefAttr(Elementals.EARTH);
  41. _elementals[4] = item.getElementDefAttr(Elementals.HOLY);
  42. _elementals[5] = item.getElementDefAttr(Elementals.DARK);
  43. }
  44. public ItemInfo(int enchantLevel)
  45. {
  46. _enchantLevel = enchantLevel;
  47. _augmentId = 0;
  48. _elementId = Elementals.NONE;
  49. _elementPower = 0;
  50. _elementals[0] = 0;
  51. _elementals[1] = 0;
  52. _elementals[2] = 0;
  53. _elementals[3] = 0;
  54. _elementals[4] = 0;
  55. _elementals[5] = 0;
  56. }
  57. public final int getEnchantLevel()
  58. {
  59. return _enchantLevel;
  60. }
  61. public final int getAugmentId()
  62. {
  63. return _augmentId;
  64. }
  65. public final byte getElementId()
  66. {
  67. return _elementId;
  68. }
  69. public final int getElementPower()
  70. {
  71. return _elementPower;
  72. }
  73. public final int[] getElementals()
  74. {
  75. return _elementals;
  76. }
  77. }