Jump to content
  • 0

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


Ramzah

Question

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.

Link to comment
Share on other sites

Recommended Posts

  • 0

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>

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0

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>

Link to comment
Share on other sites

  • 0

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>

Link to comment
Share on other sites

  • 0

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 =)

Link to comment
Share on other sites

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
Answer this question...

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



×
×
  • Create New...