L2Henna.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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.items;
  16. import java.util.ArrayList;
  17. import java.util.List;
  18. import com.l2jserver.gameserver.model.StatsSet;
  19. import com.l2jserver.gameserver.model.base.ClassId;
  20. /**
  21. * Class for the Henna object.
  22. * @author Zoey76
  23. */
  24. public class L2Henna
  25. {
  26. private final int _dyeId;
  27. private final String _dyeName;
  28. private final int _dyeItemId;
  29. private final int _str;
  30. private final int _con;
  31. private final int _dex;
  32. private final int _int;
  33. private final int _men;
  34. private final int _wit;
  35. private final int _wear_fee;
  36. private final int _wear_count;
  37. private final int _cancel_fee;
  38. private final int _cancel_count;
  39. private final List<ClassId> _wear_class;
  40. public L2Henna(StatsSet set)
  41. {
  42. _dyeId = set.getInteger("dyeId");
  43. _dyeName = set.getString("dyeName");
  44. _dyeItemId = set.getInteger("dyeItemId");
  45. _str = set.getInteger("str");
  46. _con = set.getInteger("con");
  47. _dex = set.getInteger("dex");
  48. _int = set.getInteger("int");
  49. _men = set.getInteger("men");
  50. _wit = set.getInteger("wit");
  51. _wear_fee = set.getInteger("wear_fee");
  52. _wear_count = set.getInteger("wear_count");
  53. _cancel_fee = set.getInteger("cancel_fee");
  54. _cancel_count = set.getInteger("cancel_count");
  55. _wear_class = new ArrayList<>();
  56. }
  57. /**
  58. * @return the dye Id.
  59. */
  60. public int getDyeId()
  61. {
  62. return _dyeId;
  63. }
  64. /**
  65. * @return the dye server-side name.
  66. */
  67. public String getDyeName()
  68. {
  69. return _dyeName;
  70. }
  71. /**
  72. * @return the item Id, required for this dye.
  73. */
  74. public int getDyeItemId()
  75. {
  76. return _dyeItemId;
  77. }
  78. /**
  79. * @return the STR stat.
  80. */
  81. public int getStatSTR()
  82. {
  83. return _str;
  84. }
  85. /**
  86. * @return the CON stat.
  87. */
  88. public int getStatCON()
  89. {
  90. return _con;
  91. }
  92. /**
  93. * @return the DEX stat.
  94. */
  95. public int getStatDEX()
  96. {
  97. return _dex;
  98. }
  99. /**
  100. * @return the INT stat.
  101. */
  102. public int getStatINT()
  103. {
  104. return _int;
  105. }
  106. /**
  107. * @return the MEN stat.
  108. */
  109. public int getStatMEN()
  110. {
  111. return _men;
  112. }
  113. /**
  114. * @return the WIT stat.
  115. */
  116. public int getStatWIT()
  117. {
  118. return _wit;
  119. }
  120. /**
  121. * @return the wear fee, cost for adding this dye to the player.
  122. */
  123. public int getWearFee()
  124. {
  125. return _wear_fee;
  126. }
  127. /**
  128. * @return the wear count, the required count to add this dye to the player.
  129. */
  130. public int getWearCount()
  131. {
  132. return _wear_count;
  133. }
  134. /**
  135. * @return the cancel fee, cost for removing this dye from the player.
  136. */
  137. public int getCancelFee()
  138. {
  139. return _cancel_fee;
  140. }
  141. /**
  142. * @return the cancel count, the retrieved amount of dye items after removing the dye.
  143. */
  144. public int getCancelCount()
  145. {
  146. return _cancel_count;
  147. }
  148. /**
  149. * @return the list with the allowed classes to wear this dye.
  150. */
  151. public List<ClassId> getAllowedWearClass()
  152. {
  153. return _wear_class;
  154. }
  155. /**
  156. * @param c the class trying to wear this dye.
  157. * @return {@code true} if the player is allowed to wear this dye, {@code false} otherwise.
  158. */
  159. public boolean isAllowedClass(ClassId c)
  160. {
  161. return _wear_class.contains(c);
  162. }
  163. /**
  164. * @param wearClassIds the list of classes that can wear this dye.
  165. */
  166. public void setWearClassIds(List<ClassId> wearClassIds)
  167. {
  168. _wear_class.addAll(wearClassIds);
  169. }
  170. }