summaryrefslogtreecommitdiff
path: root/npc/functions/shops.txt
blob: a4945c57eec8b56622917a4406f0b27134be9d21 (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
// Evol functions.
// Author:
//    4144
//    Jesusalva
// Description:
//    Shops utility functions
// Variables:
//    Item ID, Item Price, Item Amount

// restoreshopitem(amount) or restoreshopitem(price, amount)
function	script	restoreshopitem	{
    if (getarg(2, -1337) == -1337) {
        .@amount=getarg(1);
        .@price=-1;
    } else {
        .@amount=getarg(2);
        .@price=getarg(1);
    }

    if (shopcount(getarg(0)) < .@amount)
        sellitem getarg(0), .@price, .@amount;
    return;
}