• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

% chance MirrorImage

Status
Not open for further replies.
Level 8
Joined
Dec 26, 2006
Messages
327
I was playing Dota one day and I -arem'd the Phantom Lancer. one of his skills was that he had a percent chance to cast mirror image when he is hit. I tried making this skill in GUI and it didn't work... could someone help me?
I tried making
Trigger - When a spell starts its effect
Spell = Phantom Lance
Action - Give caster Mirror Image
Set level of Mirror Image to level of Phantom Lancer
Order Phantom Lancer to cast Mirror Image
Remove Mirror Image.

This did not work. could someone help me?
 
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of [u]MYABILITY[/u] for (Triggering unit)) Greater than or equal to 1
    • Actions
      • If ((Random integer number between (Hero level of (Triggering unit)) and 100) Greater than 50) then do (Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees) else do (Do nothing)
  • Unit - Add a 20.00 second Generic expiration timer to (Last created unit)
There aren't any special effect, but basicaly every time a unit is attacked, it checks if it has the ability MYABILITY and if it does, rolls a random number. The higher the unit level, the higher the odds. If the number is greater than 50, it creates a copy of the unit attacked. The unit lasts for 20 seconds. Also, seeing as the Add expiration timer is outside the if, it will set a timer to the last created unit, reguardless of if the unit was actually created. You'll need to fix this, I dont have time to :P.

Is that what you wanted? I dont play dota :P.
 
Last edited:
This is good, but how can you check the quality of the images?
(by quality, I mean the % damage taken, and % damage given).

And, yes, all triggers that base on a 'chance' are used by random integers only (in GUI).
 
aw thank you. ^_^ but I'm still wondering about the %chance thing... will the Spell starts its effect thing work with evasion (which is the skill i based this off of)???
Oh, i have just understood the situation. You have a hero with Evasion. You want it to be alble to create an illusion of itself when a unit that attack him misses (dou to the Evasion). Am i right?
This can only be done with JASS, by an "artifical" evasion, and damage-detection.


Btw, Blackroot, your trigger is a mess. You know nothing about chance calculation. Do you even know what an illusion is? Here's the correct one:
  • Events
  • Unit - A unit Is attacked
  • Conditions
  • (Level of <Ability> for (Triggering unit)) Greater than 0
  • Actions
  • Set Chance = (Level of <Ability> for (Triggering unit)) * 15
  • If (Chance Greater then or equal to (Random integer number between 1 and 100) then do
  • //Create a dummy unit that uses the illusion-creating item on Triggering...Unit
 
Oh, i have just understood the situation. You have a hero with Evasion. You want it to be alble to create an illusion of itself when a unit that attack him misses (dou to the Evasion). Am i right?
This can only be done with JASS, by an "artifical" evasion, and damage-detection.

U dnt need to use jass for artificial evasion, I've done it using triggers. You just have to add units to the event - unit takes damage...then work from there.
 
I really want the percents to be 2% (lvl1) 5% (lvl2) 7% (lvl3) 10% (lvl4) 12% (lvl5)
Think about it, simple math. The chance starts from 2 and increses by 3 each level.
Set Chance = 2 + (Level of ability)*3

Let's see this "chance system":
0% chance --> 0 >= Random number between 1 and 100
1% chance --> 1 >= Random number between 1 and 100
12% chance --> 12 >= Random number between 1 and 100

In your case:
(2 + (Level of ability)*3) >= Random number between 1 and 100
(>= means "greater then or equal to")

U dnt need to use jass for artificial evasion, I've done it using triggers. You just have to add units to the event - unit takes damage...then work from there.
Yeah, yeah, you're right, i always forget about it. Maybe because i hate GUI... :P
 
I really want the percents to be 2% (lvl1) 5% (lvl2) 7% (lvl3) 10% (lvl4) 12% (lvl5)

Think about it, simple math. The chance starts from 2 and increses by 3 each level. :P

No offense, but think about it, simple math. 2%--> 5% and 7% --> 10% are jumps of 3, but 5% --> 7% and 10% --> 12% are intervals of 2. Basically, if he wants it this way, he has to have individual if/thens. I totally agree with you on the way to do the trigger though...
 
dota's phantom lancer doesent use mirror image, there is simply made a dummy unit who uses the item illusion ability on the hero.
I'm questioning where I could find the item illusion skill becuase when I go to "Order unit to target a unit"... I can't find "Item Illusion" as a choice for orders.... (ex= Human Mountain King Thunder Clap, Orc Tauren Chieftan Shockwave.)

Can someone help me?
 
I'm questioning where I could find the item illusion skill becuase when I go to "Order unit to target a unit"... I can't find "Item Illusion" as a choice for orders.... (ex= Human Mountain King Thunder Clap, Orc Tauren Chieftan Shockwave.)

Can someone help me?

Hmmm... can't think of any way of doing it beside giving the unit an item with that ability and then ordering the unit to use the item. Sorry I couldnt help more...
 
I just want to give my opinion, maybe it didn't works even you tried it:bored:

why you must find the 'item illusion' skill why not makes a new one?? Simple thinking doesn't it??
 
You cant, youll have to use a line of custom script.

So in your triggers, create 2 "global" variables.
Unit_Caster
Unit_Target
(I assume you know how to create variables)

Then in your actual illusion trigger do.

Create Dummy Unit
Give Dummy Unit illusion ability
Set Unit_Caster = LastCreatedUnit
Set Unit_Target = AttackedUnit
Custom Script: call IssueTargetOrderById(udg_Unit_Caster, 852274, udg_Unit_Target)

This will order your dummy unit to cast illusion ablity onto the attacked unit.
 
variables are easy but are you sure it will work??

what's better to do this thing?? JASS or trigger, I will try with the best
 
Status
Not open for further replies.
Back
Top