summaryrefslogtreecommitdiff
path: root/npc/015-2/contrabandist.txt
blob: 2835d575581e78f8b3e99c0f18023952c3999bb1 (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
// TMW-2 Script
// Author:
//    Jesusalva
// Description:
//    Contraband of foreing goods.

015-2,166,250,0	script	#Contraband	NPC_NO_SPRITE,{

    // Store not available
    if (!.active)
        end;

    mesn;
    mesc l("I have a few items for sale...");
    next;
    menuint
        rif(.CurrentValue & 1, l("Treasure Map")), 1,
        rif(.CurrentValue & 2, l("Lock Picks")), 2,
        rif(.CurrentValue & 4, l("Return Potion")), 4,
        rif(.CurrentValue & 8, l("Golden Pearl Ring")), 8,
        rif(.CurrentValue & 16, l("Mysterious Bottle")), 16,
        rif(.CurrentValue & 32, l("Ancient Blueprint")), 32,
        rif(.CurrentValue & 64, l("Arcmage Boxset")), 64,
        rif($ARKIM_ST > 7500 && .CurrentValue & 128, l("Dark Desert Mushroom")), 128,
        l("Nothing"), 0;
    mes "";
    switch (@menuret) {
        case 1:
            .@price=600;
            .@prize=TreasureMap;
            break;
        case 2:
            .@price=1000;
            .@prize=Lockpicks;
            break;
        case 4:
            .@price=2200;
            .@prize=ReturnPotion;
            break;
        case 8:
            .@price=1000000;
            .@prize=GoldenPearlRing;
            break;
        case 16:
            .@price=4000;
            .@prize=MysteriousBottle;
            break;
        case 32:
            .@price=15000;
            .@prize=AncientBlueprint;
            break;
        case 64:
            .@price=21000;
            .@prize=ArcmageBoxset;
            break;
        case 128:
            .@price=.DDMPrice;
            .@prize=DarkDesertMushroom;
            break;
        default:
            .@price=999999999;
            .@prize=Acorn;
            break;
    }
    mesc l("Only @@ GP.", .@price);
    if (Zeny < .@price)
        close;
    if (askyesno() == ASK_YES) {
        if (!(.CurrentValue & @menuret)) {
            mesc l("Out of Stock."), 1;
            close;
        }
        .CurrentValue=.CurrentValue^@menuret;
        Zeny-=.@price;
        getitem .@prize, 1;
        mesc l("Item sold!"), 2;
    }
    close;

// Load
OnMinute21:
OnMinute46:
    setnpcdisplay .name$, NPC_KOGA;
    .active=1;

    .CurrentValue=rand2(1,255);
    .DDMPrice=max(30000,50000-($ARKIM_ST/2)+(7500/2));
    end;

// Unload
OnMinute23:
OnMinute48:
    setnpcdisplay .name$, NPC_NO_SPRITE;
    .active=0;
    end;

OnInit:
    .active=0;
    .sex = G_OTHER;
    .distance = 12;

    if (debug) {
        setnpcdisplay .name$, NPC_KOGA;
        .active=1;
    }
    end;

}