summaryrefslogtreecommitdiff
path: root/npc/003-0-1/professor.txt
blob: 43fd6f6cd663e0aef115fadcd130f5d6c2009c36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// 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.");
    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;

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

OnSpeeching:
    // Max AFK time is determined as 15 minutes + 1 second every 20 minutes AFKed
    // Capped at 1 hour (you've AFK'ed 37 days and 12 hours)
    .@maxafk=max(3600, 900+(AFKING/1200));
    // 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);
        getexp 1+.@sk,1+(.@sk/2);
        // dispbottom l("It is a boring speech...");

        // 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 speech, but you have learned ancient languages.");
            }
        }

        // You're being annoying, now
        AFKING+=1;
        switch (AFKING) {
        case 1200:
            // 24 hours, 1200 exp, enough from level 1 to level 10
            sk_lvup(TMW2_SPEECH);
            npctalk3 l("@@, you're a good student. You have a bright future if you keep listening to me.");
            dispbottom l("Learning from seeing (aka. AFK-ing) skill LEVEL UP!!");
            break;
        case 8400:
            // +1 week, 16800 exp, enough from level 1 to 23 (only AFK-ing!)
            sk_lvup(TMW2_SPEECH);
            npctalk3 l("@@, you're a good student. You have a bright future if you keep listening to me.");
            dispbottom l("Learning from seeing (aka. AFK-ing) skill LEVEL UP!!");
            break;
        case 36000:
            // +1 month, 108000 exp, enough from level 1 to ~36 (only AFK-ing!)
            sk_lvup(TMW2_SPEECH);
            npctalk3 l("@@, you're a good student. You have a bright future if you keep listening to me.");
            dispbottom l("Learning from seeing (aka. AFK-ing) skill LEVEL UP!!");
            break;
        case 108000:
            // +3 months, 432000 exp, enough from level 1 to ~46 (only AFK-ing!)
            // Note: In the needed time (~4 months) you should be over 60 if you
            // were fighting instead...
            sk_lvup(TMW2_SPEECH);
            npctalk3 l("@@, you're a good student. You have a bright future if you keep listening to me.");
            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.
        }

    }
    end;
}