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

[Trigger] Will my trigger work as intended?

Status
Not open for further replies.
Level 3
Joined
May 8, 2008
Messages
28
Mystic bolt is based off of chain lightning. I want it to work like this: if you fire the lightning at a unit and it doesn't bounce to anything, it does 5*INT of caster as additional damage to the target. To do this I check for units around the target within the AOE range of the chain lightning. I am concerned that I might be overlooking something like invulnerable dummy units or buildings near the target that prevent the bonus damage from being applied.

  • MysticBolt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mystic Bolt (sorceress)
    • Actions
      • Set TempLoc = (Position of (Target unit of ability being cast))
      • Set EnemiesNearSpell = (Units within 500.00 of TempLoc matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in EnemiesNearSpell and do (Unit Group - Remove all units of (Units within 500.00 of TempLoc matching (((Matching unit) is Magic Immune) Equal to True)) from EnemiesNearSpell)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in EnemiesNearSpell) Equal to 1
        • Then - Actions
          • Set Sleep_Caster = (Triggering unit)
          • Set Sleep_Target = (Target unit of ability being cast)
          • Set Sleep_Attribute = (Intelligence of Sleep_Caster (Include bonuses))
          • Set Sleep_Damage = ((Real(Sleep_Attribute)) x 5.00)
          • Unit - Cause Sleep_Caster to damage Sleep_Target, dealing Sleep_Damage damage of attack type Spells and damage type Unknown
          • Special Effect - Create a special effect attached to the overhead of Sleep_Target using Objects\Spawnmodels\Demon\DemonSmallDeathExplode\DemonSmallDeathExplode.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect attached to the overhead of Sleep_Target using Units\NightElf\Wisp\WispExplode.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call DestroyGroup (udg_EnemiesNearSpell)
 
Level 7
Joined
Jan 23, 2011
Messages
350
Your "Pick every blablabla" is leaking hard. You should add more conditions to the previous line or using a proper If to remove your unwanted units.
If there are many buildings in your map, and you want them ignored, add the condition
Dummies with locust are ignored by group enum
 
Level 3
Joined
May 8, 2008
Messages
28
Your "Pick every blablabla" is leaking hard. You should add more conditions to the previous line or using a proper If to remove your unwanted units.
If there are many buildings in your map, and you want them ignored, add the condition
Dummies with locust are ignored by group enum

Ok I will add the conditions. Dummies with locust are not included into the unit group? So I will not have to worry about casting dummies?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Unit Group - Pick every unit in EnemiesNearSpell and do (Unit Group - Remove all units of (Units within 500.00 of TempLoc matching (((Matching unit) is Magic Immune) Equal to True)) from EnemiesNearSpell)
This action statement seems a bit iffy and certainly is leaky. Rather pick all magic immune units, remove it from the group and then destroy the magic immune units group.
 
Status
Not open for further replies.
Top