summaryrefslogtreecommitdiff
path: root/world/map/npc/items/launcher_ammo.txt
blob: 79cf057b9ea96560bbe0cefb264bbedd2182405f (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
// ------------------------------------------------------------
// Ammo Needs to know Launcher and vice versa.
//
// Behavior:
//  - If only one is equipped, do nothing
//  - If incompatible launcher and ammo are equipped, unequip the ammo
//
// Variables passed to these scripts:
//
// @LauncherType, @AmmoType
//
// ------------------------------------------------------------

function|script|CheckLauncher|,
{
    if (getequipid(equip_arrow) == -1)
        set @LauncherType, 0;
    return;
}

function|script|CheckAmmo|,
{
    if ((@LauncherType == @AmmoType) || (!@LauncherType))
        goto L_Return;

    callfunc "UnequipLater";

L_Return:
    set @LauncherType, 0;
    set @AmmoType, 0;
    return;
}