Skip to content

PT/Clan and debuffs

Featured Replies

Hello all the purpose of this topic is that i don't know & trying to find out where to look for the correct source file(s) to make all debuffs like hex,curse gloom etc unable to be casted at party/clan members.

Any help will be appreciated and thanks in advance.

 

EDIT: I am using an INT l2j pack btw.

In IL, and from what I know, buffs and debuffs are the same thing. There are no differences between a buff and a debuff.

 

So except taking IDs of skills one by one and putting in a big "if" statement, I don't see.

 

About where to change that, and as all buff/debuffs are magic type, I think useMagic() method (L2PcInstance) would be fine. Do your check around this section (just after or before, don't matter, but do it here)

 

            // Check if the target is attackable
           if (!target.isAttackable() && (getAccessLevel() < Config.GM_PEACEATTACK))
		{
			// If target is not attackable, send a Server->Client packet ActionFailed
			sendPacket(new ActionFailed());
			return;
		}

 

So basically your check :

- is a return type (with a custom sendMessage if you want) ;

- must have any ID skill you want to ;

- must verify if the target is party/member.

 

In the isAutoAttackable() method, you got the "party" part.

 

The complete structure of code :

if ((skill || skill || skill) && (differentOfParty || differentOfClan))
{
// If target is not attackable, send a Server->Client packet ActionFailed
sendPacket(new ActionFailed());
return;
}

 

As "target" isn't surely a L2PcInstance you have to do a check too to see if it's a L2PcInstance or not, else it could bug if you hit a different type (except if you already saw a monster with a clan).

  • Author

Yeah thanks a lot, you were crystal clear,i am already working on it. :)

Yeah thanks a lot, you were crystal clear,i am already working on it. :)

You're welcomed, post errors logs / actual code if you got problems :).

  • Author

Hmm do you think that something like this will work?

 

L2PcInstance activeChar = getClient().getActiveChar();

if (activeChar == null)

return;

L2Object target = activeChar.getTarget();

if ((target.isAutoAttackable(activeChar) && target instanceof l2PcInstance) && (useSkill(id,target) || useSkill(id,target) || etc etc))

{

activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);

return;

}

 

Edit: Well it doesnt work,nvm.

Except the "return" part, it has nothing to do with the code structure I posted one week ago :p.

 

You have to check skillIds, so basically you have to make the list of all things you want to forbid, notes all their ids.

 

You can check too if "isDebuff()" exists in your pack. Just do an eclipse search with this name, if you got something it will be easier, else it's the boring way.

 

Try to understand what you copy paste, and why you copy paste it.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.