• 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] Random evasion, hero ability

Status
Not open for further replies.
Level 1
Joined
Jul 11, 2010
Messages
4
First, hello everyone, though I come here from time to time, I'm still relatively new to the whole map making business, and just now created a forum account, hoping someone can help with this. Right, so, here it goes.
I'm trying to make a hero whose one ability will be a randomed evasion. Basically, you cast an ability, and it will set your evasion to a new value: from 1 to (ability level)*10.
I made two abilities for this, the Evasion Roll is the placeholder spell that does nothing, and Evasion (1-40) is a 40 level unit spell (I also tried setting it as a hero spell, no change).
Here's the trigger:

Random evasion
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Evasion Roll
Actions
Unit - Remove Evasion (1-40) from (Triggering unit)
Unit - Add Evasion (1-40) to (Triggering unit)
Unit - Set level of Evasion (1-40) for (Triggering unit) to (Random integer number between 1 and ((Level of Evasion Roll for (Triggering unit)) x 10))

Problem is simple: it does nothing. The roll is activated, spell completes and mana is wasted, but nothing is added. Any ideas?
Thanks in advance
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Unit - A unit Finishes casting an ability
This event is often run too late so many event respones wont work.

Try changing it to starts the effect of an ability. That is what most triger enhanced spells use.

Secondly you do not need to remove the evasion 1-40 ability. You just need to add it to the unit if the unit does not have it already and then set its level randomly. As it level gets randomized, it does not mater what level it was previously set to.
 
Level 1
Joined
Jul 11, 2010
Messages
4
Thanks for the reply, though it would seem something else is amiss. I added another trigger that says

Learn Evasion
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Evasion Roll
Actions
Unit - Add Evasion (1-40) to (Triggering unit)
Trigger - Turn off (This trigger)

And yet when I learn the roll ability, actual evasion doesn't show up. I guess I'll start digging around for what I did wrong.
Also, thanks for the tip about 'finishes casting an ability', I'll use the starts the effect event from now on.
 
Status
Not open for further replies.
Top