L2EnchantSkillGroup.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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;
  16. import java.util.List;
  17. import javolution.util.FastList;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. public final class L2EnchantSkillGroup
  20. {
  21. private final int _id;
  22. private List<EnchantSkillDetail> _enchantDetails = new FastList<>();
  23. public L2EnchantSkillGroup(int id)
  24. {
  25. _id = id;
  26. }
  27. public void addEnchantDetail(EnchantSkillDetail detail)
  28. {
  29. _enchantDetails.add(detail);
  30. }
  31. public int getId()
  32. {
  33. return _id;
  34. }
  35. public List<EnchantSkillDetail> getEnchantGroupDetails()
  36. {
  37. return _enchantDetails;
  38. }
  39. public static class EnchantSkillDetail
  40. {
  41. private final int _level;
  42. private final int _adenaCost;
  43. private final int _expCost;
  44. private final int _spCost;
  45. private final byte[] _rate;
  46. public EnchantSkillDetail(int lvl, int adena, int exp, int sp, byte rate76, byte rate77, byte rate78, byte rate79, byte rate80, byte rate81, byte rate82, byte rate83, byte rate84, byte rate85)
  47. {
  48. _level = lvl;
  49. _adenaCost = adena;
  50. _expCost = exp;
  51. _spCost = sp;
  52. _rate = new byte[10];
  53. _rate[0] = rate76;
  54. _rate[1] = rate77;
  55. _rate[2] = rate78;
  56. _rate[3] = rate79;
  57. _rate[4] = rate80;
  58. _rate[5] = rate81;
  59. _rate[6] = rate82;
  60. _rate[7] = rate83;
  61. _rate[8] = rate84;
  62. _rate[9] = rate85;
  63. }
  64. /**
  65. * @return Returns the level.
  66. */
  67. public int getLevel()
  68. {
  69. return _level;
  70. }
  71. /**
  72. * @return Returns the spCost.
  73. */
  74. public int getSpCost()
  75. {
  76. return _spCost;
  77. }
  78. public int getExpCost()
  79. {
  80. return _expCost;
  81. }
  82. public int getAdenaCost()
  83. {
  84. return _adenaCost;
  85. }
  86. public byte getRate(L2PcInstance ply)
  87. {
  88. if (ply.getLevel() < 76)
  89. return 0;
  90. return _rate[ply.getLevel() - 76];
  91. }
  92. }
  93. }