L2MinionData.java 2.5 KB

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