• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Ammuntion Count Help!!!

Status
Not open for further replies.
Level 6
Joined
Sep 17, 2005
Messages
276
you have to use gold or wood for ammunition (in following i use wood) . for a simple ammo system use triggers like that:

Code:
TRIGGER 1:  ----Ammo decrease

EVENT:      unit-a unit is attacked

CONDITION:  <<< here conditions that only those players decrease ammo, which use ammo >>>
           ---for example---
           OR   
           - (owner of attacking unit) equal to player X
           - (owner of attacking unit) equal to player Y

ACTIONS:   add -1 lumber to (owner of attacking unit)


TRIGGER 2: ---If Ammo 0---

EVENT:    (player X) lumber less than or equal to 0
          (player Y) lumber less than or equal to 0
          ...

COND:     

ACTIONS: set (triggering player) alliance to player(enemy) to neutral


TRIGGER 3: ---Has ammo again---

EVENT:    (player X) lumber becomes greater than 0
          (player Y) lumber becomes greater than 0
          ...

COND:     

ACTIONS: set (triggering player) alliance to player(enemy) to enemy


hope that helps you. i created this system for my resevil map and it work all fine. :wink:
 
Status
Not open for further replies.
Top