• 🏆 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] Resurrecting Enemies?

Status
Not open for further replies.
Level 2
Joined
Feb 21, 2020
Messages
5
I have been thinking about making a spell that allows a hero to raise the dead units of an enemy and fully control them.

This sounds like Animate dead, but obviously that spell raises some different version of the dead units. Seems like they have some things like shadowmeld still in-tact, oddly, but nothing else.

So, I turn to changing Resurrection to be this spell, where it raises enemies instead, but of course I am running into the issue that when I resurrect an enemy they stay an enemy.

So I assume I need to turn to triggers to solve this, but I am not sure how to do so.

I tried using "Change Ownership of (Target unit of ability being cast)" but this does not work presumably because resurrection is not a castable spell.

I'm sure I'm missing something basic, so if anyone could help me make this happen I would be very much appreciative!
 
Level 6
Joined
Dec 31, 2017
Messages
138
It's not that easy, but it's not any hard too.

You'll need dummy spell and dummy unit.

Then use something like this:
  • res
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap (Dummy ability)
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempGroup = (Units within 900.00 of TempPoint matching (((Matching unit) is alive) Equal to False))
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If ((TempGroup is empty) Equal to True) then do (Skip remaining actions) else do (Do nothing)
          • Set TempUnit = (Random unit from TempGroup)
          • Set TempPoint = (Position of TempUnit)
          • Unit - Create 1 Dummy for (Triggering player) at TempPoint facing Default building facing degrees
          • Unit - Add Resurrection (unit) to (Last created unit)
          • Unit - Order (Last created unit) to Human Paladin - Resurrection
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Change ownership of TempUnit to (Triggering player) and Change color
          • Unit Group - Remove TempUnit from TempGroup
Keep in mind that triggers leak Things That Leak
 
Last edited:
Level 6
Joined
Dec 31, 2017
Messages
138
@Deserted
Additionally This blew my mind when It was first suggested to me.
Convenient Unit Group Filtering in GUI
This isn't really convinient when we pick a random unit from the group, because we have to filter it beforehand.
  • res
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap (Dummy ability)
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempGroup = (Units within 900.00 of TempPoint)
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit is alive) Equal to True
            • Then - Actions
              • Unit Group - Remove TempUnit from TempGroup
            • Else - Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If ((TempGroup is empty) Equal to True) then do (Skip remaining actions) else do (Do nothing)
          • Set TempUnit = (Random unit from TempGroup)
          • Set TempPoint = (Position of TempUnit)
          • Unit - Create 1 Dummy for (Triggering player) at TempPoint facing Default building facing degrees
          • Unit - Add Resurrection (unit) to (Last created unit)
          • Unit - Order (Last created unit) to Human Paladin - Resurrection
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Change ownership of TempUnit to (Triggering player) and Change color
          • Unit Group - Remove TempUnit from TempGroup
 
Status
Not open for further replies.
Top