Jump to content
  • 0

PT/Clan and debuffs


Question

Posted

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.

5 answers to this question

Recommended Posts

  • 0
Posted

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).

  • 0
Posted

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.

  • 0
Posted

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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