summaryrefslogtreecommitdiff
path: root/npc/029-1/pentagram.txt
blob: 261b0634d68709dfef00cf52981d17fd1b05d06c (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
// TMW2 scripts.
// Author:
//    Jesusalva
// Description:
//    Fires of Steam: The Death of Andrei Sakar

//////////////////////////////////////////
// Pentagram Core

029-1,35,32,0	script	Pentagram#FoS_1	NPC_NO_SPRITE,{
    .@n$=strnpcinfo(0, "_0");
    explode(.@ni$, .@n$, "_");
    .@id=atoi(.@ni$[1]);
    debugmes "ID %d", .@id;
    if (.@id < 1) end;
    if ($FIRESOFSTEAM[.@id] < 1) end;

    mesn;
    mesq l("Power remaining: %s", fnum($FIRESOFSTEAM[.@id]));
    next;
    mesc l("Use items to drain the pentagram. Final result is affected by int!");
    mesc l("WARNING: Monsters will appear!"), 1;
    select
        l("Cancel"),
        l("Dark Crystal (5 power)"),
        l("Terranite Ore (3 power)"),
        l("Coal (2 power)"),
        l("Cotton Cloth (1 power)");
    mes "";
    switch (@menu) {
    case 2:
        .@val=5;.@it=DarkCrystal;
        break;
    case 3:
        .@val=3;.@it=TerraniteOre;
        break;
    case 4:
        .@val=2;.@it=Coal;
        break;
    case 5:
        .@val=1;.@it=CottonCloth;
        break;
    default:
        close;
    }

    closeclientdialog;
    if (!countitem(.@it)) end;
    .@val*=countitem(.@it);
    .@val*=(readparam2(bInt)+100)/100; // Each int gives +1%
    delitem .@it, countitem(.@it);
    $FIRESOFSTEAM[.@id]-=.@val;
    getexp 0, .@val*2;
    // TODO: Check & unlock
    if ($FIRESOFSTEAM[.@id] < 1)
        disablenpc .name$;
    // Create monsters based on effectivity
    areamonster("029-1", .x-3, .y-3, .x+3, .y+3, strmobinfo(1, MagicGoblin), MagicGoblin, (.@val/15)+1, "SteamFire#Ctrl::OnEvent1");
    dispbottom l("Power remaining: %s", fnum($FIRESOFSTEAM[.@id]));
    close;

OnInit:
    .distance=3;
    end;
}

// Now we duplicate
029-1,258,39,0	duplicate(Pentagram#FoS_1)	Pentagram#FoS_2	NPC_NO_SPRITE
029-1,113,148,0	duplicate(Pentagram#FoS_1)	Pentagram#FoS_3	NPC_NO_SPRITE
029-1,229,188,0	duplicate(Pentagram#FoS_1)	Pentagram#FoS_4	NPC_NO_SPRITE
029-1,38,257,0	duplicate(Pentagram#FoS_1)	Pentagram#FoS_5	NPC_NO_SPRITE