Jump to content
  • 0

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

2 answers to this question

Recommended Posts

  • 0
Posted

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?

  • 0
Posted
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 :)

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.



  • Posts

    • Γεια σε ολους, προσπαθω εδω και 2 μερες να κανω αυτο το πραγμα να λειτουργει. το καταφερα για ενα διαστημα 5 ωρων. αλλα φαινεται οτι το discord μου κανει block to dll. ή κατι αλλο που δεν μπορω να ειμαι σιγουρος για το τι φταιει... αν καποιος γνωριζει κατι ας στειλει ενα pm να το δουμε μαζι.  *το source το εφιαξα εγω. https://youtu.be/kMvrbo9VBZc  ενα βιντεο που δειχνει πως δουλευε πριν σταματησει να δουλευει...   
    • thank you, please move to the desired category
    • wrong section, you need move this post to https://maxcheaters.com/forum/72-marketplace-l2packs-files/
    • Unlock Unlimited Access with GoProxy's Residential Proxies!   Experience seamless, secure, and unrestricted connectivity worldwide with GoProxy's Unlimited Residential Proxies. Our service offers access to a global network of rotating residential IPs, ensuring top performance for your large-scale data collection, streaming, and more.     ✔️Unlimited Traffic & IPs: Enjoy unrestricted access with our rotating residential proxies, delivering high performance through a vast global IP pool. ✔️High Success Rate: Achieve a 99.96% success rate with a rapid 0.6-second response time, ensuring efficient and reliable operations. ✔️Flexible Sessions: Customize IP rotation to fit your project needs, with options for automatic rotation and sticky sessions lasting up to 60 minutes. ✔️Global Coverage: Access IPs from over 120 countries, making it ideal for businesses requiring high bandwidth without region-specific constraints.     All plans include unlimited traffic and IPs, unlimited concurrent requests, and access to real residential IP addresses. Elevate your online operations with GoProxy's Unlimited Residential Proxies—your smart choice for large-scale projects.   👉 Learn more and get started today: GoProxy Unlimited Proxies
  • Topics

×
×
  • Create New...