L2MinionData.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. public class L2MinionData
  26. {
  27. /** The Identifier of the L2Minion */
  28. private int _minionId;
  29. /** The number of this Minion Type to spawn */
  30. private int _minionAmount;
  31. private int _minionAmountMin;
  32. private int _minionAmountMax;
  33. /**
  34. * Set the Identifier of the Minion to spawn.<BR><BR>
  35. *
  36. * @param if The L2Character Identifier to spawn
  37. *
  38. */
  39. public void setMinionId(int id)
  40. {
  41. _minionId = id;
  42. }
  43. /**
  44. * Return the Identifier of the Minion to spawn.<BR><BR>
  45. */
  46. public int getMinionId()
  47. {
  48. return _minionId;
  49. }
  50. /**
  51. * Set the minimum of minions to amount.<BR><BR>
  52. *
  53. * @param amountMin The minimum quantity of this Minion type to spawn
  54. *
  55. */
  56. public void setAmountMin(int amountMin)
  57. {
  58. _minionAmountMin = amountMin;
  59. }
  60. /**
  61. * Set the maximum of minions to amount.<BR><BR>
  62. *
  63. * @param amountMax The maximum quantity of this Minion type to spawn
  64. *
  65. */
  66. public void setAmountMax(int amountMax)
  67. {
  68. _minionAmountMax = amountMax;
  69. }
  70. /**
  71. * Set the amount of this Minion type to spawn.<BR><BR>
  72. *
  73. * @param amount The quantity of this Minion type to spawn
  74. *
  75. */
  76. public void setAmount(int amount)
  77. {
  78. _minionAmount = amount;
  79. }
  80. /**
  81. * Return the amount of this Minion type to spawn.<BR><BR>
  82. */
  83. public int getAmount()
  84. {
  85. if (_minionAmountMax > _minionAmountMin)
  86. {
  87. _minionAmount = Rnd.get(_minionAmountMin, _minionAmountMax);
  88. return _minionAmount;
  89. }
  90. return _minionAmountMin;
  91. }
  92. }