L2MinionData.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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
  19. * In a group mob, there are one master called RaidBoss and several slaves called Minions.
  20. *
  21. * <B><U> Data</U> :</B><BR><BR>
  22. * <li>_minionId : The Identifier of the L2Minion to spawn </li>
  23. * <li>_minionAmount : The number of this Minion Type to spawn </li><BR><BR>
  24. *
  25. */
  26. public class L2MinionData
  27. {
  28. /** The Identifier of the L2Minion */
  29. private int _minionId;
  30. /** The number of this Minion Type to spawn */
  31. private int _minionAmount;
  32. private int _minionAmountMin;
  33. private int _minionAmountMax;
  34. /**
  35. * Set the Identifier of the Minion to spawn.<BR><BR>
  36. *
  37. * @param if The L2Character Identifier to spawn
  38. *
  39. */
  40. public void setMinionId(int id)
  41. {
  42. _minionId = id;
  43. }
  44. /**
  45. * Return the Identifier of the Minion to spawn.<BR><BR>
  46. */
  47. public int getMinionId()
  48. {
  49. return _minionId;
  50. }
  51. /**
  52. * Set the minimum of minions to amount.<BR><BR>
  53. *
  54. * @param amountMin The minimum quantity of this Minion type to spawn
  55. *
  56. */
  57. public void setAmountMin(int amountMin)
  58. {
  59. _minionAmountMin = amountMin;
  60. }
  61. /**
  62. * Set the maximum of minions to amount.<BR><BR>
  63. *
  64. * @param amountMax The maximum quantity of this Minion type to spawn
  65. *
  66. */
  67. public void setAmountMax(int amountMax)
  68. {
  69. _minionAmountMax = amountMax;
  70. }
  71. /**
  72. * Set the amount of this Minion type to spawn.<BR><BR>
  73. *
  74. * @param amount The quantity of this Minion type to spawn
  75. *
  76. */
  77. public void setAmount(int amount)
  78. {
  79. _minionAmount = amount;
  80. }
  81. /**
  82. * Return the amount of this Minion type to spawn.<BR><BR>
  83. */
  84. public int getAmount()
  85. {
  86. if (_minionAmountMax > _minionAmountMin)
  87. {
  88. _minionAmount = Rnd.get(_minionAmountMin, _minionAmountMax);
  89. return _minionAmount;
  90. }
  91. else
  92. {
  93. return _minionAmountMin;
  94. }
  95. }
  96. }