1. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  2. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  3. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  4. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  5. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  6. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  7. 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.

crit system

Discussion in 'World Editor Help Zone' started by Rainbow Evil, Apr 27, 2009.

  1. Rainbow Evil

    Rainbow Evil

    Joined:
    Oct 2, 2008
    Messages:
    404
    Resources:
    0
    Resources:
    0
    Hello there. I want to make a critical strike system.One where crit chances,base dmg and bonus dmg can be modified by items.If posible no JASS plz!
     
  2. jadegolem

    jadegolem

    Joined:
    Feb 1, 2008
    Messages:
    293
    Resources:
    0
    Resources:
    0
    use a damage detection trigger. for example
    • Damage Detection Initialization
    • Events
      • Unit - A unit enters (Playable Map Area)
    • Conditions
    • Actions
      • Trigger - Add (Entering Unit takes damage) to (Damage Detection)

    • Damage Detection
    • Events
    • Conditions
    • Actions
      • <Insert Need Actions>



    You can make Critical strike stack by making a condition using loops for example if for every integer a loop between 1 and 6, if the unit has <Insert Item> in inventory integer A, add +<Insert Critical Strike Chance> to a variable. After that, make a condition saying that if a random number between 1 and 100 is lower than your variable, deal Damage Source x <Insert Value>.
     
  3. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    Careful, this will make your spell damage crit too. If you want a damage detection system (which is necessary for a crit system), you will have to trigger all spell dmg.
     
  4. graystuff111

    graystuff111

    Joined:
    Dec 11, 2007
    Messages:
    715
    Resources:
    23
    Icons:
    20
    Skins:
    1
    Maps:
    1
    Tutorials:
    1
    Resources:
    23
    It leaks and is generally a bad idea.
    I wouldnt listen to him, it will slow your game down, and definatly lead to lag if you have any defence game. The only game I would use that for would be a regular map, with very little gameplay changes, and no unit spam.
     
  5. Acutesharpness

    Acutesharpness

    Joined:
    Aug 14, 2007
    Messages:
    927
    Resources:
    3
    Maps:
    3
    Resources:
    3
    Simple as crystal, you will learn to seperate attacks from other source of damage. Firstly by making all your abilities like frost nova casted by dummy instead of your main hero.

    Secondly, use the trigger from jadegolem for this operation

    Thirdly, check if damage source is a hero or not

    Fourth Step, now you throw the logic jadegolem suggested and get over with it =X
     
  6. Kingz

    Kingz

    Joined:
    Jun 5, 2008
    Messages:
    2,470
    Resources:
    6
    Spells:
    5
    Tutorials:
    1
    Resources:
    6
  7. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    Except it crits with spells. Destiny.Knight was right, you'll have to dummycast all your spells to avoid that
     
  8. Rainbow Evil

    Rainbow Evil

    Joined:
    Oct 2, 2008
    Messages:
    404
    Resources:
    0
    Resources:
    0
    I d spell crit too but I want Agillity to increase mellee or ranged crit and intelligence ti increase spell crit
     
  9. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    The biggest problem here is that you can't detect the souce of the damage (only the damaging unit). The way I do this is replacing all damaging spells by Acid Bomb with 0.1 dmg and some dummy debuff. In the "Unit - Takes Damage" trigger, I test for the debuff (which, in case of Acid Bomb, is applied directly before the damage), and if it is present, I remove it and damage the unit accordingly by trigger.