summaryrefslogblamecommitdiff
path: root/npc/003-0/wizard.txt
blob: d4ca14a5209ac4bbf070bdcdb454cbd7a07be506 (plain) (tree)



















                                                                            
                                                                                                  










































                                                                                                     
                                                                                                                








                                                                                                 





                                            


                                    
                                                                                                                
                                                                                                  

                   

                                      




                                          










                                                                                         
                            














                                                                                                  






                                         

                  



                                               






                                         

                  













                                                                                                   
                                            



















                                                                 
                               











                                                                    
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Leader of the WIZARD class
//    TODO: Improve Fireball

003-0,55,25,0	script	Wizard Master	NPC_PLAYER,{
    if (!(MAGIC_SUBCLASS & CL_WIZARD))
        goto L_SignUp;
    goto L_Member;

// Sign Up
L_SignUp:
    // Not allowed if subclass filled or not from main class
    if (total_subclass() >= max_subclass() || getskilllv(WIZARD_MAGE) < 2)
        goto L_Close;
    mesn;
    mesq l("Hey there! Do you want to join the Wizard Class?");
    mesc l("Warning: If you join a subclass, you can't leave it later!"), 1;
    //mesc b(l("Warning: This class haven't been tested/balanced yet. Feedback is required!")), 1;
    next;
    if (askyesno() != ASK_YES)
        close;
    // TODO: Requeriment for signing up to a subclass? Or is the tier + skill quest hard enough?
    MAGIC_SUBCLASS=MAGIC_SUBCLASS|CL_WIZARD;
    mesn;
    mesq l("Welcome to the wizard guild!");
    close;

// Close
L_Close:
    goodbye;
    closedialog;
    close;

L_Missing:
    mesn;
    mesq l("Hey hey! You don't have that stuff, CAN'T YOU READ?!");
    percentheal 0, -10;
    next;
    goto L_Member;

// Membership area
// Wizard
//  MG_COLDBOLT (ice)
//  MG_LIGHTNINGBOLT (wind)
//  WZ_EARTHSPIKE (earth)
//  MG_NAPALMBEAT (ghost)
//  MG_ENERGYCOAT (For 5 minutes, raise damage reduction, but that eats MP)
// TODO: We have many other cool skills for Wizard (more AoE skills, more damage, etc)
// I will worry with that later, as that also means providing extra skills for Sage & Priest
// Note: the number of hits of bolts is the same as the skill level :D

L_Member:
    mesn;
    mesq l("Hey there! Do you want to learn new skills for a very small teaching fee?");
    select
        rif(sk_intcost(MG_ENERGYCOAT) && !getskilllv(MG_ENERGYCOAT), l("Learn Energy Coating")),
        rif(sk_intcost(MG_NAPALMBEAT) && sk_canlvup(MG_NAPALMBEAT), l("Improve Napalm Beat")),
        rif(sk_intcost(MG_COLDBOLT) && sk_canlvup(MG_COLDBOLT), l("Improve Cold Bolt")),
        rif(sk_intcost(MG_LIGHTNINGBOLT) && sk_canlvup(MG_LIGHTNINGBOLT), l("Improve Thunder Bolt")),
        rif(sk_intcost(WZ_EARTHSPIKE) && sk_canlvup(WZ_EARTHSPIKE), l("Improve Earth Spike")),
        rif(sk_intcost(MG_FIREBOLT) && sk_canlvup(MG_FIREBOLT), l("Improve Fire Bolt")),
        rif(sk_intcost(MG_FIREBALL) && getskilllv(MG_FIREBALL) < (3+degree_subclass()), l("Improve Fire Ball")),
        l("Leave Subclass"),
        l("Nothing at the moment.");
    mes "";
    switch (@menu) {
        case 1:
            mesc l("[Energy Coating]");
            mesc l("Drains Mana to reduce damage taken. The only defensive skill from wizards.");
            mes "";
            mesn;
            if (!mlearn(MG_ENERGYCOAT,
                        Tentacles, 10,
                        MushroomSpores, 5,
                        WolvernTooth, 3,
                        RedScorpionClaw, 1))
                goto L_Missing;
            break;
        case 2:
            mesc l("[Napalm Beat]");
            mesc l("Neutral attack with low damage value, but with low cost, high range and wide Effect Area.");
            //mesc l("Useful in PvP when your enemy have equipped a @@", getitemlink(AstralCube));
            mes "";
            mesn;
            if (!mlearn(MG_NAPALMBEAT,
                        Acorn, 60,
                        Bread, 30,
                        SmallMushroom, 20,
                        PinkBlobime, 20,
                        RedApple, 15))
                goto L_Missing;
            break;
        // Magic Bolts
        case 3:
        case 4:
        case 5:
        case 6:
            setarray .@ASkill, MG_COLDBOLT, MG_LIGHTNINGBOLT, WZ_EARTHSPIKE, MG_FIREBOLT;
            setarray .@AItem, Coral, BatWing, PileOfAsh, Curshroom;
            setarray .@BItem, Sapphire, Emerald, Topaz, Ruby;
            setarray .@ASkill$, "Ice", "Wind", "Earth", "Fire";

            .@index=@menu-3;

            .@Skill$=.@ASkill$[.@index];
            .@Skill=.@ASkill[.@index];
            .@Item=.@AItem[.@index];
            .@ItemB=.@BItem[.@index];

        	deletearray(.@ASkill);
        	deletearray(.@AItem);
        	deletearray(.@BItem);
        	deletearray(.@ASkill$);

            mesc l("[@@ Bolt]", .@Skill$);
            mesc l("Causes a @@ bolt on the enemy. Number of hits is the skill level.", .@Skill$);
            mes "";
            mesn;
            if (!mlearn(.@Skill,
                        .@Item, 30,
                        FluoPowder, 8,
                        HerbalTea, 3,
                        DiamondPowder, 2,
                        .@ItemB, 1))
                goto L_Missing;
            break;
        case 7:
            mesc l("[Fire Ball]");
            mesc l("Standard fireball skill.");
            mes "";
            mesn;
            if (!mlearn(MG_FIREBALL,
                        Curshroom, 10,
                        SulfurPowder, 10,
                        FluoPowder, 10,
                        PolishedRuby, 3,
                        HerbalTea, 1))
                goto L_Missing;
            break;
        case 8:
            // All skills related may include the basic class skills if they're related.
            mesc l("WARNING: If you leave the subclass, you'll lose all skills related to it!"), 1;
            mesc l("This cannot be undone. Are you sure?"), 1;
            mes "";
            if (askyesno() == ASK_YES) {
                mes "";
                if (validatepin()) {
                    skill MG_ENERGYCOAT, 0, 0;
                    skill SA_DRAGONOLOGY, 0, 0;
                    skill MG_NAPALMBEAT, 0, 0;
                    skill MG_COLDBOLT, 0, 0;
                    skill MG_LIGHTNINGBOLT, 0, 0;
                    skill WZ_EARTHSPIKE, 0, 0;
                    skill MG_FIREBOLT, 0, 0;
                    skill MG_FIREBALL, 2, 0;
                    MAGIC_SUBCLASS=MAGIC_SUBCLASS^CL_WIZARD;
                    mesc l("You abandoned the WIZARD class!"), 1;
                    close;
                } else {
                    mesc l("Failed to validate pin. Aborting.");
                    next;
                }
            } else {
                mes "";
                mesc l("Operation aborted. Phew!");
                next;
            }
            break;
        default:
            goto L_Close;
    }

    goto L_Member;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, FancyHat); // TODO: wizard hat
    setunitdata(.@npcId, UDT_HEADMIDDLE, SorcererRobe);
    setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
    setunitdata(.@npcId, UDT_WEAPON, JeansShorts);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 2);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 5);

    .sex=G_MALE;
    .distance=5;
    end;
}