• 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.

[JASS] [Spell] A challenge for you all

Status
Not open for further replies.
Level 11
Joined
Mar 31, 2009
Messages
732
I don't have any maps in mind that I would want to use this for, but I think it would be a very entertaining, and a useful spell if someone could make this.

Now. The spell is to be very simple (in theory): when activated, it turns time back by xx seconds/minutes (xx can be a preset value hardcoded as a constant), minus the units mana cost of the spell.

So the entire games state is to be rewinded back to how it was xx seconds/minutes ago... minus any players who already left the game.
 
So, actually, whatever the Nerubian Weaver hero in DotA does [(ability is called Time Lapse) http://www.playdota.com/heroes/nerubian-weaver ], but it will affect the entire map and not only the hero himself. This is the way (old code, but it functions the same, after 2 years):
Time Lapse (A0CT)
Based on Channel.

When the skill is first learnt, create a timed trigger every 0.5 seconds, and save "Unitvar" to the cache.

The periodic trigger recovers "UnitVar" from the cache, then sets for i=1 until i>10, set "TLX(i-1)" to be "TLXi" (aka TLX1 becomes what used to be TLX2, TLX2 becomes what used to be TLX3, ..., TLX9 becomes TLX10), then do the same for "TLYi", "TLLifei" and "TLManai", then increase i by 1. After the loop, set "TLX10" as "UnitVar" X position, "TLY10" as "UnitVar"'s Y position, "TLLife10" to its CurrentLife and "TLMana10" to its CurrentMana.

Now, when Time Lapse goes into effect, the trigger recovers "TLLife1", "TLMana1" (if any of those two is lower than 1 then that value is used instead, "TLX1" and "TLY1" from the cache, now if TLLife1 is strictly bigger than 1 and the casting unit is alive, show the especial event on top of the casting unit, then set the unit's X and Y, Life and Mana to the values just retrieved, remove all negative buffs from the unit and then create a timed event to run 0.0 seconds after the spell has been cast, while saving "Unit" (Weaver) and "Mana" (Weaver's CurrentMana) to the cache.

The timed trigger set "Unit"'s CurrentMana to be equal to "Mana". <- This is done because the whole trigger happens before Time Lapse takes the mana away from the unit, so this is needed so you don't end up with the expectedmana-the mana cost of Time Lapse.

Do note that Time Lapse actually make Weaver go back in time between 4.5 and 4.99 seconds, depending on the time you first learnt Time Lapse.
 
Level 11
Joined
Mar 31, 2009
Messages
732
Yeah. Would need to affect not only the unit itsself, but every other unit on the map, and most importantly: the state of all other triggers and variables.
Time of day... resources... hero experience... map exploration...
 

dab

dab

Level 10
Joined
Oct 30, 2008
Messages
413
Isn't there a spell like this in Warlocks?
The one that resets unit location, health, ability recharge (exept for this exact ability) to what they were three seconds before cast?

Not exactly, that spell was much more simple, and only made sure that 3 seconds AFTER cast, you would end up the same place with same hp, same MP and same ability cooldowns as at cast. This is much harder, due to the fact that you'd have to have triggers for almost every unit handling HP now, and HP 10 seconds ago(example, doesn't have to be 10 seconds), and the same with MP, location, and even spells! Would take a hell lot of coding, and you would want to BASE a map over it, not create this as a complimentary spell :bored:
 
Status
Not open for further replies.
Top