ItemInfo.java 2.3 KB

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