L2Henna.java 4.0 KB

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