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

    • Lineage 2 Interlude L2OFF Server Based on H5 Files   Are you looking to start your own Lineage 2 server? This is your chance! I’m selling a 100% functional server based on Official L2OFF H5 files, adapted to the Interlude version. Main Features: Based on official L2OFF H5 files, perfectly configured for Interlude. Includes the full source code, allowing you to fully customize the server to fit your needs. Fully working events, such as: TvT (Team vs. Team) CTF (Capture the Flag) Tons of custom content added, keeping the balance and original essence of the game. Why choose this project? The server is fully functional and optimized, ready to launch. You can test the server before purchasing, with access to a GM character to explore all features. Comes with everything you need to make your project a success, both technically and in terms of content. Interested? Feel free to contact me! If you need more information or would like to schedule a test, I’m happy to answer any questions.   Auto Create Accounts Client Test Server: DOWNLOAD Discord: Guytis#6760 Skype: gustavoorellano@hotmail.com  
    • Website: https://l2aurum.com/  Discord: https://discord.gg/l2aurum   Hello Everyone,  finally, the moment has arrived: I'm launching my own server, L2Aurum!   L2Aurum x300 Closed Beta Test - Start: 17.02.2025  [20:00 GMT+2] Grand Opening 21.02.2025 [20:00 GMT+2]     Experience Rates: x300 Skill Points Rates: x300 Adena Drop: x300 Premium Accounts: x2 Drop Rates: x1 Spoil Rates: x1 Quest Rates: x1 Only one account per player, no dualboxing allowed. Everything is earned through gameplay, no pay-to-win mechanics. No server wipes—your progress is permanent. Fair play is a priority, with no room for corruption. All players are treated equally, no special favors.     Buffs slots: 26+4, all buffs in NPC and Scheme System. Custom Armors: Aurum Apella Armor Custom Weapons: Aurum Weapon Custom Accessories: +300 P.Def & M.Def Tattoos: Mage & Fighter & Custom Shirts Custom Jewels: New Grand Bosses Auto Farm is FREE for everyone. Status Noblesse: Barakiel. Player Spawn Protection: 10 seconds. Geodata e Panthodes: ENABLED. All Commands are visible in .menu. System 2 Bishop Per Party: ENABLED. Boss Protect - Anti-Zerg: ENABLED.     Siege Duration: 2 hours (120 minutes). Siege Period: Every 7 days. Castle Reward: 100E Per Castle. Available Castles: Rune Aden Giran Giran Siege: Every Friday 20:00 GMT +2. Aden Siege: Every Saturday 20:00 GMT +2. Rune Siege: Every Sunday 20:00 GMT +2. Main Clan: 40 Members max. Royal Clan: 12 Members max. Knight Clan: 7 Members max. Alliance: You can have only 1.     Epic Boss Valakas: Monday 22:30 (GMT+2) Zaken: Tuesday | Thursday 22:30 (GMT+2) Queen Ant: Monday | Wednesday 22:30 (GMT+2) Baium: Friday 22:30 (GMT+2) Antharas: Saturday 22:30 (GMT+2) Orfen: Tuesday | Thursday | Saturday 18:30 (GMT+2) Core: Monday | Wednesday | Friday | Sunday 18:30 (GMT+2)   Raid Boss  Flame Of Splendor Barakiel Last Hit: Every Day Respawn 3-4 hours Ember: Every Day Respawn 3-4 hours Lilith: Every Day Respawn 3-4 hours Anakim: Every Day Respawn 3-4 hours Queen Shyeed: Every Day Respawn 3-4 hours Golkonda: Every Day Respawn 3-4 hours Shuriel: Every Day Respawn 3-4 hours Varka's Hero Shadith: Every Day Respawn 3-4 hours Ketra's Hero Hekaton: Every Day Respawn 3-4 hours Varka's Mos: Every Day Respawn 3-4 hours Chief Horus: Every Day Respawn 3-4 hours Ketra's Tayer: Every Day Respawn 3-4 hours Chief Brakki: Every Day Respawn 3-4 hours Sailren: Every Day Respawn 02:00   🥳🥳🥳🥳 I would like to chat personally with all of you over on our Discord and discuss any suggestions or feedback you might have.      Website: https://l2aurum.com/  Discord: https://discord.gg/l2aurum
    • 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
    • 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
    • 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
  • Topics

×
×
  • Create New...