• 🏆 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] "Smart" Raise Dead

Status
Not open for further replies.
Level 9
Joined
Mar 16, 2008
Messages
316
Hello! Due to the surprise success my last spell help thread got for Spell-based auto-attacks, I thought maybe the great people here at the Hive could solve another issue I've actually had for years now; a Raise Dead spell that can summon different types of skeleton, dependent on the target of the spell.

Ex.
Necromancer kills footman, raises footman/grunt/ghoul/etc, gets one skeletal warrior.
Same necromancers kills rifleman, raises rifleman/archer/headhunter/etc, gets one skeletal archer
Very same necromancer kills priest/shaman/necromancer/etc, gets one skeletal mage.

You pretty much see where I'm going with this? Any way I can do this, preferably without Jass since, as I previously mentioned, I have no idea how to work with it.

EDIT: Will, of course, +Rep anyone who can help :3
 
Level 5
Joined
May 12, 2014
Messages
133
We meet again! For the record, I love how what you want is something I am capable of. Most things that could be done with GUI I could probably accomplish in some way. Also, helping other people motivates me to work on my own maps. :goblin_good_job:

Anyway, this time you need 2 things:
1) dummy unit to summon (something that is completely and utterly invisible to everyone, and does nothing whatsoever)

2) The raise dead spell. Set the raised unit to the dummy unit from #1 and set its duration to something really tiny like 0.01 seconds.

The only downfall to the way I designed this trigger, is that you would have to add in EVERY SINGLE UNIT THAT CAN BE RAISED FROM THE DEAD to the trigger.
  • Raise Dead
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Raise Dead
    • Actions
      • Set Temp_Unit = (Target unit of ability being cast)
      • Set Temp_P = (Position of Temp_Unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of Temp_Unit) Equal to Footman
              • (Unit-type of Temp_Unit) Equal to Grunt
              • (Unit-type of Temp_Unit) Equal to Ghoul
        • Then - Actions
          • Unit - Create 1 Skeleton Warrior for (Owner of (Triggering unit)) at Temp_P facing Default building facing degrees
        • Else - 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 Temp_Unit) Equal to Rifleman
                  • (Unit-type of Temp_Unit) Equal to Troll Headhunter
                  • (Unit-type of Temp_Unit) Equal to Crypt Fiend
            • Then - Actions
              • Unit - Create 1 Skeletal Archer for (Owner of (Triggering unit)) at Temp_P facing Default building facing degrees
            • Else - 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 Temp_Unit) Equal to Sorceress
                      • (Unit-type of Temp_Unit) Equal to Troll Witch Doctor
                      • (Unit-type of Temp_Unit) Equal to Necromancer
                • Then - Actions
                  • Unit - Create 1 Skeletal Mage for (Owner of (Triggering unit)) at Temp_P facing Default building facing degrees
                • Else - Actions
                  • Game - Display to (All players) the text: That unit is not li...
                  • Unit - Create 1 Skeleton Warrior for (Owner of (Triggering unit)) at Temp_P facing Default building facing degrees
      • Unit - Add a 15.00 second Raise Dead expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_P)


OR, you could give every single unit that can be raised a type of classification, and then check for that. It makes the trigger easier to manage, but you still have to run through every unit in your map.
... I'm not actually sure how to do it this way...
 

Attachments

  • CustomRaiseDead2.w3x
    15.5 KB · Views: 56
Last edited:
Level 9
Joined
Mar 16, 2008
Messages
316
We meet again! For the record, I love how what you want is something I am capable of. Most things that could be done with GUI I could probably accomplish in some way. Also, helping other people motivates me to work on my own maps. :goblin_good_job:

Anyway, this time you need 2 things:
1) dummy unit to summon (something that is completely and utterly invisible to everyone, and does nothing whatsoever)

2) The raise dead spell. Set the raised unit to the dummy unit from #1 and set its duration to something really tiny like 0.01 seconds.

The only downfall to the way I designed this trigger, is that you would have to add in EVERY SINGLE UNIT THAT CAN BE RAISED FROM THE DEAD to the trigger.
  • Raise Dead
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Raise Dead
    • Actions
      • Set Temp_Unit = (Target unit of ability being cast)
      • Set Temp_P = (Position of Temp_Unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of Temp_Unit) Equal to Footman
              • (Unit-type of Temp_Unit) Equal to Grunt
              • (Unit-type of Temp_Unit) Equal to Ghoul
        • Then - Actions
          • Unit - Create 1 Skeleton Warrior for (Owner of (Triggering unit)) at Temp_P facing Default building facing degrees
        • Else - 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 Temp_Unit) Equal to Rifleman
                  • (Unit-type of Temp_Unit) Equal to Troll Headhunter
                  • (Unit-type of Temp_Unit) Equal to Crypt Fiend
            • Then - Actions
              • Unit - Create 1 Skeletal Archer for (Owner of (Triggering unit)) at Temp_P facing Default building facing degrees
            • Else - 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 Temp_Unit) Equal to Sorceress
                      • (Unit-type of Temp_Unit) Equal to Troll Witch Doctor
                      • (Unit-type of Temp_Unit) Equal to Necromancer
                • Then - Actions
                  • Unit - Create 1 Skeletal Mage for (Owner of (Triggering unit)) at Temp_P facing Default building facing degrees
                • Else - Actions
                  • Game - Display to (All players) the text: That unit is not li...
                  • Unit - Create 1 Skeleton Warrior for (Owner of (Triggering unit)) at Temp_P facing Default building facing degrees
      • Unit - Add a 15.00 second Raise Dead expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_P)


OR, you could give every single unit that can be raised a type of classification, and then check for that. It makes the trigger easier to manage, but you still have to run through every unit in your map.
... I'm not actually sure how to do it this way...

Fantastic work yet again, man! Thank you very much for the quick, awesome response! Despite the minor nuisance of having to add every single potential unit, this should work amazingly. You've just solved something I've been trying to figure out how to do FOREVER XD

I might just start PMing you for stuff, rather than going through the trouble of the forums!
 
Level 5
Joined
Feb 22, 2013
Messages
161
If raise dead is an AoE self-cast ability, then how will Temp_Unit register? There is no targeted unit.. Wouldn't you have to either as soon as they die, use an event-a unit dies and then tell it to raise the dead defendant on unit-type OR use the event-a unit dies and add that unit to an array or a unit group and once the ability is cast then trigger the conditions for unit-type then finally raise either a skeletal Mage, warrior or archer?
 
Level 5
Joined
May 12, 2014
Messages
133
Fantastic work yet again, man! Thank you very much for the quick, awesome response! Despite the minor nuisance of having to add every single potential unit, this should work amazingly. You've just solved something I've been trying to figure out how to do FOREVER XD

I might just start PMing you for stuff, rather than going through the trouble of the forums!

Oh man that's embarrassing... I just realized my small typo. What I meant to say was that you have to add every single "UNIT TYPE", not unit. Just making sure that was clear, since there is definitely a huge difference between adding 30 rifleman and adding 1 condition for unit type of rifleman.

Oh, and I forgot to add this. I'm not sure how or why Raise Dead works how it is, but it targets "dead" units. I guess the spell is meant to be an instant cast since it doesn't seem possible to click on a corpse. I ran a test trigger before making the spell, and every time the spell was casted, I just tossed in "display to all players name of target unit of ability being cast" (the action that looks like this anyway).
 
Level 9
Joined
Mar 16, 2008
Messages
316
Oh man that's embarrassing... I just realized my small typo. What I meant to say was that you have to add every single "UNIT TYPE", not unit. Just making sure that was clear, since there is definitely a huge difference between adding 30 rifleman and adding 1 condition for unit type of rifleman.

Oh, and I forgot to add this. I'm not sure how or why Raise Dead works how it is, but it targets "dead" units. I guess the spell is meant to be an instant cast since it doesn't seem possible to click on a corpse. I ran a test trigger before making the spell, and every time the spell was casted, I just tossed in "display to all players name of target unit of ability being cast" (the action that looks like this anyway).

Oh jeez! No worries, I knew what you meant! Dang. Adding individual units to the trigger would be a nightmare!
 
Level 13
Joined
Oct 16, 2010
Messages
731
To generalize it (avoid having to add all unit-types) you could just check if they are melee, ranged or have mana (caster)? Obviously this would be problematic if the target had both melee and ranged, but I'm pretty sure only the Gargoyle has that and can't be raised anyway.
 
Status
Not open for further replies.
Top