summaryrefslogtreecommitdiff
path: root/npc/annuals/xmas/list.txt
blob: 6f902e04edc1c9018ed5874cf1aff2df48206147 (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
function	script	XmasCheckList	{
    @xmas_list_count = 0;
    @xmas_list_loop = 0;

    if((@xmas_list_deliver) || !(@xmas_list_gather))
        goto L_Return;
    goto L_Loop;

L_Loop:
    if(XMASTIME & $@xmas_child_list[@xmas_list_loop])
        goto L_AddOne;
    goto L_LoopAgain;

L_AddOne:
    @xmas_list_count = (@xmas_list_count + 1);
    goto L_LoopAgain;

L_LoopAgain:
    if((@xmas_list_loop + 1) == getarraysize($@xmas_child_list))
        goto L_ListTally;
    @xmas_list_loop = (@xmas_list_loop + 1);
    goto L_Loop;

L_ListTally:
    if(@xmas_list_count == $@xmas_perfect_list_count)
        goto L_PerfectList;
    if(@xmas_list_count > $@xmas_required_list_count)
        goto L_SetListState;
    goto L_Return;

L_PerfectList:
    XMASTIME = XMASTIME | $@xmas_all_lists_bit;
    goto L_SetListState;

L_SetListState:
    @xmas_state = $@xmas_list_complete_state;
    callfunc "XmasSetState";
    goto L_Return;

L_Return:
    @xmas_list_loop = 0;
    return;
}

function	script	XmasList	{
    callfunc "XmasStates";

    if(($@xmas_time) && (@xmas_list_gather) && !(@xmas_list_complete))
        goto L_QuestTime;
    goto L_Return;

L_QuestTime:
    if(XMASTIME & $@xmas_child_list[@child_number])
        goto L_Return;
    goto L_GetList;

L_GetList:
    menu
        "Hey, I have come to collect your wish list for Santa", L_List,
        "Oh sorry, what were you going to say?", L_Return;

L_List:
    mes "[" + $@xmas_child_list_name$[@child_number] + "]";
    mes "Here is my list. Make sure it gets delivered, please!";
    next;
    mes "You store " + $@xmas_child_list_name$[@child_number] + "'s wish list carefully in a hidden pocket of your backpack.";
    XMASTIME = XMASTIME | $@xmas_child_list[@child_number];
    callfunc "XmasXpReward";
    menu
        "I really should be going.", L_Return;

L_Return:
    return;
}

function	script	XmasListList	{
    @xmas_list_loop = 0;
    @xmas_child_loop = 0;
    goto L_Loop;

L_Loop:
    @xmas_child_loop = ($@xmas_child_list[@xmas_list_loop]);
    if ((XMASTIME & @xmas_child_loop) != 0) goto L_LoopAgain;
    mes "\"" + $@xmas_child_list_name$[@xmas_list_loop] + "\"";
    next;
    goto L_LoopAgain;

L_LoopAgain:
    if((@xmas_list_loop + 1) == getarraysize($@xmas_child_list_name$))
        goto L_Return;
    @xmas_list_loop = (@xmas_list_loop + 1);
    goto L_Loop;

L_Return:
    @xmas_list_loop = 0;
    return;
}