KriminalMind Posted July 24, 2012 Share Posted July 24, 2012 How can I do to make mana potions usable ONLY by player with karma = 0 ?? Info: (Hi5 Project) Thx! Quote Link to comment Share on other sites More sharing options...
0 ^Wyatt Posted July 24, 2012 Share Posted July 24, 2012 game\data\scripts\handlers\itemhandlers\ManaPotion.java on @Override public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse) { insert: if(((L2PcInstance) playable).getKarma()!=0) { playable.sendPacket(SystemMessageId.NOTHING_HAPPENED); return; } Quote Link to comment Share on other sites More sharing options...
0 KriminalMind Posted July 24, 2012 Author Share Posted July 24, 2012 Is this right? package handlers.itemhandlers; import l2.gp.Config; import l2.gp.gameserver.model.actor.L2Playable; import l2.gp.gameserver.model.items.instance.L2ItemInstance; import l2.gp.gameserver.network.SystemMessageId; public class ManaPotion extends ItemSkills { /** * * @see l2.gp.gameserver.handler.IItemHandler#useItem(l2.gp.gameserver.model.actor.L2Playable, l2.gp.gameserver.model.items.instance.L2ItemInstance, boolean) */ @Override public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse) { if (((L2PcInstance) playable).getKarmaO!=0) { playable.sendPacket(SystemMessageId.NOTHING_HAPPENED); return; } if (!Config.L2JMOD_ENABLE_MANA_POTIONS_SUPPORT) { playable.sendPacket(SystemMessageId.NOTHING_HAPPENED); return; } super.useItem(playable, item, forceUse); } } Quote Link to comment Share on other sites More sharing options...
0 ^Wyatt Posted July 24, 2012 Share Posted July 24, 2012 should be... anyway... why do u ask? are u getting any error on eclipse? did u test it?... I think instead of asking if it's ok... you can test it... it's faster Quote Link to comment Share on other sites More sharing options...
0 KriminalMind Posted July 24, 2012 Author Share Posted July 24, 2012 It's not ok, 2 min and I post u the error in log.. Quote Link to comment Share on other sites More sharing options...
0 KriminalMind Posted July 24, 2012 Author Share Posted July 24, 2012 Loading Server Scripts ---------- 1. ERROR in "path"/game/data/scripts/handlers/itemhandlers/ManaPotion.java (at line 32) if (((L2PcInstance) playable).getKarmaO!=0) ^^^^^^^^^^^^^^^^^^^^^^^ L2PcInstance cannot be resolved to a type 1. ERROR in "path"/game/data/scripts/handlers/itemhandlers/ManaPotion.java (at line 32) if (((L2PcInstance) playable).getKarmaO!=0) ^^^^^^^^^^^^^^ L2PcInstance cannot be resolved to a type ---------- I'm sorry, this is the error! Quote Link to comment Share on other sites More sharing options...
0 KriminalMind Posted July 24, 2012 Author Share Posted July 24, 2012 I've modified the error. UP Quote Link to comment Share on other sites More sharing options...
0 ^Wyatt Posted July 24, 2012 Share Posted July 24, 2012 Import L2PcInstance... Quote Link to comment Share on other sites More sharing options...
0 ^Wyatt Posted July 26, 2012 Share Posted July 26, 2012 Did you try to import L2PcInstance?... Quote Link to comment Share on other sites More sharing options...
0 Tryskell Posted July 26, 2012 Share Posted July 26, 2012 Did you try to import L2PcInstance?... Sometimes, there is just no hope you know. Bip - bip - biiiiiiiiiiiiiiiiiiiiiii... "Doctor, we lost him." Quote Link to comment Share on other sites More sharing options...
Question
KriminalMind
How can I do to make mana potions usable ONLY by player with karma = 0 ??
Info: (Hi5 Project)
Thx!
Link to comment
Share on other sites
9 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.