• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Trigger question

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello, how do i make a trigger like this only fire once per unit? I want the unit to gain increased stats only the first time they enter the region.

  • Increase Unit Stats
    • Events
      • Unit - A unit enters Blood Elf Spawn <gen>
      • Unit - A unit enters Draenei Spawn <gen>
      • Unit - A unit enters Hell Spawn Spawn <gen>
      • Unit - A unit enters Ice Troll Spawn <gen>
      • Unit - A unit enters Undead Spawn <gen>
      • Unit - A unit enters Orc Spawn <gen>
      • Unit - A unit enters Night Elf Spawn <gen>
      • Unit - A unit enters Murloc Spawn <gen>
      • Unit - A unit enters Night Elf Spawn <gen>
    • Conditions
      • (Owner of (Triggering unit)) Not equal to Player 1 (Red)
      • (Owner of (Triggering unit)) Not equal to Player 2 (Blue)
      • (Owner of (Triggering unit)) Not equal to Player 3 (Teal)
      • (Owner of (Triggering unit)) Not equal to Player 4 (Purple)
    • Actions
      • -------- Health --------
      • Unit - Set Max HP of (Triggering unit) to (((Integer((Max life of (Triggering unit)))) x GameProgress) x 1)
      • Unit - Set life of (Triggering unit) to (((Life of (Triggering unit)) x (Real(GameProgress))) x 1.00)
      • -------- Mana --------
      • Unit - Set Max Mana of (Triggering unit) to (Integer((((Max mana of (Triggering unit)) x (Real(GameProgress))) x 0.70)))
      • Unit - Set mana of (Triggering unit) to (Max mana of (Triggering unit))
      • -------- Armor --------
      • Unit - Set Armor of (Triggering unit) to (((Armor of (Triggering unit)) x (Real(GameProgress))) x 0.30)
      • -------- Damage --------
      • Unit - Set Base Damage of (Triggering unit) to (Integer((((Real((Base Damage of (Triggering unit) for weapon index 0))) x (Real(GameProgress))) x 0.80))) for weapon index: 0
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
In addition to what Chaosy suggested, you can use a Unit Group to keep track of the units that have already entered a region.

  • Events:
  • A unit enters Blood Elf Spawn
  • Conditions:
  • Triggering unit is in OurNewUnitGroup equal to False
  • Actions:
  • Add hp/mana/armor/dmg...
  • Add triggering unit to OurNewUnitGroup
 
Level 19
Joined
Feb 27, 2019
Messages
582
You could add something to the unit that can be checked as a condition.

  • (Level of Check Ability for (Triggering unit)) Equal to 0
  • Unit - Add Check Ability to (Triggering unit)
Now the next time they enter a region they have the ability and so it wont run.
 
Level 7
Joined
Feb 23, 2020
Messages
253
Thank you all for the help! I will use what Uncle said which will work perfectly fine for me! :)
 
Status
Not open for further replies.
Top