summaryrefslogtreecommitdiff
path: root/npc/items/nobow_item.txt
blob: 0584c524cd18eabcbb315d399e00b445ed738357 (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
function	script	NoBowItem	{
    .@me = getarg(0);

    // Developers are always allowed to use this item
    if (is_dev())
        return;

    // If you can equip *anything*, this restriction is moot
    if (has_permission(PERM_USE_ALL_EQUIPMENT, getcharid(3)))
        return;

    // Bows which are not allowed
    if (countitem(BansheeBow))
        goto L_Abort;
    if (countitem(DesertBow))
        goto L_Abort;
    if (countitem(ForestBow))
        goto L_Abort;
    // Don't care with Bow/ShortBow/slings and darts

    return;

// Has to be a goto so `.@me` is loaded properly
L_Abort:
    message strcharinfo(0), l("This item is too cumbersome to use and could potentially break your valuable bow by accident. So you give up.");
    unequip(.@me);
    return;
}