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

Spell usable only during night

Status
Not open for further replies.
Level 5
Joined
Jul 15, 2012
Messages
101
  • Untitled 1
    • Events
      • Game - The in-game time of day becomes Equal to 24.00
    • Conditions
    • Actions
      • -------- If your spell is with triggers --------
      • Trigger - Turn on Your Trigger <gen>
      • Trigger - Turn off Untitled 3 <gen>
  • Untitled 2
    • Events
      • Game - The in-game time of day becomes Equal to 3.00
    • Conditions
    • Actions
      • Trigger - Turn on Untitled 3 <gen>
  • Untitled 3
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Order (Casting unit) to Stop
P.S - didn't test, don't know if it works.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Another way could be using requirements.
Make a dummy unit. Find your spell in object editor and in the "Techtree - Requirements" add that dummy unit.

Then, when someone chooses this hero (whose abilities you want to limit by time of day) you create that dummy unit in map.
Then use simple trigger: When in-game time of day is "your desired night time", change owner of that dummy unit to owner of the hero.
When time becomes "your desired day time", you change owner of dummy to neutral passive.

This will disable hero's ability, as long as that dummy is not controlled by same player as hero.

Example: I named this dummy unit "Night time" and did exactly what I wrote above.
So when it's day time and I hover over that hero's ability (e.g. Sleep), it will be disabled with this written in it:
Requires:
- Night time

Note that the Night time written there is actually the name of the dummy unit :)

I used this technique to limit Dreadlord's Sleep ability. Look at hidden pic:
ulcr.jpg
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You can create it whenever you want. But you would have to create one for each player at map initialization, since you don't know which player will pick that hero.

However if you create one for the player who picked that hero, you will end up with equal number of dummies to number of those heroes.

It's all about number of created dummies, there is no other reason.
Of course, the above is assuming you can have multiple of those heroes, not only one per map.
 
Level 15
Joined
Mar 9, 2008
Messages
2,174
The option Nichilus suggested is the best one, to use dummy units with the techtree requirements and to use the trigger to hide those units deppending on the ingame time and not a fixed timer. Removing the ability might confuse some players and it is much simpler to have dummy units hidden in some corner of the map than to remove abilities, store levels and then restore abilities and those same levels.
 
Status
Not open for further replies.
Top