summaryrefslogblamecommitdiff
path: root/npc/003-0-1/professor.txt
blob: 025b115683a3b17e3f9614a73441fbdacd90df95 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                 


                                                                                                     
               
                                                                                                             







                                                                                                

                                                                                                        


                                                                                     












                                                         


                 
            


                                                                      
 
            
                        
                                                  


                                                                                 


                                                                       
                                     
                              
                                 

                            
 
                                            


                           
                                                                            
                                     
                                  


                                                 
                                                        




                                                  
                                                                                        


             
                                     
                                                            

                         

                                   
                  

                                    
                                             

                                       
                                             

                                         
                                              
                                                                                
                                       
                                       
                      
                                                                                                                         

                                                                                 
         

                                                                            
 
     
                                                  


        
// TMW2 Script
// Author:
//  Jesusalva
// Description:
//  Professor - allows you to gain EXP for idling (Speech skill)

003-0-1,35,29,0	script	Professor	NPC_PLAYER,{
    mesn;
    mesq l("I've mastered the art of speech and communication.");
    next;
    mesn;
    mesq l("Sit on the rug in front of me and learn wisdom! Maybe you'll learn something this way.");
    if (AFKING)
    mesc l("Thus far, you've heard about %d hours and %d minutes of wisdom.", AFKING/1200, AFKING%1200/60*3);
    if (!TUTORIAL) close;
    next;
    mes ".:: AFK EXP AREA ::.";
    mesc l("By sitting in the rug in front of the professor (the one with benches)");
    mesc l("and \"listening\" to his speech, you'll get EXP!");
    mes "";
    mesc l("If you get too much exp this way, a skill will level up and you'll get even more!");
    mesc l("But remember: %s", b(l("You cannot sit idle for too long gaining EXP!")));
    mesc l("After about 30 minutes AFK, you won't get EXP anymore.");
    mesc l("But don't worry, because as they say: The more you learn, the better you get at learning!");
    mes "";
    mesc l("In overall, you'll get more experience by fighting monsters.");
    mesc l("But if you only want to sit down and chat, this area is ideal for you!");
    close;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, GraduationCap);
    setunitdata(.@npcId, UDT_HEADMIDDLE, GraduationRobe);
    setunitdata(.@npcId, UDT_HEADBOTTOM, DeepBlackBoots);
    setunitdata(.@npcId, UDT_WEAPON, CottonGloves);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 2);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 4);

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

OnTimer3100:
    areatimer2("003-0-1", 29, 34, 41, 38, 10, .name$+"::OnSpeeching");
    initnpctimer;
    end;

OnSpeeching:
    if (ispcdead()) end;
    deltimer(.name$+"::OnSpeeching"); // safeguard
    // Max AFK time is determined as 30 minutes + 1 second every 10 minutes AFKed
    // Capped at 2 hours (you've AFK'ed 37 days and 12 hours - 900 hours)
    .@maxafk=min(7200, 1800+(AFKING/600));
    // If you have been IDLE for at least 2 seconds you'll get the EXP.
    // Note you don't need to sit, only be idle.
    if (is_between(2, .@maxafk, checkidle())) {
        .@sk=getskilllv(TMW2_SPEECH);
        .@bxp=min(1+.@sk, 12);
        .@jxp=min(1+(.@sk/3), 6);

        getexp .@bxp, .@jxp;

        // (Extra) Experience for Homunculus
        if (gethominfo(0))
            gethomunexp(1);

        // Research happens roughly every five minutes, based on Study skill
        if (getskilllv(TMW2_STUDY)) {
            if (AFKING % 100 == 0)
                MAGIC_RP+=getskilllv(TMW2_STUDY);
        }

        // If you are learning TMW2_READANCIENTLANGUAGES
        if (ANCIENTLANGUAGEBOUNCER) {
            ANCIENTLANGUAGEBOUNCER-=1;
            if (ANCIENTLANGUAGEBOUNCER == 1) {
                ANCIENTLANGUAGEBOUNCER=0;
                skill TMW2_ANCIENTLANGUAGES, 1, 0;
                dispbottom l("It was a boring lesson, but you have mastered Mananese.");
            }
        }

        // You're being annoying, now
        // 1 hour, 1200 exp, enough from level 1 to level 10
        AFKING+=1;
        switch (AFKING) {
        case 28800:
            // 24 hours, 28,800 exp
            .@x=1;
        case 201600:
            // +1 week, +403,200 exp
            .@x=(AFKING >= 201600 ? 2 : .@x);
        case 864000:
            // +1 month, +2,592,000 exp
            .@x=(AFKING >= 864000 ? 3 : .@x);
        case 2592000:
            // +3 months, +10,368,000 exp
            .@x=(AFKING >= 2592000 ? 4 : .@x);
            // Note: In the needed time (~4 months) you should be over 90 if you
            // were fighting instead...
            skill(TMW2_SPEECH, .@x, 0);
            AFKING+=1;
            npctalk3 l("%s, you're a good student. You will have a bright future if you keep studying.", strcharinfo(0));
            dispbottom l("Learning from seeing (aka. AFK-ing) skill LEVEL UP!!");
            break;
        }
        // There are no further upgrades to TMW2_SPEECH skill
        // You'll need to get the AFK Set if you want to level from 4 to 10.

    }
    deltimer(.name$+"::OnSpeeching"); // safeguard
    end;
}