1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

% chance MirrorImage

Discussion in 'Triggers & Scripts' started by pandamanana, Feb 25, 2007.

  1. pandamanana

    pandamanana

    Joined:
    Dec 26, 2006
    Messages:
    328
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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?
     
  2. Diablo-dk

    Diablo-dk

    Joined:
    Nov 10, 2004
    Messages:
    369
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    dota's phantom lancer doesent use mirror image, there is simply made a dummy unit who uses the item illusion ability on the hero.
     
  3. pandamanana

    pandamanana

    Joined:
    Dec 26, 2006
    Messages:
    328
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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)???
     
  4. paskovich

    paskovich

    Joined:
    Jul 12, 2005
    Messages:
    794
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    base it off Evasion, and use the triggerevent 'Unit is attacked'.
    The condition should be: (Level of <Ability> for Triggering Unit) > 0
    ...
     
  5. pandamanana

    pandamanana

    Joined:
    Dec 26, 2006
    Messages:
    328
    Resources:
    1
    Maps:
    1
    Resources:
    1
    still confused.... sorry
     
  6. Blackroot

    Blackroot

    Joined:
    Feb 20, 2007
    Messages:
    32
    Resources:
    0
    Resources:
    0
    • 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: Feb 26, 2007
  7. NiKaNoRoU_GR

    NiKaNoRoU_GR

    Joined:
    Feb 23, 2007
    Messages:
    82
    Resources:
    0
    Resources:
    0
    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).
     
  8. sangir

    sangir

    Joined:
    Sep 2, 2004
    Messages:
    74
    Resources:
    0
    Resources:
    0
    use the condtion random number between 1and 100 less then or = (ur % here)
     
  9. paskovich

    paskovich

    Joined:
    Jul 12, 2005
    Messages:
    794
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    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
     
  10. pandamanana

    pandamanana

    Joined:
    Dec 26, 2006
    Messages:
    328
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I really do not understand anything after
    I really want the percents to be 2% (lvl1) 5% (lvl2) 7% (lvl3) 10% (lvl4) 12% (lvl5)
     
    Last edited: Feb 26, 2007
  11. Xarwin

    Xarwin

    Joined:
    Nov 16, 2006
    Messages:
    2,233
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Tutorials:
    1
    Resources:
    3
    Change the variable each level to the percent u want.
    Use this kind of triggers :
    • If (level of Yourability equal to 1 then do
      • Set Chance = 2
        • If (level of Yourability equal to 2 then do
      • Set Chance = 5

    And so on... Place this as the first actions.
     
  12. l33t5up4h4x0r

    l33t5up4h4x0r

    Joined:
    Oct 23, 2006
    Messages:
    228
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  13. paskovich

    paskovich

    Joined:
    Jul 12, 2005
    Messages:
    794
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    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")

    Yeah, yeah, you're right, i always forget about it. Maybe because i hate GUI... :p
     
  14. Dalaran_Guard

    Dalaran_Guard

    Joined:
    Sep 13, 2006
    Messages:
    429
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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...
     
  15. paskovich

    paskovich

    Joined:
    Jul 12, 2005
    Messages:
    794
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Heh, and i talk about simple math! :D:D You're right...
     
  16. pandamanana

    pandamanana

    Joined:
    Dec 26, 2006
    Messages:
    328
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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?
     
  17. Dalaran_Guard

    Dalaran_Guard

    Joined:
    Sep 13, 2006
    Messages:
    429
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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...
     
  18. l33t5up4h4x0r

    l33t5up4h4x0r

    Joined:
    Oct 23, 2006
    Messages:
    228
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Yes true, i also use an item instead of a skill. Order a dummy unit to use the item instead giving him an ability and using a skill.
     
  19. CoolSoFar

    CoolSoFar

    Joined:
    Dec 26, 2006
    Messages:
    300
    Resources:
    0
    Resources:
    0
    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??
     
  20. Fulla

    Fulla

    Joined:
    Aug 3, 2005
    Messages:
    757
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    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.