Yanfly Buff&StateManager Lunatics/DMG

lokirafael

Veteran
Veteran
Joined
Jun 25, 2012
Messages
153
Reaction score
80
First Language
Portuguese
Primarily Uses
RMMV
Hello,


I'm trying to archieve some effects using Yanfly lunatics, but some is really hard to figure out (since I barely understand javascript).


1 - Using Buff&StateManager to create a State called: Mark of the Offering.


Ex: User put a mark in one target. If the target die while under effect of Mark of the Offering user recover all TP. (+100 TP)


(I will use this same logic for other skill with HP and MP too).


2 - The other is a custom damage skill that probaly dont need lunatics, but I'm not sure if can do using only the damage formule: Snake Attack. (provisory name)


Ex: Cause damage to target. If target under effect of status X (Its Bleeding in my game) this skill cause +1 damage for each 10 HP the target is missing. (aka 10%).


I will explain using this logic: ifstatus(x)? damage + 0.1 * (b.maxHP - b.currentHP); else damage


I have others skills that are bugging me, but those are being a pain bc theres no reference in any Trip&Tricks videos from yanfly to use.


Tyvm
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
For your Mark of the Offering you could use the same method Yanfly used for the Tips & Tricks Phoenix Ring video.


Try this in the notebox of the "Fallen" state and replace "ID" with the ID of your Mark


<Custom Apply Effect>
if (target.isEnemy() && target.isStateAffected(ID)) {
origin.setTp(100);
}
</Custom Apply Effect>


For your "Snake Attack":


It should work inside the damage formula.


b.isStateAffected(ID) ? ([damage formula]) + 0.1 * (b.mhp - b.hp) : [damage formula];


Again replace the ID with the one from your "Bleed State" and the [damage formula] with the formula you want to use for the default dmg.
 
Last edited by a moderator:

lokirafael

Veteran
Veteran
Joined
Jun 25, 2012
Messages
153
Reaction score
80
First Language
Portuguese
Primarily Uses
RMMV
For your Mark of the Offering you could use the same method Yanfly used for the Tips & Tricks Phoenix Ring video.


Try this in the notebox of the "Fallen" state and replace "ID" with the ID of your Mark



<Custom Apply Effect>
if (target.isEnemy() && target.isStateAffected(ID)) {
origin.setTp(100);
}
</Custom Apply Effect>


For your "Snake Attack":


It should work inside the damage formula.



b.isStateAffected(ID) ? ([damage formula]) + 0.1 * (b.mhp - b.hp) : [damage formula];


Again replace the ID with the one from your "Bleed State" and the [damage formula] with the formula you want to use for the default dmg.


Teste.


1 - No effect at all. Tested using agains enemy and allies and nothing happens.


2 - Somehow this formula returns zero for me all the time (no clue why). I used the logic and changed it to:


x = (b.isStateAffected(103) ? 1000 + (0.1 * (b.mhp - b.hp)) : 100); x




And worked. :D
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
Teste.


1 - No effect at all. Tested using agains enemy and allies and nothing happens.


2 - Somehow this formula returns zero for me all the time (no clue why). I used the logic and changed it to:



x = (b.isStateAffected(103) ? 1000 + (0.1 * (b.mhp - b.hp)) : 100); x




And worked. :D


About 1:


Yeah, that was a miss on my end. I'm currently looking into this.


About 2:


I tested my version with the Sleep state, and it worked as it should


b.isStateAffected(10) ? 100 + 0.1 * (b.mhp - b.hp) : 10


When the enemy lost 42 HP and was put to sleep after that, the skill did 104 dmg.


On an enemy who was awake, it only did 10 dmg.


/EDIT:


Alright, this should work for your "Mark of the Offering"


Copy this in the notebox of that state:


<Custom Response Effect>
if (target.isEnemy() && target.hp === 0) {
origin.setTp(100);
}
</Custom Response Effect>


This runs everytime a target after an attack hit/missed.


If the enemy dies from that attack, the caster of that state gets a full tp bar
 
Last edited by a moderator:

lokirafael

Veteran
Veteran
Joined
Jun 25, 2012
Messages
153
Reaction score
80
First Language
Portuguese
Primarily Uses
RMMV
About 1:


Yeah, that was a miss on my end. I'm currently looking into this.


About 2:


I tested my version with the Sleep state, and it worked as it should



b.isStateAffected(10) ? 100 + 0.1 * (b.mhp - b.hp) : 10


When the enemy lost 42 HP and was put to sleep after that, the skill did 104 dmg.


On an enemy who was awake, it only did 10 dmg.


Yeah. I now know the problem. You put a ";" in the end so it aways return 0. xD I didnt realise that before. W/O that last symbol works like a charm.
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
Yeah. I now know the problem. You put a ";" in the end so it aways return 0. xD I didnt realise that before. W/O that last symbol works like a charm.


I tried it too after i saw that ";" and it worked. Weird...


Oh, I edited my answer with a way for your Mark skill.
 
Last edited by a moderator:

lokirafael

Veteran
Veteran
Joined
Jun 25, 2012
Messages
153
Reaction score
80
First Language
Portuguese
Primarily Uses
RMMV
I tried it too after i saw that ";" and it worked. Weird...


Oh, I edited my answer with a way for your Mark skill.


Thanks. Tested and running good.


Two questions if you dont mind (to improve otheres marks):


1 - Is possible to determine if the one that kill the target is the same that put the status? Right now anyone that kill the enemy give the TP to the user.


2 - Theres a command to add a buff to the target? (I know i can add status, but never see a buff)


Tyvm ^^
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
Thanks. Tested and running good.


Two questions if you dont mind (to improve otheres marks):


1 - Is possible to determine if the one that kill the target is the same that put the status? Right now anyone that kill the enemy give the TP to the user.


2 - Theres a command to add a buff to the target? (I know i can add status, but never see a buff)


Tyvm ^^


1. It is possible with this code


<Custom Response Effect>
if (target.isEnemy() && target.hp === 0) {
if (attacker.actorId() === origin.actorId()) {
origin.setTp(100);
}
}
</Custom Response Effect>


2. A buff is the same thing as a state.


Here's a Screenshot from an ATK Up Buff I just created:





And the skill for it:


 

lokirafael

Veteran
Veteran
Joined
Jun 25, 2012
Messages
153
Reaction score
80
First Language
Portuguese
Primarily Uses
RMMV
1. It is possible with this code



<Custom Response Effect>
if (target.isEnemy() && target.hp === 0) {
if (attacker.actorId() === origin.actorId()) {
origin.setTp(100);
}
}
</Custom Response Effect>


2. A buff is the same thing as a state.


Here's a Screenshot from an ATK Up Buff I just created:


Thanks. Now my assassin is almost done. :D
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,231
Members
137,607
Latest member
Maddo
Top