SHARE
TWEET

Untitled

a guest Aug 13th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private boolean checkConditions(L2PcInstance player)
  2.     {
  3.         final L2Party party = player.getParty();
  4.         if (party == null)
  5.         {
  6.             NpcHtmlMessage msg = new NpcHtmlMessage(0);
  7.             msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-01.htm");
  8.             player.sendPacket(msg);
  9.             player.sendPacket(new ExShowScreenMessage("You are not in party!", 3000));
  10.             return false;
  11.         }
  12.         if (party.getLeader() != player)
  13.         {
  14.             NpcHtmlMessage msg = new NpcHtmlMessage(0);
  15.             msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-02.htm");
  16.             player.sendPacket(msg);
  17.             player.sendPacket(new ExShowScreenMessage("You are not leading your party!", 3000));
  18.             return false;
  19.         }
  20.         if (party.getMemberCount() < 2)
  21.         {
  22.             NpcHtmlMessage msg = new NpcHtmlMessage(0);
  23.             msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-03.htm");
  24.             player.sendPacket(msg);
  25.             player.sendPacket(new ExShowScreenMessage("Your party must have at least 4 members!", 3000));
  26.             return false;
  27.         }
  28.         if (player.isNoble())
  29.         {
  30.             NpcHtmlMessage msg = new NpcHtmlMessage(0);
  31.             msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-04.htm");
  32.             player.sendPacket(msg);
  33.             player.sendPacket(new ExShowScreenMessage("You are already noblesse!", 3000));
  34.             return false;
  35.         }
  36.         if (player.getLevel() < 78)
  37.         {
  38.             NpcHtmlMessage msg = new NpcHtmlMessage(0);
  39.             msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-08.htm");
  40.             player.sendPacket(msg);
  41.             player.sendPacket(new ExShowScreenMessage("Your level is too low!", 3000));
  42.             return false;
  43.         }
  44.         L2ItemInstance item = player.getInventory().getItemByItemId(57);
  45.         if (item == null)
  46.         {
  47.             NpcHtmlMessage msg = new NpcHtmlMessage(0);
  48.             msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-09.htm");
  49.             player.sendPacket(msg);
  50.             player.sendPacket(new ExShowScreenMessage("You do not have required item!", 3000));
  51.             return false;
  52.         }
  53.          
  54.         for (final L2PcInstance partyMember : party.getPartyMembers())
  55.         {
  56.             if (partyMember.isNoble())
  57.             {
  58.                 NpcHtmlMessage msg = new NpcHtmlMessage(0);
  59.                 msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-05.htm");
  60.                 player.sendPacket(msg);
  61.                 player.sendPacket(new ExShowScreenMessage(partyMember.getName() + " is already noblesse. Your party cannot enter!", 3000));
  62.                 return false;
  63.             }
  64.             if (partyMember.getLevel() < 78)
  65.             {
  66.                 NpcHtmlMessage msg = new NpcHtmlMessage(0);
  67.                 msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-06.htm");
  68.                 player.sendPacket(msg);
  69.                 player.sendPacket(new ExShowScreenMessage(partyMember.getName() + "'s level is too low. Your party cannot enter!", 3000));
  70.                 return false;
  71.             }
  72.             if (!Util.checkIfInRange(1000, player, partyMember, true))
  73.             {
  74.                 NpcHtmlMessage msg = new NpcHtmlMessage(0);
  75.                 msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-07.htm");
  76.                 player.sendPacket(msg);
  77.                 player.sendPacket(new ExShowScreenMessage(partyMember.getName() + " is too far away. Your party cannot enter!", 3000));
  78.                 return false;
  79.             }
  80.            
  81.             L2ItemInstance item = partyMember.getInventory().getItemByItemId(57);
  82.             if (item == null)
  83.             {
  84.                 NpcHtmlMessage msg = new NpcHtmlMessage(0);
  85.                 msg.setFile(player.getHtmlPrefix(), "data/scripts/events/NoblesseInstance/999991-09.htm");
  86.                 player.sendPacket(msg);
  87.                 player.sendPacket(new ExShowScreenMessage("You do not have required item!", 3000));
  88.                 return false;
  89.             }
  90.            
  91.             final Long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), INSTANCEID);
  92.             if (System.currentTimeMillis() < reentertime)
  93.             {
  94.                 player.sendPacket(new ExShowScreenMessage("Test Me!", 3000));
  95.                 return false;
  96.             }
  97.         }
  98.         return true;
  99.     }
RAW Paste Data
Top