Chef / Vampire / Blue Mage / Blu Mag (Quina)

Hello everyone,


I found several "Blue Mage"'s scripts:


Driftwood's in which checking the enemy you can learn a skill.
L'esparver in which when you are hitted by the attack you learn it.

In my game those are going to be different classes, "Sage" for the first, the character will "Study" the enemy to learn the attack and "Classic" Blue Mage for the second script...


But I'd like to adquire a thirdh "blue mage" kind of class as Quina from FF9 in which you have to use an attack ("Cook/Eat") to finish an enemy if you want to adquire the skill...

I found this script from hime (Effect Conditions) where you can set an skill to be learned in certain conditions but I'm really bad scripting so I need some help to create this new class.

Any help is welcomed.

Thank you in advance

FFIX_Eat_Command.png
If I have time I'll look into this for you in the next couple of days.But I will suggest some tips as follows in case you feel like figuring it out!



It seems like you're going to be using Hime's script to setup your 'Cook/Eat' skill.


In that skill you will setup effect conditions. 'b' is the target, 'a' is the user. You have to check first if the skill has killed target 'b' and then check what skill can be learned from 'b'. User 'a' will then learn the skill.


I haven't used this script from Hime before so I could be way off base. First off, I'm not sure how to check if the enemy is killed by the skill or not. It might be a plugin command so first check the help file if it includes a check for this or not.


It seems like you might be able to setup the skill lookup function in a common event with minimal to no scripting. You would then call the common event using: $gameTemp.reserveCommonEvent(commonEventNumber)


Replace commonEventNumber with the actual number of the common event.


You might even be able to include the check for if the enemy is dead or not in the common event as well. I haven't used common events in a battle scene before so I'm not sure how it would work exactly. One thing I've noticed is that the common event tends to 'take the place of the calling event' in that you can use any self references from the calling event such as this.hp etc. Not sure if the 'a' 'b' nomenclature works in a common event or not but if it does that would be very useful.
So please disregard my last post. I just tested it out and it was far easier than I eluded to earlier.


Setup a single effect in the effects field that has no effect at all such as HP + 0. The reason for


this is that the effect is applied to the target and not the user, so we can't just use 'learn skill' in


this field.


$dataEnemies[1] refers to enemy ID 1


a.learnSkill(1) teaches the skill with ID 1


Just change the index to the correct ID as needed.


Put the following code in the notetag of the user's 'Cook/Eat' skill:

Code:
<effect condition: 1>
    if (b.hp <= 0){
        switch (b.originalName()) {
        case $dataEnemies[1].name:
            a.learnSkill(1);
            break;
        case $dataEnemies[2].name:
            a.learnSkill(2);
            break;
        case $dataEnemies[3].name:
            a.learnSkill(3);
            break;
        case $dataEnemies[4].name:
            a.learnSkill(4);
            break;
        }
    }
</effect condition>
Thank you!!
I'will try at home and will comment you, but I think it has sense and should work.

Could you explain me what "b.originalName()" is used for?
For sure, b.originalName() is an important distinction. I tried using b.name() but if I have more than one enemy of the same name then the name is actually going to be 'Bat A' or 'Bat B' using Bat as example. If I use originalName() then it will simply return 'Bat' without the A or B designation.


Another funny thing is I tried using the b.isEnemy() function similarly to how HIME was using b.isClass() to check if the enemy was the correct one but the isEnemy() function always returns true! It's like the developers forgot to write the code for this function. The function is quite literally 'return true;' as the only line.
Hi there. I know this is an old post, but I want to add in a message that shows the skill being learned. I have gotten the message to display, but now I need to create a second "if" check to see if the skill is already learned so that I can display a different message saying that it has already been learned. Right now I have:

- EDIT

I played around with it and I figured it out for one skill and one enemy. If any one else is curious this is how I did it:
<effect condition: 1>

if (b.hp <= 0&$gameActors.actor(12).hasSkill(22)) {

$gameMessage.add("Already Consumed!");

} else if (b.hp <= 0){

switch (b.originalName()) {

case $dataEnemies[10].name:

a.learnSkill(22);

$gameMessage.add("Learned skill: Fire!");

break;

-EDIT

Hmm.. But now I can't get it to work for multiples skill/enemies.

Original thread: https://forums.rpgmakerweb.com/threads/chef-vampire-blue-mage-blu-mag-quina.56482/