xAddytzu Posted October 14, 2008 Posted October 14, 2008 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
StarChild Posted February 21, 2009 Posted February 21, 2009 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.
fdLP. Posted February 21, 2009 Posted February 21, 2009 if (activeChar.getInventory().getInventoryItemCount(3470, 1000) or if (activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.yourconfig)
Vago Posted February 21, 2009 Author Posted February 21, 2009 if (activeChar.getInventory().getItemByItemId(3470).getCount() < 100) return; add it before the ress code
StarChild Posted February 21, 2009 Posted February 21, 2009 Another question... How can I add for example LVL UP effect when ressurected? Since it's kinda booring to just stand up after death ^^ Thank you in advice.
fdLP. Posted February 21, 2009 Posted February 21, 2009 try adding this if (targetChar instanceof L2PcInstance) ((L2PcInstance) targetChar).restoreExp(100.0);
Vago Posted February 21, 2009 Author Posted February 21, 2009 why targetchar? activeChar.setLevel(x); activeChar.addExpSp(x,y); ...use one of them
StarChild Posted February 21, 2009 Posted February 21, 2009 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?
StarChild Posted February 22, 2009 Posted February 22, 2009 Tried to search over the iNet, but failed to find something relevant... Still no idea how to put LvLup effect when you .res :(
Vago Posted February 22, 2009 Author Posted February 22, 2009 broadcastPacket(new SocialAction(getObjectId(), 15)); - this will show the level up animation broadcastPacket(new SocialAction(getObjectId(), 16)); - this will show the hero animation
StarChild Posted February 22, 2009 Posted February 22, 2009 Thank you a lot again Vago for help, but I can't compile now... Can you tell me how to write it right?
Vago Posted February 22, 2009 Author Posted February 22, 2009 import net.sf.l2j.gameserver.network.serverpackets.SocialAction; broadcastPacket(new SocialAction(activeChar.getObjectId(), 15));
Kràtos Posted February 22, 2009 Posted February 22, 2009 activeChar.addExpSp(x,y); The correct is activeChar.addExpAndSp(x,y); Anyway is good share but need corrects !
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now