Jump to content
  • 0

PT/Clan and debuffs


Clive

Question

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.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

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