• 🏆 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!

[Trigger] Gold when attack

Status
Not open for further replies.
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable Map Area)) and do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger3 <gen> the event (Unit - (Picked unit) takes damage)
  • Trigger2
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
  • Actions
    • Trigger - Add to Trigger3 <gen> the event (Unit - (Triggering unit) takes damage)
  • Trigger3
  • Events
  • Conditions
  • Actions
    • Player - Add (Real(Damage Dealt)) to (Owner of (Damage source)) Current gold
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Not necessarily. Depending on what you're using it for you are able to detect any change in a player's gold/lumber, so in some cases it may be easier to do it this way. There is no real down-side to using a damage detection engine either, though, if it's going to be included in the map then it might as well be used for this so that there is record of exactly how much gold was obtained, and other data that you cannot reference from event responses.
 
Status
Not open for further replies.
Top