Welcome to MaxCheaters.com

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

  • 0

Help i need little bit of help


Go to solution Solved by Kara,

Question

Posted (edited)

Hello , i recently added a code to protect newbies from attack of other players,depends at level difference of players.

"player is getting skill(anchor)" when hit player with 10+ level difference.
but this is based on "TARGET" and player is also paralyzed when they use buff to other player with 10level difference.
I want to allow buffs to other players no matter the level difference .

code:

Spoiler

 public void newbieProtectionSystem (L2Character target)
 {
 if (L2Config.ENABLE_NEWBIE_PROTECTION_SYSTEM)
 {
 int targetLevel = target.getLevel ();
 int playerLevel = L2PcInstance.this.getLevel ();

 if (playerLevel - targetLevel> Config.PROTECTION_DIFFERENCE_LEVEL)
 {
 int skillId = Config.PROTECTION_SKILL_ID;
 int skillLevel = Config.PROTECTION_SKILL_LVL;

 L2Skill skill;
 skill = SkillTable.getInstance (). getInfo (skillId, skillLevel);
 if (skill != null)
 skill.getEffects (L2PcInstance.this, L2PcInstance.this);

 sendMessage (Config.PROTECTION_MESSAGE);

 return;
}

i could add restriction skill ids but i think is simplier way than add every skill id :/ .

 

L2jfrozen last rev


Thanks in advance!

 

Edited by Irrelevant

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
  • Solution

First of all when you compare level use Math.abs() to avoid negative values such as:

 

if (Math.abs(actor.getLevel() - target.getLevel()) > Config.PROTECTION_DIFFERENCE_LEVEL)
{
  //Executed code 
}

 

Second, i don't really get failed to do. Why don't you simply interrupt any attack/spell in L2Playable.java -> onIntentionCast() and onIntentionAttack() and you make it that way?

Share this post


Link to post
Share on other sites
  • 0
2 minutes ago, Kara said:

First of all when you compare level use Math.abs() to avoid negative values such as:

 


if (Math.abs(actor.getLevel() - target.getLevel()) > Config.PROTECTION_DIFFERENCE_LEVEL)
{
  //Executed code 
}

 

Second, i don't really get failed to do. Why don't you simply interrupt any attack/spell in L2Playable.java -> onIntentionCast() and onIntentionAttack() and you make it that way?

i didnt even though about it :P ,i will try and tag you here if i cant or stacked :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.