Jump to content

[Share] .res voice command - Takes one goldbar and resses you


Recommended Posts

Posted

u wrote that i should   write this

_voicedCommandHandler.registerVoicedCommandHandler(new Res());  

after this

_log.config("VoicedCommandHandler: Loaded .res VoiceCommand handler.");  

but i can't find _log.config and dont know where to put that, maybe u can write line o smt like that? using 2ljfree

 

posible.. ∞ At me work this command..but I removed it because unbalance pvp

  • 4 months later...
Posted

I have a problem! I have added your ressurection system and I wanted to change GB count to 100...

I have changed this line:

activeChar.getInventory().destroyItemByItemId("RessSystem", 3470, 1, activeChar, activeChar.getTarget());

To this:

activeChar.getInventory().destroyItemByItemId("RessSystem", 3470, 100, activeChar, activeChar.getTarget());

And it takes 100 GB, but if you have 99 GB it ressurects you anyway and don't take GB!

 

As I think, I need to edit this line and add here count:

if(activeChar.getInventory().getItemByItemId(3470) == null)

But how can I add it? I have tried

getItemByItemId(3470, 100)

, but this don't work and give an error...

 

Help me please asap... Thank you in advice.

Posted

if (activeChar.getInventory().getInventoryItemCount(3470, 1000)

 

or

 

if (activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.yourconfig)

Posted

if (activeChar.getInventory().getItemByItemId(3470).getCount() < 100) return;

 

add it before the ress code

Posted

try adding this

 

if (targetChar instanceof L2PcInstance)

((L2PcInstance) targetChar).restoreExp(100.0);

Posted

try adding this

 

if (targetChar instanceof L2PcInstance)

((L2PcInstance) targetChar).restoreExp(100.0);

 

I used:

if (activeChar instanceof L2PcInstance)
((L2PcInstance) activeChar).restoreExp(100.0);

And it worked! Thank you a lot :)

 

Added: But it don't show an effect if you have for ex: 85 lvl and 23%... And setlvl is not a solution <__<

Any other way to do this?

Posted

        broadcastPacket(new SocialAction(getObjectId(), 15));      -      this will show the level up animation

        broadcastPacket(new SocialAction(getObjectId(), 16));      -      this will show the hero animation

 

Posted

import net.sf.l2j.gameserver.network.serverpackets.SocialAction;

 

        broadcastPacket(new SocialAction(activeChar.getObjectId(), 15));

 

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



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