• 🏆 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] Resurrection and Animate Dead

Status
Not open for further replies.
Level 6
Joined
Jul 23, 2018
Messages
243
  • Unholy Resurrection
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Unholy Resurrection
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Casting unit)) Equal to <Hero>
          • (Unit-type of (Casting unit)) Equal to <Hero AI>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Casting unit)) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Reviver) and do (Actions)
            • Loop - Actions
              • Unit - Set level of Resurrection for (Picked unit) to 1
              • Unit - Set level of Animate Dead for (Picked unit) to 1
              • Unit - Order (Picked unit) to Human Paladin - Resurrection
          • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Reviver) and do (Actions)
            • Loop - Actions
              • Unit - Set level of Resurrection for (Picked unit) to 1
              • Unit - Set level of Animate Dead for (Picked unit) to 1
              • Unit - Order (Picked unit) to Undead Death Knight - Animate Dead
              • Game - Display to (All players) the text: Success
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of (Ability being cast) for (Casting unit)) Equal to 2
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Reviver) and do (Actions)
                • Loop - Actions
                  • Unit - Set level of Resurrection for (Picked unit) to 2
                  • Unit - Set level of Animate Dead for (Picked unit) to 2
                  • Unit - Order (Picked unit) to Human Paladin - Resurrection
              • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Reviver) and do (Actions)
                • Loop - Actions
                  • Unit - Set level of Resurrection for (Picked unit) to 2
                  • Unit - Set level of Animate Dead for (Picked unit) to 2
                  • Unit - Order (Picked unit) to Undead Death Knight - Animate Dead
                  • Game - Display to (All players) the text: Success
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Ability being cast) for (Casting unit)) Equal to 3
                • Then - Actions
                  • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Reviver) and do (Actions)
                    • Loop - Actions
                      • Unit - Set level of Resurrection for (Picked unit) to 3
                      • Unit - Set level of Animate Dead for (Picked unit) to 3
                      • Unit - Order (Picked unit) to Human Paladin - Resurrection
                  • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Reviver ) and do (Actions)
                    • Loop - Actions
                      • Unit - Set level of Resurrection for (Picked unit) to 3
                      • Unit - Set level of Animate Dead for (Picked unit) to 3
                      • Unit - Order (Picked unit) to Undead Death Knight - Animate Dead
                      • Game - Display to (All players) the text: Success
                • Else - Actions
                  • Game - Display to (All players) the text: Fail

I made an ability based on Feral Spirits from Far Seer and it summons a dummy unit. When the hero begins casting the ability, the trigger orders the dummy unit to cast Animate Dead and Resurrection. But the problem is the dummy unit only cast one ability instead of 2 at the same time. I already tried using wait action, and put issue order in the same Pick unit action. Those game messages are for letting me know if the ability works or not. The dummy is a peasant, and a normal unit. The 2 abilities the dummy unit cast are set to false for "Hero Ability" and "Item Ability". Does anyone know how to solve this? I appreciate all helps.
 
Last edited:
Level 28
Joined
Feb 18, 2014
Messages
3,576
You cannot order a unit to cast two spells simultaneously, you either have to add a wait before casting the second spell or create another trigger that orders it to cast the second spell after casting the first one.
As for you trigger, there is an issue in it : You are leaking a unit group and it's unnecessary to use it anyway, you just need to detect when a unit spawns a summoned unit and order it to cast the spell.
  • Test
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Reviver
    • Actions
      • Unit - Order (Summoned unit) to Human Paladin - Resurrection
      • Wait 0.50 seconds
      • Unit - Order (Summoned unit) to Undead Death Knight - Animate Dead
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
  • Untitled Trigger 001
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • Unit - Add Animate Dead to (Summoned unit)
      • Unit - Add Resurrection to (Summoned unit)
      • Unit - Set level of Resurrection for (Last created unit) to (Level of Unholy Res for (Summoning unit))
      • Unit - Set level of Animate Dead for (Last created unit) to (Level of Unholy Res for (Summoning unit))
      • Unit - Order (Summoned unit) to Undead Death Knight - Animate Dead.
      • Unit - Order (Summoned unit) to Human Paladin - Resurrection.
 
Level 16
Joined
May 2, 2011
Messages
1,345
why dont you just create two dummy caster units?

or better solution will be

Event
paladin cast resurrection
Action
Set TempPoint = location of paladin
unit - create Animate Dead (Dummy Caster) at TempPoint facing 0 degrees
Unit - order last created unit to (DeathKnight - animate dead).
Unit - Add expiration timer for last created unit, 5 seconds
Custom script: Custom script: call RemoveLocation(udg_TempPoint)



there you go. not sure why you dont want casting resurrection to be the event that fires the trigger. if you really want to

Event
Any event you want
Action
Set TempPoint = location of trigger unit (which is the paladin that casted the spell firing the trigger)
unit - create Animate Dead (Dummy Caster) at TempPoint facing 0 degrees
Unit - order last created unit to (DeathKnight - animate dead).
Unit - Add expiration timer for last created unit, 5 seconds
unit - create Resurrection (Dummy Caster) at TempPoint facing 0 degrees
Unit - order last created unit to (Paladin- Resurrection).
Unit - Add expiration timer for last created unit, 5 seconds
Custom script: Custom script: call RemoveLocation(udg_TempPoint)



I think this should work as long as your dummy caster is properly set (having locus ability enough mana no model etc).
Note: I havent checked if both units can be spawned in the same location but I think its possible especially that they have locust ability. however, there is a chance that the second unit will be slightly next to the first one: I have not tested this.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
The dummy needs: Art - Animation Cast Backswing and Cast Point set to 0.00. Movement Type set to None. Speed Base set to 0.

I have it working in the map I attached.

  • Cast Anim Resurrect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cast Both
    • Actions
      • Set VariableSet TempPoint = (Position of (Triggering unit))
      • Set VariableSet TempInteger = (Level of (Ability being cast) for (Triggering unit))
      • -------- --------
      • Unit - Create 1 Dummy for (Triggering player) at TempPoint facing Default building facing degrees
      • Unit - Add Animate Dead (Dummy) to (Last created unit)
      • Unit - Add Resurrection (Dummy) to (Last created unit)
      • Unit - Set level of Animate Dead (Dummy) for (Last created unit) to TempInteger
      • Unit - Set level of Resurrection (Dummy) for (Last created unit) to TempInteger
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • -------- --------
      • Unit - Order (Last created unit) to Undead Death Knight - Animate Dead.
      • Unit - Order (Last created unit) to Human Paladin - Resurrection.
      • -------- --------
      • Custom script: call RemoveLocation (udg_TempPoint)
 

Attachments

  • Animate Resurrect.w3m
    17.8 KB · Views: 39
Level 16
Joined
May 2, 2011
Messages
1,345
The main issue I imagine is having enough corpses to Resurrect/Animate.
in this case the one that is ordered first in the trigger will take corpses first right?
now I am wondering what would happen if two units are ordered to resurrect lol.
anyway isnt it better to have two dummy casters? I mean just to make sure no bug will happen.

because maybe things change between versions of WC3 who knows.
[Solved] - Overwrite issued order by scripted order... doesn't work anymore?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
in this case the one that is ordered first in the trigger will take corpses first right?
now I am wondering what would happen if two units are ordered to resurrect lol.
anyway isnt it better to have two dummy casters? I mean just to make sure no bug will happen.

because maybe things change between versions of WC3 who knows.
[Solved] - Overwrite issued order by scripted order... doesn't work anymore?
Yeah, the first ability cast will take priority and consume the corpses. There will never be an instance where both go off at the same time, nothing happens at the EXACT same time.

And 1 Dummy is all you need in most cases. I used to think you needed separate dummies for each picked unit/separate ability cast, like if you wanted to create an AoE Storm Bolt, but it turns out that if the Dummy has the correct settings this isn't required.

I have a map in which I use 1 Dummy for EVERYTHING and it works fine.
 
Status
Not open for further replies.
Top