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

triggered critchance

Status
Not open for further replies.
Level 5
Joined
Apr 16, 2009
Messages
23
Hi.

After searching the internet and all the spells on this site, I can't seem to find a way to increase the critchance of units through triggers.

I want to give items critchance. So if a unit picks up an item with like 7% critchance, then it should increase critchance with 7% for that unit. Is this even possible to do? I don't want to use the crit spell because that rounds instead of giving exact numbers.

Sorry for any bad grammar or spelling, I'm not a native speaker of english.

And thank you for any help.
 
Level 9
Joined
Jul 30, 2018
Messages
445
Use a damage detection system (good one: GUI-Friendly Damage Detection v1.2.1) and use trigger action Damage target to deal damage to the attacked unit via a trigger which detects when unit is damaged (one such comes with the above DDS). With that system you do not only get the trigger event to detect damage, but you also get the exact damage dealt which you can easily multiply by anything (like 2x or whatever).

Here's an example trigger with said DDS:
  • Events
    • Game - GDD_Event becomes Equal to 0.00
  • Conditions
    • (GDD_DamageSource has an item of type [Your item]) Equal to True
  • Actions
    • Set TempInteger = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempInteger Less than or equal to 7
      • Then - Actions
        • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing (GDD_Damage) damage of attack type Normal and damage type Normal //For double damage no multiplying here, because the dmg is already dealt once
      • Else - Actions
 
Last edited:
Level 5
Joined
Apr 16, 2009
Messages
23
Use a damage detection system (good one: GUI-Friendly Damage Detection v1.2.1) and use trigger action Damage target to deal damage to the attacked unit via a trigger which detects when unit is damaged (one such comes with the above DDS). With that system you do not only get the trigger event to detect damage, but you also get the exact damage dealt which you can easily multiply by anything (like 2x or whatever).

Here's an example trigger with said DDS:
  • Events
    • Game - GDD_Event becomes Equal to 0.00
  • Conditions
    • (GDD_DamageSource has an item of type [Your item]) Equal to True
  • Actions
    • Set TempInteger = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempInteger Less than or equal to 7
      • Then - Actions
        • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing (GDD_Damage) damage of attack type Normal and damage type Normal //For double damage no multiplying here, because the dmg is already dealt once
      • Else - Actions

But would this work with multiple items? For like an RPG? with different gear.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Yes, you just need to store the unit's total crit chance in a variable and use that variable where Sabe wrote 7 in the trigger. You will need to update this crit chance variable as units pick up and drop items, and if any spells affect crit chance that will have to be accounted for too.
 
Level 5
Joined
Apr 16, 2009
Messages
23
Just want to make sure I got this right.

Like this right?
crit.png
+10crit.png
-10 crit.png
 
Status
Not open for further replies.
Top