Experience Potion and Mana Potion

==Experience Potion and Mana Potion==
by @mike_the_monk
=== Summary ===
Health Potions are already built into Habitica. What about Experience and Mana Potions? Sure, you could use Fix Character Values to mimic the effect of these potions, but it's easier to use this script below to add either of them (or both) to your Custom Rewards.
When you click each custom reward, it will grant you either +150 XP in the case of the Experience Potion or +30 MP in the case of the Mana Potion, though you may have to sync Habitica before the results appear.
----
=== Experience Potion details===
As you gulp down this golden liquid, you feel a rush of insight. Your recent experiences seem so clear and obvious now, and you're that much closer to your next level.
Experience Potions are a Reward that cost 25 gold. An experience potion will instantly give you 150 experience points (XP) upon purchase (though you may have to sync Habitica before the XP appears).
These potions unlock at level 21, trying to use them before that level will refund your gold and give you an error message (as a private message). You are limited in the number you can buy per day and cannot gain more than 1/3 of the XP needed to get to the next level to ensure you can't gain too much XP just from these potions. The table below shows how many Experience Potions you can buy each day at a given level.
Max XP Potions you can buy per day	1 	2 	3 	4 	5 	6 	7 	+
Levels 	21-38	39-52	53-63	64-73	74-83	84-91	92-99	And so on
Trying to buy more potions than these limits will refund your gold and give you an error message (as a private message).
----
=== Mana Potion details===
You feel a surge of energy as you swallow this sapphire liquid. Your Mana is restored and you can use your class skills sooner.
Mana Potions are a Reward that cost 25 gold. A mana potion will instantly give you 30 mana points (MP) upon purchase (though you may have to sync Habitica before the MP appears). If you are close to your maximum Mana, the potion will fill you to the maximum but not beyond it and send you a private message letting you know. If you are already at the maximum, the potion will have no effect to your MP, instead refunding your gold and sending you a message.
These unlock at level 11 because Mana unlocks at that level, trying to use them before that level will refund your gold and give you an error message (as a private message). You are limited to purchasing four per day. Trying to buy more than four will also refund your gold and give you an error message.
====Code====
*https://raw.githubusercontent.com/mike-the-monk/Habitica-customizations/main/Automated%20FCV%20scripts/Experience%20and%20Mana%20Potions
==== Required Customizations ====
Which of these custom potions do you want to create? You can create one or both.
*CREATE_EXPERIENCE_POTION will create the Experience Potion custom reward if the value is set to 1 (which is the default). If you don't want the Experience Potion, change the value to a 0.
*CREATE_MANA_POTION will create the Mana Potion custom reward if the value is set to 1 (which is the default). If you don't want the Mana Potion, change the value to a 0.
====Optional Customizations====
*NOTIFICATIONS_ON can be changed to a 0 so you don't get any private message notifications; if you keep it as a 1, you'll get all the usual messages (examples include if you're already at max Mana or exceeded the limit for daily potion usage)
----
===Credits and Acknowledgments===
*This wiki page, especially the section on custom rules, for giving the idea of how to use Fix Character Values to create custom potions.
*@EugeneG's code for the Warrior subclasses, and also his answers to my many questions.
Category:Extensions, Add-Ons, and Customizations
zh:经验药水和魔法药水
Category:Pages with files missing alt tags