summaryrefslogtreecommitdiff
path: root/world/map/npc/annuals/halloween/debug.txt
blob: 0da5e3616d697fd715ce80c3ddd82580f5c95e1c (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// Halloween Debug 
// Author: Wushin

function|script|HalloweenDebug|,
{
    if(debug)
        goto L_Debug;
    goto L_Live;

L_Live:
    menu
        "Debug Time", L_DebugTime,
        "Set Old Event Flag.", L_LastReset,
        "Halloween Time Key Change.", L_HalloweenTimeKey,
        "Reset NPC's mask memory", L_ResetMask,
        "Nothing.", L_Close;

L_Debug:
    menu
        "Debug Time", L_DebugTime,
        "Set Old Event Flag.", L_LastReset,
        "Halloween Time Key Change.", L_HalloweenTimeKey,
        "Quest State", L_QuestState,
        "Set NPC trick or treat flag", L_SetTrickOrTreats,
        "Reset my quest state", L_ResetMe,
        "Reset NPC's mask memory", L_ResetMask,
        "Nothing.", L_Close;

L_DebugTime:
    mes "--Sever--";
    mes "Event State: " + $@halloween_time;
    mes "Event Start" + $HALLOWEEN_TIME_KEY[0] + "/1";
    mes "Reward Start: " + $HALLOWEEN_TIME_KEY[1] + "/" + $HALLOWEEN_TIME_KEY[3];
    mes "Event End: " + $HALLOWEEN_TIME_KEY[2] + "/" + $HALLOWEEN_TIME_KEY[4];
    mes "Event Time Key (year (CCYY)): " + $HALLOWEEN_TIME_KEY[5];
    next;
    goto L_Debug;

L_LastReset:
    set HALLOWEENTIME, 255;
    set HALLOWEENYEAR, 2012;
    goto L_Debug;

L_HalloweenTimeKey:
    if (getgmlevel() < 20) goto L_Close;
    mes "Halloween Time Key Change.";
    mes "Start Month?";
    input @halloween_time_key_smonth;
    if((@halloween_time_key_smonth == 0) || (@halloween_time_key_smonth > 12))
        goto L_HalloweenError;
    mes "Reward Start Month?";
    input @halloween_time_key_srmonth;
    if((@halloween_time_key_srmonth == 0) || (@halloween_time_key_srmonth > 12))
        goto L_HalloweenError;
    mes "End Month?";
    input @halloween_time_key_emonth;
    if((@halloween_time_key_emonth == 0) || (@halloween_time_key_emonth > 12))
        goto L_HalloweenError;
    mes "Reward Start Day?";
    input @halloween_time_key_rsday;
    if((@halloween_time_key_rsday == 0) || (@halloween_time_key_rsday > 31))
        goto L_HalloweenError;
    mes "Reward End Day?";
    input @halloween_time_key_reday;
    if((@halloween_time_key_reday == 0) || (@halloween_time_key_reday > 31))
        goto L_HalloweenError;
    mes "Time Key (CCYY) ";
    input @halloween_time_key_year;
    goto L_SetNewKey;

L_HalloweenError:
    mes "Incorrect Entry. Try again.";
    next;
    goto L_Debug;

L_SetNewKey:
    setarray $HALLOWEEN_TIME_KEY, @halloween_time_key_smonth, @halloween_time_key_srmonth, @halloween_time_key_emonth, @halloween_time_key_rsday, @halloween_time_key_reday, @halloween_time_key_year;
    cmdothernpc "#HalloweenConfig", "RestartQuest";
    goto L_Debug;

L_QuestState:
    mes "Karma: " + (HALLOWEENTIME & 65535);
    set @big_reward_status$, " No.";
    if (HALLOWEENTIME & $@halloween_got_big_reward)
        set @big_reward_status$, " Yes.";
    mes "Big Reward: " + @big_reward_status$;
    set @charm_reward_status$, " No.";
    if (HALLOWEENTIME & $@halloween_got_charm_reward)
        set @charm_reward_status$, " Yes.";
    mes "Charm Reward:" + @charm_reward_status$;
    set @npc_check_loop, 0;
    goto L_NpcCheckLoop;

L_NpcCheckLoop:
    set @display_mes$, "NPC ID " + @npc_check_loop + ":" + $@halloween_npc_names$[@npc_check_loop];
    set @npc_status$, " Needed";
    if (HALLOWEENTIME & (1 << (31 - @npc_check_loop)))
        set @npc_status$, " Complete";
    set @display_mes$, @display_mes$ + @npc_status$;
    mes @display_mes$;
    set @display_mes$, "";
    goto L_NpcCheckInc;

L_NpcCheckInc:
    set @npc_check_loop, (@npc_check_loop + 1);
    if (@npc_check_loop >= getarraysize($@halloween_npc_names$))
        goto L_TrickOrTreatCount;
    goto L_NpcCheckLoop;

L_TrickOrTreatCount:
    callfunc "TrickOrTreatTally";
    mes @npc_tally + " out of 14";
    next;
    goto L_Debug;

L_SetTrickOrTreats:
    mes "Enter NPC to set";
    input @halloween_npc_id;
    set HALLOWEENTIME, HALLOWEENTIME | (1 << (31 - @halloween_npc_id));
    goto L_Debug;

L_ResetMe:
    set HALLOWEENTIME, 0;
    set HALLOWEENYEAR, $HALLOWEEN_TIME_KEY[5];
    goto L_Debug;

L_ResetMask:
    mes "Enter NPC to reset:";
    input @halloween_npc_id;
    set $@halloween_maskmemory[8 * @halloween_npc_id], 0;
    goto L_Debug;

L_Close:
    set @tmp, 0;
    set @mask, 0;
    set @karma, 0;
    set @loop, 0;
    set @menu, 0;
    set @halloween_npc_id, 0;
    close;
}
009-1.gat,51,38,0|script|HalloweenDebug#1|409,
{
    callfunc "HalloweenDebug";
    goto L_End;

OnInit:
    if(!debug)
        disablenpc "HalloweenDebug#1";
    goto L_End;

L_End:
    end;
}
001-1.gat,38,26,0|script|HalloweenDebug#2|409,
{
    callfunc "HalloweenDebug";
    goto L_End;

OnInit:
    if(!debug)
        disablenpc "HalloweenDebug#2";
    goto L_End;

L_End:
    end;
}
026-1.gat,23,37,0|script|HalloweenDebug#3|409,
{
    callfunc "HalloweenDebug";
    goto L_End;

OnInit:
    if(!debug)
        disablenpc "HalloweenDebug#3";
    goto L_End;

L_End:
    end;
}