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

[Trigger] [Spell Request] Gold to Critical Strike Passive

Level 2
Joined
Nov 23, 2018
Messages
11
Looking for someone to make this passive spell, A unit learns ability equal to (X ability [Buff]) add (Y Ability [Critical Strike Ability]) to Hero
Every 0.02 seconds of the game, If unit has a (X Ability) buff equal to true
Every 1 gold set (Y Ability) to (Y Ability[Critical Strike Ability]) +1
So 1 Gold = level 1 Y Ability[Critical Strike Ability]
2 Gold = level 2 Y Ability[Critical Strike Ability]
3 Gold = level 3 Y Ability[Critical Strike Ability] etc.
Each critical strike ability is 1% chance to crit, +1% per level

If some how the player loses gold the level of the ability is reduced to whatever gold they have

not sure if its possible, need it mui
 
Level 4
Joined
Jun 17, 2016
Messages
18
I'm not sure I'm understanding your request.

To clarify, you essentially want a Critical Strike passive that has a 1% chance of triggering for every 1 gold the controlling player holds, correct?

Deals 100% bonus damage upon a successful Critical Strike?

Do you really need the ability to level up if I can make the ability's success rate equal to the player's gold? I'm not sure what the point of that would be.

If two units controlled by the same player had this ability, their Critical chance would be the same, right?
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Looking for someone to make this passive spell, A unit learns ability equal to (X ability [Buff]) add (Y Ability [Critical Strike Ability]) to Hero
Every 0.02 seconds of the game, If unit has a (X Ability) buff equal to true
Every 1 gold set (Y Ability) to (Y Ability[Critical Strike Ability]) +1
So 1 Gold = level 1 Y Ability[Critical Strike Ability]
2 Gold = level 2 Y Ability[Critical Strike Ability]
3 Gold = level 3 Y Ability[Critical Strike Ability] etc.
Each critical strike ability is 1% chance to crit, +1% per level

If some how the player loses gold the level of the ability is reduced to whatever gold they have

not sure if its possible, need it mui
You need to tell people which patch you're on. There's no need for multiple levels on v1.31+.
 
Level 2
Joined
Nov 23, 2018
Messages
11
I'm not sure I'm understanding your request.

To clarify, you essentially want a Critical Strike passive that has a 1% chance of triggering for every 1 gold the controlling player holds, correct?

Deals 100% bonus damage upon a successful Critical Strike?

Do you really need the ability to level up if I can make the ability's success rate equal to the player's gold? I'm not sure what the point of that would be.

If two units controlled by the same player had this ability, their Critical chance would be the same, right?
hmm. I was just thinking it would be easier to code if there was 2 abilities, 1 of them is a dummy (critical strike ability) and every seconds of the game it would just adjust the ability level to the gold, crit damage can be anything. Its mainly about making the gold to crit part, every 1 gold will equal to 1% crit, if the player for example loses 3 gold while at 50 gold, then the gold will be 47 and drop the crit to 47% crit. Is that doable?
Like this below:
1734678131964.png
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
im on version 2.01.22481
Okay, so you're on the latest patch meaning you have access to everything new. This is important because if you were on an older patch and I was on a newer patch then you wouldn't be able to open or use the map that I sent you. I could end up wasting my time trying to create something that you can't use! Anyway, just something to remember in the future.

You can directly modify Ability fields with triggers now, meaning you can modify the Chance to Critical Strike a short moment before your attack deals damage:
  • Events
    • Unit - A unit is Attacked
  • Conditions
    • (Level of CRIT for (Attacking unit)) Greater than 0
  • Actions
    • Set Variable Gold_Crit_Attacker = (Attacking unit)
    • Set Variable Gold_Crit_Lvl = ((Level of CRIT for Gold_Crit_Attacker) - 1)
    • Set Variable Gold_Crit_Gold = (Real((Owner of Gold_Crit_Attacker)'s current Gold))
    • Set Variable Gold_Crit_Chance = (Min(Gold_Crit_Gold, 100.00))
    • Ability - Set Ability: (Unit: Gold_Crit_Attacker's Ability with Ability Code: CRIT)'s Real Level Field: Chance to Critical Strike ('Ocr1') of Level: Gold_Crit_Lvl to Gold_Crit_Chance
    • -------- This weird inc/dec is necessary to fix a bug related to modifying passive fields --------
    • Unit - Increase level of CRIT for Gold_Crit_Attacker
    • Unit - Decrease level of CRIT for Gold_Crit_Attacker
Notes:
  • I use the Math - Min function to make sure that the Chance doesn't go above 100%. I assume a Player can go above 100 Gold after all.
  • The Set Ability action expects your Level to start at 0 rather than 1. That is why I subtract 1 from Gold_Crit_Lvl.
  • I need to Increase/Decrease the level of the Critical Strike ability in order for the Set Ability action to take effect. It's a bug, we call it "refreshing" the ability. It's generally only necessary for passive effects like this.
  • CRIT is your custom Critical Strike ability. Of course you can name it anything you want along with these Variables.
  • I convert the Player's Gold into a Real from an Integer since the Chance to Critical Strike uses a Real value.
Variables:
  • Gold_Crit_Attacker = Unit
  • Gold_Crit_Lvl = Integer
  • Gold_Crit_Gold = Real
  • Gold_Crit_Chance = Real
 
Last edited:
Level 2
Joined
Nov 23, 2018
Messages
11
te
Okay, so you're on the latest patch meaning you have access to everything new. This is important because if you were on an older patch and I was on a newer patch then you wouldn't be able to open or use the map that I sent you. I could end up wasting my time trying to create something that you can't use! Anyway, just something to remember in the future.

You can directly modify Ability fields with triggers now, meaning you can modify the Chance to Critical Strike a short moment before your attack deals damage:
  • Events
    • Unit - A unit is Attacked
  • Conditions
    • (Level of CRIT for (Attacking unit)) Greater than 0
  • Actions
    • Set Variable Gold_Crit_Attacker = (Attacking unit)
    • Set Variable Gold_Crit_Lvl = ((Level of CRIT for Gold_Crit_Attacker) - 1)
    • Set Variable Gold_Crit_Gold = (Real((Owner of Gold_Crit_Attacker)'s current Gold))
    • Set Variable Gold_Crit_Chance = (Min(Gold_Crit_Gold, 100.00))
    • Ability - Set Ability: (Unit: Gold_Crit_Attacker's Ability with Ability Code: CRIT)'s Real Level Field: Chance to Critical Strike ('Ocr1') of Level: Gold_Crit_Lvl to Gold_Crit_Chance
    • -------- This weird inc/dec is necessary to fix a bug related to modifying passive fields --------
    • Unit - Increase level of CRIT for Gold_Crit_Attacker
    • Unit - Decrease level of CRIT for Gold_Crit_Attacker
Notes:
  • I use the Math - Min function to make sure that the Chance doesn't go above 100%. I assume a Player can go above 100 Gold after all.
  • The Set Ability action expects your Level to start at 0 rather than 1. That is why I subtract 1 from Gold_Crit_Lvl.
  • I need to Increase/Decrease the level of the Critical Strike ability in order for the Set Ability action to take effect. It's a bug, we call it "refreshing" the ability. It's generally only necessary for passive effects like this.
  • CRIT is your custom Critical Strike ability. Of course you can name it anything you want along with these Variables.
  • I convert the Player's Gold into a Real from an Integer since the Chance to Critical Strike uses a Real value.
Variables:
  • Gold_Crit_Attacker = Unit
  • Gold_Crit_Lvl = Integer
  • Gold_Crit_Gold = Real
  • Gold_Crit_Chance = Real
testing it now
 
Level 2
Joined
Nov 23, 2018
Messages
11
update: its not working this is my code:
1734680662302.png

update 2: nevermind I forgot to do the -1 for the level, thanks +rep
 
Level 4
Joined
Jun 17, 2016
Messages
18
Okay, so you're on the latest patch meaning you have access to everything new. This is important because if you were on an older patch and I was on a newer patch then you wouldn't be able to open or use the map that I sent you. I could end up wasting my time trying to create something that you can't use! Anyway, just something to remember in the future.

You can directly modify Ability fields with triggers now, meaning you can modify the Chance to Critical Strike a short moment before your attack deals damage:
  • Events
    • Unit - A unit is Attacked
  • Conditions
    • (Level of CRIT for (Attacking unit)) Greater than 0
  • Actions
    • Set Variable Gold_Crit_Attacker = (Attacking unit)
    • Set Variable Gold_Crit_Lvl = ((Level of CRIT for Gold_Crit_Attacker) - 1)
    • Set Variable Gold_Crit_Gold = (Real((Owner of Gold_Crit_Attacker)'s current Gold))
    • Set Variable Gold_Crit_Chance = (Min(Gold_Crit_Gold, 100.00))
    • Ability - Set Ability: (Unit: Gold_Crit_Attacker's Ability with Ability Code: CRIT)'s Real Level Field: Chance to Critical Strike ('Ocr1') of Level: Gold_Crit_Lvl to Gold_Crit_Chance
    • -------- This weird inc/dec is necessary to fix a bug related to modifying passive fields --------
    • Unit - Increase level of CRIT for Gold_Crit_Attacker
    • Unit - Decrease level of CRIT for Gold_Crit_Attacker
Notes:
  • I use the Math - Min function to make sure that the Chance doesn't go above 100%. I assume a Player can go above 100 Gold after all.
  • The Set Ability action expects your Level to start at 0 rather than 1. That is why I subtract 1 from Gold_Crit_Lvl.
  • I need to Increase/Decrease the level of the Critical Strike ability in order for the Set Ability action to take effect. It's a bug, we call it "refreshing" the ability. It's generally only necessary for passive effects like this.
  • CRIT is your custom Critical Strike ability. Of course you can name it anything you want along with these Variables.
  • I convert the Player's Gold into a Real from an Integer since the Chance to Critical Strike uses a Real value.
Variables:
  • Gold_Crit_Attacker = Unit
  • Gold_Crit_Lvl = Integer
  • Gold_Crit_Gold = Real
  • Gold_Crit_Chance = Real

Correct me if I'm wrong here, but doesn't Critical Strike always round to an interval of 5%? As in, you can't have a 1% or 2% chance to perform a Critical Strike with the Critical Strike ability. I know it used to be like that, but maybe that was updated in a patch?

What I had a mind was a method to actually have those cases where the chance isn't a multiple of 5%, but it seems like the original poster is happy with your solution. At this point, I'm just curious if Critical Strike was actually updated in a patch and I just didn't know about it.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Correct me if I'm wrong here, but doesn't Critical Strike always round to an interval of 5%? As in, you can't have a 1% or 2% chance to perform a Critical Strike with the Critical Strike ability. I know it used to be like that, but maybe that was updated in a patch?

What I had a mind was a method to actually have those cases where the chance isn't a multiple of 5%, but it seems like the original poster is happy with your solution. At this point, I'm just curious if Critical Strike was actually updated in a patch and I just didn't know about it.
I can't say for certain but now that I think about it I vaguely remember reading about something like that. I suppose a Damage Event could be used instead if it's a serious issue.
 
Top