From b55a4543d92a804473cb639193aaa9b6a83edcce Mon Sep 17 00:00:00 2001 From: wushin Date: Fri, 25 Oct 2013 12:22:53 -0500 Subject: Multiple Ammo Types Added Item SlingShot Added Item SlingBullet Added Const AMMO_NONE, AMMO_BOW, AMMO_SLING Added Function CheckAmmo Added Trigger OnQuequipAmmo to Unequipcb Added Var @AmmoType to Ammo Added Var @LauncherType to Launchers Added File launcher_ammo.txt to scripts Needs TMWA-server commit equip-arrow to work (equip_arrow) --- world/map/npc/items/launcher_ammo.txt | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 world/map/npc/items/launcher_ammo.txt (limited to 'world/map/npc/items/launcher_ammo.txt') diff --git a/world/map/npc/items/launcher_ammo.txt b/world/map/npc/items/launcher_ammo.txt new file mode 100644 index 00000000..3b0b21f8 --- /dev/null +++ b/world/map/npc/items/launcher_ammo.txt @@ -0,0 +1,36 @@ +// ------------------------------------------------------------ +// Ammo Needs to know Launcher and vice versa. +// +// Behavior: +// Ammo is always unequipped +// +// Variables passed to this script: +// +// @LauncherType, @AmmoType +// +// ------------------------------------------------------------ + +function|script|CheckLauncher|, +{ + set @AmmoEquip, (getequipid(equip_arrow) + 1); + if (@AmmoEquip) + goto L_Return; + +L_NoAmmoEquip: + set @LauncherType, 0; + +L_Return: + return; +} + +function|script|CheckAmmo|, +{ + if ((@LauncherType == @AmmoType) || (!@LauncherType)) + goto L_Return; + +L_Unequip: + callfunc "UnequipLater"; + +L_Return: + return; +} -- cgit v1.2.3-60-g2f50