Jump to content
  • 0

Void Useitem [While Clan Is Allready Level 8]


Question

Posted

Hello mates i (this is l2jfrozen pack)

 

I got this code  and i want to put an else if clan is allready level 8 on void but i dont know on this specific pack how to do it .. any idea? .. thanks

          public void useItem(L2PlayableInstance playable, L2ItemInstance item)
          {
                          if(!(playable instanceof L2PcInstance))
                                          return;
                          
                          if (item == null)
                          {
                                          return;
                          }
                                          
                          L2PcInstance player = (L2PcInstance)playable;
                          if (!player.isClanLeader())
                          {
                                          player.sendPacket(new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addItemName(item));
                                          return;
                          }
                          else if (player.isInOlympiadMode())
                          {
                                          player.sendPacket(new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addItemName(item));
                                          return;
                          }
                          else
                          {
                                          if(player.destroyItem("Consume", item.getObjectId(), 1, null, false))
                                          {
                                                          if (Config.ALLOW_ITEM_SET_LEVEL)
                                                          {
                                                                          player.getClan().changeLevel(Config.CLAN_ITEM_LEVEL);
                                                                          player.sendMessage((new StringBuilder()).append("Congratulations you now have your clan level ").append(Config.CLAN_ITEM_LEVEL).append(".").toString());
                                                          }
                                                          
                                                          if (Config.CLAN_TITLE)
                                                          {
                                                                          player.setTitle(Config.ADD_CLAN_TITLE);
                                                          }
                                                          
                                                          player.ClanItem();
                                          }
                          }
          }

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

after this,

 

else if (player.isInOlympiadMode())
{
player.sendPacket(new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addItemName(item));
return;
}

 

add

 

else if (player.getClan().getLevel() == 8 )
{
   player.sendPacket(new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addItemName(item));
   return;
}

Edited by Devlin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock