• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Making a Unit revert to past level

Status
Not open for further replies.
Level 2
Joined
Nov 9, 2006
Messages
25
How would I go about creating a spell that sets a unit to what his level was 5 minutes ago?

I thought about storing the units level to a variable every 5 minutes. But if the variable had been stored 1 minute ago, and the spell was cast, the unit would go to what his level was 1 minute ago...

Then I came up with the idea, of creating a clock (a variable that is set to +1 every 1 second). But how would I attach the units level at that point to that point in time.....
 
Level 5
Joined
Apr 16, 2005
Messages
153
Maybe this could be a sollution to your problem, but im not sure...
You need an interger variable for this trigger

Hero - Gains a level

Wait 300 seconds
Set Level to Level +1
 
Level 6
Joined
Feb 2, 2005
Messages
205
You could use the Units costume value. Store the actual level in the value when the spell is cast, and restore old level with the value afterwards.

Steel_Cold: that wont work, couse the spell will add also an level
 
Level 2
Joined
Nov 9, 2006
Messages
25
Okay here is what I came up with....
  • Time Toss
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Set Hero1Level[level] = (Level of Hero[1])
      • Set Hero2Level[level] = (Level of Hero[2])
      • Set Hero3Level[level] = (Level of Hero[3])
      • Set Hero4Level[level] = (Level of Hero[4])
      • Set Hero5Level[level] = (Level of Hero[5])
      • Set Hero6Level[level] = (Level of Hero[6])
      • Set Hero7Level[level] = (Level of Hero[7])
      • Set Hero8Level[level] = (Level of Hero[8])
      • Set Hero9Level[level] = (Level of Hero[9])
      • Set Hero10Level[level] = (Level of Hero[10])
      • Set Hero11Level[level] = (Level of Hero[11])
      • Set Hero12Level[level] = (Level of Hero[12])
      • Set level = (level + 1)
  • Time Toss Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Time Toss (Neutral Hostile)
    • Actions
      • Set TossFactor3 = (2 + (3 x (Level of Time Toss (Neutral Hostile) for (Triggering unit))))
      • Set TossFactor = (level - TossFactor3)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero[(Integer A)] Equal to (Target unit of ability being cast)
            • Then - Actions
              • Set TimeTossed[(Integer A)] = Hero[(Integer A)]
            • Else - Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target unit of ability being cast) Equal to Hero[(Integer A)]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer A) Equal to 1
                • Then - Actions
                  • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                  • Hero - Set (Target unit of ability being cast) Hero-level to Hero1Level[TossFactor], Hide level-up graphics
                  • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                  • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Integer A) Equal to 2
                    • Then - Actions
                      • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                      • Hero - Set (Target unit of ability being cast) Hero-level to Hero2Level[TossFactor], Hide level-up graphics
                      • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                      • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Integer A) Equal to 3
                        • Then - Actions
                          • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                          • Hero - Set (Target unit of ability being cast) Hero-level to Hero3Level[TossFactor], Hide level-up graphics
                          • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                          • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Integer A) Equal to 4
                            • Then - Actions
                              • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                              • Hero - Set (Target unit of ability being cast) Hero-level to Hero4Level[TossFactor], Hide level-up graphics
                              • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                              • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Integer A) Equal to 5
                                • Then - Actions
                                  • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                                  • Hero - Set (Target unit of ability being cast) Hero-level to Hero5Level[TossFactor], Hide level-up graphics
                                  • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                                  • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Integer A) Equal to 6
                                    • Then - Actions
                                      • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                                      • Hero - Set (Target unit of ability being cast) Hero-level to Hero6Level[TossFactor], Hide level-up graphics
                                      • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                                      • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Integer A) Equal to 7
                                        • Then - Actions
                                          • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                                          • Hero - Set (Target unit of ability being cast) Hero-level to Hero7Level[TossFactor], Hide level-up graphics
                                          • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                                          • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Integer A) Equal to 8
                                            • Then - Actions
                                              • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                                              • Hero - Set (Target unit of ability being cast) Hero-level to Hero8Level[TossFactor], Hide level-up graphics
                                              • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                                              • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Integer A) Equal to 9
                                                • Then - Actions
                                                  • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                                                  • Hero - Set (Target unit of ability being cast) Hero-level to Hero9Level[TossFactor], Hide level-up graphics
                                                  • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                                                  • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • (Integer A) Equal to 10
                                                    • Then - Actions
                                                      • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                                                      • Hero - Set (Target unit of ability being cast) Hero-level to Hero10Level[TossFactor], Hide level-up graphics
                                                      • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                                                      • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • (Integer A) Equal to 11
                                                        • Then - Actions
                                                          • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                                                          • Hero - Set (Target unit of ability being cast) Hero-level to Hero11Level[TossFactor], Hide level-up graphics
                                                          • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                                                          • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                                                        • Else - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • (Integer A) Equal to 12
                                                            • Then - Actions
                                                              • Set CurrentLevel = (Hero level of (Target unit of ability being cast))
                                                              • Hero - Set (Target unit of ability being cast) Hero-level to Hero12Level[TossFactor], Hide level-up graphics
                                                              • Wait (2.00 + ((Real((Level of Time Toss (Neutral Hostile) for (Triggering unit)))) x 3.00)) seconds
                                                              • Hero - Set Hero[(Integer A)] Hero-level to CurrentLevel, Hide level-up graphics
                                                            • Else - Actions
            • Else - Actions
Yes I know that tossfactor and tossfactor3 are unecessary, but I was to lazy to change the variable so i just made a new one :p
 
Status
Not open for further replies.
Top