Jump to content

Recommended Posts

Posted

========================Updated=======================================

 

after a replay on l2j form i have realized how newbie i am in programing and changed the script a little:)

 

and if you want to give 200 mana in siege zone or other things change :

 

if (item.getItemId()==728 && item.getCount()>0&& playable.getPvpFlag() == 0)

to:

if (item.getItemId()==728 && item.getCount()>0&& playable.getPvpFlag() == 0&&!playable.isInSiege())

 

you can add whatever you want..

========================How to add it===================================

this works on latest freya revision ...on older packs the manapotion handler is in core and not handled individualy ...you may need to search it

 

if you want to add this custom for mana potion you need to do this:

1) go to your mana potion at skills 10001

2) the "power" will be the ammount of mana given when is flaged

3) go to \data\scripts\handlers\itemhandlers\manapotion.java and replace it with the code below

4) go at line "playable.setCurrentMp(playable.getCurrentMp()+800);" and change it to the bonus for non flaged

 

ex.)i wanted to give 200 mana for flaged players and 1000 for non flaged and i have changed the power of 10001 to 200 and put 800 for bonus

notice: non flaged players will get the the mana from normal mana potion + the number you set !

 

 

========================original post=================================

2 day ago i wanted to make mana potion to give less mana if you are flaged and more if you are not ... and with the last freya revision a lot of things changed , so i can't find anything allready done ... and once again i;ve put my ass to work and after some try's i came up with this:

 

1)go to your 10001 skill and put power=200

 

 

2) go to \data\scripts\handlers\itemhandlers\manapotion.java and replace the code with this

/*

* This program is free software: you can redistribute it and/or modify it under

* the terms of the GNU General Public License as published by the Free Software

* Foundation, either version 3 of the License, or (at your option) any later

* version.

* 

* 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.entity.TvTEvent;

import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;

import com.l2jserver.gameserver.model.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 void 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;

	if (!Config.L2JMOD_ENABLE_MANA_POTIONS_SUPPORT)

	{

		playable.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOTHING_HAPPENED));

		return;

	}

	if(activeChar.isInOlympiadMode()||!TvTEvent.onScrollUse(playable.getObjectId()))

	{return;}
               super.useItem(playable, item, forceUse);

	if (item.getItemId()==728 && item.getCount()>0&& playable.getPvpFlag() == 0)

	{
		double aux  = playable.getCurrentMp();

		playable.setCurrentMp(playable.getCurrentMp()+800);

		playable.sendMessage((playable.getCurrentMp()-aux)+"Mana Bonus restored[Not Flaged]");			

	}



}

}

 

 

In this way if a player is flaged he takes 200 if he is not he takes 1000...

 

 

 

I hope this helps you:)

 

 

edited: Updated   the 1st version gived mana in oly and tvt...:D

 

Posted

Nice one. Thanks. But why don't you add configs(when they use it unflagged), how much more mp to add?

 

Like:

			playable.setCurrentMp(playable.getCurrentMp() + Config.MORE_MP_WHEN_UNFLAGGED);

I believe you can add the config.

 

Once again, thanks.

Posted

he says he did it. we can't be 100% sure, but...

 

its 100% by me

 

Nice one. Thanks. But why don't you add configs(when they use it unflagged), how much more mp to add?

 

Like:

			playable.setCurrentMp(playable.getCurrentMp() + Config.MORE_MP_WHEN_UNFLAGGED);

I believe you can add the config.

 

Once again, thanks.

 

if you want to do this you need to open core... and this is not done in core... i think is better this way... i think

 

 

but still this can be done better ... by modify the manapotion skill to have 2 lvl and when you are flaged to get lvl one and when you are not to get lvl 2... but i didn't manage to do it:):D

 

 

 

 

 

Posted

And if you want enable mana when you are casting just delete this:

\data\scripts\handlers\itemhandlers\itemskilltemplate.java

 

if (!itemSkill.isPotion() && playable.isCastingNow())
				{
					return;
				}

 

I hope this helps you:)

 

 

10001 skill has "isPotion" val="true" (obvisouly, it means its a potion skill)

The condition you are telling us to erase is exactly the restriction for all items except potions,

so i recommend you to test your "suggestions" before advice other ppl about wrong statements

Posted

10001 skill has "isPotion" val="true" (obvisouly, it means its a potion skill)

The condition you are telling us to erase is exactly the restriction for all items except potions,

so i recommend you to test your "suggestions" before advice other ppl about wrong statements

 

sorry...

Posted

i just noticed that, when player isn't flagged, it won't increase him 1k mp, but 800 because you say:

		playable.setCurrentMp(playable.getCurrentMp()+800);

This means that if player isn't flagged, get his current mp and restore it by 800.

 

IF i am not mistaken...

Posted
i just noticed that, when player isn't flagged, it won't increase him 1k mp, but 800 because you say:

Code:

playable.setCurrentMp(playable.getCurrentMp()+800);

This means that if player isn't flagged, get his current mp and restore it by 800.

 

IF i am not mistaken...

 

no man look at this part only:

 

 

if (playable.getPvpFlag() > 0)   //if the player is flaged

 

{

 

super.useItem(playable, item, forceUse);//just use the normal mana potion from skill 10001

 

}

 

else//else if is not flaged

 

{super.useItem(playable, item, forceUse); //use the mana potion

 

playable.setCurrentMp(playable.getCurrentMp()+800);// and add aditional 800 mana bonus

}

i think this will clear your mind

 

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • All that shit are false positives of the vanganth cliext, sources are well and who sell it is a big scammer
    • Information Selling a premium Lineage 2 High Five (L2J) project with active development, available by subscription. Includes Git support and access to compiled or full source code. Ideal for serious server owners seeking stability and performance, uniqueness and well-done features.   General Project Specifications: JDK Version: 23 -> 24 Chronicle: HighFive Structure: Core & Datapack merged into a single project Database: MariaDB Database Driver: HicariCP GIT Website: gitlab.com   Features include (but are not limited to):   1. Tournament Single & Party (Check Youtube Video) 2. Faction (Check Youtube Video) 3. Event Engine (Check Youtube Video) 4. Sell Buff System (Check Youtube Video) 5. Start UP System (Check Youtube Video) 6. User Panel 7. Visual - Dress me System 8. Donate Store 9. Automatic Farm System (Check Youtube Video) 10. Captcha (Anti-BOT) (Check Youtube Video) 11. Auction (Check Youtube Video) 12. Vote (API) 13. Admin Real Time Balance (Check Youtube Video) 14. Achievements (Check Youtube Video) 15. Daily Mission (Check Youtube Video) 16. A.I. Bot (Check Youtube Video) 17. Rebirth 18. Daily Reward  19. Skill Tree - Ability System 20. Craft System 21. Twitch Automatic Reward (Check Youtube Video) 22. Quiz Game (Check Youtube Video) 23. Automatic Item Enchant (Check Youtube Video) 24. Secondary Auth Using Google Authenticator (Check Youtube Video) 25. Gm Shop - Gatekeeper - Scheme Buffer   How to get Access (Payment Subscription): To get Access you either pay monthly subscription to GIT for source or Compiled. Project is currently active and has at least 1-2 commit / day.  Clients in both Compiled & Source subscription can request features or any addon in already existing mods inside discord.   Price per Month (Source) in GIT: 250 Eur Price per Month (Compiled) in GIT: 100 Eur   Contact: To get Access or ask further information join discord  https://discord.gg/gKAsAhJNuq      
    • We're officially closing the current season today. While we focus on refining the Essence project, our resources will temporarily shift toward supporting the Classic server.
    • ➡ Discount for your purchase: MAY2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
  • Topics

×
×
  • Create New...