Jump to content
  • 0

Toggle Skills After Death


Question

Recommended Posts

  • 0
Posted

Hi, you need a source code to modify that, no idea what pack you're using, but search in methods that called after/along with Die.java server packet.

  • 0
Posted

Hello I am using l2jfrozen pack and this is the DIe.java of it , so what do I have to change?

 

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package com.l2jfrozen.gameserver.network.serverpackets;

import com.l2jfrozen.gameserver.datatables.AccessLevel;
import com.l2jfrozen.gameserver.datatables.sql.AccessLevels;
import com.l2jfrozen.gameserver.managers.CastleManager;
import com.l2jfrozen.gameserver.managers.FortManager;
import com.l2jfrozen.gameserver.model.L2Attackable;
import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2SiegeClan;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.entity.event.CTF;
import com.l2jfrozen.gameserver.model.entity.event.DM;
import com.l2jfrozen.gameserver.model.entity.event.TvT;
import com.l2jfrozen.gameserver.model.entity.siege.Castle;
import com.l2jfrozen.gameserver.model.entity.siege.Fort;
import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;

/**
 * sample 0b 952a1048 objectId 00000000 00000000 00000000 00000000 00000000 00000000 format dddddd rev 377 format
 * ddddddd rev 417
 * 
 * @version $Revision: 1.3.3 $ $Date: 2009/04/29 00:46:18 $
 */
public class Die extends L2GameServerPacket
{
	private static final String _S__0B_DIE = "[S] 06 Die";
	private int _charObjId;
	private boolean _fake;
	private boolean _sweepable;
	private boolean _canTeleport;
	private AccessLevel _access = AccessLevels.getInstance()._userAccessLevel;
	private com.l2jfrozen.gameserver.model.L2Clan _clan;
	L2Character _activeChar;

	/**
	 * @param cha 
	 */
	public Die(L2Character cha)
	{
		_activeChar = cha;
		if(cha instanceof L2PcInstance)
		{
			L2PcInstance player = (L2PcInstance) cha;
			_access = player.getAccessLevel();
			_clan = player.getClan();
			_canTeleport = !((TvT.is_started() && player._inEventTvT)
							|| (DM.is_started() && player._inEventDM)
							|| (CTF.is_started() && player._inEventCTF)
							|| player.isInFunEvent()
							|| player.isPendingRevive()
							|| (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && L2MultiFunctionZone.revive));
		}
		_charObjId = cha.getObjectId();
		_fake = !cha.isDead();
		if(cha instanceof L2Attackable)
		{
			_sweepable = ((L2Attackable) cha).isSweepActive();
		}

	}

	@Override
	protected final void writeImpl()
	{
		if(_fake)
			return;

		writeC(0x06);

		writeD(_charObjId);
		// NOTE:
		// 6d 00 00 00 00 - to nearest village	
		// 6d 01 00 00 00 - to hide away
		// 6d 02 00 00 00 - to castle
		// 6d 03 00 00 00 - to siege HQ
		// sweepable
		// 6d 04 00 00 00 - FIXED

		writeD(_canTeleport ? 0x01 : 0);   // 6d 00 00 00 00 - to nearest village

		if(_canTeleport && _clan != null)
		{
			L2SiegeClan siegeClan = null;
			Boolean isInDefense = false;
			Castle castle = CastleManager.getInstance().getCastle(_activeChar);
			Fort fort = FortManager.getInstance().getFort(_activeChar);

			if(castle != null && castle.getSiege().getIsInProgress())
			{
				//siege in progress
				siegeClan = castle.getSiege().getAttackerClan(_clan);
				if(siegeClan == null && castle.getSiege().checkIsDefender(_clan))
				{
					isInDefense = true;
				}
			}
			else if(fort != null && fort.getSiege().getIsInProgress())
			{
				//siege in progress
				siegeClan = fort.getSiege().getAttackerClan(_clan);
				if(siegeClan == null && fort.getSiege().checkIsDefender(_clan))
				{
					isInDefense = true;
				}
			}

			writeD(_clan.getHasHideout() > 0 ? 0x01 : 0x00); // 6d 01 00 00 00 - to hide away
			writeD(_clan.getHasCastle() > 0 || _clan.getHasFort() > 0 || isInDefense ? 0x01 : 0x00); // 6d 02 00 00 00 - to castle
			writeD(siegeClan != null && !isInDefense && siegeClan.getFlag().size() > 0 ? 0x01 : 0x00); // 6d 03 00 00 00 - to siege HQ
		}
		else
		{
			writeD(0x00); // 6d 01 00 00 00 - to hide away
			writeD(0x00); // 6d 02 00 00 00 - to castle
			writeD(0x00); // 6d 03 00 00 00 - to siege HQ
		}

		writeD(_sweepable ? 0x01 : 0x00); // sweepable  (blue glow)
		writeD(_access.allowFixedRes() ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED
	}

	/* (non-Javadoc)
	 * @see com.l2jfrozen.gameserver.serverpackets.ServerBasePacket#getType()
	 */
	@Override
	public String getType()
	{
		return _S__0B_DIE;
	}
}

 

  • 0
Posted

so About the 8k lines I got you the "title" of it.. also at the Pcinstance those are the best matches I could get also at l2 character and continues javas I chose those who made more sence but dont really thing is something from those either..

 

59d2580a530ef_.thumb.png.2f4266043fa03ad58160cc60a09574b4.png

  • 0
Posted (edited)

maybe on l2character.java

try find

    public final void stopAllEffects()

and add this code

               

 if(effect.getSkill().isToggle()) continue;

after this

            if (effect != null)
            {

 

i not tested so it can not work :D

Edited by wongerlt
  • 0
Posted (edited)

even if this is the right place to add the check, check again what you just did. You removing the effect and then you checking if is toggle?

  • L2Character.java -> click the stopAllEffects() with your cursor in order to highlight it
  • In eclipse tools -> Refactor -> Change Method Signature
  • click on Add button . A default column will appear with : Object as 'type' , newParam as Name, null as Default Value. Edit them with 'boolean' as type , 'onDeath' as Name , 'false' as default value 
  • Click ok.
  • L2Character.java -> doDie() method, edit all stopAllEffects(false) with true argument only those are inside of "if (this instanceof L2PcInstance)" check
  • Edit the method stopAllEffects like this:
public final void stopAllEffects(boolean onDeath)
	{
		final L2Effect[] effects = getAllEffects();
		for (final L2Effect effect : effects)
		{
			if (effect != null)
			{
				if (onDeath && effect.getSkill().isToggle())
					continue;
				effect.exit(true);
			}
			else
			{
				synchronized (_effects)
				{
					_effects.remove(effect);
				}
			}
		}
		if (this instanceof L2PcInstance)
		{
			((L2PcInstance) this).updateAndBroadcastStatus(2);
		}
	}

 

If you just add a check in stopAllEffects() for toggle then even in subclass change/add/cancel or idk where this method is used you will keep all toggles ....

 

P.s 'Not tested'

Edited by melron
Guest
This topic is now closed to further replies.


  • Posts

    • Dragic is a trusted guy—buy with confidence. The feature list looks incredibly solid, and you've clearly put a ton of work into this pack. Good luck with the sale, mate!
    • Im Selling my Interlude server L2wish only The Data and Core of L2wish based on lucera2 files with source code reconstructed which i did a long time ago. Im not selling the servername copyrights logos launcher etc only server data and source code, including Essence Interface reworked with interface source also.      EXP/SP: x75  Adena: x20  Drop: x20  Spoil: x20  Seal Stones: x5  Fangs of Stakato: x5  Raid Boss EXP/SP: x75  Raid Boss Drop: x1  Epic Boss Drop: x1  Manor: x5  Safe Enchant: +3  Max Enchant: Unlimited   Normal Scroll S/A Grade: 50%   Blessed Scroll S/A Grade: 55%    Normal Scroll B/C/D Grade: 50%    Blessed Scroll B/C/D Grade 55%  Max clans in ally (2)  3rd Class Cost (700 Halisha's Mark from Shrine of Loyalty)  NPC Buffer with 3h buff duration  GM Shop until B-Grade  Mana Potions  (1000 Power Delay 10 Seconds)  Auto-learn skills   Buff Slots (22+4 extra with Divine Inspiration)  Autopickup  Auction House in NPC at all towns  Offline Stores  Max Clients per PC (2)  Retail Geodata and Pathnodes  Reworked movement  Shift + Click Droplist on Monsters  Alt + Click Remove Buffs  Global Shout & Trade Chat  Special akamanah and zariche transformation  Seven Sings (Open)  Olympiad Weekly Circle  Olympiad Non-class  (5 min participants to begin)  Olympiad Class based (5 min participants to begin)  Tyrannosaurus drop Top LS chance 20% 5 Minutes Respawn  Flames of Invincibility cast 5 sec / duration 30 sec  Premium Account System  Auto Farm system using 10th Skill Bar.  IMPROVED RING OF CORE +1 STR +1 INT • INCREASE M. ATK. AND P. ATK.  IMPROVED EARRING OF ORFEN +1 WIT • INCREASE CASTING SPEED.  Subclass Quest           Part I: Kill Cabrio (Aden-Seal of Shilen) Talk to the box and bring the item to Subclass Quest           NPC.           Part II: Go for Hallate TOI 3, Kernon TOI 8 and Golkonda TOI 11, (Regardless of the order)           kill them, talk to the boxes and bring the sticks to Subclass Quest NPC to redeem your           subclass item.    Vote Reward System with Vote Coins and 12 Hours Vote Rune.  Vote Rune increases your P. Def and M. Def by 6%, P. Attack and M. Attack by 4%, Movement Speed by 4%.  Duration 12 Hours   Quest Name Drop  Relics of the Old Empire x4-8  Gather The Flames x3  Alliance with the Ketra Orcs x5  Alliance with the Varka Silenos x5  War with Ketra Orcs x10  War with the Varka Silenos x10  The Finest Food x5  A Powerful Primeval Creature x5  Rise and Fall of the Elroki Tribe x8  Legacy of Insolence x6-50%  Exploration of Giants Cave Part 1 x3  Exploration of Giants Cave Part 2 x3   Seekers of the Holy Grail x10   Guardians of the Holy Grail x10  Hunt of the Golden Ram Mercenary Force x10  The Zero Hour x5  Delicious Top Choice Meat x1  Heart in Search of Power x1  Whisper of Dreams 1/2 x3  In Search Of Fragments Of The Dimension x1 Raid Boss Name LvL Respawn  Frintezza    80 Respawn 48 Hours + - 30 Min  • Frintezza’s Necklace drop chance is 100%  Valakas    80 Respawn 240 Hours + - 30 Min  Sleep time 30 Minutes • Necklace of Valakas drop chance is 100%  Antharas    80 Respawn 192 Hours + - 30 Min  Sleep time 30 Minutes • Earring of Antharas drop chance is 100%  Baium    80 Respawn 120 Hours + - 30 Min  Sleep time 30 Minutes • Ring of Baium drop chance is 100%  Zaken    80 Respawn 48 Hours + - 30 Min  Door Open 22:00 in the night • Zaken’s Earring drop chance is 100%  Orfen    80 Every 24 Hours -+ 20 Minutes  • Earring of Orfen drop chance is 30%  Core    80 Every 26 Hours -+ 20 Minutes   • Ring of Core drop chance is 30%  Ant Queen    80 Every 28 Hours -+ 20 Minutes • Ring of Queen Ant drop chance is 30%  Splendor Barakiel    80 Spawn 6 Hours + - 15 Min Random  Subclass - Cabrio    80 Spawn 6 Hours + - 15 Min Random  Subclass - Hallate    80 Spawn 6 Hours + - 15 Min Random  Subclass - Kernon    80 Spawn 6 Hours + - 15 Min Random  Subclass - Golkonda    80 Spawn 6 Hours + - 15 Min Random   Ketra's Hero Hekaton    80 Spawn 22 Hours + - 15 Min Random   Ketra's Commander Tayr    80 Spawn 22 Hours + - 15 Min Random  Varka's Hero Shadith    80 Spawn 22 Hours + - 15 Min Random   Varka's Commander    80 Spawn 22 Hours + - 15 Min Random   Command Description .getreward Get vote reward from Hopzone. .rune Your Rune Informations. .menu Personal Menu Options. .raid Shows Normal Raids & Respawn. .epic Shows Epic Raids & Respawn. .rewards Get your Achievments. .offline Offline Shops. .relog Clearing your cache fps.     Source code reconstructed from my Lucera2 project.           Contact me for more informations, trollers will be not answered and don't expect a low price or a price drop. This project was running with 500+ real players.
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • I think you should check the video more carefully you missing something very important 😛      
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..