MV Unlock class with Items [Addon for Yanfly Class Change Core]

Hi Guys!

I need help with an addon for a plugin. I'm using Yanfly class change core alongside with Corniflex plugin ClassChangeCore Addon. This plugin Display locked classes in the list and provides info about how to unlock them. What I want to add is the possibility to unlock classes not only by level, but also items. So I think that this addon would modify how these two plugins works.

So, classes would be unlocked when the level was reached, as well as a specific amount of items being available in the inventory (for example, 5 light evolutionary stones + level 16 unlock the paladin class).

1748832427353.png


This is How this information is currently shown on the class change menu.

I would be very grateful for the help. This mechanic is very important for my game!
It would require updates to both plugins.

YFs to add the extra requirements and CFs to display them.

Now, a way you might be able to circumvent this would be to add a common event shop or just need 1 item at a time. Since there are plugin commands to add classes, you can just have the common event look for the needed items and unlock as needed, assuming you don't have to do it per PC.
It would require updates to both plugins.

YFs to add the extra requirements and CFs to display them.

Now, a way you might be able to circumvent this would be to add a common event shop or just need 1 item at a time. Since there are plugin commands to add classes, you can just have the common event look for the needed items and unlock as needed, assuming you don't have to do it per PC.
I kind of didn't get your idea. Can you explain how this would work?
Well, to super simplify, you can make an item that is menu use only and give it the code for adding the class.
See below
ClassItem.png


You can make it a common event to make it check for the class and cancel or something, but this is the basic item.

And I also I realized you can use the YF Skill core and Skill Learn System to allow this as well.
You can make skills teach the class when learned and the skills can require items to learn.
Look it up and see if that can help you.
(Not sure if that plugin is behind a paywall, tho...)
EDIT: It is...
I have those plugins. But I am not sure if this approach would work. Because to unlock the new class the player must reach level 16 (for example) and have 3 fire essences in his inventory (like a key item). Imagine something similar to a pokemon game: you have a pokemon that evolves at level 25 with the use of a fire stone. Both conditions must be met for the evolution to happen.

I'm not sure if I am being clear.
Ok.

I'm going to see if I can work out a way to achieve this with the Skill plugins I mentioned since you have em.

So, first, I'd make a Skill category and call it Class Upgrades.
Next, I'd make a skill called Paladin and make sure it is in the Class Upgrades skill group.
Next, in ALL Actor Classes that will be able to access this upgrade, I'd add the below to those class notes:

<Learn Skill: x> with x being the id of the above skill.

Now, in the skill notes, you'll need to add a few somewhat complicated notetags.
I'll run thru one and hopefully you will be able to figure the rest out for other creatures in your project.


<Learn Show Eval>
value = user.level >= 16;
</Learn Show Eval>


This will make the skill show up once the actor reaches level 16.
(If you need this to be different levels for whatever reason, you'd have to add conditionals.)

Next we need the skill to be usable when you have the required items.
For that we'd add the below to the skill notes:

<Learn Require Eval>
value = $gameParty.numItems($dataItems[item.id]) >= 5;
</Learn Require Eval>

(Item.id needs to be the id of the light evolutionary stones.)

So, now the skill should show up when the actor is level 16 and will not be usable unless the party has 5 light evolutionary stones.

Lastly, we need the skill to unlock the actual class AND consume the 5 items.
For that, we'll add this code to the skill notes:


<Learn Cost Eval>
user.unlockClass(x);
$gameParty.loseItem($dataItems[item.id], 5);
</Learn Cost Eval>


Where x is the ClassId from your database.
If you need to add any animations of whatever, it would likely need to happen here.

So give these tags a try and let me know if they work ok.

Original thread: https://forums.rpgmakerweb.com/threads/unlock-class-with-items-addon-for-yanfly-class-change-core.178077/