summaryrefslogtreecommitdiff
path: root/world/map/npc/functions/clear_vars.txt
blob: 71d81fcbe565432b3a701654cee5c147878885ab (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Clears old variables

function|script|ClearVariables|{
    // Halloween 2006
    set HWQUEST1, 0;
    set HWQUEST2, 0;
    set HWQUEST3, 0;
    set HWQUEST4, 0;
    set HWQUEST5, 0;
    set HWQUEST6, 0;
    set HWQUEST7, 0;
    set HWQUEST8, 0;
    set HWQUEST9, 0;
    set HWQUEST10, 0;
    set HWQUEST11, 0;
    set HWQUEST12, 0;
    set HWQUEST13, 0;
    set HWQUEST14, 0;
    set HWQUEST15, 0;
    set HWQUEST16, 0;
    set HWQUEST17, 0;
    set HWQUEST18, 0;
    set HWQUEST18, 0;
    set HWQUEST19, 0;
    set HWQUEST20, 0;

    // Christmas 2006
    set XMASQUEST1, 0;
    set XMASQUEST2, 0;
    set XMASQUEST3, 0;
    set XMASQUEST4, 0;
    set XMASQUEST5, 0;
    set XMASQUEST6, 0;
    set XMASQUEST7, 0;
    set XMASQUEST8, 0;
    set XMASQUEST9, 0;
    set XMASQUEST10, 0;
    set XMASQUEST11, 0;
    set XMASQUEST12, 0;
    set XMASQUEST13, 0;
    set XMASQUEST14, 0;
    set XMASQUEST15, 0;
    set XMASQUEST16, 0;
    set XMASQUEST17, 0;
    set XMASQUEST18, 0;
    set XMASQUEST19, 0;
    set XMASQUEST20, 0;

    set QUEST_xmas07_state, 0;
    set QUEST_xmas07_milk, 0;
    set QUEST_xmas07_cookies, 0;
    set QUEST_xmas07_presents, 0;

    set QUEST_Easter08_state, 0;

    set Halloween08, 0;

    set QUEST_xmas08_state, 0;

    set QUEST_Easter09, 0;

    set Candyman, 0; // Halloween 2009

    set QUEST_Christmas09_state, 0;

     set QUEST_Easter09_slots, 0;

    // easter 2010
    // This must not be cleared: since some people would like to go to the easter island!
    // set Easter_2010_QuestState, 0;
    set Easter_2010_EggState1, 0;
    set Easter_2010_EggState2, 0;
    set Easter_2010_EggState3, 0;
    set Easter_2010_EggState4, 0;
    set Easter_2010_EggState5, 0;

    // halloween 2010
    set hween10, 0;
    set hween10_collect_canpump, 0;
    set hween10_credits, 0;
    set hween10_collect, 0;
    set hween10_collect_mmallow, 0;
    set hween10_collect_jelskul, 0;
    set hween10_bonecount, 0;
    set hween10_collect_tondel, 0;
    set hween10_paid, 0;

    // Xmas 2010:
    set Count_Yellow, 0;
    set Count_White, 0;
    set Maze, 0;
    set Yellow, 0;
    set White, 0;
    set Xmas2010, 0;
    set Golbenez_Inn_Cost, 0;

    // Tulimshar and Mine Variables which aren't used anymore
    set Scorp, 0;
    set Bugleg, 0;
    // variable isn't used
    set QUEST_clothdyer_state, 0;
    // variable was moved to a temporary player variable
    set KatzeBeenOutside, 0;

    //These lines are needed to migrate stuff from variables to flags
    if (Open_Underground_Palace_Barrier)
        set FLAGS, FLAGS | FLAG_OPENED_UNDERGROUND;
    set Open_Underground_Palace_Barrier, 0;

    if (Naem_Quest_Done)
        set FLAGS, FLAGS | FLAG_GOT_NAEM_GLOVES;
    set Naem_Quest_Done, 0;

    if (ChristmasQuest)
        set FLAGS, FLAGS | FLAG_SNOWMAN;
    set ChristmasQuest, 0;

    if (ChristmasQuest2)
        set FLAGS, FLAGS | FLAG_SANTAS_HELPER;
    set ChristmasQuest2, 0;

    if (#BankAccount < 0)
        goto FixBank;

    return;

FixBank:
    if (Zeny >= -#BankAccount)
        goto L_Fix_Full;

    // Partial fix
    set #BankAccount, #BankAccount + Zeny;
    set Zeny, 0;
    return;

L_Fix_Full:
    set Zeny, Zeny + #BankAccount;
    set #BankAccount, 0;
    return;
}