diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-11-24 14:44:15 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-11-24 14:44:15 -0800 |
commit | 14b0731f8a74aad602e004fa726c53584bb72029 (patch) | |
tree | e86b6f2762680809c560047234e77543a650e4df /world/map/npc | |
parent | 5b7768879adf803278e425bc20961c2dc4bc4147 (diff) | |
download | serverdata-14b0731f8a74aad602e004fa726c53584bb72029.tar.gz serverdata-14b0731f8a74aad602e004fa726c53584bb72029.tar.bz2 serverdata-14b0731f8a74aad602e004fa726c53584bb72029.tar.xz serverdata-14b0731f8a74aad602e004fa726c53584bb72029.zip |
Fix style and logic of UnequipCB
Diffstat (limited to 'world/map/npc')
-rw-r--r-- | world/map/npc/026-1/munro.txt | 3 | ||||
-rw-r--r-- | world/map/npc/items/launcher_ammo.txt | 18 | ||||
-rw-r--r-- | world/map/npc/items/unequipcb.txt | 8 |
3 files changed, 13 insertions, 16 deletions
diff --git a/world/map/npc/026-1/munro.txt b/world/map/npc/026-1/munro.txt index 1151e3b8..ab304091 100644 --- a/world/map/npc/026-1/munro.txt +++ b/world/map/npc/026-1/munro.txt @@ -69,6 +69,7 @@ L_disablemunro: disablenpc "Munro"; L_End: + setnpctimer 0; end; } @@ -81,7 +82,7 @@ function|script|CheckMunro|, if ((gettime(6) == 12 && gettime(5) >= 23) || (gettime(6) == 12 && gettime(5) <= 26)) goto L_Return; - // unequipbyid @slotId; + callfunc "UnequipLater"; L_Return: return; diff --git a/world/map/npc/items/launcher_ammo.txt b/world/map/npc/items/launcher_ammo.txt index 3b0b21f8..79cf057b 100644 --- a/world/map/npc/items/launcher_ammo.txt +++ b/world/map/npc/items/launcher_ammo.txt @@ -2,9 +2,10 @@ // Ammo Needs to know Launcher and vice versa. // // Behavior: -// Ammo is always unequipped +// - If only one is equipped, do nothing +// - If incompatible launcher and ammo are equipped, unequip the ammo // -// Variables passed to this script: +// Variables passed to these scripts: // // @LauncherType, @AmmoType // @@ -12,14 +13,8 @@ function|script|CheckLauncher|, { - set @AmmoEquip, (getequipid(equip_arrow) + 1); - if (@AmmoEquip) - goto L_Return; - -L_NoAmmoEquip: - set @LauncherType, 0; - -L_Return: + if (getequipid(equip_arrow) == -1) + set @LauncherType, 0; return; } @@ -28,9 +23,10 @@ function|script|CheckAmmo|, if ((@LauncherType == @AmmoType) || (!@LauncherType)) goto L_Return; -L_Unequip: callfunc "UnequipLater"; L_Return: + set @LauncherType, 0; + set @AmmoType, 0; return; } diff --git a/world/map/npc/items/unequipcb.txt b/world/map/npc/items/unequipcb.txt index ec185f02..62dc7715 100644 --- a/world/map/npc/items/unequipcb.txt +++ b/world/map/npc/items/unequipcb.txt @@ -6,7 +6,7 @@ botcheck.gat,0,0,0|script|UnequipCB|-1,-1,-1 { OnUnequip: - unequipbyid (@unequip_slot -1); + unequipbyid (@unequip_slot - 1); set @unequip_slot, 0; end; } @@ -14,11 +14,11 @@ OnUnequip: // Paired with unequipcb function|script|UnequipLater|, { - if(@unequip_slot) + // if there are multiple items that want to be removed, + // only schedule one timer - scripts will be called again + if (@unequip_slot) goto L_Return; - goto L_ReturnTimer; -L_ReturnTimer: set @unequip_slot, (@slotId + 1); addtimer 0, "UnequipCB::OnUnequip"; |