MV Lancet / Skill Steal Plugin

Hello,

I found the exact plugin I am looking for but it is for VX Ace, and I have searched high and low but have not yet found anything similar enough to it for MV.

In short, it allows the creation of a "Skill Steal" skill. It was known as "Lancet" in Final Fantasy X. Basically, it allows the user to learn certain skills known by the enemy by using a special skill on them. It's a take on Blue Magic from earlier FF games, where you're sort of learning the enemy's skill by magical absorption.

To be super clear on how it works and what I'm wanting, specifically:

- The user knows a skill ("Skill Steal" or "Lancet") that can absorb enemy skills (i.e. will teach the user enemy skills when used on them in battle).

- When the user casts this skill on an enemy, if the enemy has a "stealable" skill (designated by note tag on the skill itself), the user will have a chance at learning it.

- Once a skill is learned by the user it is permanent.

- If the user uses the "Skill Steal" skill on an enemy who has no stealable skills or else whose skill they have already acquired, it fails (or misses, or else a message appears stating that the user already knows the enemy's stealable skill).

For this current project, I am not looking for anything more than this functionality, although I have ideas for how the plugin could be expanded if anyone wants to get crazy with it!

Would it be possible for someone to rewrite this for MV?

Here's the link: https://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/skill-steal/

The Github link is still active on that page with the existing plugin code for VX Ace.

I'm using a lot of Yanfly plugins in my project, including Skill Core, so I would need compatibility with them.

<snip by moderator> I'm planning on releasing the game via Steam when it is done, so it would be used commercially.

Thank you in advance!
Since you are familiar with Yanfly's plugins, I think you should take a look at THIS video of his. It may serve your purpose.
Since you are familiar with Yanfly's plugins, I think you should take a look at THIS video of his. It may serve your purpose.
I appreciate your response. I have watched the video but the mechanics are quite different from the "Lancet" form of Blue Magic found in FFX.

With the Blue Magic implementation in that video, a user has to be of a certain class (Blue Mage) and attacked by the enemy in order to learn the skill. I'm looking for something that is class-less and works the other way around—where the user has to use a skill on the enemy in order to absorb/steal their special skills.

I tried to adapt the Blue Magic eval posted by Yanfly to suit my purposes, but in the end I just couldn't figure out how to make it all work.
Hi @DarkGTX88 could you please remove Yanfly's script from your post, and give a link to it instead?

There is a Steal & Snatch plugin for MV but I don't know if that's what you're after.
Huh, really? I get relevant stuff when I Google skill steal. I think this is a tutorial on doing it via events:


And here's a mini-plugin I wrote for someone previously:

It doesn't do the searching enemy skills for a notetag, but it goes off of skill type which should be the same thing in most occasions - enemies don't actually have any need for skill types.
Huh, really? I get relevant stuff when I Google skill steal. I think this is a tutorial on doing it via events:


And here's a mini-plugin I wrote for someone previously:

It doesn't do the searching enemy skills for a notetag, but it goes off of skill type which should be the same thing in most occasions - enemies don't actually have any need for skill types.


It looks like that video is just teaching how to create a Steal (items) skill, not a skill for stealing skills from enemies. (Which is a lot of what I found when Googling for this.)

Your snippet/plugin is very close to what I'm looking for though! Thank you!

I've already implemented it for testing purposes and it seems to work well. The only concern I have is that I would like to specify the exact Skill Type ID to be stolen from an enemy, rather than having it pick a random skill of a type which also matches the skill types of the actor.

This is because I'd like enemies and actors to both know "Magic" skills and I DON'T want magic skills to be stealable from enemies.

Of course, I could just duplicate the magic skills and create a second set just for enemies that has no skill type (or a different skill type). It's just a bit of an inconvenience with the number of enemies and skills I'm working on in this project.

EDIT: After continuing to tinker with your plugin, I am loving it!

How would I go about setting up my common event such that it displays a specific message when the user already knows that particular skill?

Currently, I have my common event set up so that if the variable specified is != 0, it displays the "Skill Learned" message, else it displays "Unsuccessful."

What condition would equal "Player already knows the skill trying to be stolen"?
I cannot share the code I was commissioned to do, but what you are looking for can be done with minimal effort. 😀
I made it work using 1 enemy note tag and a custom damage formula (the entire code is IN the formula for max plugin compatibility)

Plays a sound effect when new skill is learned, a different sound if the skill is already known, as well as stating what skill name it was attempting to steal.
1687094643773.png

1687094773567.png


Not here to brag or anything, just letting you know not to give up as it can be done! 😀
(images posted with my commissioners permission)
The only concern I have is that I would like to specify the exact Skill Type ID to be stolen from an enemy, rather than having it pick a random skill of a type which also matches the skill types of the actor.
So you'd just modify the condition on line 10. If you want to only learn skills of skill type 3, for example, you'd change it to:
Code:
if (user.isLearnedSkill(skill) || $dataSkills[skill].stypeId!=3)

If you want to give skills a <stealable> notetag and you can only steal those skills (but are guaranteed to steal one if the enemy has it), here's the rewritten function:
Code:
function StealSkill(user, target)
{
    if (target.isActor())
        return 0;
    
    var enemy=$dataEnemies[target.enemyId()];
    
    var skillList=enemy.actions.filter(skill => $dataSkills[skill.skillId].meta.stealable);

    if (!skillList.length)
        return 0;

    var skill=skillList[Math.randomInt(skillList.length)].skillId;
    
    if (user.isLearnedSkill(skill))
        return 0;
    
    user.learnSkill(skill);
    return $dataSkills[skill].name;
};
This will only allow you to steal skills with the <stealable> notetag, but you still have an equal chance to steal each (meaning you could randomly steal one you already know, for no result). If you want to be guaranteed to get a new skill if one exists, that's a simple tweak.

I think you might not have found a lot about this because it's just not terribly complex to implement - there's not a lot to stuff into a full-sized plugin. 😉

Let us know if you need anything else.
Let us know if you need anything else.

Thank you!

How would I go about setting up my common event such that it displays a specific message when the user already knows that particular skill?

Currently, I have my common event set up so that if the variable specified is != 0, it displays the "Skill Learned" message, else it displays "Unsuccessful."

What condition would equal "Player already knows the skill trying to be stolen"?
Which version are you using? If you're going off the original code, it would require a bit of tweaking.

If you're going off the one I posted earlier, that has the notetag, then on line 16, the line after user.isLearned, change it to return -1 instead of 0.

Then you can check the variable for 0 is unsuccessful, -1 is already known, anything else is the name of the skill.
Which version are you using? If you're going off the original code, it would require a bit of tweaking.

If you're going off the one I posted earlier, that has the notetag, then on line 16, the line after user.isLearned, change it to return -1 instead of 0.

Then you can check the variable for 0 is unsuccessful, -1 is already known, anything else is the name of the skill.
I’m going off the original code without note tags.
Okay. I fear this might be getting convoluted for anyone else who comes across it and wants info, but whatever 😛

Original version, based on the Skill Type, no notetags:
Code:
function StealSkill(user, target)
{
    if (target.isActor())
        return 0;
    
    var enemy=$dataEnemies[target.enemyId()];
    
    var skill=enemy.actions[Math.randomInt(enemy.actions.length)].skillId;
    
    if (!user.addedSkillTypes().includes($dataSkills[skill].stypeId))
        return 0;

    if (user.isLearnedSkill(skill))
        return -1;
   
    user.learnSkill(skill);
    return $dataSkills[skill].name;
};

Returns 0 if the steal is unsuccessful/invalid. Returns -1 if the skill is already known. Returns the name of the skill if it was learned.
Okay. I fear this might be getting convoluted for anyone else who comes across it and wants info, but whatever 😛

Original version, based on the Skill Type, no notetags:
Code:
function StealSkill(user, target)
{
    if (target.isActor())
        return 0;
   
    var enemy=$dataEnemies[target.enemyId()];
   
    var skill=enemy.actions[Math.randomInt(enemy.actions.length)].skillId;
   
    if (!user.addedSkillTypes().includes($dataSkills[skill].stypeId))
        return 0;

    if (user.isLearnedSkill(skill))
        return -1;
  
    user.learnSkill(skill);
    return $dataSkills[skill].name;
};

Returns 0 if the steal is unsuccessful/invalid. Returns -1 if the skill is already known. Returns the name of the skill if it was learned.
Beautiful. Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/lancet-skill-steal-plugin.158446/