Hello, I wrote up a way to make critical Strike based on stats and I figured I should Share it with you guys because.... well its useful.
Before you read This make sure you understand:
Triggers, and creating attributes and hero levels (veterancy)
basically in my map a hero get 4 attribute points per level: Finesse is the stat I use to increase crit (as well as movement speed)
The Equation is as follows:
(Finesse+5+(Hero Level*.1))/((Hero Level/2)+100)
If my calculations are correct it should Guarantee at least 5% crit at all times and a steady increase of crit per level if you put at least one point into finesse per level. (Feel Free to Correct and Humiliate me if im wrong because i haven't spent an incredible time making sure)
anyhow-
First you have to designate an attack type to be used as critical strike (I used ranged damage for this because my hero is melee and im pretty sure you can set attacks as melee and still make them ranged- there may be a way to make new types of damage i haven't experimented with this yet.)
Set That Damage type to be affected by your attribute (finesse) mine increases ranged damage by 1.
Next, You create an effect that deals 0 ranged damage. I called mine Critical Strike.
~IMPORTANT NOTE~ Im also using a stacking buff that increases the hero's stats per level as I am using a custom stat distribution system. If you are using the regular method for stat distribution ill try and update this later so I can help you out...
~IMPORTANT NOTE 2~ Within Bounds is BUGGED (at least the time when this was written) min sets the maximum - max sets the minimum.
You must also create a trigger that detects hero level (mine increases by one everytime the hero levels up)
Implement The following Trigger and you are done:
~~~EVENTS:~~~
-A Unit is attacked
~~~VARIABLES:~~~
-Finesse (Integer)
-Hero Level (Real)
-Crit (Integer)
-Crit Text Tag (text tag)
~NOTE~ My Agility and Hero Level Variables are Global because I use them in other triggers as well. You might want to do the same.
Also, If your map is multiplayer be sure to set them all as arrays. If you do not choose to set them as arrays ignore all [Owner of Unit(Acquired Target)] beyond this point
~~~Actions:~~~
-Set Variable Crit[Owner of Unit: Acquired Target]- Random Integer Between Min: 0 and Max: Arithmatic (Integer): (Value1: Arithmatic Integer: (Value 1: Convert Real to Integer: Hero Level [Owner of Unit(Acquired Target)]) Operator* 2.2)+100)
-Set Variable Finesse[Owner of Unit: Acquired Target]- Value: Stack Count of Behavior on unit: Finesse Buff
-IF THEN ELSE:
~IF:~
-WITHIN BOUNDS: <Min: Arithmetic (Real): (Value 1: Convert Integer to Real: (Value 1: Finesse Index [Owner of unit (Acquired Target)])
Operator:+ (Value 2: Arithmatic (Real): (Value 1: Hero Level [Owner of unit (Acquired Target)] Operator:*Value 2: 0.1))>
Value: Crit [Owner of Unit: Acquired Target]
Max: 1
~THEN:~
-Environment: Create Effect on unit: Effect: Crit Damage, Target: Triggering Unit, Caster Acquired Target
-Create Text Tag: Text:"Critical Strike!", Players: All Players, Font Size: 24, Point: Position of Unit [Acquired Target], Height Offset: 1.0, Visible: Visible, Use Fog of War: True
-Set Variable: Crit text tag[Owner of Unit (acquired target)]: Last Created Text Tag
-Wait 0.5 Game Seconds
-Destroy Text Tag: Crit Text Tag[Owner of Unit(Acquired Target)]
~ELSE:~
Good Luck and happy Mapping Guys! I may edit this for clarity in the future.
@zifoon: Go
That is a simpler way; however, if you follow this method the chance of critically striking will increase with every point of finesse and the damage dealt can be scaled to every point of finesse as well.
every point of finesse increases the bonus damage by one
EDIT: most of your criticism is fair though so im gonna go ahead and edit this tomorrow for clarity and add a simple map. plus i may end up just using double damage instead of each point of finesse increasing the crit damage so i don't have to devote an entire damage type to it.
@Redwulf85048:
y not do it a simpler method then? I was talking about my trigger method below my data editor method. Also you can use catalog to change the chance of the critical chance happening.
also using catalog trigger can be used for damage so you don't have to use range attack hotfix. Amount of damage or any field for that matter can be modified.
Hello, I wrote up a way to make critical Strike based on stats and I figured I should Share it with you guys because.... well its useful.
Before you read This make sure you understand: Triggers, and creating attributes and hero levels (veterancy)
basically in my map a hero get 4 attribute points per level: Finesse is the stat I use to increase crit (as well as movement speed)
The Equation is as follows:
(Finesse+5+(Hero Level*.1))/((Hero Level/2)+100)
If my calculations are correct it should Guarantee at least 5% crit at all times and a steady increase of crit per level if you put at least one point into finesse per level. (Feel Free to Correct and Humiliate me if im wrong because i haven't spent an incredible time making sure)
anyhow-
First you have to designate an attack type to be used as critical strike (I used ranged damage for this because my hero is melee and im pretty sure you can set attacks as melee and still make them ranged- there may be a way to make new types of damage i haven't experimented with this yet.)
Set That Damage type to be affected by your attribute (finesse) mine increases ranged damage by 1.
Next, You create an effect that deals 0 ranged damage. I called mine Critical Strike.
~IMPORTANT NOTE~ Im also using a stacking buff that increases the hero's stats per level as I am using a custom stat distribution system. If you are using the regular method for stat distribution ill try and update this later so I can help you out...
~IMPORTANT NOTE 2~ Within Bounds is BUGGED (at least the time when this was written) min sets the maximum - max sets the minimum.
You must also create a trigger that detects hero level (mine increases by one everytime the hero levels up)
Implement The following Trigger and you are done:
~~~EVENTS:~~~
-A Unit is attacked
~~~VARIABLES:~~~
-Finesse (Integer)
-Hero Level (Real)
-Crit (Integer)
-Crit Text Tag (text tag)
~NOTE~ My Agility and Hero Level Variables are Global because I use them in other triggers as well. You might want to do the same. Also, If your map is multiplayer be sure to set them all as arrays. If you do not choose to set them as arrays ignore all [Owner of Unit(Acquired Target)] beyond this point
~~~Actions:~~~
-Set Variable Crit[Owner of Unit: Acquired Target]- Random Integer Between Min: 0 and Max: Arithmatic (Integer): (Value1: Arithmatic Integer: (Value 1: Convert Real to Integer: Hero Level [Owner of Unit(Acquired Target)]) Operator* 2.2)+100) -Set Variable Finesse[Owner of Unit: Acquired Target]- Value: Stack Count of Behavior on unit: Finesse Buff -IF THEN ELSE:
~IF:~
~THEN:~
~ELSE:~
Good Luck and happy Mapping Guys! I may edit this for clarity in the future.
1. Shouldn't this be in tutorial section?
2. Kinda hard to read...
3. You really should add a map~
and
4. That's not a good way to add a critical strike
This is how you add critical strike
http://forums.sc2mapster.com/development/map-development/2562-critical-strike-issue-and-item-activation-issue/?post=6
Event trigger wise, you could have used catalog to make life much easier.
@zifoon: Go That is a simpler way; however, if you follow this method the chance of critically striking will increase with every point of finesse and the damage dealt can be scaled to every point of finesse as well.
every point of finesse increases the bonus damage by one
EDIT: most of your criticism is fair though so im gonna go ahead and edit this tomorrow for clarity and add a simple map. plus i may end up just using double damage instead of each point of finesse increasing the crit damage so i don't have to devote an entire damage type to it.
@Redwulf85048:
y not do it a simpler method then? I was talking about my trigger method below my data editor method. Also you can use catalog to change the chance of the critical chance happening.
also using catalog trigger can be used for damage so you don't have to use range attack hotfix. Amount of damage or any field for that matter can be modified.