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

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
Reply to this topic...

×   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

    • interlude: l2acis uber alles
    • New Dragon-Network Server – Vote Now!   We’re launching a new Dragon-Network (Multiskill) server under a new domain, created by the original Classic-Interlude team. We no longer have access to the old domain, but this is the official continuation — not a scam, just a new home. The new domain will host: A main migrated server (nothing lost – all chars/items kept) Plus seasonal servers (voted by players) All seasonal progress will be merged into the main realm Help shape the new server – vote now: https://dragon-network.eu/   Let’s build the future of DN – together.
    • Hello there, Im beyond confused and dont know what path to take. I want to start working on a L2 server, changing some stuff here and there and finally in the future if  im happy with the results, to launch the server, but... L2j or L2off? After all this years, is there a Interlude L2j close to off?   Ive spent some time lookin over this forum, searching what would be better and what files to take but I ain't near to a clear answer.  Most of the time everyone is trowing stones at everyone, "your filles are trash, my filles are good" and viceversa. Therefore, Im reaching out to a knowledge guy, hopefully from a neutral position to all this drama, that can pin point me in a direction.    To explain what I want for a base start is an Interlude with a classic interface (features), low rate. Mostly what this guy TravorJ is describing in his post TravorJ post , and to do some reworks on it, ex: mobs drop, rethink the augment system/interface, rethink learning skills/enchant skills, create some custom potions/buff effects, siege mechanics... Is that possible on off files? or is better to go with L2j? I also want to mention that I have little to none L2 dev experince (13-15yrs ago I had an L2j server running  for a month where I made some basics changes), but I have coding background so Im used to that and more than willing to learn.   So in conclusion, I dont want to get some free shared files without any support, that I need to wrap my head around and fix stuff for long time to make them work, stuff thats already fixed buy someone else. Instead im looking to buy something thats more updated and start working from there. Question is what and from whom? Kinda sux when you go and buy something and u dont know what the hell are you buying (need some guidance here)   Is L2j Orion a good choice? I saw that is regularly updated. Lucera2 I dont think is something that I want cuz they dont sell soruce, prefer to have control and not to be dependent on someone to much...   Big thanks in advance!   
    • L2 INSIDE - HTML DESIGN     Portfolio - protojahdesigns.com You can also join Protojah Designs Discord
  • 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