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..
Question
Hardstyle
i want to make mana potion to give less mana if player is flaged ..
i don't know what i do wrong... so please help me:
i use the latest l2j revision..
package handlers.itemhandlers; import com.l2jserver.Config; import com.l2jserver.gameserver.model.L2ItemInstance; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; public class ManaPotion extends ItemSkills { public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse) { if (!Config.L2JMOD_ENABLE_MANA_POTIONS_SUPPORT) { playable.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOTHING_HAPPENED)); return; } L2PcInstance player = getClient().getActiveChar(); if (player.getPvpFlag() > 0) { L2Skill skill = SkillTable.getInstance().getInfo(10001, 1); player.useMagic(skill, true, false); } else {L2Skill skill = SkillTable.getInstance().getInfo(10003, 1); player.useMagic(skill, true, false); playable.sendMessage("unflaged"); } } }i've try this as well:
THX:)
edited:"playable.sendMessage("unflaged");" i see this message but no mana...
3 answers to this question
Recommended Posts