Jump to content

Auto Potion refill event


Recommended Posts

Hi, this is a small feature which starts a recovery/refill event on auto potions when the player is near a given NPC.

In my example i use a range of 1500 units and NPC 9001 (Weapons Dealer), but you can change it as you want. Maybe add a new config token if you want.
When you enter the radius of 1500 units around the npc the refill event will start and restore 10% of the auto potions max value every 3 seconds. When you leave the radius the event stops.
 

If there are any questions/suggestions let me know.

This is the hidden content, please

Alternative download links → 

This is the hidden content, please

  • Metin2 Dev 41
  • Good 6
  • Love 15
Link to comment
Share on other sites

12 hours ago, HFWhite said:

Do you have a video/gif of the system ? I don;t really understand what it does.

When you are within a certain radius of NPC x, your Auto Potion will be refilled. This means if your Auto Potion only has 5% remaining, it will regenerate/refill your potion.

  • Good 1
Link to comment
Share on other sites

  • 2 weeks later...
On 5/26/2024 at 7:32 PM, treizen said:

Hi, thank you. But what's the item ID please?

I have used the default values from unique_item.h

	ITEM_AUTO_HP_RECOVERY_S	=	72723,
	ITEM_AUTO_HP_RECOVERY_M	=	72724,
	ITEM_AUTO_HP_RECOVERY_L	=	72725,
	ITEM_AUTO_HP_RECOVERY_X	=	72726,

	ITEM_AUTO_SP_RECOVERY_S	=	72727,
	ITEM_AUTO_SP_RECOVERY_M	=	72728,
	ITEM_AUTO_SP_RECOVERY_L	=	72729,
	ITEM_AUTO_SP_RECOVERY_X	=	72730,

and simply re-assigned them to the enum

enum EAutoPotion
{
	ITEM_AUTO_HP_POTION_1 = ITEM_AUTO_HP_RECOVERY_S,
	ITEM_AUTO_HP_POTION_2 = ITEM_AUTO_HP_RECOVERY_M,
	ITEM_AUTO_HP_POTION_3 = ITEM_AUTO_HP_RECOVERY_L,
	ITEM_AUTO_HP_POTION_4 = ITEM_AUTO_HP_RECOVERY_X,
	ITEM_AUTO_SP_POTION_1 = ITEM_AUTO_SP_RECOVERY_S,
	ITEM_AUTO_SP_POTION_2 = ITEM_AUTO_SP_RECOVERY_M,
	ITEM_AUTO_SP_POTION_3 = ITEM_AUTO_SP_RECOVERY_L,
	ITEM_AUTO_SP_POTION_4 = ITEM_AUTO_SP_RECOVERY_X,
	AUTO_POTION_MAX_NUM = 8,
};

If you use other vnums just change them in the enum. If you add or remove enum values make sure to adjust AUTO_POTION_MAX_NUM

  • Love 1
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.