L2PetLevelData.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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;
  20. import com.l2jserver.gameserver.model.stats.MoveType;
  21. /**
  22. * Stats definition for each pet level.
  23. * @author JIV, Zoey76
  24. */
  25. public class L2PetLevelData
  26. {
  27. private final int _ownerExpTaken;
  28. private final int _petFeedBattle;
  29. private final int _petFeedNormal;
  30. private final float _petMAtk;
  31. private final long _petMaxExp;
  32. private final int _petMaxFeed;
  33. private final float _petMaxHP;
  34. private final float _petMaxMP;
  35. private final float _petMDef;
  36. private final float _petPAtk;
  37. private final float _petPDef;
  38. private final float _petRegenHP;
  39. private final float _petRegenMP;
  40. private final short _petSoulShot;
  41. private final short _petSpiritShot;
  42. private final int _walkSpeedOnRide;
  43. private final int _runSpeedOnRide;
  44. private final int _slowSwimSpeedOnRide;
  45. private final int _fastSwimSpeedOnRide;
  46. private final int _slowFlySpeedOnRide;
  47. private final int _fastFlySpeedOnRide;
  48. public L2PetLevelData(StatsSet set)
  49. {
  50. _ownerExpTaken = set.getInteger("get_exp_type");
  51. _petMaxExp = set.getLong("exp");
  52. _petMaxHP = set.getFloat("org_hp");
  53. _petMaxMP = set.getFloat("org_mp");
  54. _petPAtk = set.getFloat("org_pattack");
  55. _petPDef = set.getFloat("org_pdefend");
  56. _petMAtk = set.getFloat("org_mattack");
  57. _petMDef = set.getFloat("org_mdefend");
  58. _petMaxFeed = set.getInteger("max_meal");
  59. _petFeedBattle = set.getInteger("consume_meal_in_battle");
  60. _petFeedNormal = set.getInteger("consume_meal_in_normal");
  61. _petRegenHP = set.getFloat("org_hp_regen");
  62. _petRegenMP = set.getFloat("org_mp_regen");
  63. _petSoulShot = set.getShort("soulshot_count");
  64. _petSpiritShot = set.getShort("spiritshot_count");
  65. _walkSpeedOnRide = set.getInteger("walkSpeedOnRide", 0);
  66. _runSpeedOnRide = set.getInteger("runSpeedOnRide", 0);
  67. _slowSwimSpeedOnRide = set.getInteger("slowSwimSpeedOnRide", 0);
  68. _fastSwimSpeedOnRide = set.getInteger("fastSwimSpeedOnRide", 0);
  69. _slowFlySpeedOnRide = set.getInteger("slowFlySpeedOnRide", 0);
  70. _fastFlySpeedOnRide = set.getInteger("fastFlySpeedOnRide", 0);
  71. }
  72. /**
  73. * @return the owner's experience points consumed by the pet.
  74. */
  75. public int getOwnerExpTaken()
  76. {
  77. return _ownerExpTaken;
  78. }
  79. /**
  80. * @return the pet's food consume rate at battle state.
  81. */
  82. public int getPetFeedBattle()
  83. {
  84. return _petFeedBattle;
  85. }
  86. /**
  87. * @return the pet's food consume rate at normal state.
  88. */
  89. public int getPetFeedNormal()
  90. {
  91. return _petFeedNormal;
  92. }
  93. /**
  94. * @return the pet's Magical Attack.
  95. */
  96. public float getPetMAtk()
  97. {
  98. return _petMAtk;
  99. }
  100. /**
  101. * @return the pet's maximum experience points.
  102. */
  103. public long getPetMaxExp()
  104. {
  105. return _petMaxExp;
  106. }
  107. /**
  108. * @return the pet's maximum feed points.
  109. */
  110. public int getPetMaxFeed()
  111. {
  112. return _petMaxFeed;
  113. }
  114. /**
  115. * @return the pet's maximum HP.
  116. */
  117. public float getPetMaxHP()
  118. {
  119. return _petMaxHP;
  120. }
  121. /**
  122. * @return the pet's maximum MP.
  123. */
  124. public float getPetMaxMP()
  125. {
  126. return _petMaxMP;
  127. }
  128. /**
  129. * @return the pet's Magical Defense.
  130. */
  131. public float getPetMDef()
  132. {
  133. return _petMDef;
  134. }
  135. /**
  136. * @return the pet's Physical Attack.
  137. */
  138. public float getPetPAtk()
  139. {
  140. return _petPAtk;
  141. }
  142. /**
  143. * @return the pet's Physical Defense.
  144. */
  145. public float getPetPDef()
  146. {
  147. return _petPDef;
  148. }
  149. /**
  150. * @return the pet's HP regeneration rate.
  151. */
  152. public float getPetRegenHP()
  153. {
  154. return _petRegenHP;
  155. }
  156. /**
  157. * @return the pet's MP regeneration rate.
  158. */
  159. public float getPetRegenMP()
  160. {
  161. return _petRegenMP;
  162. }
  163. /**
  164. * @return the pet's soulshot use count.
  165. */
  166. public short getPetSoulShot()
  167. {
  168. return _petSoulShot;
  169. }
  170. /**
  171. * @return the pet's spiritshot use count.
  172. */
  173. public short getPetSpiritShot()
  174. {
  175. return _petSpiritShot;
  176. }
  177. /**
  178. * @param mt movement type
  179. * @return the base riding speed of given movement type.
  180. */
  181. public int getSpeedOnRide(MoveType mt)
  182. {
  183. switch(mt)
  184. {
  185. case WALK:
  186. return _walkSpeedOnRide;
  187. case RUN:
  188. return _runSpeedOnRide;
  189. case SLOW_SWIM:
  190. return _slowSwimSpeedOnRide;
  191. case FAST_SWIM:
  192. return _fastSwimSpeedOnRide;
  193. case SLOW_FLY:
  194. return _slowFlySpeedOnRide;
  195. case FAST_FLY:
  196. return _fastFlySpeedOnRide;
  197. }
  198. return 0;
  199. }
  200. }