L2PetData.java 11 KB

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