summaryrefslogtreecommitdiff
path: root/npc/craft/options.txt
blob: 515cd315c05a29e805ad3c544e7f066708679465 (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
111
112
113
114
115
116
117
118
119
// TMW2 Script
// Author:
//  Jesusalva
// Description:
//  Item Option System
// Notes:
//  Awarded for crafters and their own base skill tree system

// Player knowledge structure
// CRAFTSYS[ SKILL_SCOPE ] = SKILL_LV

// ReturnVarID() takes the scope and finds out the skills on the group
// It'll fill the following variables:
//      @csys_attr → Available attributes
//      @csys_penalty → Penalty attribute array
//
//      use getarraysize(@csys_attr) to know how many are there.
// Players can active the bonus groups they want to use (in future, TODO)

// Max Level for base: 10
// Max Level for first tier: 5
// Max Level for second tier: 
// Max Level for third tier: 
// Max Level for ultimate tier: 1

// ReturnVarID( cr_id{, preserve} )
function	script	ReturnVarID	{
    .@gid=getarg(0);
    if (!getarg(1, false)) {
        deletearray(@csys_attr);
    }
    .@lvl=getd("CRAFTSYS["+.@gid+"]");

    switch (.@gid) {
        case CRGROUP_BASE:
            if (@lvl >= 1)
                array_push(@csys_attr, VAR_STRAMOUNT);
            if (@lvl >= 2)
                array_push(@csys_attr, VAR_AGIAMOUNT);
            if (@lvl >= 3)
                array_push(@csys_attr, VAR_VITAMOUNT);
            if (@lvl >= 4)
                array_push(@csys_attr, VAR_INTAMOUNT);
            if (@lvl >= 5)
                array_push(@csys_attr, VAR_DEXAMOUNT);
            if (@lvl >= 6)
                array_push(@csys_attr, VAR_LUKAMOUNT);
            if (@lvl >= 8)
                array_push(@csys_attr, VAR_MAXHPAMOUNT);
            if (@lvl >= 10)
                array_push(@csys_attr, VAR_MAXSPAMOUNT);
            break;
        // First tier
        case CRGROUP_ATK:
            if (@lvl >= 1) {
                array_push(@csys_attr, VAR_ATTPOWER);
                array_push(@csys_attr, VAR_ATTMPOWER);
            }
            if (@lvl >= 5) {
                array_push(@csys_attr, VAR_MAGICATKPERCENT);
                array_push(@csys_attr, VAR_ATKPERCENT);
            }
            array_push(@csys_penalty, VAR_ITEMDEFPOWER);
            array_push(@csys_penalty, VAR_MDEFPOWER);
            break;
        case CRGROUP_DEF:
            if (@lvl >= 1) {
                array_push(@csys_attr, VAR_ITEMDEFPOWER);
                array_push(@csys_attr, VAR_MDEFPOWER);
            }
            if (@lvl >= 5) {
                array_push(@csys_attr, DAMAGE_CRI_USER);
                array_push(@csys_attr, RANGE_ATTACK_DAMAGE_USER);
            }
            array_push(@csys_penalty, VAR_ATTPOWER);
            array_push(@csys_penalty, VAR_ATTMPOWER);
            break;
        case CRGROUP_ACC:
            if (@lvl >= 1) {
                array_push(@csys_attr, VAR_HITSUCCESSVALUE);
            }
            if (@lvl >= 5) {
                array_push(@csys_attr, VAR_CRITICALSUCCESSVALUE);
            }
            array_push(@csys_penalty, VAR_ATTPOWER);
            array_push(@csys_penalty, VAR_ATTMPOWER);
            break;
            break;
        case CRGROUP_EVD:
            if (@lvl >= 1) {
                array_push(@csys_attr, VAR_AVOIDSUCCESSVALUE);
            }
            if (@lvl >= 5) {
                array_push(@csys_attr, VAR_PLUSAVOIDSUCCESSVALUE);
            }
            array_push(@csys_penalty, VAR_ATTPOWER);
            array_push(@csys_penalty, VAR_ATTMPOWER);
            break;
            break;
        // Second tier
        case CRGROUP_REGEN:
            if (@lvl >= 1) {
                array_push(@csys_attr, VAR_HPACCELERATION);
            }
            if (@lvl >= 5) {
                array_push(@csys_attr, VAR_SPACCELERATION);
            }
            array_push(@csys_penalty, VAR_ATTPOWER);
            array_push(@csys_penalty, VAR_ATTMPOWER);
            break;
    }

    return Exception("Invalid ID");
}