Recover HP When Equipping Certain Equips

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
Hey everyone, I wold like a plugin that will recover a certain amount an health when certain equipment is put on. For Example: 


Actor1 has 34/62 HP. When he puts on the magic robes his Max HP goes up by 6 and he recovers 6 HP, so now his health is 40/68. When he removes the armour it goes back to 34/62. 


Is there a plugin that covers this?
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Here you go!


http://pastebin.com/fvugfX4F


(It works with both HP and MP!)


Just note that it may have compatibility issues with any plugin that deals with the equip menu.


Let me know if you have any issues and I'll look into it.
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
Here you go!


http://pastebin.com/fvugfX4F


(It works with both HP and MP!)


Just note that it may have compatibility issues with any plugin that deals with the equip menu.


Let me know if you have any issues and I'll look into it.


It works! And it seems to be playing nicely with my other plugins. The only thing is that with Yanfly's Item Upgrade plugin when you attach a mod to an already equipped weapon or armor that increases health, the plugin doesn't adjust the hp difference. I would appreciate it if you could make it compatible with yanfly's plugin. 
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
It works! And it seems to be playing nicely with my other plugins. The only thing is that with Yanfly's Item Upgrade plugin when you attach a mod to an already equipped weapon or armor that increases health, the plugin doesn't adjust the hp difference. I would appreciate it if you could make it compatible with yanfly's plugin. 
Ok.  I think I got it working for ya!


First, I had to update my plugin, so redownload that.


As for the rest, you just have to use the Eval notetags including the function I added.


for example, Let's say you have an item that increases HP by 10.


You'd make the following notes in the item's notebox:


<Upgrade Effect>


Eval: num = 10


Eval: item.params[0]+= num;


Eval: if ($gameParty.checkItemIsEquippedId(item) > 0) $gameActors.actor($gameParty.checkItemIsEquippedId(item))._hp += num;


</Upgrade Effect>


This will increase the item stat (HP), then increase the specific actor's HP who is equipped with the item!


Give it a try and let me know if you have any further issues.


Just remember that you MUST be using YF Itemcore plugin and have Instance Items turned on for this to work right.


(I'll be using this add-on myself!  Thanks for the suggestion!)
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV





Perfecto. My sir and/or madam you are an annoying peeve saver. if there is anything writing, eventing, or database related that I can help with, do not hesitate to ask.


Edit: I think I came across something. I changed the hp to mp in the third eval line, but the item only increases HP.
 
Last edited by a moderator:

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A





Perfecto. My sir and/or madam you are an annoying peeve saver. if there is anything writing, eventing, or database related that I can help with, do not hesitate to ask.


Edit: I think I came across something. I changed the hp to mp in the third eval line, but the item only increases HP.
To switch to mp, you also have to change the second Eval line to params[1].
 
Last edited by a moderator:

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
To switch to mp, you also have to change the second Eval line to params[1].
Duh. I should have seen that. That's what I get for reading code at 3 in the morning. Is there any special way that I should credit you in my game?
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Duh. I should have seen that. That's what I get for reading code at 3 in the morning. Is there any special way that I should credit you in my game?
Just a "Special Thanks to Maliki79" would be fine.  And a promise you'll let me know when you release it!


Glad to have helped and Good luck!
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
Will do. Will do.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,016,998
Members
137,562
Latest member
tamedeathman
Top