Skip to content

Announce system

Featured Replies

I wanted to ask if anyone know the code/place for the next thing.

character "Dex" has killed 3 times there will be an Announce: Dex is domnating.

Dex has killed 6times there will be announce : Dex is Unstoppable.!

and more.. if anyone can help please do it!!

"Announcement ,not any other chat".

search it it must be shared somewhere here

Just add how much case's you want in the same way, just change the number. Number = how much pvp you need in a row to announce a spree.

 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 224)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -35,6 +35,7 @@
import javolution.util.FastSet;
import net.sf.l2j.Config;
import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.GameTimeController;
import net.sf.l2j.gameserver.GeoData;
import net.sf.l2j.gameserver.ItemsAutoDestroy;
@@ -4525,6 +4526,8 @@
		if (is-beep-ted())
			stopFeed();

+		spreeKills = 0;
+		
		synchronized (this)
		{
			if (isFakeDeath())
@@ -4783,8 +4786,38 @@
      * Increase the pvp kills count and send the info to the player
      *
      */
+	private int spreeKills = 0;
+	
     public void increasePvpKills()
     {
+    	spreeKills++;
+    	
+    	switch(spreeKills)
+    	{
+    	case 1:
+    		Announcements.getInstance().announceToAll("" + this.getName()+ " has drawn the first blood!");
+    		break;
+    		
+    	case 2:
+    		Announcements.getInstance().announceToAll("" + this.getName()+ " has scored a double kill!");
+    		break;
+    		
+    	case 3:
+    		Announcements.getInstance().announceToAll("" + this.getName()+ " has scored a triple kill!");
+    		break;
+    		
+    	default:
+    		;
+    	}
+    	
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);

SweeTs, your example doesn't reset number when you die (it should) :P.

SweeTs, your example doesn't reset number when you die (it should) :P.

 

Yeah, you're right*, I forgot about spreeKills = 0; in doDie() :P

 

Here you go fixed code:

 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 224)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -35,6 +35,7 @@
import javolution.util.FastSet;
import net.sf.l2j.Config;
import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.GameTimeController;
import net.sf.l2j.gameserver.GeoData;
import net.sf.l2j.gameserver.ItemsAutoDestroy;
@@ -4525,6 +4526,8 @@
		if (is-beep-ted())
			stopFeed();

+		spreeKills = 0;
+		
		synchronized (this)
		{
			if (isFakeDeath())
@@ -4783,8 +4786,38 @@
      * Increase the pvp kills count and send the info to the player
      *
      */
+	private int spreeKills = 0;
+	
     public void increasePvpKills()
     {
+    	spreeKills++;
+    	
+    	switch(spreeKills)
+    	{
+    	case 1:
+    		Announcements.getInstance().announceToAll("" + this.getName()+ " has drawn the first blood!");
+    		break;
+    		
+    	case 2:
+    		Announcements.getInstance().announceToAll("" + this.getName()+ " has scored a double kill!");
+    		break;
+    		
+    	case 3:
+    		Announcements.getInstance().announceToAll("" + this.getName()+ " has scored a triple kill!");
+    		break;
+    		
+    	default:
+    		;
+    	}
+    	
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);

 

* - like always, damn Falcon's eye :D

  • Author

can u code it to post "after 3 kills $player is Dominating

after 6 kills "player is Unstoppable

after 9 kills "Player is GodLike? please!

can u code it to post "after 3 kills $player is Dominating

after 6 kills "player is Unstoppable

after 9 kills "Player is GodLike? please!

 

Ummm, just change mine code (case 1: => case 3:, case2: => case 6: and so on..) and change the text, it's not hard.

Create an account or sign in to comment

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.