ItemInfo.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 com.l2jserver.gameserver.model.multisell;
  16. import com.l2jserver.gameserver.model.Elementals;
  17. import com.l2jserver.gameserver.model.L2ItemInstance;
  18. /**
  19. *
  20. * @author DS
  21. *
  22. */
  23. public class ItemInfo
  24. {
  25. private final int _enchantLevel, _augmentId;
  26. private final byte _elementId;
  27. private final int _elementPower;
  28. private final int[] _elementals = new int[6];
  29. public ItemInfo(L2ItemInstance item)
  30. {
  31. _enchantLevel = item.getEnchantLevel();
  32. _augmentId = item.getAugmentation() != null ? item.getAugmentation().getAugmentationId() : 0;
  33. _elementId = item.getAttackElementType();
  34. _elementPower = item.getAttackElementPower();
  35. _elementals[0] = item.getElementDefAttr(Elementals.FIRE);
  36. _elementals[1] = item.getElementDefAttr(Elementals.WATER);
  37. _elementals[2] = item.getElementDefAttr(Elementals.WIND);
  38. _elementals[3] = item.getElementDefAttr(Elementals.EARTH);
  39. _elementals[4] = item.getElementDefAttr(Elementals.HOLY);
  40. _elementals[5] = item.getElementDefAttr(Elementals.DARK);
  41. }
  42. public ItemInfo(int enchantLevel)
  43. {
  44. _enchantLevel = enchantLevel;
  45. _augmentId = 0;
  46. _elementId = Elementals.NONE;
  47. _elementPower = 0;
  48. _elementals[0] = 0;
  49. _elementals[1] = 0;
  50. _elementals[2] = 0;
  51. _elementals[3] = 0;
  52. _elementals[4] = 0;
  53. _elementals[5] = 0;
  54. }
  55. public final int getEnchantLevel()
  56. {
  57. return _enchantLevel;
  58. }
  59. public final int getAugmentId()
  60. {
  61. return _augmentId;
  62. }
  63. public final byte getElementId()
  64. {
  65. return _elementId;
  66. }
  67. public final int getElementPower()
  68. {
  69. return _elementPower;
  70. }
  71. public final int[] getElementals()
  72. {
  73. return _elementals;
  74. }
  75. }