Announce PK & PvP

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Luna
Posts: 34
Joined: Sat Mar 16, 2013 6:59 pm

Announce PK & PvP

Post by Luna »

L2J Revision Number: 5937
L2JDP Revision Number: 9641

Heyo everyone!

So I found this code inside L2PcInstance:

Code: Select all

// announce pvp/pkif (Config.ANNOUNCE_PK_PVP && (pk != null) && !pk.isGM()){    String msg = "";    if (getPvpFlag() == 0)    {        msg = Config.ANNOUNCE_PK_MSG.replace("$killer", pk.getName()).replace("$target", getName());        if (Config.ANNOUNCE_PK_PVP_NORMAL_MESSAGE)        {            SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1);            sm.addString(msg);            Announcements.getInstance().announceToAll(sm);        }        else        {            Announcements.getInstance().announceToAll(msg);        }    }    else if (getPvpFlag() != 0)    {        msg = Config.ANNOUNCE_PVP_MSG.replace("$killer", pk.getName()).replace("$target", getName());        if (Config.ANNOUNCE_PK_PVP_NORMAL_MESSAGE)        {            SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1);            sm.addString(msg);            Announcements.getInstance().announceToAll(sm);        }        else        {            Announcements.getInstance().announceToAll(msg);        }    }}
I already turned it to true insideL2JMods.properties and it's going to the systemmsg as it should.

Code: Select all

# -----------------------------------------------------------# Pvp/pk Announce# ----------------------------------------------------------- # Default: FalseAnnouncePkPvP = True # Announce this as normal system message# Default: TrueAnnouncePkPvPNormalMessage = True # Pvp message template# variables: $killer, $targetAnnouncePvpMsg = $killer has defeated $target # PK message template# variables: $killer, $targetAnnouncePkMsg = $killer has slaughtered $target
Now, here's my question, I'd like to change to local or if possible only to yourslef instead of being global, do I have to change this line "Announcements.getInstance().announceToAll(sm);"? And chage it for what?

Have a nice day and thanks in advance! ;)
Amoguai
Posts: 1
Joined: Tue Sep 10, 2013 1:38 pm

Re: Announce PK & PvP

Post by Amoguai »

Hello. I also need this code.

I'm assuming something needs to change in Announcements.getInstance().announceToAll(sm);. I would like this announcement to be made to the player only, not to its vicinity.

Thanks in advance!
Luna
Posts: 34
Joined: Sat Mar 16, 2013 6:59 pm

Re: Announce PK & PvP

Post by Luna »

Errors after errors :P Still couldn't find out how to do it :s
NosBit
L2j Veteran
L2j Veteran
Posts: 314
Joined: Mon Mar 11, 2013 4:19 pm

Re: Announce PK & PvP

Post by NosBit »

i have 2 patches in the link below one of them broadcasts to all players around killer(including self) the other one sends it only to killer. Choose one of them :)
https://gist.github.com/NosBit/6530790
Image
Luna
Posts: 34
Joined: Sat Mar 16, 2013 6:59 pm

Re: Announce PK & PvP

Post by Luna »

Going to test it out, thanks for the share :)
Luna
Posts: 34
Joined: Sat Mar 16, 2013 6:59 pm

Re: Announce PK & PvP

Post by Luna »

Im using the one for killer only and nothing happens, no errors, no msg. :s
NosBit
L2j Veteran
L2j Veteran
Posts: 314
Joined: Mon Mar 11, 2013 4:19 pm

Re: Announce PK & PvP

Post by NosBit »

Luna wrote:Im using the one for killer only and nothing happens, no errors, no msg. :s
are you sure you have announce pvp/pk config enabled?
Image
Luna
Posts: 34
Joined: Sat Mar 16, 2013 6:59 pm

Re: Announce PK & PvP

Post by Luna »

Yep.
NosBit
L2j Veteran
L2j Veteran
Posts: 314
Joined: Mon Mar 11, 2013 4:19 pm

Re: Announce PK & PvP

Post by NosBit »

Are you testing it with GM? this wont work for GMs
Image
Luna
Posts: 34
Joined: Sat Mar 16, 2013 6:59 pm

Re: Announce PK & PvP

Post by Luna »

Hmm okay you got me! ahahaha,I'll check it out w/ a normal char then ^^ my bad...
Luna
Posts: 34
Joined: Sat Mar 16, 2013 6:59 pm

Re: Announce PK & PvP

Post by Luna »

Ok it's working, my bad dude, thanks for the share! Keep up the good work :)
Post Reply