2
0

L2MinionData.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. import com.l2jserver.util.Rnd;
  17. /**
  18. * This class defines the spawn data of a Minion type In a group mob, there are one master called RaidBoss and several slaves called Minions.
  19. */
  20. public class L2MinionData
  21. {
  22. /** The Identifier of the L2Minion to spawn */
  23. private int _minionId;
  24. /** The number of this Minion Type to spawn */
  25. private int _minionAmount;
  26. private int _minionAmountMin;
  27. private int _minionAmountMax;
  28. /**
  29. * Set the Identifier of the Minion to spawn.
  30. * @param id The L2Character Identifier to spawn
  31. */
  32. public void setMinionId(int id)
  33. {
  34. _minionId = id;
  35. }
  36. /**
  37. * @return the Identifier of the Minion to spawn.
  38. */
  39. public int getMinionId()
  40. {
  41. return _minionId;
  42. }
  43. /**
  44. * Set the minimum of minions to amount.
  45. * @param amountMin The minimum quantity of this Minion type to spawn
  46. */
  47. public void setAmountMin(int amountMin)
  48. {
  49. _minionAmountMin = amountMin;
  50. }
  51. /**
  52. * Set the maximum of minions to amount.
  53. * @param amountMax The maximum quantity of this Minion type to spawn
  54. */
  55. public void setAmountMax(int amountMax)
  56. {
  57. _minionAmountMax = amountMax;
  58. }
  59. /**
  60. * Set the amount of this Minion type to spawn.
  61. * @param amount The quantity of this Minion type to spawn
  62. */
  63. public void setAmount(int amount)
  64. {
  65. _minionAmount = amount;
  66. }
  67. /**
  68. * @return the amount of this Minion type to spawn.
  69. */
  70. public int getAmount()
  71. {
  72. if (_minionAmountMax > _minionAmountMin)
  73. {
  74. _minionAmount = Rnd.get(_minionAmountMin, _minionAmountMax);
  75. return _minionAmount;
  76. }
  77. return _minionAmountMin;
  78. }
  79. }