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

Event Seeking

Status
Not open for further replies.
Level 2
Joined
Sep 23, 2008
Messages
8
Ive been trying to solve this problem for a while, but i just cant seem to get my head round it, so Im hoping the good people of the hive can help me!

I have a spell based on immolation, with all effects removed (IE all it does it drain mana). When the Immolation is turned on, using a trigger I add a spell book with aura abilities to the user of the spell, the spell book is then hidden.

The trouble comes when trying to remove the spell book, of course removing the book itself is simple, what i lack is the capacity to find the right event. I need to the book to be removed when
a.) Immolation is cancelled by the user.
b.) Immolation is cancelled due to insufficient mana.

The only solution I've come up with is to add an additional ability when Immolation is triggered, said ability can then be used (via the Event-Unit beings casting ability) to disable it via the users request, however this does not cover option B.

Any comments or suggestions are welcome!
Thanks,
Tyross

(Afterthought, I am using GUI as I have very little knowledge on JASS!)
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Add the unit to a unit group,,

Periodic event (0.10 secs maybe?)
Pick every unit in Aura-Book-Ability-Group and do
if mana of picked unit equal to 0.00
remove Aura-Book from picked unit
Turn off Aura-Book-Spell (or something, just make it turn off)
Remove picked unit from Aura-Book-Ability-Group
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Events: Unit - a unit is issued an order with no target
Conditions: order equal to "unimmolation" AND level of (your ability) on triggering unit > 0
Actions: remove the spellbook

"unimmolation" is the order given to turn off immolation.
The other condition is there so the trigger isn't triggered for the other immolation-based spells as well.
 
Level 2
Joined
Sep 23, 2008
Messages
8
Magical! The ability works perfectly!
I had to tweak you suggestion slightly, Yixx. But i think that was because i set the periodic time to 1 instead of 0.1. Nontheless, extremely helpful.

+Rep for both. :)
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Ok, it might be less laggy,, but it works! And since i have got some bad experiences with the (issued order) comparison thing,,
But if course, it would only run every time it is (de)casted, and not 10 times every second,,
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Ok, it might be less laggy,, but it works! And since i have got some bad experiences with the (issued order) comparison thing,,
But if course, it would only run every time it is (de)casted, and not 10 times every second,,

No. Mana will almost never be 0.00. Immolation might turn off because mana is low, but the trigger will not detect that, mana might have been 0.3, immolation turned off and mana started to increase, never going down to 0.0, not to mention that it might not stay at 0.00(presuming it went down to that) long enough for the trigger to catch it.
The trigger you presented, doesn't handle user deactivation.
Meaning you activate the skill once, then deactivate it, and you still get the bonuses as long as you like, or somehow you get to 0 mana, but they you just reactivate and deactivate.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
No. Mana will almost never be 0.00. Immolation might turn off because mana is low, but the trigger will not detect that, mana might have been 0.3, immolation turned off and mana started to increase, never going down to 0.0, not to mention that it might not stay at 0.00(presuming it went down to that) long enough for the trigger to catch it.
The trigger you presented, doesn't handle user deactivation.
Meaning you activate the skill once, then deactivate it, and you still get the bonuses as long as you like, or somehow you get to 0 mana, but they you just reactivate and deactivate.

Ok, well,, it is much better! Happy now? =P

P.S. Learned something today ^^
 
Status
Not open for further replies.
Top