First you need to create a damage detection system (at map init, add the event "Unit takes damage" in the critical strike-trigger).
In the Critical Strike trigger, set the condition to Order equal to "attack", "smart" or "" (empty string).
Then deal damage according to the damage dealt.
Edit: No screenshots are neccesary, trigger-tags are way better and faster.
Init
Events
Map initialization
Conditions
Actions
Set UnitGroup = (Units in (Playable map area))
Unit Group - Pick every unit in UnitGroup and do (Actions)
Loop - Actions
Trigger - Add to Check Damage <gen> the event (Unit - (Picked unit) Takes damage)
Custom script: call DestroyGroup(udg_UnitGroup)
Damage Detection
Events
Unit - A unit enters (Playable map area)
Conditions
Actions
Trigger - Add to Check Damage <gen> the event (Unit - (Entering unit) Takes damage)
Check Damage
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Current order of (Damage source)) Equal to (Order(attack))
(Current order of (Damage source)) Equal to (Order(smart))
(Current order of (Damage source)) Equal to (Order(<Empty String>))
Then - Actions
Deal damage
Else - Actions
Lets say you want a classic passive Critical Strike ability from wc3, but you wannit in GUI/Trigger form. How do you make it? Can anyone post map with it or screenshot of the trigger? Thanks in advance..
Thx alot ap0calypseFirst you need to create a damage detection system (at map init, add the event "Unit takes damage" in the critical strike-trigger).
In the Critical Strike trigger, set the condition to Order equal to "attack", "smart" or "" (empty string).
Then deal damage according to the damage dealt.
Edit: No screenshots are neccesary, trigger-tags are way better and faster.
Init
Events
Map initialization
Conditions
Actions
Set UnitGroup = (Units in (Playable map area))
Unit Group - Pick every unit in UnitGroup and do (Actions)
Loop - Actions
Trigger - Add to Check Damage <gen> the event (Unit - (Picked unit) Takes damage)
Custom script: call DestroyGroup(udg_UnitGroup)
Damage Detection
Events
Unit - A unit enters (Playable map area)
Conditions
Actions
Trigger - Add to Check Damage <gen> the event (Unit - (Entering unit) Takes damage)
Check Damage
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Current order of (Damage source)) Equal to (Order(attack))
(Current order of (Damage source)) Equal to (Order(smart))
(Current order of (Damage source)) Equal to (Order(<Empty String>))
Then - Actions
Deal damage
Else - Actions
I think that in classic editor there is no ''Unit's Damage'' data that you could store as variable, there's only ''Event Response - Damage Taken'', but i dont know wheather that is attacking units damage or damage that has passed through damage reduction of attacked unit armor or any other unit's reductions (hp lost)? And besides that you said in post you need to make a Condition which will check if the damage taken is normal units damage or its a spell or something else,like ap0calypse showed me, cause we need it to work on regular attacks onlyWell you could store a units damage in a variable...and add chances that he deals his damage by 1.5 times...
Too simple.
Thx alot ap0calypsejust 2 more questions:
What is Order(smart) in game?
Why did you leave the third Condition in Damage Check Order(<Empty String>)?
Ive just tested it, its fine but it still works on spells, for example if i cast some DoT spell on unit every time it deals dot damage to the unit its a ''DoT's critical strike''.. Any advise?The order "smart" is basically the same as the attack-function, when a unit is attack-moving, I believe it is set to "smart", but I'm not sure there...
The empty string is because when a unit is auto-attacking (you didn't order him to attack, a unit just came in range), his order will neither be "attack" or "smart", but just an empty string...
Well, I've tested it with a damage-detection system and it seemed to work just fine![]()
Actually it works on ranged units too, but it works on spell also and thats what im trying to avoid..This will only work with meele units... ranged units deal damage after having the order, a missle while casting won't be able to procc crit like this. You'll need to check if it's a physical attack via orbs or remove the possibility of spells with a system like "Intuitive Damage Detection System" from Wc3c.net. By the way, are you sure that auto attack is an empty string? I thought that it has one too, if not even smart.
Damage Detection System
Actually Justify is right about melee/range units thing. The problem is in ''Damage Check Order(<Empty String>)'' cause it is, in my opinion, a condition that's always fulfilled!
I checked out Intuitive Damage Detection System. Its in Jass and I'm avoiding it, mainly cause I don't know how to work in it. That orb thing is ok but you already explained its disadvantagesSo, these are the two possibilities I know:
1) Orb System. You use an "Orb of Frost" ability with a 0.01 duration, slow of 0% and a black icon. This is completly invisible for the user and won't change anything.
The advantage of this short buff is, that only attacks (and not spells) will apply the buff. In the damage event you can check for the buff.
2) Intuitive Damage Detection System. It is somewhere on Wc3c.net. This system is very complex and requires all spell damage to be dealt via triggers. Even the most simple shockwave needs to be triggerd and deals damage with a special function.
All damage not from this function is then physical.
Solution 1) has the problem that most orbs don't stack, so you can't use them anymore.
Here's the deal, lets say my hero is ranged attacker and has Immolation:I don't think that's true, for this reason:
The trigger only activates when a unit receives damage, so the unit must be
1) damaging a unit (be it through attacking or spells)
2) must have no order.
When a unit casts a spell, he usually has an order like "stormbolt", or "flamestrike".
Here's the deal, lets say my hero is ranged attacker and has Immolation:
1)When I test the map with The Condition in Damage Check Order(<Empty String>): When I attack enemies it deals Critical Strikes fine and when I just pass by enemy units with immolation on it deals Critical Strike of Immolation DoT.
And
2)When I test map without Condition in Damage Check Order(<Empty String>): When I attack enemies it DONT deal Critical Strikes and when I just pass by enemy units with immolation on it DONT deal Critical Strike of Immolation DoT.
I checked out Intuitive Damage Detection System. Its in Jass and I'm avoiding it, mainly cause I don't know how to work in it. That orb thing is ok but you already explained its disadvantagesThanks a lot for your time, will try to find some system in GUI