Page 1 of 1

Attack problem

Posted: Sun Jun 14, 2009 6:01 pm
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?

Re: Attack problem

Posted: Sun Jun 14, 2009 6:04 pm
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.

Re: Attack problem

Posted: Mon Jun 15, 2009 4:36 am
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.

Re: Attack problem

Posted: Wed Jun 17, 2009 5:04 am
by trantadoros33
will my previous code in my previous post work?

Re: Attack problem

Posted: Wed Jun 17, 2009 8:36 am
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))

Re: Attack problem

Posted: Thu Jun 18, 2009 11:17 am
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 ?