SphereCommunity
always 200 arrows and bolts in backpack - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: always 200 arrows and bolts in backpack (/Thread-always-200-arrows-and-bolts-in-backpack)

Pages: 1 2


RE: always 200 arrows and bolts in backpack - Kanibal - 02-17-2016 10:42 PM

(02-17-2016 10:37 PM)karma Wrote:  Your solution won't work...

Really?


RE: always 200 arrows and bolts in backpack - karma - 02-18-2016 12:55 AM

Uhmm nope, it works, i thought you was changing the AMOUNT of the item Tongue


RE: always 200 arrows and bolts in backpack - pointhz - 02-18-2016 05:28 AM

[FUNCTION f_restock_ammo]
FORCONT <SRC.FINDLAYER.21.UID> 0
IF (<BASEID> == i_arrow) || (<BASEID> == i_xbolt)
REMOVE
ENDIF
ENDFOR
SERV.NEWITEM = i_arrow, 200, <FINDLAYER.21.UID>
SERV.NEWITEM = i_xbolt, 200, <FINDLAYER.21.UID>

timerf 30, f_restock_ammo



Make sure you call the function on the npc, not on the items.

[CHARDEF npc_id]

on=@create
f_restock_ammo


RE: always 200 arrows and bolts in backpack - Khaos - 02-18-2016 07:31 AM

Or... we could have bypassed all of this and used an override on the bows/xbows the NPC's use and set it to use no ammo. Which is great if you don't have them switching to hand to hand combat weaponry or they can shoot in hand to hand.

Food for thought...