L2MinionData.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (C) 2004-2013 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.model;
  20. import com.l2jserver.util.Rnd;
  21. /**
  22. * 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.
  23. */
  24. public class L2MinionData
  25. {
  26. /** The Identifier of the L2Minion to spawn */
  27. private int _minionId;
  28. /** The number of this Minion Type to spawn */
  29. private int _minionAmount;
  30. private int _minionAmountMin;
  31. private int _minionAmountMax;
  32. /**
  33. * Set the Identifier of the Minion to spawn.
  34. * @param id The L2Character Identifier to spawn
  35. */
  36. public void setMinionId(int id)
  37. {
  38. _minionId = id;
  39. }
  40. /**
  41. * @return the Identifier of the Minion to spawn.
  42. */
  43. public int getMinionId()
  44. {
  45. return _minionId;
  46. }
  47. /**
  48. * Set the minimum of minions to amount.
  49. * @param amountMin The minimum quantity of this Minion type to spawn
  50. */
  51. public void setAmountMin(int amountMin)
  52. {
  53. _minionAmountMin = amountMin;
  54. }
  55. /**
  56. * Set the maximum of minions to amount.
  57. * @param amountMax The maximum quantity of this Minion type to spawn
  58. */
  59. public void setAmountMax(int amountMax)
  60. {
  61. _minionAmountMax = amountMax;
  62. }
  63. /**
  64. * Set the amount of this Minion type to spawn.
  65. * @param amount The quantity of this Minion type to spawn
  66. */
  67. public void setAmount(int amount)
  68. {
  69. _minionAmount = amount;
  70. }
  71. /**
  72. * @return the amount of this Minion type to spawn.
  73. */
  74. public int getAmount()
  75. {
  76. if (_minionAmountMax > _minionAmountMin)
  77. {
  78. _minionAmount = Rnd.get(_minionAmountMin, _minionAmountMax);
  79. return _minionAmount;
  80. }
  81. return _minionAmountMin;
  82. }
  83. }