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

Pick every unit not working

Status
Not open for further replies.
Level 2
Joined
Jul 19, 2010
Messages
6
Hello,

can you help me fixing my triggers?
What i want to do is, when hero learns a spell, it should damage a random enemy unit at the heroe very 2,5 seconds.


  • Learn WizardsGift
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Wizards Gift /// Grandmage
    • Actions
      • Set VariableSet Grandmage = (Triggering unit)
      • Trigger - Add to Wizards Gift <gen> the event (Time - Every 2.50 seconds of game time)
      • Trigger - Turn off (This trigger)


seconds trigger:

  • Wizards Gift
    • Events
    • Conditions
      • (Grandmage is alive) Equal to Wahr
    • Actions
      • Set VariableSet WizardsGiftLVL = (Level of Wizards Gift /// Grandmage for Grandmage)
      • Set VariableSet Grandmage = Grandmage2
      • Set VariableSet WizardsGiftGroup = (Units within 700.00 of (Position of Grandmage) matching (((Picked unit) belongs to an enemy of (Owner of Grandmage).) Equal to Wahr).)
      • Unit - Create 1 DAMAGEDUMMY for (Owner of Grandmage) at (Center of (Playable map area)) facing Default building facing degrees
      • Unit Group - Pick every unit in (Random 1 units from WizardsGiftGroup) and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\DarkRitual\DarkRitualCaster.mdl
          • Unit - Cause (Last created unit) to damage (Picked unit), dealing (100.00 x (Real(WizardsGiftLVL))) damage of attack type Hero and damage type Normal
          • Unit - Cause Grandmage2 to damage (Picked unit), dealing ((Real((Intelligence of Grandmage (Include bonuses)))) x (0.10 x (Real(WizardsGiftLVL)))) damage of attack type Chaos and damage type Normal
      • Unit - Remove (Last created unit) from the game
      • Unit Group - Remove all units from WizardsGiftGroup.
      • Custom script: call DestroyGroup(udg_WizardsGiftGroup)
      • Set VariableSet Grandmage2 = No unit
The question why 2 different units damage the picked unit? Because one has a chance to trigger another spell when damage is taken by this unit.
And the spell must not be MUI since there can only be that one unit with that spell.
 
Last edited:
Level 2
Joined
Jul 19, 2010
Messages
6
Hey,

thank you for the answer. Can you explain me how do I cause leaking locations... and how can I avoid them?

Since corona I am ging to teach myself the wc3 Editor.
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
if.gif
(Grandmage is alive) Equal to Wahr
what is wahr? that should be true there...
Hey,

thank you for the answer. Can you explain me how do I cause leaking locations... and how can I avoid them?

Since corona I am ging to teach myself the wc3 Editor.
In general leaking is when you create objects like points or unit groups, and then lose the way to access them (=handle). they add up and clogg up memory behind the scenes and can make your map lag and cause other problems.

 
Status
Not open for further replies.
Top