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

[Spell] Dispel Magic and Trained Units

Status
Not open for further replies.
Level 3
Joined
Mar 29, 2009
Messages
25
I was just wondering if it is possible to make dispel magic and its variants deal damage to certain trained units as well as summons.
For instance to make a distinction between lesser and greater undead trained skeletons are damaged by dispel while say an abomination isn't.
 
Level 25
Joined
May 11, 2007
Messages
4,651
If you edit the skeletons and give them the classification - Summoned, do they take damage from the dispel?

Otherwise, replace the trained unit with a skeleton summoned by a water elemental spell with a duration of 0 (infinite).
 
Level 8
Joined
Jul 8, 2013
Messages
249
This is pretty easy to just trigger though isn't it? All you have to do is make something like:

  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dispel Magic
    • Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Set TempUnitGroup = (Units within 250.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Footman
                  • (Unit-type of (Picked unit)) Equal to Knight
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 250.00 damage of attack type Spells and damage type Universal
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempUnitGroup)
That'll pick everything in the AoE, see if it's an enemy unit, then see if it's one of the types you want. If so, the caster will damage that unit. It'll work 100% as if the spell was doing the damage really.

For other dispels, Devour Magic and Disenchant could pretty much be copy/pasted. Purge and Abolish would just be a single target version of the same principle. The only dispel I can think of that wouldn't be really easy to do this way is Ray of Disruption maybe. Even that should be manageable.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
Trained units cannot be distinguish after another was trained, make a group for your certain trained and summoned units, add them in a condition;
  • Untitled Trigger 001
    • Events
      • Unit - A unit Finishes training a unit
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Trained unit)) Equal to Footman
        • Then - Actions
          • -------- ADD to a group here --------
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Summoned unit)) Equal to Water Elemental (Level 1)
        • Then - Actions
          • -------- ADD to a group here --------
        • Else - Actions
Then you can do your damage if all of the above is in the group...
 
Status
Not open for further replies.
Top