Skip to content

[Ψάχνω] PvP Protection System

Featured Replies

Καλησπέρα, ψάχνω για ένα pvp protection σαν του l2jfrozen.

 

Κάπως έτσι,

 

#====================================
# Anti Farm System
#====================================
# You must put True to active the AntiFarm mod.
AntiFarmEnabled = False
# You must active AntiFarmEnabled = True to enable this mod.
# AntiFarm for Party, IP, Clan and Ally.
AntiFarmParty = False
AntiFarmIP = False
AntiFarmClanAlly = False
# You must active AntiFarmEnabled = True to enable this mod.
# AntiFarm if player has level < AntiFarmMaxLvlDiff.
AntiFarmLvlDiff = False
AntiFarmMaxLvlDiff = 30
# You must active AntiFarmEnabled = True to enable this mod.
# AntiFarm if player has Pdef < AntiFarmMaxPdefDiff.
AntiFarmPdefDiff = False
AntiFarmMaxPdefDiff = 300
# You must active AntiFarmEnabled = True to enable this mod.
# AntiFarm if player has Patk < AntiFarmMaxPatkDiff.
AntiFarmPatkDiff = False
AntiFarmMaxPatkDiff = 300

 

Ψάχνω κάτι παρόμοιο για aCis, ευχαριστώ!

  • Author

  private boolean checkAntiFarm(L2PcInstance targetPlayer){

        if(Config.ANTI_FARM_ENABLED){

            //Anti FARM Clan - Ally
            if(Config.ANTI_FARM_CLAN_ALLY_ENABLED && (getClanId() > 0 && targetPlayer.getClanId() > 0 && getClanId() == targetPlayer.getClanId()) || (getAllyId() > 0 && targetPlayer.getAllyId() > 0 && getAllyId() == targetPlayer.getAllyId()))
            {
                this.sendMessage("Farm is punishable with Ban! Gm informed.");
                _log.warning("PVP POINT FARM ATTEMPT, " + this.getName() + " and " + targetPlayer.getName() +". CLAN or ALLY.");
                return false;
            }

            //Anti FARM level player < 40
            if(Config.ANTI_FARM_LVL_DIFF_ENABLED && targetPlayer.getLevel() < Config.ANTI_FARM_MAX_LVL_DIFF)
            {
                this.sendMessage("Farm is punishable with Ban! Don't kill new players! Gm informed.");
                _log.warning("PVP POINT FARM ATTEMPT, " + this.getName() + " and " + targetPlayer.getName() +". LVL DIFF.");
                return false;
            }

            //Anti FARM pdef < 300
            if(Config.ANTI_FARM_PDEF_DIFF_ENABLED && targetPlayer.getPDef(targetPlayer) < Config.ANTI_FARM_MAX_PDEF_DIFF)
            {
                this.sendMessage("Farm is punishable with Ban! Gm informed.");
                _log.warning("PVP POINT FARM ATTEMPT, " + this.getName() + " and " + targetPlayer.getName() +". MAX PDEF DIFF.");
                return false;
            }

            //Anti FARM p atk < 300
            if(Config.ANTI_FARM_PATK_DIFF_ENABLED && targetPlayer.getPAtk(targetPlayer) < Config.ANTI_FARM_MAX_PATK_DIFF)
            {
                this.sendMessage("Farm is punishable with Ban! Gm informed.");
                _log.warning("PVP POINT FARM ATTEMPT, " + this.getName() + " and " + targetPlayer.getName() +". MAX PATK DIFF.");
                return false;
            }

            //Anti FARM Party
            if(Config.ANTI_FARM_PARTY_ENABLED && this.getParty() != null
                    && targetPlayer.getParty() != null
                    && this.getParty().equals(targetPlayer.getParty()))
            {
                this.sendMessage("Farm is punishable with Ban! Gm informed.");
                _log.warning("PVP POINT FARM ATTEMPT, " + this.getName() + " and " + targetPlayer.getName() +". SAME PARTY.");
                return false;
            }

            //Anti FARM same Ip
            if(Config.ANTI_FARM_IP_ENABLED){

               if(this.getClient() != null && targetPlayer.getClient() != null)
               {
                 String ip1 = this.getClient().getConnection().getInetAddress().getHostAddress();
                 String ip2 = targetPlayer.getClient().getConnection().getInetAddress().getHostAddress();

                 if (ip1.equals(ip2))
                 {
                 this.sendMessage("Farm is punishable with Ban! Gm informed.");
                 _log.warning("PVP POINT FARM ATTEMPT: " + this.getName() + " and " + targetPlayer.getName() +". SAME IP.");
                 return false;
                 }
               }
            }
            return true;
        }
        return true;
    }

 

χρειάζεται να πάρω κάτι άλλο από άλλο αρχείο ή μόνο τα configs και είναι εντάξει?

den paizh na einai mono afta logika...

kane search sta source ph me ta config h antifeed

  • Author

den paizh na einai mono afta logika...

kane search sta source ph me ta config h antifeed

ξέρω, απλά βαριέμαι να κάνω checkout :p
  • Author

exw ena alla einai xoris config an to thes pes moy.

απλά πες μου πια αρχεία χρησιμοποιεί ο κώδικας.

 

μόνο l2pcinstance?

  • Author

σε όλο το l2jfrozen έχει μόνο τις γραμμές του l2pcinstance + config.

 

άρα είμαι okay, μπορείτε να κλειδώσετε!

 

ευχαριστώ, όσους βοήθησαν.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.