Jump to content
  • 0

[HELP] help for this pls


Question

Posted

i there i will add a config like

 

100 PvP & 100 PK = Noble.

 

so just dont know how make the double check i tryed like this :

 

public void increasePvpKills(L2Character target)

{

if (target instanceof L2PcInstance

&& AntiFeedManager.getInstance().check(this, target))

{

// Add karma to attacker and increase its PK counter

setPvpKills(getPvpKills() + 1);

 

if (Config.ALLOWNOBLEPVPPK)

{

increaseNoblekills(getPvpKills());

broadcastUserInfo();

};

 

// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter

sendPacket(new UserInfo(this));

sendPacket(new ExBrExtraUserInfo(this));

}

}

 

and pvp :

 

public void increasePkKillsAndKarma(L2Character target)

{

int baseKarma           = Config.KARMA_MIN_KARMA;

int newKarma            = baseKarma;

int karmaLimit          = Config.KARMA_MAX_KARMA;

 

int pkLVL               = getLevel();

int pkPKCount           = getPkKills();

 

int targLVL             = target.getLevel();

 

int lvlDiffMulti = 0;

int pkCountMulti = 0;

 

// Check if the attacker has a PK counter greater than 0

if (pkPKCount > 0)

pkCountMulti = pkPKCount / 2;

else

pkCountMulti = 1;

 

if (pkCountMulti < 1)

pkCountMulti = 1;

 

// Calculate the level difference Multiplier between attacker and killed L2PcInstance

if (pkLVL > targLVL)

lvlDiffMulti = pkLVL / targLVL;

else

lvlDiffMulti = 1;

 

if (lvlDiffMulti < 1)

lvlDiffMulti = 1;

 

// Calculate the new Karma of the attacker : newKarma = baseKarma*pkCountMulti*lvlDiffMulti

newKarma *= pkCountMulti;

newKarma *= lvlDiffMulti;

 

// Make sure newKarma is less than karmaLimit and higher than baseKarma

if (newKarma < baseKarma)

newKarma = baseKarma;

if (newKarma > karmaLimit)

newKarma = karmaLimit;

 

// Fix to prevent overflow (=> karma has a  max value of 2 147 483 647)

if (getKarma() > (Integer.MAX_VALUE - newKarma))

newKarma = Integer.MAX_VALUE - getKarma();

 

// Add karma to attacker and increase its PK counter

setKarma(getKarma() + newKarma);

if (target instanceof L2PcInstance

&& AntiFeedManager.getInstance().check(this, target))

setPkKills(getPkKills() + 1);

 

if (Config.ALLOWNOBLEPVPPK)

{

increaseNoblekills(getPkKills());

broadcastUserInfo();

};

 

// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter

sendPacket(new UserInfo(this));

sendPacket(new ExBrExtraUserInfo(this));

}

 

public void increaseNoblekills(int i)

{

if (getPvpKills() == (Config.PVPNOBLE) && getPkKills() == (Config.PKNOBLE));

setNoble(true);

sendMessage("Congratulations you Reached "+ Config.PVPNOBLE +" PvPs and "+ Config.PKNOBLE +" PKs and Recived Nobless");

}

 

 

the orange thing is no error but if he get 100 pvps and have 0 pk they get the noble so what i have todo ?

 

in config i have 100 pvp  & 100 pk.

 

thanks for help

 

 

 

14 answers to this question

Recommended Posts

  • 0
Posted

let me ask something.

you want to make a system which if character take 100 pvp and 100 pk then he will be noblesse?

  • 0
Posted

in increaseNoblekills

change that if to

if(getPvpKills()>=(Config.PVPNOBLE)&&getPkKills()>=(Config.PKNOBLE));{

setNoble(true);

sendMessage("Congratulations you Reached "+ Config.PVPNOBLE +" PvPs and "+ Config.PKNOBLE +" PKs and Recived Nobless");

}

 

also u can do check if player isnt nobles atm

 

thats all, check it, tell me if its working :)

  • 0
Posted

what exactly is not working with it? its still like before that every1 who have just 100+ pvps are getting nobles even with having 0 pks or what?

  • 0
Posted

are u sure that they are getting blessing of nobless and all things that nobless is giving and not only the message? also check if this config is working good, if its tested and its still not working good then delete line setNoble(true); and check if they are getting noblesses(just to see if this is giving it and not something else), if u did that and they are not getting noblesses anymore then i dont know :/

  • 0
Posted

thats the problem at the stats 2pvp 0 pk they get noble and the message so anything will not really check

 

maybe the part of getPvpKills and getPkKills

 

becurse the NobleKills is in increasePvpKills and in increasePkKills.

 

so someone can help me

  • 0
Posted

write there something like:

System.out.println("1"+getPvpKills());

System.out.println("2"+getPkKills());

System.out.println("3"+Config.PKNOBLE);

System.out.println("4"+Config.PVPNOBLE);

thats what i always do to check something :)

later in console check the numbers they return

  • 0
Posted

First it should be

 

public void increaseNoblekills()
  {
     if ((getPvpKills() == (Config.PVPNOBLE)) && (getPkKills() == (Config.PKNOBLE)));
     {
        setNoble(true);
        sendMessage("Congratulations you Reached "+ Config.PVPNOBLE +" PvPs and "+ Config.PKNOBLE +" PKs and Recived Nobless");
     }
  }

 

-----

 

Second, your code means : if you get 100 pvp and 100 pks, go noble. You think it's good but it's not. Your code doesn't think about if one value is higher than that. Your condition can be fill ONLY IF BOTH PVP/PKKILLS = 100, which is nearly impossible to do.

 

So rethink your idea better cause it's crappy atm :).

 

Instead of == use >= for both pks and pvp stuff.

 

public void increaseNoblekills()
  {
     if ((getPvpKills() >= (Config.PVPNOBLE)) && (getPkKills() >= (Config.PKNOBLE)));
     {
        setNoble(true);
        sendMessage("Congratulations, you reached "+ Config.PVPNOBLE +" PvPs and "+ Config.PKNOBLE +" PKs and received Noblesse status.");
     }
  }

 

-----

 

Third you don't need to do that : increaseNoblekills(int i), as i is never used. Clean both increaseNoblekills(getPvpKills()); for increaseNoblekills();

  • 0
Posted

mine:

if(getPvpKills()>=(Config.PVPNOBLE)&&getPkKills()>=(Config.PKNOBLE));{
setNoble(true);
sendMessage("Congratulations you Reached "+ Config.PVPNOBLE +" PvPs and "+ Config.PKNOBLE +" PKs and Recived Nobless");
}

yours

      if ((getPvpKills() >= (Config.PVPNOBLE)) && (getPkKills() >= (Config.PKNOBLE)));
      {
         setNoble(true);
         sendMessage("Congratulations, you reached "+ Config.PVPNOBLE +" PvPs and "+ Config.PKNOBLE +" PKs and received Noblesse status.");
      }

its same but nvm

  • 0
Posted
Third you don't need to do that : increaseNoblekills(int i), as i is never used. Clean both increaseNoblekills(getPvpKills()); for increaseNoblekills();

 

if i add this with getpvpkills than he dont check pks

 

or i am wrong ?

  • 0
Posted

mine:

if(getPvpKills()>=(Config.PVPNOBLE)&&getPkKills()>=(Config.PKNOBLE));{
setNoble(true);
sendMessage("Congratulations you Reached "+ Config.PVPNOBLE +" PvPs and "+ Config.PKNOBLE +" PKs and Recived Nobless");
}

yours

     if ((getPvpKills() >= (Config.PVPNOBLE)) && (getPkKills() >= (Config.PKNOBLE)));
     {
        setNoble(true);
        sendMessage("Congratulations, you reached "+ Config.PVPNOBLE +" PvPs and "+ Config.PKNOBLE +" PKs and received Noblesse status.");
     }

its same but nvm

 

Use code tags then I will see your code next time :D.

 

And red, you're wrong.

 

About the fact it doesn't works, verify if your lovely config is set to True and not False. It has no reason to don't work.

 

The broadcastUserInfo has to be put in the increaseNoblekills() method aswell. It's called anytime else.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • 📌 FORUM RULES (Revised – Legal Compliant) Η χρήση του forum προϋποθέτει την πλήρη αποδοχή των παρακάτω κανόνων. Οποιαδήποτε παραβίαση ενδέχεται να οδηγήσει σε περιορισμούς ή μόνιμο αποκλεισμό. 1. Spam & Κατάχρηση Δημοσιεύσεων Το spam απαγορεύεται. Μονολεκτικές, άσχετες ή πολλαπλές διαδοχικές δημοσιεύσεις δεν επιτρέπονται. Bumping επιτρέπεται μόνο στο Marketplace, μία φορά κάθε 24 ώρες. Απάντηση σε θέματα παλαιότερα των 6 μηνών δεν επιτρέπεται. Σχόλια τύπου «wrong section», «request lock» κ.λπ. απαγορεύονται — χρησιμοποιήστε το Report Section. 2. Συμπεριφορά & Τάξη Απαγορεύονται: βρισιές, trolling, drama, απειλές, ρατσισμός, flame posts. Οι κανόνες συμπεριφοράς ισχύουν και σε PMs, profile comments και λοιπές περιοχές. Πολιτικά θέματα επιτρέπονται μόνο εντός λογικών και πολιτισμένων ορίων. 3. Απαγορευμένο & Ακατάλληλο Περιεχόμενο Απαγορεύεται αυστηρά η δημοσίευση ή αναζήτηση περιεχομένου που είναι: Παράνομο βάσει ισχύουσας νομοθεσίας Πειρατικό (warez, cracks, serials, pirated software) Σεξουαλικό, πορνογραφικό ή βίαιο Προσβλητικό, ρατσιστικό ή εξτρεμιστικό Θρησκευτικά προκλητικό με σκοπό την ένταση ➡️ Όλα τα παραπάνω διαγράφονται άμεσα, χωρίς προειδοποίηση. 4. Διαφημίσεις & Προώθηση Απαγορεύεται κάθε μορφή διαφήμισης χωρίς έγκριση Administrator. Απαγορεύεται η προώθηση παράνομων ή μη αδειοδοτημένων υπηρεσιών. Affiliate links, referral systems και external promotions απαιτούν έγκριση. 5. Γλώσσα & Παρουσίαση Μην αναμειγνύετε γλώσσες (αγγλικά σε ελληνικά topics και αντίστροφα). Χρησιμοποιείτε tags [GR] ή [EN]. Τα Greeklish επιτρέπονται προσωρινά, ωστόσο προτιμάται η χρήση ελληνικών χαρακτήρων. 6. Credits & Πνευματικά Δικαιώματα Υποχρεωτική αναφορά πηγών και credits. Απαγορεύεται η αναδημοσίευση περιεχομένου χωρίς άδεια. Κάθε χρήστης είναι υπεύθυνος για τα δικαιώματα του περιεχομένου που δημοσιεύει. 7. Κυβερνοεγκλήματα & Επιβλαβείς Πρακτικές Απαγορεύεται αυστηρά: Hacking, DDoS, flooding, botnets, booters Οδηγίες, εργαλεία ή καθοδήγηση για παράνομες ψηφιακές επιθέσεις Αναζήτηση ή πώληση τέτοιων υπηρεσιών 8. Υπογραφές (Signatures) Μέγιστο μέγεθος: 800x300 pixels. Υπογραφές που παραβιάζουν τους κανόνες αφαιρούνται. 9. Λογαριασμοί & Ασφάλεια Ένας λογαριασμός ανά χρήστη. Κλεμμένοι, κοινόχρηστοι ή πολλαπλοί λογαριασμοί απαγορεύονται. Το forum διατηρεί το δικαίωμα άμεσης διαγραφής λογαριασμών. 10. Σεβασμός προς το Staff Υποτίμηση, απειλές ή προσβολές προς staff δεν γίνονται ανεκτές. Για διαφωνίες ή παραβάσεις χρησιμοποιήστε το Report Section. LEGAL POLICY (Updated – Strict Compliance) 1. Νομιμότητα Περιεχομένου Απαγορεύεται κάθε περιεχόμενο που: Παραβιάζει νόμους ή κανονισμούς Παραβιάζει copyright ή intellectual property Προωθεί παράνομες οικονομικές, τραπεζικές ή επενδυτικές υπηρεσίες Σχετίζεται με απάτη, phishing, money laundering 2. DMCA – Copyright Protection Το forum συμμορφώνεται πλήρως με τον DMCA. Έγκυρες αναφορές οδηγούν σε άμεση αφαίρεση περιεχομένου. Επαναλαμβανόμενες παραβιάσεις = μόνιμος αποκλεισμός. 3. AML / Financial Compliance Απαγορεύεται περιεχόμενο σχετικό με ξέπλυμα χρήματος. Απαγορεύεται η προώθηση μη αδειοδοτημένων χρηματοοικονομικών υπηρεσιών. Δεν παρέχεται καμία οικονομική ή επενδυτική συμβουλή. 4. User-Generated Content & Ευθύνη Όλο το περιεχόμενο δημιουργείται από τους χρήστες. Το forum δεν φέρει νομική ευθύνη, αλλά: Παρακολουθεί Διαγράφει Συμμορφώνεται με τον νόμο 5. AI Moderation Χρησιμοποιούνται AI-based εργαλεία για εντοπισμό παραβάσεων. Η τελική απόφαση λαμβάνεται πάντα από άνθρωπο. 6. Τελικές Διατάξεις Οι κανόνες μπορούν να τροποποιηθούν χωρίς προειδοποίηση. Η χρήση του forum συνεπάγεται αποδοχή όλων των πολιτικών. Η άγνοια των κανόνων δεν αποτελεί δικαιολογία.   ΠΟΛΙΤΙΚΗ ΑΠΟΡΡΗΤΟΥ (Privacy Policy) – Ελληνικά Η παρούσα Πολιτική Απορρήτου περιγράφει τον τρόπο με τον οποίο το forum συλλέγει, χρησιμοποιεί και προστατεύει τα προσωπικά δεδομένα των χρηστών του, σύμφωνα με τον Γενικό Κανονισμό Προστασίας Δεδομένων (GDPR – ΕΕ 2016/679). 1. Συλλογή Δεδομένων Το forum ενδέχεται να συλλέγει τα ακόλουθα δεδομένα: Όνομα χρήστη (username) Διεύθυνση email IP address Ημερομηνία και ώρα σύνδεσης Περιεχόμενο δημοσιεύσεων (posts, topics, private messages) Δεν συλλέγονται ευαίσθητα προσωπικά δεδομένα. 2. Χρήση Δεδομένων Τα δεδομένα χρησιμοποιούνται αποκλειστικά για: Τη λειτουργία και ασφάλεια του forum Τη διαχείριση λογαριασμών Τη βελτίωση της εμπειρίας χρήσης Την πρόληψη κατάχρησης, απάτης ή παράνομων ενεργειών Τη συμμόρφωση με νομικές υποχρεώσεις 3. User-Generated Content Όλο το περιεχόμενο που δημοσιεύεται στο forum δημιουργείται από τους χρήστες. Οι χρήστες φέρουν την αποκλειστική ευθύνη για τα δεδομένα που επιλέγουν να δημοσιεύσουν. 4. Cookies Το forum χρησιμοποιεί cookies μόνο για: Διατήρηση σύνδεσης χρήστη Βασική λειτουργικότητα Ασφάλεια Δεν χρησιμοποιούνται cookies για διαφημιστική παρακολούθηση τρίτων. 5. AI & Αυτοματοποιημένη Επεξεργασία Το forum ενδέχεται να χρησιμοποιεί αυτοματοποιημένα ή AI-based εργαλεία για: Ανίχνευση spam Εντοπισμό παραβιάσεων κανόνων ή παράνομου περιεχομένου ➡️ Οι αποφάσεις επιβολής λαμβάνονται πάντα από άνθρωπο. 6. Κοινοποίηση Δεδομένων Τα προσωπικά δεδομένα: Δεν πωλούνται Δεν διαμοιράζονται με τρίτους Εξαίρεση υπάρχει μόνο εφόσον απαιτείται από τον νόμο ή αρμόδιες αρχές. 7. Δικαιώματα Χρηστών (GDPR) Οι χρήστες έχουν δικαίωμα: Πρόσβασης στα δεδομένα τους Διόρθωσης ή διαγραφής Περιορισμού επεξεργασίας Υποβολής αιτήματος διαγραφής λογαριασμού 8. Ασφάλεια Δεδομένων Λαμβάνονται εύλογα τεχνικά και οργανωτικά μέτρα για την προστασία των δεδομένων, ωστόσο καμία πλατφόρμα δεν είναι απολύτως ασφαλής. 9. Τροποποιήσεις Η παρούσα πολιτική μπορεί να τροποποιηθεί χωρίς προηγούμενη ειδοποίηση. Η συνέχιση χρήσης του forum συνιστά αποδοχή των αλλαγών. ✅ Σημείωση Οποιοδήποτε παράνομο περιεχόμενο δεν επιτρέπεται πουθενά στο forum, ανεξαρτήτως ρόλου, πρόσβασης ή status (VIP / Donator / Staff). 📌 FORUM RULES (English – Legal Compliant) By accessing or using this forum, you agree to comply with the following rules. Violations may result in warnings, restrictions, or permanent account termination. 1. Spam & Abuse Spam is strictly prohibited. One-word, low-effort, off-topic, or consecutive posts are not allowed. Bumping is allowed only in the Marketplace, once every 24 hours. Replying to topics older than 6 months is not permitted. Posts such as “wrong section”, “request lock”, etc. are not allowed — use the Report Section instead. 2. Conduct & Behavior Insults, harassment, trolling, threats, racism, flame posts, and toxic behavior are prohibited. These rules apply to all areas, including private messages and profile comments. Political discussions are allowed only within reasonable and respectful limits. 3. Prohibited & Illegal Content The following content is strictly prohibited anywhere on the forum: Any content that violates applicable laws or regulations Pirated software, warez, cracks, serials, or copyright-infringing material Malware, hacking tools, exploits, or harmful code Sexual, pornographic, violent, or extremist material Hate speech, discrimination, or incitement Content intended to provoke religious or social conflict ➡️ Such content will be removed immediately, without notice. 4. Advertising & Promotion Advertising of any kind requires prior administrator approval. Promotion of illegal or unlicensed services is strictly forbidden. Affiliate links, referral systems, and external promotions require approval. 5. Language & Formatting Do not mix languages (English in non-English topics and vice versa). Use [GR] or [EN] tags when creating a topic. Greeklish is temporarily allowed, but native characters are preferred. 6. Credits & Intellectual Property Proper credit must be given when using third-party content. Reposting content without permission is prohibited. Users are solely responsible for the intellectual property rights of their posts. 7. Cybercrime & Harmful Activities Strictly prohibited: Hacking, DDoS, flooding, botnets, booters Requests, guides, tools, or services related to cyber attacks Buying, selling, or searching for such services 8. Signatures Maximum allowed size: 800x300 pixels. Non-compliant signatures will be removed. 9. Accounts & Security One account per user is allowed. Stolen, shared, or multiple accounts are prohibited. The forum reserves the right to suspend or delete accounts immediately. 10. Respect Toward Staff Disrespect, threats, or harassment toward moderators or administrators will not be tolerated. Use the Report Section to address issues. ⚖️ LEGAL POLICY (English – Strict Compliance) This policy defines the legal framework governing forum operation. 1. User-Generated Content & Liability All content is created by users. The forum and its staff are not legally responsible for user-generated content. Reasonable efforts are made to monitor, review, and remove unlawful material. 2. Legal Compliance Content that violates: Local, national, or international laws Intellectual property rights Terms of third-party services is strictly prohibited. 3. DMCA – Copyright Policy The forum complies fully with the Digital Millennium Copyright Act (DMCA). Valid takedown requests result in prompt content removal. Repeat copyright offenders will be permanently banned. 4. AML – Anti-Money Laundering Prohibited content includes: Money laundering schemes or instructions Fraud, scams, or financial manipulation Promotion of unlicensed or illegal financial services The forum cooperates with authorities when legally required. 5. FCS – Financial & Compliance Services The forum does not provide financial, investment, or legal advice. Promotion of unregulated banking, investment, or financial services is forbidden. 6. Privacy & GDPR Publishing personal data of others is prohibited. Sharing private communications without consent is forbidden. The forum operates in compliance with GDPR regulations. 7. AI-Assisted Moderation Automated and AI-based tools may be used to detect violations. All enforcement actions involve human review. 8. Final Provisions Policies may be updated without prior notice. Continued use of the forum constitutes acceptance of all rules. Ignorance of the rules is not an excuse. PRIVACY POLICY – English Version This Privacy Policy explains how the forum collects, uses, and protects user data, in accordance with the General Data Protection Regulation (GDPR – EU 2016/679). 1. Data Collection The forum may collect the following data: Username Email address IP address Login timestamps User-generated content (posts, topics, private messages) No sensitive personal data is intentionally collected. 2. Use of Data Data is used solely for: Forum operation and security Account management Improving user experience Preventing abuse, fraud, or illegal activity Legal and regulatory compliance 3. User-Generated Content All content posted on the forum is created by users. Users are solely responsible for any personal data they choose to publish. 4. Cookies Cookies are used only for: Session management Essential functionality Security purposes No third-party advertising or tracking cookies are used. 5. AI & Automated Processing The forum may use automated or AI-assisted tools to: Detect spam Identify rule violations or illegal content ➡️ All enforcement decisions are subject to human review. 6. Data Sharing Personal data is: Not sold Not shared with third parties Except where required by law or competent authorities. 7. User Rights (GDPR) Users have the right to: Access their personal data Request correction or deletion Request restriction of processing Request account deletion 8. Data Security Reasonable technical and organizational measures are implemented to protect data. However, no online platform can guarantee absolute security. 9. Policy Updates This policy may be updated at any time without prior notice. Continued use of the forum constitutes acceptance of the updated policy. ✅ Final Note If you have concerns regarding privacy or data protection, please contact the forum administration. ✅ Important Notice Illegal content is not allowed anywhere on the forum, regardless of user role, status, or access level.
    • Hello everyone, This topic has been created to report any content that is considered illegal under applicable law or in violation of the forum rules. This includes, but is not limited to: Illegal software (pirated, cracked, or unauthorized software) Copyright-infringing material Malware, viruses, or any harmful code Scams, fraud, phishing attempts, or impersonation Illegal banking or financial services Money laundering activities or related instructions Any other illegal, unethical, or rule-violating activity — you name it If you encounter any such content, please report it here so it can be reviewed and removed promptly. Legal Disclaimer All content published on this forum is created and posted by its users. The forum administration does not take responsibility for user-generated content. However, we make every reasonable effort to monitor, review, remove, and maintain the forum by deleting illegal or rule-violating content as soon as it is reported or identified. By using this forum, you acknowledge and agree to these terms.     Moderator Notice We would like to inform all users that we are currently developing a custom AI-powered API tool that will assist our moderation team in scanning the forum database for illegal or rule-violating activity. This system will be used strictly as a support tool to help identify potentially problematic content, which will then be reviewed by human moderators before any action is taken. The goal is to improve forum safety, compliance, and response time while maintaining fairness and transparency. 🚧 Coming soon — more details will be shared once the system is ready. Thank you for your cooperation and for helping us keep the forum clean and lawful.
    • Reporting Illegal or Rule-Violating Content (post here)
    • If anyone is reading this, until we find the 488 protocol system that works with AuthD + Authgated from High Five (HF), just use L2Filter included in the leak as the login server to be able to play. hAuthd does not works with this chronicle, @Hint. do you happen to know about this?   Be aware of the system you use! If UseEMailAccount is set as true in l2.ini, your user_info table linked to your account must have email column not NULL with a valid e-mail, and you will use that e-mail to login instead of the account name. (Post merged)   OKAY! Nevermind about the above, I just figured it out, AuthD and Authgated from HF requires GameGuard to be enabled and UseEMailAccount set to false. Enable GameGuard at server side as per Fyyre instructions,  Add the missing GameGuard files in your client system: https://mega.nz/file/xZMWQBjK#triEj7My9B9roiLqAKk32HOLcLmPynoOm-QhBI_Ligw
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock