summaryrefslogtreecommitdiff
path: root/npc/functions/vault.txt
blob: b66d46ff020d681c17f27108b48825615d7b41c2 (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
// TMW-2 Script
// Author:
//    Jesusalva
//  Description:
//    Vault Utilities

function	script	getvaultid	{
    // FIXME: Make this False
    if ($BETASERVER && !debug)
        return ##VAULT;
    else
        return 0;
}

function	script	getvaultexp	{
    .@exp=getarg(0);
    if (.@exp > 100)
        Exception("ILLEGAL VAULT EXPERIENCE, FIXME URGENTLY. STOPPING SCRIPT BY FORCE WHILE DOING NOTHING.",
            RB_DEBUGMES | RB_IRCBROADCAST | RB_GLOBALANNOUNCE | RB_ISFATAL);
    if (getvaultid()) {
        ##VAULT_EXP+=.@exp;
        consoleinfo("Granting %d Soul Exp to %d under the Moubootaur's authority.",
                 .@exp, ##VAULT);
    }
    return;
}

// MirrorLakeSendTo(World, Lake)
function	script	MirrorLakeSendTo	{
    .@w=getarg(0);
    .@t=getarg(1);
    ##VAULT_GOTO=.@w;
    ##VAULT_MLTO=.@t;
    closeclientdialog;
    dispbottom l("Darkness fills your vision...");
    sleep2(1000);
    kick(getcharid(3), 7); // 7 is not a valid kick reason
    //atcommand("@kick "+strcharinfo(0));
    end;
}


// BonusEXP({mobId})
function	script	BonusEXP	{
    // Only applies if you are not in TOP 3
    if (BaseLevel >= TOP3AVERAGELVL())
        return;

    // Permanent Level Boost
    if (#ADD_LVL) {
        .@mobId=getarg(0, killedrid);
        .@exp = min(#ADD_LVL, getmonsterinfo(.@mobId, MOB_BASEEXP) * 2);
        getexp .@exp, 0;
        #ADD_LVL-=.@exp;

        /*
        if ((readparam(BaseExp)+.@exp > readparam(NextBaseExp))) {
            do {
                if (BaseLevel >= TOP3AVERAGELVL()) break; // Boundaries
                .@v=readparam(NextBaseExp)-readparam(BaseExp);
                getexp .@v, 0;
                #ADD_LVL-=.@v;
            } while (readparam(BaseExp)+.@exp > readparam(NextBaseExp));
        }
        */
    }
    return;
}