PcCondOverride.java 2.3 KB

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