Help creating this skill please?

I am wanting to recreate Devoted Sacrifice from Unison League which is
You receive the damage inflicted on all allies for 5 seconds. Only you will take damage from both all-party and multiple-unit attacks, but damage received will increase with the number of targets the attacks are originally intended to hit. While this is in effect, your HP will not be reduced to 0.

To translate into RM words:
Only the user takes all the damage (including that of attacks that hit multiple allies) that would be received by all allies for this turn only. While this is in effect, the user's HP cannot drop below 1.

My question is how can I create this in MV?
Hmm, it seems like Yanfly Taunt plug-in would be used, to give you a taunt skill that provokes enemy attacks onto the user, but you'd have to inflict a state on your that gives you immortality pretty much. Have that state last however long you want, then on the last turn it is effective, maybe heal 1 hp, just in case you did go to 0 hp? I dunno, probably not the most elegant way to handle that, but it's a start to get the gears turning.
I think you could adapt this http://yanfly.moe/2016/11/17/tips-tricks-lightning-rod-pokemon-rpg-maker-mv/
by removing all instances of element check and giving your state (the one instead of lightning) rod knock out/death resist. Also be sure to remove the value = 0 part, just make it default damage.
This is what you're looking for 🙂
http://yanfly.moe/2016/12/07/tips-tricks-aura-of-sacrifice-world-of-warcraft-rpg-maker-mv/
@Sauteed_Onion @gambitben @Fernyfer775 Thanks. Also, a few more skill-related questions:
*Is it possible to make a skill that gives the rest of the party the same buffs that the user currently has? (This is a attempt to recreate White Charm from Unison League)
*How do I randomize the number of times the effect of a skill hits in a single use (ie: using a skill that deals its damage formula between 2 to 5 times at random in a single use)?
*How do I make a skill that randomly deals either a physical (a.atk * 4 - b.def * 2) or magical (a.mat * 4 - b.MDF * 2) damage formula when used?
For the sharing buffs on the user, I believe this is how you'd do it:
You need Yanfly's Skill Core.
In the var spread = [ ] section is where you put the State ID's and change the X in this section to the animation ID you want to play when it happens targ.startAnimation(X);
<Post-Damage Eval>
var spread = [1, 2, 3, 4, 5, 6];
spread = target.states().filter(function(state) {
return spread.indexOf(state.id) > -1;
});
if (spread.length > 0) {
var group = target.friendsUnit().members();
while (spread.length > 0) {
var state = spread.shift();
group.forEach(function(targ) {
targ.startAnimation(X);
targ.addState(state.id);
});
}
}
</Post-Damage Eval>

EDIT: dohhh, this is for STATES, not buffs... :/
@Fernyfer775 It's fine- we all make mistakes.
Also, a few more skill-related questions:
*Is it possible to make a skill that gives the rest of the party the same buffs that the user currently has? (This is a attempt to recreate White Charm from Unison League)
I'm not familiar with Unison League, so let's go with an example to clarify what you're seeking. Say Harold and Therese are adventuring toegther. Harold has 1 x atk buff, 2 x def buff, and 1 x luk debuff, while Therese has 1 x atk buff, 1 x def debuff, and 1 x agi buff. If Harold uses this skill, do you expect Therese to end up with:
  • 1 x atk buff, 2 x def buff, 1 x luk debuff (new buffs override old ones)
  • 2 x atk buff, 1 x def buff, 1 x agi buff, 1 x luk debuff (new buffs add to old ones)
  • Something else?
*How do I randomize the number of times the effect of a skill hits in a single use (ie: using a skill that deals its damage formula between 2 to 5 times at random in a single use)?
I think you'd need a plugin. This one looks worth a try: https://forums.rpgmakerweb.com/index.php?threads/random-repeats.49476/
*How do I make a skill that randomly deals either a physical (a.atk * 4 - b.def * 2) or magical (a.mat * 4 - b.MDF * 2) damage formula when used?
Try putting this for the skill's damage formula:
Code:
Math.randomInt(2) === 0 ? a.atk * 4 - b.def * 2 : a.mat * 4 - b.mdf * 2
Math.randomInt(2) returns a random integer from 0 to 1, i.e. 0 or 1. Note that the skill's hit type has nothing to do with the damage formula, though. If you want a true "random skill" setup maybe try the workaround mentioned here: https://forums.rpgmakerweb.com/index.php?threads/skill-that-make-user-cast-random-skill.75529/
@caethyril White Charm does not transfer debuffs, only buffs, so it is more like this:
Harold has atk buff x3 and def buff x4, Therese has atk buff x1, def buff x1, and agi buff x2. After Harold uses White Charm, Therese ends up with atk buff x4, def buff x5, agi buff x2.
OK...I'm not entirely certain, but after a bit of testing with a skill set to target all allies the following notetag seemed to work. 😅

This requires Yanfly's Skill Core plugin:
Code:
<Post-Damage Eval>
for (var p = 0; p < user.buffLength(); p++) {
  if (!user.isBuffAffected(p)) continue;
  if (target.buff(p) >= user.buff(p)) continue;
  var t = Math.max(target._buffTurns[p], user._buffTurns[p]);
  for (var n = (user.buff(p) - target.buff(p)); n >= 0; n--) {
    target.addBuff(p, t);
  }
}
</Post-Damage Eval>
A line-by-line explanation:
Spoiler
  • Loop over all buffable parameters p;
  • If this param is not buffed for the skill user, skip to next param;
  • If target has an equal or higher buff on this param compared to skill user, skip to next param;
  • Set turns remaining on applied buff, t, equal to that of the user's/target's current buff on this param, whichever is larger (you may want to change this?);
  • Do this next bit once per level of difference between user and target buffs on this param;
  • Apply 1 buff level to param p, with duration t turns.
😮‍💨
@caethyril I tried that note-tag, but it didn't work.
Sorry for the delay! Just tested again to be sure and it looks like it's working for me with no plugins other than YEP_SkillCore. Buffs on the user are transferred to all living allies.

In what way does it not work for you? E.g. maybe nothing seems to happen, or the wrong thing happens, or the game crashes? 😅
  • If you're using battle-test for this, be sure to save your project just beforehand, otherwise changes to your plugins may not be seen during the test.
  • If you're using play-test, be sure to test from a new game rather than continuing from a save.
It's a good idea to make sure your Yanfly plugins are in the order recommended on http://yanfly.moe/yep/

Failing that, maybe list which plugins you're using? 😅
@caethyril It just plays the animation as if it worked, but the buffs did not transfer. I have all my YEP plugins in the right order. and I haven't added new plugins (as all of the ones you said I needed I already had in the project). And when play testing, I always start from new save. And I always save before battle tests. I'm starting to wonder if I was supposed to replace the p's with something.
@JtheDuelist ...OK, just realised that this was my fault, I somehow gave you something completely different to what you asked for. >_<

Try this one instead:
Code:
<Post-Damage Eval>
for (var p = 0; p < user.buffLength(); p++) {
  if (!user.isBuffAffected(p)) continue;
  if (user == target) continue;
  var t = Math.max(target._buffTurns[p], user._buffTurns[p]);
  for (var n = user.buff(p); n > 0; n--) {
    target.addBuff(p, t);
  }
}
</Post-Damage Eval>
This one ought to add the buffs as you wanted. The previous one made the target's buffs equal the user's buffs for some reason...sorry about that. 😴

Edit: oh, and you shouldn't need to replace anything, just copy+paste. 😅

Edit2: added a line to prevent the user from buffing themselves!
@caethyril The skill still doesn't do as it should, even with the new notetags.
Here are my plugins.
Plugins1.png
Oh. Sorry, I'm not sure what might be going wrong then. I suspect it's a conflict somewhere, but I had a search through both Skill Core and Mog's plugins for relevant terms and couldn't find any likely-looking culprits. .-.

Unless someone has a better idea, my only suggestion at this point would be to try turning off various plugins to see if you can find which one is conflicting...
@caethyril I may try @Fernyfer775's idea and use states as buffs. If that doesn't work, I'll just scrap the ability.

Original thread: https://forums.rpgmakerweb.com/threads/help-creating-this-skill-please.95818/