summaryrefslogtreecommitdiff
path: root/npc/025-1/phoenix.txt
blob: c9e95556afb246d7745848ecab9d5cfd46491a9a (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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// TMW-2 Script.
// Author:
//    Jesusalva
// Notes:
//    Phoenix Rebirth

025-1,66,21,0	script	Phoenix Rebirth	NPC_BRGUARD_SPEAR,{
    setpcblock(PCBLOCK_HARD, true);
    .@phoenix = true;

OnMain:
    mesn;
    mesq l("Hello there. My name is %s.", .name$);
    next;
    mesn;
    if (REBIRTH)
        .@blvl=0-(REBIRTH_OVERLEVEL/REBIRTH);
    else
        .@blvl=0;

    switch (REBIRTH) {
    case 0:
        .@blvl+=99;
        .@rebirth$=l("first");
        break;
    case 1:
        .@blvl+=120;
        .@rebirth$=l("second");
        break;
    case 2:
        .@blvl+=135;
        .@rebirth$=l("third");
        break;
    case 3:
        .@blvl+=150;
        .@rebirth$=l("fourth");
        break;
    case 4:
        .@blvl+=175;
        .@rebirth$=l("final");
        if ($GAME_STORYLINE >= 5)
            break;
    default:
        setpcblock(PCBLOCK_HARD, false);
        mesc l("Unfortunately you cannot rebirth anymore!");
        close;
        break;
    }
    .@blvl=max(90, .@blvl); // Do not allow it to go too far below!
    mesc l("Once you reach level %d, I'll offer you a life-time opportunity to delete all your levels and experience for your %s rebirth!", .@blvl, .@rebirth$);
    next;
    mesn;
    mesq l("Rebirth is free. Here are the perks you'll get by doing the rebirth:");
    mes "";
    mes l("* +3 Inventory Slots")+" ##1##BWIP##b##0";
    mes l("* +1 in all attributes, permanently");
    mes l("* +1 Magic Skill Point");
    mes l("* +%d%% EXP Gain and Drop Chance, permanently", 2);
    mes l("* 1 %s", getitemlink(SupremeGift));
    mes l("* 1 Trait");
    mes l("* Healing items improved");
    mes l("* %s Level up", getskillname(TMW2_DROPS));
    if (BaseLevel < .@blvl) {
        setpcblock(PCBLOCK_HARD, false);
        close;
    }
    next;
    mesn;
    mesq l("Are you interested? You'll keep %s your equipment, magic, quest progression, craft recipes, money, whatever else which is not a level. Not even Job level won't be reset!", b(l("ALL")));
    mesc l("This cannot be undo later!"), 1;
    next;
    setpcblock(PCBLOCK_HARD, false);
    inventoryplace NPCEyes, 7;
    select
        l("Do not rebirth"),
        l("Rebirth"),
        l("Do not rebirth");
    mes "";
    if (@menu != 2)
        close;
    mesc l("ARE YOU SURE? THIS CANNOT BE UNDONE LATER!!"), 1;
    if (askyesno() != ASK_YES)
        close;

    setnpcdialogtitle l("Rebirth Trait Selection");
    if (!ChooseTrait())
        close;

    // Okay, then a rebirth it is!
    expandinventory(3);
    REBIRTH+=1;
    REBIRTH_OVERLEVEL=max(0, BaseLevel-.@blvl-(REBIRTH_OVERLEVEL/REBIRTH));
    resetlvl(3);
    sk_lvup(TMW2_DROPS);
    NewcomerEXPDROPUP();
    getvaultexp(20);
    getitembound SupremeGift, 1, 4;
    warp "005-1", 40, 117;
    LOCATION$="Candor";
    kamibroadcast(strcharinfo(0)+" has been reborn.");
    // Maybe you were THE FIRST
    if (!REBIRTH_WINNER)
        REBIRTH_WINNER = gettimetick(2);
    if ($REBIRTH_WINNER$ == "") {
        $REBIRTH_WINNER$=strcharinfo(0);
        channelmes("#world", $REBIRTH_WINNER$+" is the first player to REBIRTH!! They are so OP! %%N");
        announce "All hail ##B"+$REBIRTH_WINNER$+"##b, first player to REBIRTH and become OP!", bc_all|bc_npc;
        getitem SupremeGift, 1;
        next;
    }
    // These operations can be delayed or fail
    StatusResetReinvest();
    if ($EVENT$ == "Rebirth" && .@phoenix)
        BaseLevel = 3;
    // Open a new dialog
    clear;
    setnpcdialogtitle l("Rebirth Race Selection");
    mesc l("Do you want to change your race?");
    mesc l("This can only be reverted at rebirth! Beware!");
    next;
    if (askyesno() != ASK_YES)
        close;

    // Rebirth: 0
    mes "";
    mes ".:: "+l("Human")+" ::.";
    mesc l("The most widespread race in the continent, highly versatile, perfect all-rounders.");
    mesc l("Strength: NONE"), 2;
    mesc l("Weakness: NONE"), 1;


    // Rebirth: 1
    if (REBIRTH >= 1) {
        mes "";
        mes ".:: "+l("Elven")+" ::.";
        mesc l("They are highly intelligent, and have higher magical affinity, and live longer, but lacks creativity.");
        mesc l("Strength: INT+"), 2;
        mesc l("Weakness: STR-"), 1;
        mes "";
        mes ".:: "+l("Tritan")+" ::.";
        mesc l("Blue from sea, learned how to hunt. But unfortunately, not how to withstand attacks.");
        mesc l("Strength: DEX+"), 2;
        mesc l("Weakness: VIT-"), 1;
    }


    // Rebirth: 2
    if (REBIRTH >= 2) {
        mes "";
        mes ".:: "+l("Raijin")+" ::.";
        mesc l("Lives undercover in human society. Luck led them to surviving this far.");
        mesc l("Strength: LUK+"), 2;
        mesc l("Weakness: DEX-"), 1;
        mes "";
        mes ".:: "+l("Orc")+" ::.";
        mesc l("Highly strong and bulky, faces their foes head-on.");
        mesc l("Strength: STR+, Carry Weight +"), 2;
        mesc l("Weakness: AGI-"), 1;
    }


    // Rebirth: 3
    if (REBIRTH >= 3) {
        mes "";
        mes ".:: "+l("Ukar")+" ::.";
        mesc l("Superb stealth, and quick on their toes.");
        mesc l("Strength: AGI+, Walk Speed +"), 2;
        mesc l("Weakness: LUK-"), 1;
        mes "";
        mes ".:: "+l("Redy")+" ::.";
        mesc l("Grown in harsh environments, withstand anything.");
        mesc l("Strength: VIT++"), 2;
        mesc l("Weakness: INT-"), 1;
    }


    // Rebirth: 5
    if (REBIRTH >= 5) {
        mes "";
        mes ".:: "+l("Savior")+" ::.";
        mesc l("Unparelled, strength without precedents. Ancient beings of pure mana, rumored to be immortal.");
        mesc l("Strength: ALL"), 2;
        mesc l("Weakness: NONE"), 1;
    }
    next;
    menuint
        l("Kaizei Human"), 0,
        rif(REBIRTH >= 1, l("Elven")), 3,
        rif(REBIRTH >= 1, l("Tritan")), 6,
        rif(REBIRTH >= 2, l("Raijin")), 5,
        rif(REBIRTH >= 2, l("Orc")), 4,
        rif(REBIRTH >= 3, l("Ukar")), 7,
        rif(REBIRTH >= 3, l("Redy")), 8,
        rif(REBIRTH >= 5, l("Savior")), 9,
        l("Argaes Human"), 1,
        l("Tonori Human"), 2,
        l("Don't change race"), Class;

    jobchange max(0, @menuret);
    close;

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