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

its mana potion for l2j  but it gives more mana if player is not flaged.....

 

Indeed, cool idea :)

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

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Anything that is not a kernel level anticheat is totally useless on todays market. You cannot properly prevent botting because, without kernel access, you cannot detect injected DLLs or inspect processes at the level required to stop them. It's good to see people contributing and trying different approaches, but in general, you won't be able to prevent bots from accessing and operating on your server with a usermode anticheat alone. There is a solution that I have not posted or shared with anyone that can fully prevent Adrenaline/Helper from being used on servers. However, I want to give it more time before discussing it publicly so I can see how people attempt to bypass anticheat systems. As I said, kernel level protection is the only thing that can effectively stop Adrenaline usage. When combined with HWID bans, TPM validation, and other hardware based checks, bypassing the protection becomes significantly harder.
    • Improved lucera2 fake appearance (SKINS) system with a more reliable equipment redraw, ensuring skin changes refresh properly in-game without requiring relog or manual armor re-equip. This fixes cases where the client could keep showing the previous armor model after changing appearance    
    • 🚀 IronLock Shield - Closed Beta Testing Hello everyone, We are currently looking for Lineage II Interlude server owners interested in participating in the closed beta phase of IronLock Shield. IronLock Shield is a security platform designed specifically for Interlude servers. Features include: ✓ Secure Launcher Architecture ✓ HWID-Based Licensing ✓ Anti-Debug Protection ✓ DLL Injection Detection ✓ Manual Map Detection ✓ Session Protection ✓ Replay Protection ✓ Runtime Integrity Verification ✓ Secure Update System Selected servers will receive 1 month of free access in exchange for testing and feedback. Website: https://ilshield.com If you are interested, feel free to send me a private message or contact me through Discord. Thank you.
    • GX-EXT Pack – 30% Discount Until Wednesday, June 17 Hello everyone, We are offering a special 30% discount on the GX-EXT Pack until Wednesday, June 17. GX-EXT is a complete extension pack for Lineage II servers, focused on performance, stability, gameplay improvements, custom systems, and server-side/client-side enhancements.
  • Topics

×
×
  • Create New...

Important Information

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..