summaryrefslogtreecommitdiff
path: root/world/map/npc/commands/valentine.txt
blob: b78056ae5bb67eb2a066197550a6a46da862cf08 (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
-|script|@givelvlplz|32767
{
    end;

OnValentine:
    if (#VALENTINE20_INDEX > 0)
        goto L_AlreadyDone;
    goto L_Register;

L_AlreadyDone:
    message strcharinfo(0), "You are already registered for Valentine Event.";
    end;

L_Register:
    set @ml_login$, "";
    set @ml_char$, "";
    mes "##1You can only port one char level per person!##0";
    mes "##1Are you sure you want to port level "+BaseLevel+" for Valentine?##0";
    next;
    mes ".:: MOUBOOTAUR LEGENDS DATA ::.";
    mes "What is your login name?";
    mes "(Please leave the field blank to cancel. Case-sensitive.)";
    input @ml_login$;
    if (@ml_login$ == "")
        goto L_Abort;
    mes "";
    mes ".:: MOUBOOTAUR LEGENDS DATA ::.";
    mes "What is your char name?";
    mes "(The char name must be on the account login you've provided earlier. Case-sensitive.)";
    input @ml_char$;
    if (@ml_char$ == "")
        goto L_Abort;
    next;
    if (strcharinfo(0) == @ml_char$)
        goto L_Warning;
    goto L_Review;

L_Warning:
    mes "##1##BWARNING##b##0";
    mes "Make sure you are inserting your data ##BOn Moubootaur Legends Server##b.";
    mes "";
    mes "##BIf you provide invalid data, you will need to contact a GM.##0";
    next;
    goto L_Review;

L_Review:
    mes "";
    mes ".:: Data Review ::.";
    mes "ML Login: "+@ml_login$;
    mes "ML Char: "+@ml_char$;
    mes "Level: "+BaseLevel;
    mes "";
    mes "Is the data correct?";
    mes "##1##BThis cannot be changed later.##0";
    next;
    menu
        "Actually, can I start over?", L_Register,
        "Yes, this is how I login on ML and my char name", L_Save,
        "I'm not sure. Sorry.", L_Abort;

L_Save:
    set @rank, 0;
    set @loop, 0;
    goto L_Search;

L_Search:
    if ($VALENTINE20_LVL[@loop] == 0)
        goto L_Finished;
    set @loop, @loop + 1;
    goto L_Search;

L_Finished:
    mes "";
    set #VALENTINE20_INDEX, @loop+1; // 0 is a valid index
    set $VALENTINE20_LOGIN$[@loop], @ml_login$;
    set $VALENTINE20_NAME$[@loop], @ml_char$;
    set $VALENTINE20_LVL[@loop], BaseLevel;
    goto L_Abort;

L_Abort:
    mes "";
    set @ml_login$, "";
    set @ml_char$, "";
    set @loop, 0;
    set @rank, 0;
    close;

OnReport:
    if (GM < 60 && GM < G_SYSOP) end;
    goto L_Report;

L_Report:
    set @rank, 0;
    set @loop, 0;
    mes "ID - Login / Char - Level";
    mes "-------------------------";
    goto L_ShowNextRecord;

L_ShowNextRecord:
    if ($VALENTINE20_LVL[@loop] == 0)
        goto L_Close;
    mes (@loop + 1) + " - " + $VALENTINE20_LOGIN$[@loop] + " / " + $VALENTINE20_NAME$[@loop] + " - Lv. " + $VALENTINE20_LVL[@loop];
    set @loop, @loop + 1;
    if ((@loop % 10) == 0 && $VALENTINE20_LVL[@loop] > 0)
        goto L_NextShowNextRecord;
    goto L_ShowNextRecord;

L_NextShowNextRecord:
    next;
    goto L_ShowNextRecord;

L_Close:
    close;

OnInit:
    registercmd chr(ATCMD_SYMBOL) + "givelvlplz", strnpcinfo(0) + "::OnValentine";
    registercmd chr(ATCMD_SYMBOL) + "valentine2020", strnpcinfo(0) + "::OnValentine";
    registercmd chr(ATCMD_SYMBOL) + "moubootaurs", strnpcinfo(0) + "::OnReport";
    end;
}