PcCondOverride.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. /**
  17. * @author UnAfraid
  18. */
  19. public enum PcCondOverride
  20. {
  21. MAX_STATS_VALUE(0, "Overrides maximum states conditions"),
  22. ITEM_CONDITIONS(1, "Overrides item usage conditions"),
  23. SKILL_CONDITIONS(2, "Overrides skill usage conditions"),
  24. ZONE_CONDITIONS(3, "Overrides zone conditions"),
  25. CASTLE_CONDITIONS(4, "Overrides castle conditions"),
  26. FORTRESS_CONDITIONS(5, "Overrides fortress conditions"),
  27. CLANHALL_CONDITIONS(6, "Overrides clan hall conditions"),
  28. FLOOD_CONDITIONS(7, "Overrides floods conditions"),
  29. CHAT_CONDITIONS(8, "Overrides chat conditions"),
  30. INSTANCE_CONDITIONS(9, "Overrides instance conditions"),
  31. QUEST_CONDITIONS(10, "Overrides quest conditions"),
  32. DEATH_PENALTY(11, "Overrides death penalty conditions"),
  33. DESTROY_ALL_ITEMS(12, "Overrides item destroy conditions"),
  34. SEE_ALL_PLAYERS(13, "Overrides the conditions to see hidden players"),
  35. TARGET_ALL(14, "Overrides target conditions"),
  36. DROP_ALL_ITEMS(15, "Overrides item drop conditions");
  37. private final int _mask;
  38. private final String _descr;
  39. private PcCondOverride(int id, String descr)
  40. {
  41. _mask = 1 << id;
  42. _descr = descr;
  43. }
  44. public int getMask()
  45. {
  46. return _mask;
  47. }
  48. public String getDescription()
  49. {
  50. return _descr;
  51. }
  52. public static PcCondOverride getCondOverride(int ordinal)
  53. {
  54. try
  55. {
  56. return values()[ordinal];
  57. }
  58. catch (Exception e)
  59. {
  60. return null;
  61. }
  62. }
  63. public static long getAllExceptionsMask()
  64. {
  65. long result = 0L;
  66. for (PcCondOverride ex : values())
  67. {
  68. result |= ex.getMask();
  69. }
  70. return result;
  71. }
  72. }