Jump to content
  • 0

Try to add Killing Spree Fandc/ro Team files


Question

Posted (edited)

hi, i working with Fandc/ro team files and try add Killing spree system

Any can help me with add killing spree?

i already add some lines in java/model/player.java but dont work properly

Problem: cannot stop killer on death, i need stop killing_spree when killer die

 

find: private long _resurrectionBuffBlockedTime = 0;

i put below

 

private int kill_streak = 0;

 

find: protected void doPKPVPManage(Creature killer) {

and search pk.setPvpKills(pk.getPvpKills() + 1); and i put below

 

kill_streak++;
switch(kill_streak) {
  case 1:
    blah blah blah
      break;
  case 2:
    blah blah blah
      break;
    }

 

find protected void onDeath(Creature killer) {

i put below

 

if(kill_streak > 0) {
  	if(kill_streak > 12 {
    	kill_streak = 0;
      announcement stop killing spree blah blah blah;
  	}
}

 

 

When i test in game nothing happens and only show messages from switch if i delete kill_streak = 0; on protected void onDeath(Creature killer) { class

any can help me? thanks sorry for my bad english. 

Edited by StarSCreams
test results

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

Your code will reset spree IF its greater than 12. Remove that shit check.. just set it to 0 without any checks.

Edited by SweeTs
  • 0
Posted

thanks sweets, i move kill_streak 0; outside that check.

you can help how to announce if killer dead and if killer take more than 12 kills?

 

i tested modification and now work, but i need announce when killer dead and he reach 12 kills or more..

 

i tested again with this code

 

if(kill_streak > 12) {
  	announcement stop killing spree blah blah blah;
}

this code announce when killer reach 12 kills or more, not when he DIE hahaha i dont understand why.. 

 

thanks again.

  • 0
Posted

in this files does not exist onDie method, only onDeath in model/Player.java

 

onDeath method:

 

protected void onDeath(Creature killer)
	{
		// Check for active charm of luck for death penalty
		getDeathPenalty().checkCharmOfLuck();

		if (isInStoreMode())
		{
			setPrivateStoreType(Player.STORE_PRIVATE_NONE);
		}
		if (isProcessingRequest())
		{
			Request request = getRequest();
			if (isInTrade())
			{
				Player parthner = request.getOtherPlayer(this);
				sendPacket(SendTradeDone.FAIL);
				parthner.sendPacket(SendTradeDone.FAIL);
			}
			request.cancel();
		}

		if (_cubics != null)
		{
			getEffectList().stopAllSkillEffects(EffectType.Cubic);
		}

		setAgathion(0);
  
  		if(kill_streak >= 12) {
			announcement stop killing spree blah blah blah;
		}
  
  		kill_streak = 0;
 
		boolean checkPvp = true;
		if (Config.ALLOW_CURSED_WEAPONS)
		{
			if (isCursedWeaponEquipped())
			{
				CursedWeaponsManager.getInstance().dropPlayer(this);
				checkPvp = false;
			}
			else if ((killer != null) && killer.isPlayer() && killer.isCursedWeaponEquipped())
			{
				CursedWeaponsManager.getInstance().increaseKills(((Player) killer).getCursedWeaponEquippedId());
				checkPvp = false;
			}
		}

		if (checkPvp)
		{
			doPKPVPManage(killer);

			altDeathPenalty(killer);
		}

		// And in the end of process notify death penalty that owner died :)
		getDeathPenalty().notifyDead(killer);

		if (_event != null)
		{
			_event.doDie(killer, this);
		}

		setIncreasedForce(0);

		if (isInParty() && getParty().isInReflection() && (getParty().getReflection() instanceof DimensionalRift))
		{
			((DimensionalRift) getParty().getReflection()).memberDead(this);
		}

		stopWaterTask();

		if (!isSalvation() && isOnSiegeField() && isCharmOfCourage())
		{
			ask(new ConfirmDlg(SystemMsg.YOUR_CHARM_OF_COURAGE_IS_TRYING_TO_RESURRECT_YOU, 60000), new ReviveAnswerListener(this, 100, false));
			setCharmOfCourage(false);
		}

		if (getLevel() < 6)
		{
			Quest q = QuestManager.getQuest(255);
			if (q != null)
			{
				processQuestEvent(q.getName(), "CE30", null);
			}
		}

		if (isInOlympiadMode() && (killer.isPlayable() && killer.getPlayer().isInOlympiadMode()))
		{
			_log.warn("Player: " + getName() + " DIED in olympiad from: " + killer.getName());
			Thread.dumpStack();
		}

		// Ady - Call the gm event manager due to this death
		GmEventManager.getInstance().onPlayerKill(this, killer);

		super.onDeath(killer);
	}

 

with this modification, when any player reach 12 kills announce appears.

i need execute this announce when killer die if him take 12 kills or more.. 

 

but thanks for your help

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
Answer this question...

×   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

    • L2 PVPTOP - HTML DESIGN    
    • Do not trust this guy, he will scam you. I have sent proof to the mods, I have posted proof on another thread and I can send proof to anyone who DMs me. Avoid this guy. So not only did he scam me out of $51 USDTthen delete his messages and blocked me (I have proof) . You can see his Facebook group is constantly changing names depending on his most current scam. If you see this message and you still decide to go forward with sending your money to him, that’s on you. I can’t stress this enough. This guy is a scammer. 
    • So Goldbar thinks that deleted his side of the conversation makes it easier to claim he didn’t scam me. But I sent him $51 USDT to his ERC-20 account it was verified, he acted like it was fine but then deleted his messages and blocked me. Seriously do not trust this guy. 
    • Hi everyone, let me introduce myself—I'm Martin, a junior developer. I'm diving into the world of L2 servers, and honestly, I'm super overwhelmed about where to start learning the right way to set up, configure, and run a server. There are so many datapacks—free, private—but it's so much that my head feels like it's going to explode. I'm currently looking for someone or an active project willing to take me on as an intern. I'm not looking to make money—I'm just here to learn and grow out of pure passion for L2. I've already been working with L2jMobius H5. I managed to edit the Community Board, add a buffer, GM Shop, and teleports. I've also created custom NPCs for the GM Shop, and imported new custom weapons and armors—complete with original glow effects, like the Valakas and Antharas weapons. But there's still a lot I don't know, and it can get overwhelming. That’s why I’m looking for someone—or an active non-profit project—willing to take me on as an intern. I’m not looking to make money; I just want to learn, contribute, and grow out of pure passion for L2. If you’re working on a project and could use a motivated learner who’s eager to help, I’d love to connect!
    • Our next easy-botting project, Kain, is right around the corner! Launching tomorrow, Saturday, April 26th at 9:00 ET (UTC -4)! If you haven’t, check out the features and join our Discord to catch up on the latest drama. See you very soon! Read more about L2Toggle and Kain on our site and forum!  
  • Topics

×
×
  • Create New...