Mjolk

Villager
Member
Joined
Jan 23, 2015
Messages
17
Reaction score
3
First Language
english
Primarily Uses
Hello,

I want to do a skill which gives a status buff to the Max Hp TEMPORARILY, and at the end of the status turns the hp returns to normal.

Example: Erick HP/Max HP: 1000/1000 after status buff (+500) it becomes Erick HP/Max HP: 1000/1500, at the end of the effect return Erick HP/Max HP: 1000/1000.
Example in middle battle: Erick HP/Max HP: 350/1000 after status buff (+500) it becomes Erick HP/Max HP: 850/1500, at the end of the effect return Erick HP/Max HP: 350/1000.

I know, I can do it with the basic engine of RPG MAKER, but I can ONLY increase the maximum number of HP and don't give a TEMPORARY buff to Max Hp.


An perfect example of skill: https://wiki.guildwars.com/wiki/Endure_Pain

No one knows how the script could be with Yanfly Buffs & States Core?
Any suggestions are welcome!

Thank you!
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,761
Reaction score
2,110
First Language
EN
Primarily Uses
RMMZ
This is just from memory so there might be issues, but maybe try something like:
Code:
<Custom Apply Effect>
var boost = 500;
user.addParam(0, boost);  // mhp up
user.gainHp(boost);  // hp up
</Custom Apply Effect>

<Custom Remove Effect>
var boost = 500;
user.gainHp(-boost);  // hp down
user.addParam(0, -boost);  // mhp down
</Custom Remove Effect>
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,143
First Language
English
Primarily Uses
RMMV
@Mjolk If the actor loses HP when the buff ends, what happens if their HP goes below zero? Should they die?

Example:
HP before buff: 350/1000
HP buff added: 850/1500
HP after being attacked: 200/1500
HP buff expire: 0/1000 (are they dead?)
 

Mjolk

Villager
Member
Joined
Jan 23, 2015
Messages
17
Reaction score
3
First Language
english
Primarily Uses
This is just from memory so there might be issues, but maybe try something like:
Code:
<Custom Apply Effect>
var boost = 500;
user.addParam(0, boost);  // mhp up
user.gainHp(boost);  // hp up
</Custom Apply Effect>

<Custom Remove Effect>
var boost = 500;
user.gainHp(-boost);  // hp down
user.addParam(0, -boost);  // mhp down
</Custom Remove Effect>

Hello, thank you for answering.
This works very close (I was not aware of the command user.addParam), but when it loses the buff the damage is reflected on the normal hp.
Example: HP before buff: 1000/1000, buff added: 1500/1500 enemy hit (for 300 damage) 1200/1500 HP buff end: 700/1000 <---issues
The real result was: HP buff end: 1000/1000
In practice with this code are +500hp fake.

Anyway, thank you for the answer is very appreciated, now I have some more elements to succeed.
 
Last edited:

Mjolk

Villager
Member
Joined
Jan 23, 2015
Messages
17
Reaction score
3
First Language
english
Primarily Uses
@Mjolk If the actor loses HP when the buff ends, what happens if their HP goes below zero? Should they die?

Example:
HP before buff: 350/1000
HP buff added: 850/1500
HP after being attacked: 200/1500
HP buff expire: 0/1000 (are they dead?)
Yes, right!
The enemy hits the the result of normal hp + temporarily stock of 500 hp, if the hero has less when the buff ends it dies or stays with 1 hp (for me it's the same).

Exactly like in this skill:
https://wiki.guildwars.com/wiki/Endure_Pain

Is written in the notes:
  • This skill is best used when very low on health.
  • The health gained is temporary; your health can drop below zero when this ends. However, if that happens, you won't always die. For example, if you have positive health regeneration, your health bar will show 1 health while you recover the negative health caused from this skill ending. But if you have health degeneration or take any damage, you will die. Healing may also be fatal if it does not bring your health above zero.


Thanks for your interest!











Ok Edit, i have Resolved.

The code is:
Code:
<Custom Apply Effect>
target._boostDmg = target._boostDmg || 500;
var boost = 500;
user.addParam(0, boost);       // mhp up
user.gainHp(target._boostDmg); // hp up
</Custom Apply Effect>

<Custom React Effect>
target._boostDmg = target._boostDmg || 500;
if (this.isHpEffect()) {
   target._boostDmg = target._boostDmg || 500;
   if (value > 0) {
      target._boostDmg -= value;
 }
}
</Custom React Effect>

<Custom Remove Effect>
target._boostDmg = target._boostDmg || 500;
if (target._boostDmg < 0) {
   value = 0;
}
var boost = 500;
user.gainHp(-value);       // hp down
user.addParam(0, -boost);  // mhp down
target._boostDmg = undefined;
</Custom Remove Effect>

I applied a counter that degenerates the hp boost, and if the damage goes further it is reflected in the remaining hp.
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,761
Reaction score
2,110
First Language
EN
Primarily Uses
RMMZ
Oh I see, nice to see you found a solution! :D
 

Latest Threads

Latest Profile Posts

so... I decided since a park was an area in my game... here's an enemy that's slide with a hand behind it. cause why not.
Hot chocolate and music make studying and note-taking much easier :kaoluv:
Until my hand cramps up from writing too much!
Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png

Forum statistics

Threads
115,270
Messages
1,088,497
Members
149,875
Latest member
BlaireBear1
Top