summaryrefslogtreecommitdiff
path: root/npc/003-10/quirino.txt
blob: ab21dff8f01735f6362e07cd750c6c336ae0c3db (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
// TMW2 Script
// Author:
//    Ernando <ernando.quirino@hotmail.com> (Creator)
//    Jesusalva <admin@tmw2.org>
// Description:
//    Hunger Games™ version for The Mana World Brazil v2, created by Ernando Quirino.
//    Entrance to Hungry Quirin Arena
// Variables:
//      $@EQ_STATUS
//          0: Register open
//          1: Fight happening
//          2: Event finished

003-10,27,60,0	script	Quirin	NPC_ERNANDO,{
    if (is_gm()) goto L_Hub;
    if ($EVENT$ != "Hunger") goto L_NoSeason;
    if ($@EQ_STATUS == 0)
        goto L_Register;

    hello;
    end;

L_NoSeason:
    npctalkonce l("Heya!");
    end;

L_Register:
    mesn;
    mesq l("Hello player, do you want to participate on HUNGRY QUIRIN event?!");
    next;
    select
        l("Yeah, sign me up!"),
        l("No, not at the moment."),
        l("Information");

    switch (@menu) {
    case 1:
        goto L_SignUp;
    case 2:
        close;
    case 3:
        goto L_Info;
    }

L_Info:
    mesn col("Hungry Quirin Arena Rules", 3);
    mes col("1- You must not be carrying anything with you.", 9);
    mes col("2- You must not use a cart. If you do, YOU WILL BE SEVERELY PENALIZED.", 9);
    mes col("3- All items from the Arena are from the Arena. You won't carry any of them back with you.", 9);
    mes col("4- Experience and Gold earned during this event can be kept.", 9);
    next;
    mesn col("Hungry Quirin Arena Information", 3);
    mes col("1- Survive. If you die, you will gain nothing. And people want to kill you.", 9);
    mes col("2- Take everything you can find. You'll be warped without equip or healing items! Kill monsters to get some stuff too!", 9);
    mes col("3- Trust nobody. There can be only one winner, and it must be you.", 9);
    mes col("4- Take Care. Wildlife can kill you too. There can be traps.", 9);
    mes col("5- Trust yourself. You will lose the moment you enter in panic. This arena is not for the weak-willed!", 9);
    next;
    goto L_Register;

L_SignUp:
    // Player cannot be carrying anything
	getinventorylist;
	if(@inventorylist_count>=1) goto L_Full;
    getcartinventorylist();
	if(@cartinventorylist_count>=1) goto L_Full;

    // Warp player
    if (rand(1,2) == 1)
        warp "001-8", rand(42, 57), 42;
    else
        warp "001-8", rand(42, 57), 57;

    // Prevent further movements!
    setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM|PCBLOCK_MOVE|PCBLOCK_COMMANDS, true);
    dispbottom l("Stay ready!");
    close;

L_Full:
    mesn;
    mesq l("You cannot bring anything to the arena. Please put everything on the storage.");
    close;

L_Hub:
    mesn;
    mes col("Welcome to HUNGRY QUIRIN ARENA mangment panel.", 9);
    mes col("Current Event: "+$EVENT$,9);
    mes col("Event stage: "+$@EQ_STATUS, 9);
    mes l("Current player count: @@/5 must be online.", getusers(1));
    mes l("Current arena player count: @@ on map. (Min. 3 to begin event)", getmapusers("001-8"));

    // Open event? Minimum 5 connections or GM_OVERRIDE flag.
    if ($EVENT$ == "" && (getusers(1) >= 5 || $@GM_OVERRIDE)) {
        next;
        mes col("Activate event?", 1);
        if (askyesno() == ASK_YES) {
            $EVENT$="Hunger";
            announce("##1HUNGRY QUIRIN EVENT: ##3##BRegister is now open! Talk to Quirin, on Tulimshar Guardhouse!", bc_all|bc_npc);
        }
        close;
    }

    // Main Control menu. Not using l() on purpose.

    select
        rif($@EQ_STATUS == 0 && (getmapusers("001-8") >= 3 || $@GM_OVERRIDE), "Start Event!"),
        rif($@EQ_STATUS == 1, "Send wave of items and monsters!"),
        rif($@EQ_STATUS == 0 && $@GM_OVERRIDE && is_admin(), "[DEBUG] Join Event"),
        rif($@EQ_STATUS == 0 && $@GM_OVERRIDE && is_admin(), "[DEBUG] Join & Start Event"),
        "I'm done.";

    if (@menu == 1)
        donpcevent("#QuirinoHUB::OnStart");
    if (@menu == 2)
        donpcevent("#QuirinoHUB::OnSendWave");
    if (@menu == 3)
        goto L_Register;
    if (@menu == 4) {
        addtimer 1000, "Quirin::OnDebugReg";
        goto L_SignUp;
    }

    close;

OnDebugReg:
    donpcevent("#QuirinoHUB::OnStart");
    end;

OnInit:
    .sex=G_MALE;
    .distance=5;
    end;
}