Jump to content
  • 0

Who Know Java Code Killing Spree


MegaCheat

Question

Hallo Guys I want make killing spree

 

this code

 

ndex: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(revision 4638)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(working copy)


@@ -243,6 +243,7 @@
import com.l2jserver.gameserver.network.serverpackets.UserInfo;
import com.l2jserver.gameserver.skills.AbnormalEffect;
import com.l2jserver.gameserver.skills.Env;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jserver.gameserver.skills.Formulas;
import com.l2jserver.gameserver.skills.Stats;
import com.l2jserver.gameserver.skills.l2skills.L2SkillSiegeFlag;

@@ -5664,14 +5737,63 @@
	 * Increase the pvp kills count and send the info to the player
	 *
	 */
+		private int impro = 0;
	public void increasePvpKills(L2Character target)
	{
		if (target instanceof L2PcInstance
				&& AntiFeedManager.getInstance().check(this, target))
		{
+					impro++;
+					        
+					       switch(impro){
+					       
+					                case 3:
+			   				ExShowScreenMessage case3 = new ExShowScreenMessage("You reached 3 killing spree!", 10000);
+			   				sendPacket(case3);
+							Announcements.getInstance().announceToAll("Player: " + getName() + " :Just got a Triple Kill!");
+			   				break;
+			   				
+							case 5:
+			   				ExShowScreenMessage case5 = new ExShowScreenMessage("You reached 5 killing spree!", 10000);
+			   				sendPacket(case5);
+							Announcements.getInstance().announceToAll("Player: " + getName() + " :Just got an Ultra Kill!");
+			   				break;
+			   				
+							case 10:
+			   				ExShowScreenMessage case10 = new ExShowScreenMessage("You reached 10 killing spree!", 10000);
+			   				sendPacket(case10);
+			   				Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 10 kill in a row!");
+			   				break;
+			   				
+							case 15:
+			  				ExShowScreenMessage case15 = new ExShowScreenMessage("You reached 15 killing spree!", 10000);
+			   				sendPacket(case15);
+			   				Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 15 kill in a row!");
+			  				break;
+			   				
+							case 20:
+			   				ExShowScreenMessage case20 = new ExShowScreenMessage("You reached 20 killing spree!", 10000);
+			   				sendPacket(case20);
+			   				Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 20 kill in a row!");
+			   				break;
+			  				
+							case 25:
+			   				ExShowScreenMessage case25 = new ExShowScreenMessage("You reached 25 killing spree!", 10000);
+			   				sendPacket(case25);
+			  				Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 25 kill in a row!");
+			   				break;
+					          default:
+					           ;
+					        }
+				
+			


@@ -13495,6 +13639,8 @@
					setCurrentFeed(0);
					stopFeed();
					dismount();
+							
+							impro = 0;
					sendPacket(SystemMessage.getSystemMessage(SystemMessageId.OUT_OF_FEED_MOUNT_CANCELED));
				}

But not when he dies but with time  1 min 

 

impro = 0;  <<<< 1 min

 

Edited by MegaCheat
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1

 

Btw, you don't need to announce/screenmessage the pvp count in every line. 

  • Upvote 2
Link to comment
Share on other sites

  • 0
1- You store a Future _spreeTask on the Player level (your impro variable should be named _impro, btw).
2 - You cancel it and relaunch it on every kill :

if (_spreeTask != null)
_spreeTask.cancel(false);

_spreeTask = ThreadPool.schedule(() -> _impro = 0, 60000L);

Basically, if you kill someone, it will cancel current task and reschedule it with a fresh timer. If you want to avoid to make one task per Player, you can also handled it using a Manager (similar to multiple other timed stuff : pvp, random animation timer, or even movement in default L2J...), where you register all Players on a 1sec task manager and test each of those every second.
  • Like 1
Link to comment
Share on other sites

  • 0
9 hours ago, Tryskell said:

1- You store a Future _spreeTask on the Player level (your impro variable should be named _impro, btw).
2 - You cancel it and relaunch it on every kill :

if (_spreeTask != null)
_spreeTask.cancel(false);

_spreeTask = ThreadPool.schedule(() -> _impro = 0, 60000L);

Basically, if you kill someone, it will cancel current task and reschedule it with a fresh timer. If you want to avoid to make one task per Player, you can also handled it using a Manager (similar to multiple other timed stuff : pvp, random animation timer, or even movement in default L2J...), where you register all Players on a 1sec task manager and test each of those every second.

you talk to him like he is a casual Senior Java developer even tho you are right i dont think he will understand 😕

 

49 minutes ago, &#x27;Baggos&#x27; said:

 

Btw, you don't need to announce/screenmessage the pvp count in every line. 

nice job buddy

 

Link to comment
Share on other sites

  • 0
3 hours ago, MegaCheat said:

thanks guys very mutch

the problem is chronical Hi5

Just changes the imports. Only in KillingSpreeTaskManager you get errors.

Remove imports, rename Player to L2PcInstance and press Ctrl + Shift + O

 

Instead of var change it to int

Remove:

World.announceToOnlinePlayers("Player " + getName() + ": reached " + value + " kills in a row!", true);

 

And put

Announcements.getInstance().announceToAll("Player " + getName() + ": reached " + value + " kills in a row!", true);

Edited by 'Baggos'
Link to comment
Share on other sites

  • 0

private int _killCount;
private long _killTime;
 

public void increasePvpKills(L2Character target)
{
    if (target instanceof L2PcInstance && AntiFeedManager.getInstance().check(this, target))
    {

        if (_killTime < System.currentTimeMillis())
            _killCount = 0;
 

        _killCount++;
        _killTime = System.currentTimeMillis() + 60000L;

 
There is no need for any task @MegaCheat

Edited by StinkyMadness
  • Like 1
  • Thanks 1
  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Good afternoon I am selling a list of forums, which contains more than 100 lines of active and current RU forums.   - topics: dark, crypto, SMM, programming, services, cheats, etc.; - sorting from more popular to less popular (by traffic, by the number of new posts per day);   Are you looking for where to advertise your services? This base will definitely suit you! In addition, on the forums you can find a bunch of useful information, software, as well as advertisements about sales and services from other users.   Payment: 12 USTD   After payment you receive a text document with a list of forums (PS. all information is provided for informational purposes only); TELEGRAM - https://t.me/milozare
    • I strongly concur with some opinions shared. As I've previously mentioned on different posts, it's shocking to see how seasonal servers gather this much population. However, being back in the game some months I did start understanding how the current community of L2 plays and thinks.   It's a huge problem, but in my opinion the guilt is shared between server owners and community. To keep a long term project running (more than a year on) you need to have the equivalent community that will support the project, which unfortunately is not that big. The current player community of L2 hops on new servers with such a haste to get full and "dominate" which does indeed give a lot of activity for some weeks but after that it's just downfall, population gets reduced drastically day by day. The reason is, while the community is busy "grinding" to win on their current server, a "new" server is being advertised which most likely is from the same owner. As I've mentioned, the guilt is shared since the server-owners focus on bringing up "new" servers for the cash grab but also since the community doesn't have the patience to support a long-term project. Besides, let's not forget about clans/CPs being invited directly to the server with some benefits. I'll give an example. An admin opens a server, invites 3 groups (either CPs or clans) by promising them some small benefits. Those three groups will invite more players and so on. It's like an investment, they spent 5$ to earn 20$. Therefore, most admins willing to play "fair" do not succeed, except for a few. Most of us "old-timers" play for nostalgia trips and are fine with low populated servers but lets take a step back and think about the owners that really want to provide a good server, no income will slowly dry out the server and eventually die.   Don't get me wrong, there are some great servers out there, but not everything is for everyone. I'll finish by quoting someone I saw few days ago on YouTube, he said something along the lines that we shouldn't expect fair play while we play an "illegal" version of the game.
    • You have to create the "voiced" handler in the core too, or at the very least make sure that the delimiter is underscore and not an empty space. Alternatively, you can try changing all references of the strings below to start with "voiced_", or remove the "voiced_" portion from the button bypass.   private static final String[] VOICED_COMMANDS = { "siege", "siege_gludio", "siege_dion", "siege_giran", "siege_oren", "siege_aden", "siege_innadril", "siege_goddard", "siege_rune", "siege_schuttgart" };
    • Hi maxcheaters, I recently added some code to my l2jacis revision and everything works fine with the .siege commands but when I click on the html options to open the registry I don't succeed!   registerHandler(new Castles());   package net.sf.l2j.gameserver.handler.voicedcommandhandlers;   import net.sf.l2j.Config; import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; import net.sf.l2j.gameserver.data.manager.CastleManager; import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.model.entity.Castle; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; import net.sf.l2j.gameserver.network.serverpackets.SiegeInfo;   public class Castles implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "siege", "siege_gludio", "siege_dion", "siege_giran", "siege_oren", "siege_aden", "siege_innadril", "siege_goddard", "siege_rune", "siege_schuttgart" };   @Override public boolean useVoicedCommand(String command, Player player, String target) { if (command.equals("siege") && Config.ENABLE_MENU) showHtm(player); else if (command.startsWith("siege_")) { if (player.getClan() != null && !player.isClanLeader()) { player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT); return false; }   int castleId = 0; if (command.startsWith("siege_gludio") && Config.SIEGE_GLUDIO) castleId = 1; else if (command.startsWith("siege_dion") && Config.SIEGE_DION) castleId = 2; else if (command.startsWith("siege_giran") && Config.SIEGE_GIRAN) castleId = 3; else if (command.startsWith("siege_oren") && Config.SIEGE_OREN) castleId = 4; else if (command.startsWith("siege_aden") && Config.SIEGE_ADEN) castleId = 5; else if (command.startsWith("siege_innadril") && Config.SIEGE_INNADRIL) castleId = 6; else if (command.startsWith("siege_goddard") && Config.SIEGE_GODDARD) castleId = 7; else if (command.startsWith("siege_rune") && Config.SIEGE_RUNE) castleId = 8; else if (command.startsWith("siege_schuttgart") && Config.SIEGE_SCHUT) castleId = 9; else player.sendMessage("This Castle has been disabled");   Castle castle = CastleManager.getInstance().getCastleById(castleId); if ((castle != null) && (castleId != 0)) player.sendPacket(new SiegeInfo(castle)); } return true; }   private static void showHtm(Player player) { NpcHtmlMessage htm = new NpcHtmlMessage(0); htm.setFile(player.isLang() + "mods/menu/CastleManager.htm"); player.sendPacket(htm); }   @Override public String[] getVoicedCommandList() { return VOICED_COMMANDS; } }     <button value="Giran" action="bypass voiced_siege_giran" width=75 height=22 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  • Topics

×
×
  • Create New...