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.



×
×
  • Create New...