Attack problem

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
trantadoros33
Posts: 8
Joined: Wed Aug 22, 2007 1:13 pm

Attack problem

Post by trantadoros33 »

Hello all ,

i am trying to add the following code in doAttack in l2character but when the user tries to use skills they will land .. and i dont want skills to laund if both are nobled

Code: Select all

 if (((L2PcInstance) this).isnoble() && ((L2PcInstance) target).isnoble())     {      ((L2PcInstance) this).sendMessage("You cant attack a player which is noblesse.");      sendPacket(ActionFailed.STATIC_PACKET);     return;         }  
any solutions how to make them not being able to attack with skills as well?
User avatar
ZaKaX
Posts: 357
Joined: Thu Nov 22, 2007 6:28 am
Location: Somewhere in Asia.

Re: Attack problem

Post by ZaKaX »

Take a look under doCast. Btw, Java is case sensitive so isnoble() will not work, isNoble() will :)

P.S: Weird, very weird idea.
¿ Que dice los cojones de la nina ?
trantadoros33
Posts: 8
Joined: Wed Aug 22, 2007 1:13 pm

Re: Attack problem

Post by trantadoros33 »

ZaKaX wrote:Take a look under doCast. Btw, Java is case sensitive so isnoble() will not work, isNoble() will :)

P.S: Weird, very weird idea.
yeah my bad in syntax , its not the problem.

What about this ?

Code: Select all

 if(((L2PcInstance)this).isNoble() && (((L2PcInstance)target).isNoble() && skill.getSkillType() == L2SkillType.XX || skill.getSkillType() == L2SkillType.XX)) 
do you think it will work with those skilltypes?

XX = skillstypes.
trantadoros33
Posts: 8
Joined: Wed Aug 22, 2007 1:13 pm

Re: Attack problem

Post by trantadoros33 »

will my previous code in my previous post work?
User avatar
ZaKaX
Posts: 357
Joined: Thu Nov 22, 2007 6:28 am
Location: Somewhere in Asia.

Re: Attack problem

Post by ZaKaX »

Why don't you just try it? :shock:

Correct version....

Code: Select all

if(((L2PcInstance)this).isNoble() && ((L2PcInstance)target).isNoble() && (skill.getSkillType() == L2SkillType.XX || skill.getSkillType() == L2SkillType.XX))
¿ Que dice los cojones de la nina ?
trantadoros33
Posts: 8
Joined: Wed Aug 22, 2007 1:13 pm

Re: Attack problem

Post by trantadoros33 »

ZaKaX wrote:Why don't you just try it? :shock:

Correct version....

Code: Select all

if(((L2PcInstance)this).isNoble() && ((L2PcInstance)target).isNoble() && (skill.getSkillType() == L2SkillType.XX || skill.getSkillType() == L2SkillType.XX))
thanks , is there any easier way to tell them that they cannot use any skill if they try to ?
Post Reply