Hah! Well, I don't know what you did, but I Googled "RPG Maker MV use item javascript" and it came up. I'm honestly surprised it's not a functionality of Yanfly's Item Core or something, that library is pretty big on adding JS usage to just about everything else in the game.
It's not quite like people do talking, but I tried...
Yeah, it is indeed simple:
JavaScript:
Window_ActorCommand.prototype.addSkillCommands = function() {
var skillTypes = this._actor.addedSkillTypes();
skillTypes.sort(function(a, b) {
return a - b;
});
var knownTypes = new Set();
this._actor.skills().forEach(function(skill) {
if(!this._actor.isOccasionOk(skill)) {
return;
}
knownTypes.add(skill.stypeId);
});
skillTypes = skillTypes.filter(knownTypes.has.bind(knownTypes));
skillTypes.forEach(function(stypeId) {
var name = $dataSystem.skillTypes[stypeId];
this.addCommand(name, 'skill', true, stypeId);
}, this);
};
Hey, you literally are ahead of me by a few minutes, because I already wanted to send you a PM about the plugin. Thanks for this one.
Well, thank you all guys. So, now I have two ways:
1)To do it with this plugin and do it through skill types. But in that case, if I'm not mistaken, the characters will have 3 options for magic types in the battle menu + Special type, which I didn't mention before, that every character has. And in my opinion that would be great to sort the spells if I haven't used the spell slots plugin, but I do, so I just don't know.
2)To do it with the individual code for each spellbook. It's perfect as I can write anything I want, with the custom script I can create an event just in the item notes, but wait...I don't know JS at all.
So for now I just need to think of it. I will try both plugins, but I prefer the second way for It's more suited to my game. Need to try to google how to code an events in JS. Basically, I need to just check what actor used a book, and tell that this actor can't use the book if it's a wrong actor, and ask a player if he wants to learn the spell or not, and learn it, and destroy the book later.
Ohh...I hope it's not that hard as I can imagine.