Jump to content
  • 0

[HELP] How to make mana potions restore mana like hp potions


Question

Posted

I'd love to know how to make mana potions slowly restore mp over time and add some delay on them, just like hp potions, since i'm a newbie i know little to no java code, anybody can guide me step-to-step on how to edit them? thanks.

Recommended Posts

  • 0
Posted

open 2200-2299.xml

 

id 2288

 

	<skill id="2288" levels="6" name="Elixir of Mental Strength">
	<table name="#power"> 75 125 175 250 350 420 </table>
	<table name="#minLvl"> 0 20 40 52 61 76 </table>
	<table name="#maxLvl"> 20 40 52 61 76 86 </table>
	<set name="itemConsumeCount" val="1" />
	<set name="power" val="#power" />
	<set name="target" val="TARGET_SELF" />
	<set name="skillType" val="MANAHEAL" />
	<set name="operateType" val="OP_ACTIVE" />
	<set name="reuseDelay" val="300000" />
	<set name="staticReuse" val="true" />
	<set name="sharedReuse" val="2287-1" />
	<set name="isPotion" val="true" />
	<cond msgId="113" addName="1">
		<and>
			<player flyMounted="False" />
			<player level="#minLvl" />
			<not>
				<player level="#maxLvl" />
			</not>
		</and>
	</cond>
</skill>

  • 0
Posted

Elixir of Mental Strenght still gives instant mp, the only difference is it has delay...

Even tho adding delay to mana potions could as well fix my problem (i don't want mana potions to be spammable...) i'd rather make them slowly restore mp...So is there any way i can do that?

 

P.S.

 

Yeah i have l2j server version 4319, datapack version 7546

  • 0
Posted

why you can't?

 

just change 2288 skill xml with this

 

	<skill id="2288" levels="6" name="Elixir of Mental Strength">
	<set name="itemConsumeCount" val="1" />
	<set name="target" val="TARGET_SELF" />
	<set name="skillType" val="HOT" />
	<set name="operateType" val="OP_ACTIVE" />
	<set name="isPotion" val="true" />
	<set name="buffDuration" val="20000" />
	<cond msgId="113" addName="1">
		<player flyMounted="False" />
	</cond>
	<for>
		<effect count="4" name="HealOverTime" time="5" val="1.5" stackOrder="1.5" stackType="HpRecover" />
	</for>
</skill>

 

and it's oky...

 

i never worked on L2jEpilogue...

  • 0
Posted

By playing around with xml files and testing and reading around the internet etc..etc...

I developed a correct syntax for mprecovery over time:

 

<set name="target" val="TARGET_SELF"/>

<set name="skillType" val="MPHOT"/>

<set name="operateType" val="OP_ACTIVE"/>

<set name="buffDuration" val="15000"/>

<set name="reuseDelay" val="10000"/>

<set name="staticReuse" val="true"/>

<set name="isPotion" val="true"/>

<for>

<effect name="ManaHealOverTime" count="15" time="1" val="50" stackOrder="1" stackType="ManaPotion"/>

</for>

This potion will restore 50 mp each second for 15 seconds for a total of 750 mp (i might lower it a bit, if u want it lower too just change the val="50" to something like: val="30")

The problem is it doesn't seem like skillid 2005 is the mana potions, unless i'm doing something wrong, this code does work if use it under elixir of mental strenght (ID 2288 in xml files), so can anyone confirm that 2005 is the mana potions ID?

  • 0
Posted

its so hard to look into the config ?

 

# ---------------------------------------------------------------------------
# Mana Drugs/Potions
# ---------------------------------------------------------------------------
# This option will enable core support for:
# Mana Drug (item ID 726), using skill ID 10000.
# Mana Potion (item ID 728), using skill ID 10001.
EnableManaPotionSupport = True

 

its also 10000 and i hope u did EnableManaPotionSupport = True

 

<skill id="10000" levels="1" name="Custom Mana Drug">
	<set name="itemConsumeId" val="726" />
	<set name="itemConsumeCount" val="1" />
	<set name="buffDuration" val="15000" />
	<set name="isPotion" val="true" />
	<set name="magicLvl" val="1" />
	<set name="operateType" val="OP_ACTIVE" />
	<set name="skillType" val="MPHOT" />
	<set name="target" val="TARGET_SELF" />
	<cond msgId="113" addName="1">
		<player flyMounted="False" />
	</cond>
	<for>
		<effect count="3" name="ManaHealOverTime" time="5" val="1.5" stackOrder="1.5" stackType="mp_recover" />
	</for>
</skill>

  • 0
Posted

Doh.... thank you very much SkyNet, yes i did enable mana potions, but i didn't pay attention to the skill Id back then cuz they were all rubbish numbers to my inexperienced eyes... =p

It seems to work now, even tho it doesn't display the item name on my chat when i use mana potions, odd o.o

This is my current code:

<skill id="10001" levels="1" name="Custom Mana Potion">
	<set name="itemConsumeId" val="728" />
	<set name="itemConsumeCount" val="1" />
	<set name="target" val="TARGET_SELF"/>
	<set name="skillType" val="MPHOT"/>
	<set name="operateType" val="OP_ACTIVE"/>
	<set name="buffDuration" val="15000"/>
	<set name="reuseDelay" val="10000"/>
	<set name="staticReuse" val="true"/>
	<set name="isPotion" val="true"/>
	<for>
	<effect noicon="1" name="ManaHealOverTime" count="15" time="1" val="35" stackOrder="1" stackType="mp_recover"/>
	</for>
</skill>

  • 0
Posted

Doh.... thank you very much SkyNet, yes i did enable mana potions, but i didn't pay attention to the skill Id back then cuz they were all rubbish numbers to my inexperienced eyes... =p

It seems to work now, even tho it doesn't display the item name on my chat when i use mana potions, odd o.o

This is my current code:

<skill id="10001" levels="1" name="Custom Mana Potion">
	<set name="itemConsumeId" val="728" />
	<set name="itemConsumeCount" val="1" />
	<set name="target" val="TARGET_SELF"/>
	<set name="skillType" val="MPHOT"/>
	<set name="operateType" val="OP_ACTIVE"/>
	<set name="buffDuration" val="15000"/>
	<set name="reuseDelay" val="10000"/>
	<set name="staticReuse" val="true"/>
	<set name="isPotion" val="true"/>
	<for>
	<effect noicon="1" name="ManaHealOverTime" count="15" time="1" val="35" stackOrder="1" stackType="mp_recover"/>
	</for>
</skill>

 

Thanks for this I was looking for this kind of code =)

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

    • Hi everyone, A while ago, I needed to extract some L2 textures and found that acmi's L2Tool was a good way to do it. There might be other methods out there but I'm not aware of them, so I decided to fork this project and improve it to suit my needs. I built this using BellSoft Liberica JDK 17. Since modern Java versions no longer include JavaFX by default, I've made the app handle it automatically. You don't need any manual setup—just use the  run.bat  and it will automatically extract the required JavaFX modules on the first run. Key features of this fork: UI Overhaul: I've tweaked the interface to give it a cleaner look with Dark Mode and more detailed metadata for each texture. Export Formats: You can now extract textures in WEBP, PNG, and DDS. Individual or Batch Export: Flexible options to export a single selected texture or the entire package at once.     I'm leaving the link here in case it's useful to anyone!   Installation and Execution:     Clone the repository:   https://github.com/Ak4n1/l2tool cd l2tool          2.Build the project:   ./gradlew build              3. Run the application:         ./run.bat      Or simply double-click on run.bat.    
    • Wtb full account or items on l2 warland 
    • https://discord.gg/k53SZ4DM5z   Interlude Client L2Old Pride is a L2 Pride Interlude Based All functional skills (Not archer/mage server)   L2Old Pride Helper (Works like Woundrous Cubic) https://imgur.com/iYqmHQY Farm Zones: Cave of Trials and Elven Ruins (Chaotic) Olympiads: Every 15 days Various Cosmetic Items https://imgur.com/uoeU6Jw https://imgur.com/oCS2Zed PvP Zone: Gludin Village (No-Parties, Disguised) More than 100 new Skills https://imgur.com/6RaPsQV Max Level: 90 https://imgur.com/z4QVJKZ Gaining Xp by PVP https://imgur.com/LRqI31T Purchasable S-grade items +10 or +20 with random chance to enchant +5 Purchasable Custom Items Depends on Tier Mysterious Merchants https://imgur.com/2ZwWyPH Auto Enchant Via PvPing (with low chance) Custom Raid Bosses Siege Every Weekend (Aden, Rune, Giran) Autofarm / Drop Tracker https://imgur.com/Vz3rha6   RATES: • Start Level 80 • Max level 90  • EXP: 5000x • SP: 5000x • ADENA 6000x   ENCHANT: • Maximum enchant S Grade Items: +35. • Maximum enchant Unique/Epic Items: +25. • Maximum enchant Legendary Items: +18. • Maximum enchant Relic Items: +14. •Descriptions for rate at scrolls!   EVENTS: • TEAMS vs TEAMS • CAPTURE THE FLAG • DOMINATION • DEATH MATCH • DICE OF DEATH • CHAOTIC ZONE   OTHERS: Assistance system in pvps. Where support classes are enabled to receive pvp with a low chance, for supporting a party member during pvp. •  /sit to regen HP/MP/CP • Custom Shots Glows https://imgur.com/FLK0DmR • Achievements System • Daily Tasks System • Monthly Tasks System   CUSTOM ARMORS SETS Dread Armor/Titanium Armor Pride Armor Rykros Armor https://imgur.com/SPxoQp1   CUSTOM WEAPONS SETS Unique Weapons Pride Weapons Legendary Weapons Relic Weapons https://imgur.com/kOHNXhS   CUSTOM ACCESSORIES Standard Superior Legendary https://imgur.com/zPqNiiX   CUSTOM JEWELS/TATTOO Legendary Nightmarish https://imgur.com/gcqS28P There are many more features that you will only understand by playing and following. Beta testing server is currently open. Follow us on our discord and join our server to test it.
    • You shouldn't use rev 382, not sure why everyone keep using that.   I don't make changesets for fun, I don't make new revisions for nothing.   Follow the revisions.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock