Jump to content

Keep Buffs After Death Player & Summon. [High-Five Beta]


brett16

Recommended Posts

Hello guys this is my fire share and this is pretty basic for all you experts of Java. But I'm learning myself and couldn't find any shares for highfive beta that worked, so I found my own way to do it and this is how to do it.

 

First we locate our file L2Summon.java which is at com.l2jserver.gameserver.model.actor

Ctrl+F to search for public boolean doDie(L2Character killer) and you will see this on line 309:

public boolean doDie(L2Character killer)
	{
		if (isNoblesseBlessedAffected())
		{
			stopEffects(L2EffectType.NOBLESSE_BLESSING);
			storeEffect(true);
		}
		else
		{
			storeEffect(false);
		}

It's very simple and all we do is replace on line 318 storeEffect(false); to storeEffect(true);

Now it looks like this:

public boolean doDie(L2Character killer)
	{
		if (isNoblesseBlessedAffected())
		{
			stopEffects(L2EffectType.NOBLESSE_BLESSING);
			storeEffect(true);
		}
		else
		{
			storeEffect(true);
		}

Now everytime your summon dies you can resummon it on the battlefield with buffs. Now we do the player character, so open up your L2Playable.java from the same location above and search for

boolean deleteBuffs = true; on line 134 and change to boolean deleteBuffs = false;

boolean deleteBuffs = false;
		
		if (isNoblesseBlessedAffected())
		{
			stopEffects(L2EffectType.NOBLESSE_BLESSING);
			deleteBuffs = false;
		}
		if (isResurrectSpecialAffected())
		{
			stopEffects(L2EffectType.RESURRECTION_SPECIAL);
			deleteBuffs = false;
		}
		if (isPlayer())
		{
			L2PcInstance activeChar = getActingPlayer();
			
			if (activeChar.hasCharmOfCourage())
			{
				if (activeChar.isInSiege())
				{
					getActingPlayer().reviveRequest(getActingPlayer(), null, false, 0);
				}
				activeChar.setCharmOfCourage(false);
				activeChar.sendPacket(new EtcStatusUpdate(activeChar));
			}
		}
		
		if (deleteBuffs)
		{
			stopAllEffectsExceptThoseThatLastThroughDeath();
		}

So now you don't lose buffs on death for your characters and summons, great for pvp servers or whatever you are doing. Enjoy!

Link to comment
Share on other sites

  • 2 months later...

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
Reply to this topic...

×   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...