*copies & pastes information*
Another skill is something called "Soul Eater" and what I hope to do for this one that I have no idea how to accomplish, is for the user to heal 50% of their health on kill of an enemy. But in truth, I would like to figure out how to make this a passive ability, rather than a spell attack of sorts. Does this make sense?
Any and all help would be appreciated~! This skill is actually something I hope to implement within the game as it is rather unique to the character itself~
~ Dragon
[Solved~!] Passive Leech Health Skill
● ARCHIVED · READ-ONLY
-
-
When you specifically want this to happen at the end of a kill, you will need the Buffs & States Core that Yanfly has and add the following to the Knockout state (let's say your actor is #2):
<Custom Apply Effect>
if (origin.isActor(){
if (origin.actorId() === 2){
origin.gainHp(user.mhp * 0.5);
}
}
</Custom Apply Effect>
To rough this out, apply is when the state is given to the target (in this case, the Knockout state, default at #1 in Database). It then checks if the battler giving the state is an actor and if that's true, checks if the actor's ID is 2 (the number order in your actor list). If this is also true, it then heals the state giver by half the user's maximum HP (this is the battler with the state). -
So would I add that to the notebox of the Knockout state then? Or to the formula? And... I would just change the number 2 to the correct actor number and it would work?
~ Dragon -
You just add that to the state's note box, and you would change to the actorId number of the actor you want it for.
It should work after that unless I missed something. -
Like this?
~ Dragon -
Yes, that's right so far, but there is one line I forgot about; you said this is a passive skill, so we have to add a check for that:
<Custom Apply Effect>
if (origin.isActor()}{
if (origin.actorId() === 8){
if (origin.skills().contains($dataSkills[5])){
origin.gainHp(user.mhp * 0.5);
}
}
}
</Custom Apply Effect>
The third line does a check that the actor previously checked for has skill #5 learned (change this number to what your skill is on). -
It might work without the skill being listed as a skill, but if it doesn't, I'll try that method too~
~ Dragon -
So... an update on this...
It did not work. And I'm not entirely certain what I might be doing wrong.
~ Dragon -
So... an update on this...
It did not work. And I'm not entirely certain what I might be doing wrong.
~ Dragon
Did you check it actually healed? Meaning your actor was not on full HP at the time of kill.
Also, adding the following line will help:
origin.startDamagePopup();
which will display the resulting heal; thus you should get
<Custom Apply Effect>
if (origin.isActor()}{
if (origin.actorId() === 8){
if (origin.skills().contains($dataSkills[12])){
origin.gainHp(user.mhp * 0.5);
origin.startDamagePopup();
}
}
}
</Custom Apply Effect>
assuming your skill is #12. -
My character was not at full health. Which is the only reason I said it wasn't working.
But I will try the new code tomorrow. Thank you~
~ Dragon -
Okay, so... it still isn't working. But to be sure I'm not doing anything wrong with the information I have been given, I'm gonna post what my database looks like for both this skill and the Knockout state.
Knockout Skill:
(The text in the notebox: )
State #1 will be automatically added when HP reaches 0.
<Custom Apply Effect>
if (origin.isActor(){
if (origin.actorId() === 8){
if (origin.skills().contains($dataSkills[22])){
origin.gainHp(user.mhp * 0.5);
origin.startDamagePopup();
}
}
}
</Custom Apply Effect>
And Soul Eater skill:
Is it anything with what I am doing with this skill or state the problem? Please let me know...
I can also provide battle proof of the skill not working if it is needed. No health is gained after the enemy is KO'd.
~ Dragon -
Can you display the actor ID number and the skill being inside the class' learn skill window?
-
Like... this?
I'm almost certain I have all the variables right... but I still don't know why it's not working...
~ Dragon -
Is this actor doing the finishing blow?
-
Yes. When I test the skill, I have the actor in a party on his own. I let him get damaged a little, attacking the enemy- two Bats- and when he kills them, no health is gained from their death.
Let me provide an image of this proof to further detail what I mean...
How the passive skill shows in his skill menu:
Character Health:
After Kill:
See?
~ Dragon -
And your Buffs & States Core plugin is ON? Sounds like the plugin is not reading the notetag.
-
~ Dragon -
What might help is ordering your plugins according to Yanfly's website, which in your case is:
Battle Engine Core > Buffs & States Core > Damage Core >Target Core > Selection Control > Skill Core
The only one you seem to need to move is the damage core. -
Still nothing...
If nothing else works, I may have to give up.
~ Dragon -
I have just noticed your isActor check is missing a right bracket ); you need to add it (granted, it was an error on my part):
<Custom Apply Effect>
if (origin.isActor()){
if (origin.actorId() === 8){
if (origin.skills().contains($dataSkills[22])){
origin.gainHp(user.mhp * 0.5);
origin.startDamagePopup();
}
}
}
</Custom Apply Effect>