Jump to content

Recommended Posts

Posted (edited)

Hello.

 

This is a PvP protection system I made a while ago (1-2 years ago).

 

Basically what it is: If a player kills someone 4 consecutive times in a row without 10 seconds passing between each kill, a protection from the killer to the victim is added which means for the next 15 minutes, the killer will not get any rewards from killing the victim (rewards like pvp point and maybe other customs addons you have like on-kill reward). There are also checks for same clan, same ally and same ip. GMs are excluded from the protection.

 

If you find any issues reply here and I will fix them. There are NO CONFIGS, everything is hardcoded but it's basically 3 numbers that you can change on the code.

 

Ignore the l2spike package on PvpProtection class, add it anywhere and change it.

 

I know it can be improved to avoid many tasks, I will do it soon and update the topic.

 

http://pastebin.com/B9W2neb1

 

Use this one (avoid having many tasks by checking the time of each kill): http://pastebin.com/JD1igS6t

 

Also, in L2PcInstance, find setPvpKills(getPvpKills()+1) and ABOVE it add:

		if (PvpProtection.getInstance().protectionExists(this, targetPlayer))
		{
			sendMessage("You did not get any rewards from this kill.");
			return;
		}
		PvpProtection.getInstance().checkKill(this, targetPlayer);

And in GameServer add:

PvpProtection.getInstance();

It was coded on aCis (can't remember revision).

Edited by An4rchy
Posted (edited)

Don't forget AoE

This system checks player -> player kills, so aoe would still count. (since the player using AoE is killing another player, I mean same methods are called to update pvp kills)

Edited by An4rchy
Posted

Similar to your AuctionManager, probably end with ConcurrentException, both on maps and lists. Not sure about int integrity on kills aswell - notably on AoE kills (AtomicInteger is probably a better choice).

Posted (edited)

Similar to your AuctionManager, probably end with ConcurrentException, both on maps and lists. Not sure about int integrity on kills aswell - notably on AoE kills (AtomicInteger is probably a better choice).

I've tested similar systems (map accessed by many players, looped through etc) and never had a ConcurrentException before. Probably because it's too fast or I'm too lucky.

Anyway updated.

Edited by An4rchy
  • 1 year later...
Posted (edited)
    public void addNewProtection(Player killer, Player victim, KillStats ks)
    {
        killStats.remove(ks);
       
  ->      if (protections.containsKey(victim))
  ->         protections.get(victim).add(killer.getObjectId());
        else
        {

on these that i marked i get this warning  : Unlikely argument type Player for containsKey(Object) on a Map<Integer,List<Integer>>

 

what causing this ? i did compile and tested and wasnt working ...

**do we have any other code that protects pvp with hwid ip ?

 

i use 370 acis rev

Edited by Xenokage

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

    • Why not, if you're interested I will post an update
    • UPD: New features and improvements
    • Hi everyone! I'm the admin of Lineage 2 ByPass. Some of you might remember it from 2009, when it first launched. This year I brought it back. The old server ran on a server pack from 2008, so I didn't copy anything. Every item, shop, NPC, teleport, drop and spawn was taken from the original files and rewritten for a modern engine. The sets, farm zones, buffer and TvT are the same ones you remember, but a lot of things that had been quietly broken for years are finally fixed, and the client got a big upgrade. THE SERVER IS NOT LIVE YET. We're finishing the last pieces and plan to open the Open Beta very soon. Join our Discord to hear the date first, and to tell me what you'd change while it's still easy to change things.   ──────────────────── RATES & ENCHANT - EXP / SP x1000 - Safe enchant +6, max +25 - Scrolls: Simple 75%, Blessed 80%, Crystal 95% (from events) - Augment skill chance 6% (chance augments removed, only active/passive left); augment buffs stack and last 2 hours UPGRADED INTERFACE - Auto Farm (2 hours per day) that sweeps what you spoil, with a separate skill setup per subclass - Auto Enchant, built-in Teleport and Skill Enchant windows - Next Target (Player): a target key made for PvP - Auto Soulshots / Spiritshots and Auto Potions at a % you set - Arrows and shots never run out - Optimized game client CUSTOM GEAR — 3 TIERS OVER S GRADE - Tier 1 (+5%): Demonic weapons, Dynasty armor - Tier 2 (+10%): Epic weapons, Epic Dark Knight armor - Tier 3 (+15%): Monster weapons, Vesper Gold armor - Every tier has its own weapon ability and a set bonus by armor type - Wings, Tattoos, Custom Shields, RB Jewels GAMEPLAY - 5 subclasses; no class, subclass or Noblesse quests - No grade penalty, no weight limit - Auto Buff: a full set in one click — buffs last 2 hours, 64 buff slots - GM Shop, Custom Item Shop, Global GK EVENTS & BOSSES - Team vs Team every 2 hours — 10-minute fights, every kill counts as PvP - Olympiad every weekend, Fri–Sun 18:00–24:00 Eastern European Time, new heroes every Monday - Castle Siege (Innadril) - 3 Mini Raid Bosses (respawn every 15 minutes) and Scarlet van Halisha (every 30 minutes) And this is only the start: big features never seen in Interlude are on the way. Server location: Warsaw, Poland Website: https://l2bypass.com Discord: https://l2bypass.com/discord See you in game!
    • 🎧 Ad-Free Streaming & Social Tools: YouTube Premium and Telegram Premium available with instant automated activation.     FINAL CALL: Google is Shutting This Down After October 2026! Google will NEVER bring back this window of opportunity again. Once this month ends, this massive backdoor upgrade is gone permanently!  BUY 2, GET 1 FREE IS STILL LIVE! Stock up now for yourself, your family, your business, and your friends! Think about it: Every single person you know uses a Gmail account, and everyone is running out of storage. Don't let your loved ones get trapped paying $20–$30 every single month when you can set them up with 5TB Cloud Storage + Gemini Advanced (12–18 Months) right now for only $15! Why Buy Bulk Activations Today? Instant Gift Value: Perfect lifetime-style gift for clients, family, or team members. 100% Private & Safe: Activates on personal Gmails—zero passwords or logins required. Global Access: Works worldwide with zero VPN hassles. Instant Automated Delivery: Receive your activation links in seconds 24/7! ‍ Time is running out fast—secure your extra free licenses before the October deadline hits! Order Your Bundle Now on the Website
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..