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

    • Hello,iv got fafurion running localy just for fun and seems that files dont have geodata couse i can hit through walls so are mobs.Anyone can tell me how to activate geodata or where to insert geodata files?
    • L2Extend_Server_by_Guytis_Rev_201.rar Trojan:Script/Sabsik.FLA!ml   LOL
    • Good luck with your g/o 😃
    • You're talking complete nonsense. The source code of SphereAPI, which handles all requests, is closed and has never been published anywhere.     That return $this doesn't affect anything, PHP just ignores it. Why are you showing it?     Yes, of course I want that, and I’m asking you — go ahead and hack it, I’d even be thankful. The most you can probably do is launch a DDoS attack, but that’s not hacking. The IP you see is just a public one, used by default to handle requests. There are many other IPs involved, which aren’t disclosed for privacy reasons. So, when should I expect your hacker attack? If you fail, it means you talked big for nothing. I hope you're not all talk and can actually back up your words. UPD: To make your task easier, I have disabled limits on incorrect and failed requests, so your site/IP won't get blocked.
    • Lineage2Dex Interlude+ x50 Server launches TODAY!       The wait is over – the Lineage2Dex Interlude+ x50 Server launches TODAY! Grand Opening - April 26 at 19:00 (UTC+3) Over 10,000 registered accounts are ready to dive in! Beta with massive activity over, thx all who participate on it! It's time to begin your real Jorney! 👉 Read full roadmap 👉 Full server description 👉 Download and registration The server will be split into 3 stages, each featuring multiple content episodes. Stage 1: April 26 – May 18 Welcome to the Classic Interlude Phase. This stage is built with minimal custom content, focused on delivering that pure Interlude experience. It’s perfect for both new players unfamiliar with our project and veterans who enjoy a traditional start. Expect a smooth and nostalgic journey with familiar mechanics. Stage 2: May 19 – June 22 Time to expand the world! As most Interlude content gets completed, we gradually introduce new elements. Hellbound will open first, followed by weekly content updates. Midway through this stage, the Isle of Prayer will become available — a new zone featuring Dynasty Gear and fresh challenges. Stage 3: From June 23 Welcome to full content access! Some location become to High-level location, offering great reward! Once this phase concludes, a full merge with Union server will take place — and yes, all your characters and items will carry over safely. We wish everyone a smooth start, fair play, and tons of fun on the new x50 server! See you in-game!
  • Topics

×
×
  • Create New...