Jump to content

Question

Posted (edited)

Hello MxC,

I have a question. How can I make any etcitem to be dropped like Adena? So if I'm in a party the amount will be shared with all party members like Adena.

 

Edit: Could anyone give me the idea where to search? Or is it really hard to do? I'm using L2jFrozen btw.

Edited by BloodRav3N

6 answers to this question

Recommended Posts

  • 0
Posted
On 4/2/2018 at 6:55 PM, BloodRav3N said:

Could anyone give me the idea where to search? Or is it really hard to do? I'm using L2jFrozen btw.

have a look how it works on l2party.java, then copy and add with the item id

  • 0
Posted

Your file is Party.java

Search/try what you want in there.. Ofc will not work if you simple change/add some ids. But, there is your file.

  • 0
Posted

If anyone wants to do it here is what I did:

 

PcInventory.java

	public static final int ADENA_ID = 57;
	+public static final int COIN_ID = 9404;
	public static final int ANCIENT_ADENA_ID = 5575;
	
	private final L2PcInstance _owner;
	private L2ItemInstance _adena;
	+private L2ItemInstance _coin;
	private L2ItemInstance _ancientAdena;

--------------------------------------------

	public L2ItemInstance getAdenaInstance()
	{
		return _adena;
	}
	
	+public L2ItemInstance getCoinInstance()
	+{
	+	return _coin;
	+}
	
	@Override
	public int getAdena()
	{
		return _adena != null ? _adena.getCount() : 0;
	}
	
	+public int getCoin()
	+{
	+	return _coin != null ? _coin.getCount() : 0;
	+}

---------------------------------------------

	public void addAdena(final String process, final int count, final L2PcInstance actor, final L2Object reference)
	{
		if (count > 0)
		{
			addItem(process, ADENA_ID, count, actor, reference);
		}
	}
	
	+public void addCoin(final String process, final int count, final L2PcInstance actor, final L2Object reference)
	+{
	+	if (count > 0)
	+	{
	+		addItem(process, COIN_ID, count, actor, reference);
	+	}
	+}

-----------------------------------------------------

	public L2ItemInstance addItem(final String process, L2ItemInstance item, final L2PcInstance actor, final L2Object reference)
	{
		item = super.addItem(process, item, actor, reference);
		
		if (item != null && item.getItemId() == ADENA_ID && !item.equals(_adena))
		{
			_adena = item;
		}
		
		+if (item != null && item.getItemId() == COIN_ID && !item.equals(_coin))
		+{
		+	_coin = item;
		+}

--------------------------------------------------------

	public L2ItemInstance transferItem(final String process, final int objectId, final int count, final ItemContainer target, final L2PcInstance actor, final L2Object reference)
	{
		final L2ItemInstance item = super.transferItem(process, objectId, count, target, actor, reference);
		
		if (_adena != null && (_adena.getCount() <= 0 || _adena.getOwnerId() != getOwnerId()))
		{
			_adena = null;
		}
		
		+if (_coin != null && (_coin.getCount() <= 0 || _coin.getOwnerId() != getOwnerId()))
		+{
		+	_coin = null;
		+}

------------------------------------------------------

	public L2ItemInstance dropItem(final String process, L2ItemInstance item, final L2PcInstance actor, final L2Object reference)
	{
		item = super.dropItem(process, item, actor, reference);
		
		if (_adena != null && (_adena.getCount() <= 0 || _adena.getOwnerId() != getOwnerId()))
		{
			_adena = null;
		}
		
		+if (_coin != null && (_coin.getCount() <= 0 || _coin.getOwnerId() != getOwnerId()))
		+{
		+	_coin = null;
		+}

----------------------------------------------------

	public L2ItemInstance dropItem(final String process, final int objectId, final int count, final L2PcInstance actor, final L2Object reference)
	{
		final L2ItemInstance item = super.dropItem(process, objectId, count, actor, reference);
		
		if (_adena != null && (_adena.getCount() <= 0 || _adena.getOwnerId() != getOwnerId()))
		{
			_adena = null;
		}

		+if (_coin != null && (_coin.getCount() <= 0 || _coin.getOwnerId() != getOwnerId()))
		+{
		+	_coin = null;
		+}

--------------------------------------------------------------

	protected void removeItem(final L2ItemInstance item)
	{
		// Removes any reference to the item from Shortcut bar
		getOwner().removeItemFromShortCut(item.getObjectId());
		
		// Removes active Enchant Scroll
		if (item.equals(getOwner().getActiveEnchantItem()))
		{
			getOwner().setActiveEnchantItem(null);
		}
		
		if (item.getItemId() == ADENA_ID)
		{
			_adena = null;
		}
		+else if (item.getItemId() == COIN_ID)
		+{
		+	_coin = null;
		+}

----------------------------------------------------------

	public void restore()
	{
		super.restore();
		_adena = getItemByItemId(ADENA_ID);
	+	_coin = getItemByItemId(COIN_ID);
		_ancientAdena = getItemByItemId(ANCIENT_ADENA_ID);
	}

----------------------------------------------------------

 

L2PcInstance.java

	public int getAdena()
	{
		return _inventory.getAdena();
	}
	+public int getCoin()
	+{
	+	return _inventory.getCoin();
	+}

--------------------------------------------------------
  
  	+public void addCoin(final String process, int count, final L2Object reference, final boolean sendMessage)
	+{
	+	if (count > 0)
	+	{
	+		if (_inventory.getCoin() == Integer.MAX_VALUE)
	+		{
	+			return;
	+		}
	+		else if (_inventory.getCoin() >= Integer.MAX_VALUE - count)
	+		{
	+			count = Integer.MAX_VALUE - _inventory.getCoin();
	+			_inventory.addCoin(process, count, this, reference);
	+		}
	+		else if (_inventory.getCoin() < Integer.MAX_VALUE - count)
	+		{
	+			_inventory.addCoin(process, count, this, reference);
	+		}
	+		if (sendMessage)
	+		{
	+			SystemMessage sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
	+			sm.addItemName(PcInventory.COIN_ID);
	+			sm.addNumber(count);
	+			sendPacket(sm);
	+			sm = null;
	+		}
	+		
	+		// Send update packet
	+		if (!Config.FORCE_INVENTORY_UPDATE)
	+		{
	+			InventoryUpdate iu = new InventoryUpdate();
	+			iu.addItem(_inventory.getAdenaInstance());
	+			sendPacket(iu);
	+			iu = null;
	+		}
	+		else
	+		{
	+			sendPacket(new ItemList(this, false));
	+		}
	+	}
	+}

----------------------------------------------------------------------------
  
  		else if (item.getItemId() == 57)
		{
			addAdena("AutoLoot", item.getCount(), target, true);
		}
		+else if (item.getItemId() == 9404)
		+{
		+	addCoin("AutoLoot", item.getCount(), target, true);
		+}

----------------------------------------------------------------------------
  
  			else if (target.getItemId() == 57 && getInventory().getAdenaInstance() != null)
			{
				addAdena("Pickup", target.getCount(), null, true);
				ItemTable.getInstance().destroyItem("Pickup", target, this, null);
			}
		+	else if (target.getItemId() == 9404 && getInventory().getCoinInstance() != null)
		+	{
		+		addCoin("Pickup", target.getCount(), null, true);
		+		ItemTable.getInstance().destroyItem("Pickup", target, this, null);
		+	}


  

 

L2Party.java

	public void distributeItem(final L2PcInstance player, final L2ItemInstance item)
	{
		if (item.getItemId() == 57)
		{
			distributeAdena(player, item.getCount(), player);
			ItemTable.getInstance().destroyItem("Party", item, player, null);
			return;
		}
		+if (item.getItemId() == 9404)
		+{
		+	distributeCoin(player, item.getCount(), player);
		+	ItemTable.getInstance().destroyItem("Party", item, player, null);
		+	return;
		+}

-------------------------------------------------------------------

	public void distributeItem(final L2PcInstance player, final L2Attackable.RewardItem item, final boolean spoil, final L2Attackable target)
	{
		if (item == null)
			return;
		
		if (item.getItemId() == 57)
		{
			distributeAdena(player, item.getCount(), target);
			return;
		}
		
		+if (item.getItemId() == 9404)
		+{
		+	distributeCoin(player, item.getCount(), target);
		+	return;
		+}

------------------------------------------------------------------------
  Search for public void distributeAdena and paste this under:

+	public void distributeCoin(final L2PcInstance player, final int coin, final L2Character target)
+	{
+		// Get all the party members
+		final List<L2PcInstance> membersList = getPartyMembers();
+		
+		// Check the number of party members that must be rewarded
+		// (The party member must be in range to receive its reward)
+		final List<L2PcInstance> ToReward = FastList.newInstance();
+		
+		for (final L2PcInstance member : membersList)
+		{
+			if (!Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true))
+			{
+				continue;
+			}
+			ToReward.add(member);
+		}
+		
+		// Avoid null exceptions, if any
+		if (ToReward.isEmpty())
+			return;
+		
+		// Now we can actually distribute the adena reward
+		// (Total adena split by the number of party members that are in range and must be rewarded)
+		final int count = coin / ToReward.size();
+		
+		for (final L2PcInstance member : ToReward)
+		{
+			member.addCoin("Party", count, player, true);
+		}
+		FastList.recycle((FastList<?>) ToReward);
+	}

Thanks again for the replies (even if it took 1 months for a reply :P ) you can lock this topic :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Download Lobby u need island for lobby Download Crow Island  
    • Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs    
    • L2-LORENA x100 MID RATE   Interlude Nostalgia Meets Modern Gameplay   OFFICIAL OPENING:  April 4 (Saturday)  19:00 UTC+1 ⸻  MAIN INFORMATION  Adena: x5  Drop: x10  Spoil: x10  Raid Boss: x10  Seal Stones: x2  Quests: x10 ⸻  FEATURES  GM Shop up to B-Grade  Full Buffer  Premium System (x2 bonuses)  AutoFarm – FREE for everyone ⸻  SERVER CONCEPT  Classic Interlude nostalgia  Enhanced with modern interface & mechanics  Balanced PvP & PvE gameplay  Active development & custom features ⸻  WHY JOIN L2-LORENA?  No Pay-to-Win  Smooth gameplay & stable server  Competitive PvP environment  Friendly & active community ⸻  JOIN US NOW L2-LORENA 100X <<< LINK Discord: https://discord.gg/TYZ88Tgx4b  Facebook: https://www.facebook.com/share/18kwbkaYZY/?mibextid=wwXIfr   L2-LORENA Link << Discord: https://discord.gg/TYZ88Tgx4b  Facebook: https://www.facebook.com/share/18kwbkaYZY/?mibextid=wwXIfr
    • https://web.archive.org/web/20260306183214/https://maxcheaters.com/topic/241828-l2j-l2damage/page/3/ https://l2topzone.com/forum/l2-server-support-problems/9/l2damage-stopped/30514 Also we will try to push longer seasons ever ! (1135-100)/9 = 115 online
    • ONE SIDE – AND EVERYTHING BREAKS ▪ Looks like a simple case: Florida DL, back side, barcode – “clean and minimal”. ▪ In reality, these are exactly the tasks that fail most often. – data provided as plain text – request only for the back side – focus on the barcode (PDF417) ▪ And here’s the key point: ▪ A barcode is not just a “picture on the back”. It’s compressed logic of the entire document. ▪ If it doesn’t match the front, format, and data structure – the system flags it instantly. ▪ Many create a “similar-looking” code. But systems don’t read “similar” – they read by specification. ▪ In cases like this, it’s not about design. It’s about correct data assembly and how it behaves inside the format. ▪ Today only – 15% off for verification cases. ▪ Want it to pass, not just look right? Describe your case – we’ll show where even clean files break. › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #editing #photoshop #documents #verification #case
  • 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..