Jump to content
  • 0

Question

Posted

Hello, I'm trying to make an item that when you own it or activate it, like you activate your soulshots (if it's posible) to give some stats on the player.

Here is what I have done so far and still not working:

 

Item xml:

<item id="60000" type="EtcItem" name="Pandora's Item">
		<set name="icon" val="icon.etc_armor_soul_i00" />
		<set name="immediate_effect" val="1" />
		<set name="default_action" val="soulshot" />
		<set name="material" val="paper" />
		<set name="price" val="0" />
		<set name="is_tradable" val="false" />
		<set name="is_dropable" val="false" />
		<set name="is_sellable" val="false" />
		<set name="time" val="1440" />
		<set name="handler" val="Cactive" />
		<set name="item_skill" val="30412-1" />
	</item>

Skill xml:

<skill id="30412" levels="1" name="Pandora's Item">
		<set name="target" val="TARGET_SELF" />
		<set name="skillType" val="SOULSHOT" />
		<set name="operateType" val="OP_ACTIVE" />
		<for>
			<mul order="0x40" stat="rExp" val="2" />
			<mul order="0x30" stat="regMp" val="1.20" />
			<mul order="0x30" stat="runSpd" val="1.05" />
			<add order="0x40" stat="maxHp" val="1000" />
		</for>
	</skill>

Cactive handler (toke it from L2J_DataPack/dist/game/data/scripts/handlers/itemhandlers/SoulShot.java:

I wanted to make the item active with right-click and shine like soulshot and get the stats

package handlers.itemhandlers;

import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.L2ItemInstance;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;



public class Cactive implements IItemHandler
{
	/**
	 * 
	 * @see com.l2jserver.gameserver.handler.IItemHandler#useItem(com.l2jserver.gameserver.model.actor.L2Playable, com.l2jserver.gameserver.model.L2ItemInstance, boolean)
	 */
	public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
	{
		if (!(playable instanceof L2PcInstance))
			return;
		
		L2PcInstance activeChar = (L2PcInstance) playable;
		
		
		int itemId = item.getItemId();
			
		
		activeChar.soulShotLock.lock();
		try
		{
		}
		finally
		{
			activeChar.soulShotLock.unlock();
		}
		@SuppressWarnings("unused")
		int skillId = 0;
		switch (itemId)
		{
			case 60000:
				skillId=30412;
				break;
			case 60001:
				skillId=30413;
				break;
				
		}
	}
}

What I have done wrong and how to fix it or if it's a way to get the stats just the item to be inside inventory or something like that.

Thanks for your time :) 

2 answers to this question

Recommended Posts

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

    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market
    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market
    • try to send the PID of l2.bin to active64.sys service and we will avoid to buy aac license xD. i will try it in the next days. 😄
    • 🤝 SocNet is looking for new partners and suppliers!  We are building a reliable partner network across all areas of online business.  If you're in digital, traffic, accounts, or media — let’s discuss collaboration opportunities.   📌 Open to:  — Webmasters and media buyers  — Telegram channel and website owners  — Sellers of accounts and auto-registered profiles  — Developers of digital services  — Marketing agencies and freelancers 💬 We value quality, transparency, and growth. If that resonates with you — get in touch!   📎 Our current list of partners:  🔗 https://socnet.bgng.io/partners   📦 Our key products:  🛒 Online Store: Click ✅  🤖 Telegram Bot: Click ✅  📲 SMM Panel: Click ✅   📩 Contact us:  💬 Telegram: https://t.me/solomon_bog  📱 WhatsApp: https://wa.me/79051904467  🎮 Discord: https://discord.gg/y9AStFFsrh  📧 Email: solomonbog@socnet.store   📢 Follow updates: https://t.me/accsforyou_shop ✅
    • 🤝 SocNet is looking for new partners and suppliers!  We are building a reliable partner network across all areas of online business.  If you're in digital, traffic, accounts, or media — let’s discuss collaboration opportunities. 📌 Open to:  — Webmasters and media buyers  — Telegram channel and website owners  — Sellers of accounts and auto-registered profiles  — Developers of digital services  — Marketing agencies and freelancers 💬 We value quality, transparency, and growth. If that resonates with you — get in touch! 📎 Our current list of partners:  🔗 https://socnet.bgng.io/partners 📦 Our key products:  🛒 Online Store: Click ✅  🤖 Telegram Bot: Click ✅  📲 SMM Panel: Click ✅ 📩 Contact us:  💬 Telegram: https://t.me/solomon_bog  📱 WhatsApp: https://wa.me/79051904467  🎮 Discord: https://discord.gg/y9AStFFsrh  📧 Email: solomonbog@socnet.store 📢 Follow updates: https://t.me/accsforyou_shop ✅
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock