/*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.itemhandlers;
import com.l2jserver.Config;
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
public class ManaPotion extends ItemSkills
{
/**
*
* @see com.l2jserver.gameserver.handler.IItemHandler#useItem(com.l2jserver.gameserver.model.actor.L2Playable, com.l2jserver.gameserver.model.L2ItemInstance, boolean)
*/
@Override
public boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
{
L2PcInstance activeChar=(L2PcInstance) playable;
boolean isPet = playable instanceof L2PetInstance;
if (isPet)
activeChar = ((L2PetInstance) playable).getOwner();
else if (playable instanceof L2PcInstance)
activeChar = (L2PcInstance) playable;
else
return false;
if (!Config.ENABLE_MANA_POTIONS_SUPPORT)
{
playable.sendPacket(SystemMessageId.NOTHING_HAPPENED);
return super.useItem(playable, item, forceUse);
}
if (item.getItemId()==728 && item.getCount()>0&& playable.getPvpFlag() == 0)
{
double aux = playable.getCurrentMp();
playable.setCurrentMp(playable.getCurrentMp()+300);
playable.sendMessage((playable.getCurrentMp()-aux)+"Mana Bonus restored[Not Flaged]");
}
return super.useItem(playable, item, forceUse);
}
}
I'm having a problem, the bonus in pvp works well, but is not in pvp, I mean normal mode one can use as many times you want the potions of mp .. and not spend
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.
DISCORD :
https://discord.com/users/325653525793210378
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/uthciha-services
https://campsite.bio/utchihaamkt
A small reminder for everyone browsing here - our bonus-start is active starting from today, you can already play with the new benefits! Have a good time everyone 🙂
Congratulations to the Creative alliance on the first-ever defeat of Frintezza on our server! 🏆 Your teamwork and dedication have earned you a place in history.🎉
Question
kadabra
I'm having a problem, the bonus in pvp works well, but is not in pvp, I mean normal mode one can use as many times you want the potions of mp .. and not spend
I can do?
3 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.