1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Trigger question

Discussion in 'World Editor Help Zone' started by Xzere, Oct 7, 2020.

  1. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    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
     
  2. Chaosy

    Chaosy

    Tutorial Reviewer

    Joined:
    Jun 9, 2011
    Messages:
    11,102
    Resources:
    18
    Icons:
    1
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    18
    Do you know how to use a unit indexer, or a hashtable?
     
  3. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,472
    Resources:
    0
    Resources:
    0
    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
     
  4. Chaosy

    Chaosy

    Tutorial Reviewer

    Joined:
    Jun 9, 2011
    Messages:
    11,102
    Resources:
    18
    Icons:
    1
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    18
    ^ easier and quicker, I suggest that instead
     
  5. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,472
    Resources:
    0
    Resources:
    0
    Although, if he wants it to work once for EACH region, he'd need multiple Unit Groups which seems sort of ugly... A hashtable would be a lot cleaner in that case.
     
  6. [db]east

    [db]east

    Joined:
    Feb 27, 2019
    Messages:
    144
    Resources:
    0
    Resources:
    0
    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.
     
  7. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    Thank you all for the help! I will use what Uncle said which will work perfectly fine for me! :)