• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

I need help with a trigger

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2008
Messages
35
im working on a trigger and i relly need some help on this im somewhat expernced with normal triggers but it would be helpful to hav some step by step instructions or a website that has what i need/

but anyway the trigger is suposta take an item from the heros inventory that i call the ammuntion and uses the ammo but he needs the gun in his inventory as well as the ammo.:confused:
 
Level 7
Joined
Jun 14, 2009
Messages
235
is it a spell or an attack? Does it shoot 1 ammo per attack or spell or more? You can make it easy by using lumber for ammo and putting the gun in slot 1 always.

Either way try something like this

  • gun
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Item carried by (Attacking unit) in slot 1) Equal to Gun
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Attacking unit)) Current lumber) Greater than 0
        • Then - Actions
          • Player - Add -1 to (Owner of (Attacking unit)) Current lumber
          • etc.... firing bullet
        • Else - Actions
          • Player Group - Add (Owner of (Attacking unit)) to TempPlayerGroup
          • Game - Display to TempPlayerGroup the text: You have no Ammo!
          • Custom Script: call DestroyForce(udg_PlayerGroup)
something like that, its kinda leaky though im not that great

give me a min ill try to make it look better
 
Here is a modified one:


  • gun
    • Events
      • Unit - A unit Is Attacked //You use attacking unit so this must be the event used
    • Conditions
      • (Item carried by (Attacking unit) in slot 1) Equal to Gun
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Attacking unit)) Current lumber) Greater than 0
        • Then - Actions
          • Player - Add -1 to (Owner of (Attacking unit)) Current lumber
          • etc.... firing bullet
        • Else - Actions
          • Player Group - Add (Owner of (Attacking unit)) to TempPlayerGroup
          • Unit - Order (Attacking Unit) to stop. //You add this to stop the unit from attacking if he has no ammo
          • Game - Display to TempPlayerGroup the text: You have no Ammo!
          • Custom Script: call DestroyForce(udg_TempPlayerGroup)
 
Status
Not open for further replies.
Top