• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How would a Hero use ammo?

Status
Not open for further replies.
Level 3
Joined
Apr 1, 2007
Messages
35
In my RPG, I need to make my Hunter use ammo for his shots. So far, I only have a basic gun made. So, how would I make the gun use ammo? Would it take triggers, JASS, nothing? A little help would be appreciated.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Everytime the hunter attacks, remove 1 arrow from inventory, if no arrows are found, stop it from attacking. One of the simplist systems to make, if only I could make one where the unit actually stops shooting when I issue the stop order, and not after, but anyway im sure I can if I wanted to.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Well, Super

Events
A Unit attacks
Conditions
Unit Type of Attacking Unit == Hunter
Actions
if (Arrows == 0)
Order Attacking Unit to stop
endif
if (Arrows > 0)
Remove 1 arrow
endif
if (Arrows == 0)
Create some dummy unit
Order some dummy unit to cast Drunken Haze (AOE 0) on Attacking Unit, that does nothing except block Ranged attacks.
Add Expiration Timer to that dummy
endif

-----

Events
Unit Acquires an Item
Conditions
Unit has buff (No Arrows!)
Item being Manipulated == Arrows
Actions
Remove (No Arrows!) from triggering unit
 
Status
Not open for further replies.
Top