summaryrefslogtreecommitdiff
path: root/npc/003-0/fejda.txt
blob: a92e464fc0fa09a899c072de17be1a8d07bf4f5b (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// TMW2 Script
// Author:
//  Jesusalva
// Description:
//  Job Classes manager

003-0,29,42,0	script	Fejda Reader	NPC_SITTED_NINJA,{
    // CurrentClasses() MaxClasses() TotalBaseLevel() CLASS_CHANGE and JobClass
    mesn;
    mesq l("Heya. I am Fejda Reader, in charge of proofreading the application forms."); // aka. Fedja Beader, but with a couple typos :3
    next;
    if (TotalBaseLevel() < 100) {
        mesn;
        mesq l("Once you reach 100 total levels, you'll be eligible for a job class.");
        mesc l("* You still need to earn %d levels.", (100-TotalBaseLevel()));
        close;
    }
    mesn;
    mesq l("According to these forms, you have %d total levels and may have up to %d job class(es). Their effects increase as your total levels increases.", TotalBaseLevel(), MaxClasses());
    next;
    mesn;
    mesq l("The first job class you select is free, and it is also free to change after every rebirth. Otherwise, you can only change every %d days for the small fee of %s GP.", .Dayem, fnum(.GpFee));
    mesc l("Your current job class(es): %s", CurrentClasses()), 3;
    if (CLASS_CHANGE > gettimetick(2)) close;
    next;
    mesc l("Do you want to change your job class(es)?"), 1;
    // Do you need to pay the fee?
    if (CLASS_CHANGE) {
        if (askyesnosafe() == ASK_NO) {
            closeclientdialog;
            close;
        }
        // Pay the fee
        if (Zeny < .GpFee) {
            mesc l("Not enough money."), 1;
            close;
        } else {
            Zeny -= .GpFee;
        }
    } else {
        // First class change, so no need for safe confirm
        if (askyesno() == ASK_NO) {
            closeclientdialog;
            close;
        }
    }

    // Reset class
    JobClass = 0;
    do
    {
        mesc l("Which classes do you wish to pick?"), 3;

/*
O	CLASS_WARRIOR:       1 // Bonus on melee damage
X	CLASS_RANGER:        2 // Bonus on ranged damage (or accuracy?)
O	CLASS_WIZARD:        4 // Bonus on magic damage
	CLASS_BLACKSMITH:    8 // Bonus on crafting / brewing / cooking
O	CLASS_HUNTER:       16 // Bonus on MobPt gain and discount on Grants
	CLASS_MERCHANT:     32 // Bonus on GP earning (+all mobs drop GP)
O	CLASS_TANKER:       64 // Bonus on defense/hp
	CLASS_RAGGER:      128 // Bonus on crit (berserker)
O	CLASS_PALADIN:     256 // Bonus on attack speed
O	CLASS_NINJA:       512 // Bonus on evasion
	CLASS_SAGE:       1024 // Bonus on potions/effects
O	CLASS_CARRY:      2048 // Bonus on max weight
*/

        menuint
            l("Warrior (atk+)"), CLASS_WARRIOR,
            l("Wizard (matk+/mp+)"), CLASS_WIZARD,
            l("Hunter (mobpt+)"), CLASS_HUNTER,
            l("Tanker (def+/hp+)"), CLASS_TANKER,
            l("Paladin (aspd+)"), CLASS_PALADIN,
            l("Ninja (eva+)"), CLASS_NINJA,
            l("Carry (weight+)"), CLASS_CARRY,
            l("[Cancel]"), -1;

        // Cancel selection, reverting class again and recovering money.
        if (@menuret == -1) {
            JobClass = 0;
            if (CLASS_CHANGE) {
                Zeny += .GpFee;
                //CLASS_CHANGE += 86400;
            }
            closeclientdialog;
            close;
        }

        // If you pick a class you already selected, it'll be unselected
        // Otherwise, it'll be added
        JobClass = JobClass ^ @menuret;

    } while (bitmask_count(JobClass) < MaxClasses());

    // Wrap up class change
    CLASS_CHANGE = gettimetick(2) + (.Dayem * 86400);
    mesc l("Success!"), 2;
    mesc l("Your current job class(es): %s", CurrentClasses()), 3;
    close;

OnInit:
    .sex = G_MALE;
    .distance = 5;
    .GpFee = 1000000;
    .Dayem = 20;
    end;

}