• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Channel Necromancy Spell

Status
Not open for further replies.
Level 2
Joined
Feb 20, 2018
Messages
15
I'm trying to make a spell that raises an undead unit based on the corpse's unit type. It's based on the Channel ability because I want it to allow you to select the corpse. Is it possible or should I just use Raise Dead?
 
Level 12
Joined
Feb 5, 2018
Messages
525
Well I don't know what was your main goal to achieve here, but you can select dead units and their unit-type persists trough dead.
So I made this AoE custom Animate Dead, hope this helps you :)

  • Animate Dead
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead (Channel)
    • Actions
      • Set VariableSet TempCaster = (Triggering unit)
      • Set VariableSet TempPlayer = (Owner of TempCaster)
      • Set VariableSet TempLoc = (Target point of ability being cast)
      • Set VariableSet TempGroup = (Units within 175.00 of TempLoc matching (((Matching unit) is dead) Equal to True).)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet TempTarget = (Picked unit)
          • Set VariableSet TempLoc2 = (Position of TempTarget)
          • Special Effect - Create a special effect at TempLoc2 using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempTarget) Equal to Footman
            • Then - Actions
              • Unit - Create 1 Ghoul for TempPlayer at TempLoc2 facing Default building facing degrees
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempTarget) Equal to Peasant
            • Then - Actions
              • Unit - Create 1 Acolyte for TempPlayer at TempLoc2 facing Default building facing degrees
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempTarget) Equal to Rifleman
            • Then - Actions
              • Unit - Create 1 Crypt Fiend for TempPlayer at TempLoc2 facing Default building facing degrees
            • Else - Actions
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call RemoveLocation (udg_TempLoc2)
 

Attachments

  • Animate Dead.w3m
    18.1 KB · Views: 18
Level 29
Joined
Feb 18, 2014
Messages
3,583
Alternatively, you can just remove the animated unit if it doesn't match with the unit type you want to revive.
  • Remove Spawned Unit
    • Events
      • Unit - A unit Spawns A Summoned Unit
    • Conditions
      • (Unit-type of (Summoned unit)) Not equal to Footman
    • Actions
      • Unit - Remove (Summoned unit) from the game
      • Unit - Set mana of (Summoning unit) to ((Mana of (Summoning unit)) + 75.00)
      • Unit - For Unit (Summoning unit), Set cooldown of ability Animate Dead, Level: 1 to 0.00
 
Last edited:
Level 6
Joined
Dec 31, 2017
Messages
138
Well I don't know what was your main goal to achieve here, but you can select dead units and their unit-type persists trough dead.
So I made this AoE custom Animate Dead, hope this helps you :)

  • Animate Dead
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead (Channel)
    • Actions
      • Set VariableSet TempCaster = (Triggering unit)
      • Set VariableSet TempPlayer = (Owner of TempCaster)
      • Set VariableSet TempLoc = (Target point of ability being cast)
      • Set VariableSet TempGroup = (Units within 175.00 of TempLoc matching (((Matching unit) is dead) Equal to True).)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet TempTarget = (Picked unit)
          • Set VariableSet TempLoc2 = (Position of TempTarget)
          • Special Effect - Create a special effect at TempLoc2 using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempTarget) Equal to Footman
            • Then - Actions
              • Unit - Create 1 Ghoul for TempPlayer at TempLoc2 facing Default building facing degrees
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempTarget) Equal to Peasant
            • Then - Actions
              • Unit - Create 1 Acolyte for TempPlayer at TempLoc2 facing Default building facing degrees
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempTarget) Equal to Rifleman
            • Then - Actions
              • Unit - Create 1 Crypt Fiend for TempPlayer at TempLoc2 facing Default building facing degrees
            • Else - Actions
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call RemoveLocation (udg_TempLoc2)
Idea is quite nice, but this trigger leaks if there are more than 1 unit in TempGroup.
Custom script: call RemoveLocation (udg_TempLoc2) should be used at the end of the loop.

Also, solution from this thread ([Spell] - Resurrecting Enemies?) might come in handy, just adapt it for ability targeting point.
 
Status
Not open for further replies.
Top