Page 1 of 1

Announce PK & PvP

Posted: Tue Sep 10, 2013 8:12 am
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! ;)

Re: Announce PK & PvP

Posted: Tue Sep 10, 2013 3:28 pm
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!

Re: Announce PK & PvP

Posted: Wed Sep 11, 2013 9:41 pm
by Luna
Errors after errors :P Still couldn't find out how to do it :s

Re: Announce PK & PvP

Posted: Wed Sep 11, 2013 10:45 pm
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

Re: Announce PK & PvP

Posted: Thu Sep 12, 2013 2:54 am
by Luna
Going to test it out, thanks for the share :)

Re: Announce PK & PvP

Posted: Thu Sep 12, 2013 3:12 am
by Luna
Im using the one for killer only and nothing happens, no errors, no msg. :s

Re: Announce PK & PvP

Posted: Thu Sep 12, 2013 10:09 am
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?

Re: Announce PK & PvP

Posted: Thu Sep 12, 2013 3:21 pm
by Luna
Yep.

Re: Announce PK & PvP

Posted: Thu Sep 12, 2013 4:09 pm
by NosBit
Are you testing it with GM? this wont work for GMs

Re: Announce PK & PvP

Posted: Thu Sep 12, 2013 4:49 pm
by Luna
Hmm okay you got me! ahahaha,I'll check it out w/ a normal char then ^^ my bad...

Re: Announce PK & PvP

Posted: Thu Sep 12, 2013 4:54 pm
by Luna
Ok it's working, my bad dude, thanks for the share! Keep up the good work :)