Advertisement
Sarada-L2

Correção TVT+CTF+DM PROTEÇÃO l2jBan Yo: Sarada

Dec 9th, 2020 (edited)
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. Index: net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java
  2.  
  3. +if(player.isInCTFEvent() && CTFEvent.isStarted() || player.isInTVTEvent() && TvTEvent.isStarted() || player.isInDMEvent() && DMEvent.isStarted())
  4. + {
  5. + player.sendMessage("You cannot logout while in CTF And TvT And DM Event!");
  6. + player.sendPacket(ActionFailed.STATIC_PACKET);
  7. + sendPacket(RestartResponse.valueOf(false));
  8. + return;
  9. + }
  10.  
  11. if ((player.isInArenaEvent() || player.isArenaProtection()) && ArenaTask.is_started())
  12. {
  13. player.sendMessage("You cannot logout while in Tournament Event!");
  14. player.sendPacket(ActionFailed.STATIC_PACKET);
  15. sendPacket(RestartResponse.valueOf(false));
  16. return;
  17. }
  18.  
  19. Index: net/sf/l2j/gameserver/network/clientpackets/Logout.java
  20.  
  21. +if(player.isInCTFEvent() && CTFEvent.isStarted() || player.isInTVTEvent() && TvTEvent.isStarted() || player.isInDMEvent() && DMEvent.isStarted())
  22. + {
  23. + player.sendMessage("You cannot Exit while in CTF And TvT And DM Event!");
  24. + player.sendPacket(ActionFailed.STATIC_PACKET);
  25. + sendPacket(RestartResponse.valueOf(false));
  26. + return;
  27. + }
  28.  
  29.  
  30. if (player.getActiveEnchantItem() != null)
  31. {
  32. player.sendPacket(ActionFailed.STATIC_PACKET);
  33. return;
  34. }
  35.  
  36.  
  37. Index: net/sf/l2j/gameserver/model/actor/Player.java
  38.  
  39. public boolean atEvent = false;
  40. public boolean atCTFEvent = false;
  41. public boolean atTVTEvent = false;
  42. +public boolean atDMEvent = false;
  43.  
  44. +public boolean isInDMEvent()
  45. + {
  46. + return (atDMEvent || (DMEvent.isStarted() && DMEvent.isPlayerParticipant(getObjectId())));
  47. + }
  48.  
  49. public boolean isInFunEvent()
  50. {
  51. return (atEvent || (TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(getObjectId())) || (CTFEvent.isStarted() && CTFEvent.isPlayerParticipant(getObjectId())));
  52. }
  53.  
  54. Index: net/sf/l2j/gameserver/network/clientpackets/UseItem.java
  55.  
  56. import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
  57. +import net.sf.l2j.gameserver.model.entity.events.capturetheflag.CTFEvent;
  58. +import net.sf.l2j.gameserver.model.entity.events.deathmatch.DMEvent;
  59. +import net.sf.l2j.gameserver.model.entity.events.teamvsteam.TvTEvent;
  60.  
  61.  
  62.  
  63. if (activeChar.isInsideZone(ZoneId.INVASION) && L2InvasionZone.isRestrictedItem(item.getItemId()))
  64. {
  65. activeChar.sendMessage(item.getName() + " cannot be used inside Tournament Invasion Zone.");
  66. return;
  67. }
  68.  
  69. +if ((item.getItemId() == 736 || item.getItemId() == 7117 || item.getItemId() == 7118 || item.getItemId() == 7119 || item.getItemId() == 7120 || item.getItemId() == 7121 || item.getItemId() == 7122 || item.getItemId() == 7123 || item.getItemId() == 7124 || item.getItemId() == 7121 || item.getItemId() == 7125 || item.getItemId() == 7126 || item.getItemId() == 7127 || item.getItemId() == 7128 || item.getItemId() == 7129 || item.getItemId() == 7130 || item.getItemId() == 7131 || item.getItemId() == 7132 || item.getItemId() == 7133 || item.getItemId() == 7134 || item.getItemId() == 7135 || item.getItemId() == 7554 || item.getItemId() == 7555 || item.getItemId() == 7556 || item.getItemId() == 7557 || item.getItemId() == 7558 || item.getItemId() == 7559 || item.getItemId() == 1538 || item.getItemId() == 1830 || item.getItemId() == 1829 || item.getItemId() == 3958 || item.getItemId() == 5858 || item.getItemId() == 5859 || item.getItemId() == 9156) && ((activeChar.isInTVTEvent() && TvTEvent.isStarted()) || (activeChar.isInCTFEvent() && CTFEvent.isStarted()) || (activeChar.isInDMEvent() && DMEvent.isStarted())))
  70. + {
  71. + activeChar.sendMessage("You can not use this item in TVT+DM+CTF Event..");
  72. + return;
  73. + }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement