L2PetData.java 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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. public class L2PetData
  17. {
  18. public static final String PET_TYPE = "typeID";
  19. public static final String PET_LEVEL = "level";
  20. // public static final String PET_EXP = "exp";
  21. public static final String PET_MAX_EXP = "expMax";
  22. // public static final String PET_HP = "hp";
  23. public static final String PET_MAX_HP = "hpMax";
  24. // public static final String PET_MP = "mp";
  25. public static final String PET_MAX_MP = "mpMax";
  26. public static final String PET_PATK = "patk";
  27. public static final String PET_PDEF = "pdef";
  28. public static final String PET_MATK = "matk";
  29. public static final String PET_MDEF = "mdef";
  30. public static final String PET_ACCURACY = "acc";
  31. public static final String PET_EVASION = "evasion";
  32. public static final String PET_CRITICAL = "crit";
  33. public static final String PET_SPEED = "speed";
  34. public static final String PET_ATK_SPEED = "atk_speed";
  35. public static final String PET_CAST_SPEED = "cast_speed";
  36. // public static final String PET_FEED = "feed";
  37. public static final String PET_MAX_FEED = "feedMax";
  38. public static final String PET_FEED_BATTLE = "feedbattle";
  39. public static final String PET_FEED_NORMAL = "feednormal";
  40. // public static final String PET_LOAD = "load";
  41. public static final String PET_MAX_LOAD = "loadMax";
  42. public static final String PET_REGEN_HP = "hpregen";
  43. public static final String PET_REGEN_MP = "mpregen";
  44. public static final String OWNER_EXP_TAKEN = "owner_exp_taken";
  45. private int _petId;
  46. private int _petLevel;
  47. private float _ownerExpTaken;
  48. // private int petExp;
  49. private long _petMaxExp;
  50. // private int petHP;
  51. private int _petMaxHP;
  52. // private int petMP;
  53. private int _petMaxMP;
  54. private int _petPAtk;
  55. private int _petPDef;
  56. private int _petMAtk;
  57. private int _petMDef;
  58. private int _petAccuracy;
  59. private int _petEvasion;
  60. private int _petCritical;
  61. private int _petSpeed;
  62. private int _petAtkSpeed;
  63. private int _petCastSpeed;
  64. // private int petFeed;
  65. private int _petMaxFeed;
  66. private int _petFeedBattle;
  67. private int _petFeedNormal;
  68. private int _petMaxLoad;
  69. private int _petRegenHP;
  70. private int _petRegenMP;
  71. public void setStat(String stat, int value)
  72. {
  73. // if (stat.equalsIgnoreCase(PET_EXP)) { this.setPetExp(value); }
  74. if (stat.equalsIgnoreCase(PET_MAX_EXP))
  75. {
  76. setPetMaxExp(value);
  77. }
  78. // else if (stat.equalsIgnoreCase(PET_HP)) { this.setPetHP(value); }
  79. else if (stat.equalsIgnoreCase(PET_MAX_HP))
  80. {
  81. setPetMaxHP(value);
  82. }
  83. // else if (stat.equalsIgnoreCase(PET_MP)) { this.setPetMP(value); }
  84. else if (stat.equalsIgnoreCase(PET_MAX_MP))
  85. {
  86. setPetMaxMP(value);
  87. }
  88. else if (stat.equalsIgnoreCase(PET_PATK))
  89. {
  90. setPetPAtk(value);
  91. }
  92. else if (stat.equalsIgnoreCase(PET_PDEF))
  93. {
  94. setPetPDef(value);
  95. }
  96. else if (stat.equalsIgnoreCase(PET_MATK))
  97. {
  98. setPetMAtk(value);
  99. }
  100. else if (stat.equalsIgnoreCase(PET_MDEF))
  101. {
  102. setPetMDef(value);
  103. }
  104. else if (stat.equalsIgnoreCase(PET_ACCURACY))
  105. {
  106. setPetAccuracy(value);
  107. }
  108. else if (stat.equalsIgnoreCase(PET_EVASION))
  109. {
  110. setPetEvasion(value);
  111. }
  112. else if (stat.equalsIgnoreCase(PET_CRITICAL))
  113. {
  114. setPetCritical(value);
  115. }
  116. else if (stat.equalsIgnoreCase(PET_SPEED))
  117. {
  118. setPetSpeed(value);
  119. }
  120. else if (stat.equalsIgnoreCase(PET_ATK_SPEED))
  121. {
  122. setPetAtkSpeed(value);
  123. }
  124. else if (stat.equalsIgnoreCase(PET_CAST_SPEED))
  125. {
  126. setPetCastSpeed(value);
  127. }
  128. // else if (stat.equalsIgnoreCase(PET_FEED)) { this.setPetFeed(value); }
  129. else if (stat.equalsIgnoreCase(PET_MAX_FEED))
  130. {
  131. setPetMaxFeed(value);
  132. }
  133. else if (stat.equalsIgnoreCase(PET_FEED_NORMAL))
  134. {
  135. setPetFeedNormal(value);
  136. }
  137. else if (stat.equalsIgnoreCase(PET_FEED_BATTLE))
  138. {
  139. setPetFeedBattle(value);
  140. }
  141. // else if (stat.equalsIgnoreCase(PET_LOAD)) { this.setPetLoad(value); }
  142. else if (stat.equalsIgnoreCase(PET_MAX_LOAD))
  143. {
  144. setPetMaxLoad(value);
  145. }
  146. else if (stat.equalsIgnoreCase(PET_REGEN_HP))
  147. {
  148. setPetRegenHP(value);
  149. }
  150. else if (stat.equalsIgnoreCase(PET_REGEN_MP))
  151. {
  152. setPetRegenMP(value);
  153. }
  154. }
  155. public void setStat(String stat, long value)
  156. {
  157. // if (stat.equalsIgnoreCase(PET_EXP)) { this.setPetExp(value); }
  158. if (stat.equalsIgnoreCase(PET_MAX_EXP))
  159. {
  160. setPetMaxExp(value);
  161. }
  162. }
  163. public void setStat(String stat, float value)
  164. {
  165. // if (stat.equalsIgnoreCase(PET_EXP)) { this.setPetExp(value); }
  166. if (stat.equalsIgnoreCase(OWNER_EXP_TAKEN))
  167. {
  168. setOwnerExpTaken(value);
  169. }
  170. }
  171. // ID
  172. public int getPetID()
  173. {
  174. return _petId;
  175. }
  176. public void setPetID(int pPetID)
  177. {
  178. _petId = pPetID;
  179. }
  180. // Level
  181. public int getPetLevel()
  182. {
  183. return _petLevel;
  184. }
  185. public void setPetLevel(int pPetLevel)
  186. {
  187. _petLevel = pPetLevel;
  188. }
  189. // Exp
  190. // public int getPetExp() { return petExp; }
  191. // public void setPetExp(int petExp) { this.petExp = petExp; }
  192. // Max Exp
  193. public long getPetMaxExp()
  194. {
  195. return _petMaxExp;
  196. }
  197. public void setPetMaxExp(long pPetMaxExp)
  198. {
  199. _petMaxExp = pPetMaxExp;
  200. }
  201. public float getOwnerExpTaken()
  202. {
  203. return _ownerExpTaken;
  204. }
  205. public void setOwnerExpTaken(float pOwnerExpTaken)
  206. {
  207. _ownerExpTaken = pOwnerExpTaken;
  208. }
  209. // HP
  210. // public int getPetHP() { return petHP; }
  211. // public void setPetHP(int petHP) { this.petHP = petHP; }
  212. // Max HP
  213. public int getPetMaxHP()
  214. {
  215. return _petMaxHP;
  216. }
  217. public void setPetMaxHP(int pPetMaxHP)
  218. {
  219. _petMaxHP = pPetMaxHP;
  220. }
  221. // Mp
  222. // public int getPetMP() { return petMP; }
  223. // public void setPetMP(int petMP) { this.petMP = petMP; }
  224. // Max Mp
  225. public int getPetMaxMP()
  226. {
  227. return _petMaxMP;
  228. }
  229. public void setPetMaxMP(int pPetMaxMP)
  230. {
  231. _petMaxMP = pPetMaxMP;
  232. }
  233. // PAtk
  234. public int getPetPAtk()
  235. {
  236. return _petPAtk;
  237. }
  238. public void setPetPAtk(int pPetPAtk)
  239. {
  240. _petPAtk = pPetPAtk;
  241. }
  242. // PDef
  243. public int getPetPDef()
  244. {
  245. return _petPDef;
  246. }
  247. public void setPetPDef(int pPetPDef)
  248. {
  249. _petPDef = pPetPDef;
  250. }
  251. // MAtk
  252. public int getPetMAtk()
  253. {
  254. return _petMAtk;
  255. }
  256. public void setPetMAtk(int pPetMAtk)
  257. {
  258. _petMAtk = pPetMAtk;
  259. }
  260. // MDef
  261. public int getPetMDef()
  262. {
  263. return _petMDef;
  264. }
  265. public void setPetMDef(int pPetMDef)
  266. {
  267. _petMDef = pPetMDef;
  268. }
  269. // Accuracy
  270. public int getPetAccuracy()
  271. {
  272. return _petAccuracy;
  273. }
  274. public void setPetAccuracy(int pPetAccuracy)
  275. {
  276. _petAccuracy = pPetAccuracy;
  277. }
  278. // Evasion
  279. public int getPetEvasion()
  280. {
  281. return _petEvasion;
  282. }
  283. public void setPetEvasion(int pPetEvasion)
  284. {
  285. _petEvasion = pPetEvasion;
  286. }
  287. // Critical
  288. public int getPetCritical()
  289. {
  290. return _petCritical;
  291. }
  292. public void setPetCritical(int pPetCritical)
  293. {
  294. _petCritical = pPetCritical;
  295. }
  296. // Speed
  297. public int getPetSpeed()
  298. {
  299. return _petSpeed;
  300. }
  301. public void setPetSpeed(int pPetSpeed)
  302. {
  303. _petSpeed = pPetSpeed;
  304. }
  305. // Atk Speed
  306. public int getPetAtkSpeed()
  307. {
  308. return _petAtkSpeed;
  309. }
  310. public void setPetAtkSpeed(int pPetAtkSpeed)
  311. {
  312. _petAtkSpeed = pPetAtkSpeed;
  313. }
  314. // Cast Speed
  315. public int getPetCastSpeed()
  316. {
  317. return _petCastSpeed;
  318. }
  319. public void setPetCastSpeed(int pPetCastSpeed)
  320. {
  321. _petCastSpeed = pPetCastSpeed;
  322. }
  323. // Feed
  324. // public int getPetFeed(){ return petFeed; }
  325. // public void setPetFeed(int petFeed) { this.petFeed = petFeed; }
  326. // MaxFeed
  327. public int getPetMaxFeed()
  328. {
  329. return _petMaxFeed;
  330. }
  331. public void setPetMaxFeed(int pPetMaxFeed)
  332. {
  333. _petMaxFeed = pPetMaxFeed;
  334. }
  335. // Normal Feed
  336. public int getPetFeedNormal()
  337. {
  338. return _petFeedNormal;
  339. }
  340. public void setPetFeedNormal(int pPetFeedNormal)
  341. {
  342. _petFeedNormal = pPetFeedNormal;
  343. }
  344. // Battle Feed
  345. public int getPetFeedBattle()
  346. {
  347. return _petFeedBattle;
  348. }
  349. public void setPetFeedBattle(int pPetFeedBattle)
  350. {
  351. _petFeedBattle = pPetFeedBattle;
  352. }
  353. // Load
  354. // public int getPetLoad() { return petLoad; }
  355. // public void setPetLoad(int petLoad) { this.petLoad = petLoad; }
  356. // Max Load
  357. public int getPetMaxLoad()
  358. {
  359. return _petMaxLoad;
  360. }
  361. public void setPetMaxLoad(int pPetMaxLoad)
  362. {
  363. _petMaxLoad = pPetMaxLoad;
  364. }
  365. // Regen HP
  366. public int getPetRegenHP()
  367. {
  368. return _petRegenHP;
  369. }
  370. public void setPetRegenHP(int pPetRegenHP)
  371. {
  372. _petRegenHP = pPetRegenHP;
  373. }
  374. // Regen MP
  375. public int getPetRegenMP()
  376. {
  377. return _petRegenMP;
  378. }
  379. public void setPetRegenMP(int pPetRegenMP)
  380. {
  381. _petRegenMP = pPetRegenMP;
  382. }
  383. @Override
  384. public String toString()
  385. {
  386. return "PetID: " + getPetID() + " \t" + "PetLevel: " + getPetLevel() + " \t" +
  387. // PET_EXP + ": " + getPetExp() + " \t" +
  388. PET_MAX_EXP + ": " + getPetMaxExp() + " \t" +
  389. // PET_HP + ": " + getPetHP() + " \t" +
  390. PET_MAX_HP + ": " + getPetMaxHP() + " \t" +
  391. // PET_MP + ": " + getPetMP() + " \t" +
  392. PET_MAX_MP + ": " + getPetMaxMP() + " \t" + PET_PATK + ": " + getPetPAtk() + " \t"
  393. + PET_PDEF + ": " + getPetPDef() + " \t" + PET_MATK + ": " + getPetMAtk() + " \t" + PET_MDEF
  394. + ": " + getPetMDef() + " \t" + PET_ACCURACY + ": " + getPetAccuracy() + " \t" + PET_EVASION
  395. + ": " + getPetEvasion() + " \t" + PET_CRITICAL + ": " + getPetCritical() + " \t"
  396. + PET_SPEED + ": " + getPetSpeed() + " \t" + PET_ATK_SPEED + ": " + getPetAtkSpeed() + " \t"
  397. + PET_CAST_SPEED + ": " + getPetCastSpeed() + " \t" +
  398. // PET_FEED + ": " + getPetFeed() + " \t" +
  399. PET_MAX_FEED + ": " + getPetMaxFeed() + " \t" + PET_FEED_BATTLE + ": " + getPetFeedBattle()
  400. + " \t" + PET_FEED_NORMAL + ": " + getPetFeedNormal() + " \t" +
  401. // PET_LOAD + ": " + getPetLoad() + " \t" +
  402. PET_MAX_LOAD + ": " + getPetMaxLoad() + " \t" + PET_REGEN_HP + ": " + getPetRegenHP()
  403. + " \t" + PET_REGEN_MP + ": " + getPetRegenMP();
  404. }
  405. }