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

Evasion 'art'

Status
Not open for further replies.
Level 1
Joined
Aug 17, 2006
Messages
7
I have a blademaster hero on my map with an ability I named 'Illusion', which is evasion. What I want to happen is, when he dodges an attack, to create the special effect on him for the mirror image ability. It should appear that he has evaded the attack by temporarily splitting ...

But I don't know how I could do this. Would I need JASS? Or perhaps it'd be possible by basing it on a different ability?
 
Level 11
Joined
Jul 12, 2005
Messages
764
well, the best would be in jass (for MUI), but it can be done by triggers.

trigger #1
event - hero learns a skill
cond - learned skill == Illusion
action - set EvasionUnit = triggering unit

trigger #2
event - EvasionUnit is damaged
action:
if (RandomInteger between 1 and 100) < 20 (this means 20% chance:) )
set EvasionUnit's life to (life of EvasionUnit + Event damage)
create special effect on EvasionUnit...

thats all

If you want, i can write this to you is jass to be MUI.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
paskovitch - you're making the famous mistake that everyone (except my newer ones) who have done Shield spells make

EventDamage registers BEFORE ( 0 seconds before ) the damage is dealt, so if GetUnitState( u, UNIT_STATE_LIFE ) + GetEventDamage() > GetUnitState( u, UNIT_STATE_MAX_LIFE ) then all the damage wont be prevented, as it will heal before being damaged, which isnt very effective :)

therefore, use my if/then statement up there and do the normal way on the Else. however, if that is in the Then, put a call TriggerSleepAction( 0 ) or call TriggerSleepAction( .01 ) in front of the Regain Life thing
 
Level 1
Joined
Aug 17, 2006
Messages
7
Well yeah, it looks great and everything, but I have no idea how to put it in my map ^^ Could your perhaps put it in copy and paste form or similar? that'd rawk ;)
 
Level 11
Joined
Feb 22, 2006
Messages
752
ummm...you can't have Unit - unit is damaged register damage for a unit variable. The event function will only accept preplaced units on the map as parameters. You can't even input a unit variable into that event using GUI, and if you try to input a unit variable using JASS [i.e. call TriggerRegisterUnitEvent( gg_trg_Evasion, EVENT_UNIT_DAMAGED, udg_EvasionUnit )], the trigger will simply not fire when the unit stored in the unit variable is damaged.
 
Level 1
Joined
Aug 17, 2006
Messages
7
I understand the difficulties with it but I'm sure this is possible as I've seen it been done on other maps before. Is there a different ability I could base it on, but just not get the 'miss' test?
 
Level 4
Joined
Aug 17, 2005
Messages
82
OR
You can get hardened skin and edit its ability status.I think that will work just make it so its not always damage reduced and change the damage reduced to 9999999.The spell should display mirror image..No I am not 100% sure but its worth a try! :p
 
Level 1
Joined
Aug 17, 2006
Messages
7
Yeah it worked really well :D thanks a lot, I thought there was an ability that 'blocked' damage rather than dodged it but didn't know which. No JASS or triggeres required!
 
Status
Not open for further replies.
Top