/*
* 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.
mpa pali to idio pragma
mallon apo oti katalava fteei to back up
katevasa to pack tou l2 finest
alla enw ola trexoun kanonika den me vazei sto game.
telos panton mhpws mporoume na vroume kanena interlude pack gia na asxolithw?
DISCORD :
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/hood-services
https://campsite.bio/utchihaamkt
Hello, it still depends on which build you're using. Do you have L2J or L2OFF? If it's L2J, you can fix this in armorgrp as @KejbL has already suggested, but if it's L2OFF, additional changes in the code are needed (if it's not already done, of course).
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?
Link to comment
Share on other sites
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.