How would I create a critical strike ability? I want it to be something that has a % chance of adding a certain amount of damage to your regular attacks whenever you attack.
Also, how would I create a pierce ability that give your attacks a % chance to ignore the enemy unit's armor?
Edit: I messed up the condition, it should be Attacking Unit, not Triggering Unit. Also I'd move the "set bonusdamage" to the "then", above the damage dealer. No point setting that variable if there's no reason too.
This shows you how to randomize crit, as well as how to randomize the damage crit does (you can also control it directly).
You can do a similiar thing for armor penetration I think. But instead of deal damage, choose "Change unit damage" for your hero. I'm not sure if there's an anti-armor option, but you should be able to find something nice.
Small notes: "math - cycle" is actually modulo addition, and "set life" won't give the attacking unit credit for the kill. The "damage unit X from unit Y" actions from the Warcraft 3 editor appear to have been removed in the SC2 editor, so it's probably difficult at best through triggers... might be something in the data editor though.
Why not just use the Switch event, with random = 1 and have it alternate between x instances of regular attack damage and 1 instance of a 'special' damage event that does more damage? :)
well, it wont give credit for the dmg done, but you could make it (i hate to advocate trigger use for something that obviously seems like it should be done with the data editor but...)
if (triggering unit) current life <= ( real (bonuscrit dmg) then ... create effect on triggering unit from attacking unit (a blank effect that just kills the unit to give credit to the attacking unit. shoddy, crappy, so many areas for error (what if the unit has buffs that reduce dmg, then you have to incorporate all that into your trigger too, it just gets messier and sloppier the more i think about it, but for a basic map, say (campaign) it could be a way to make it work within a mintute...).
you create a hidden unit owned by the player which kill the unit if the damage of the critical are too high (you randomize the damage, they are 35 and the unit only has 25), you make this unit kills the target (and you give to the hidden unit shared xp in all the map -which can cause a problem if you have two hero at two different place but you can also give the xp by trigger, even if it's difficult cause there is no "add xp" I think I see a thread which explain how to do that...)
If your critical strike is not a bonus damage but a multiplier, I think you can calcultate the exact damages of your hero by checking the life after each auto-attack (the difference between the two last hit is the modified damages) add the armor of the target to have the actual damages -and by checking the attribut type of the unit -biologic, mecanic etc... adding/removing the bonus/malus damages. Once you have the exact damages of your hero (of course if the damages of your hero don't change for all the party no need of such trigger) you check the life of the targer and if it's a fatal blow, kill it with the hidden unit. You have also to check the unit is the same for both hit (so if you kill many unit in one hit it won't be precise, cause it won't be calculate often enough. Even if you don't kill in one hit, an error can happen just after you damages changed -by picking an item-)
(it can cause a problem if the first hit of the game is a critical one which have to kill the unit since it need two hit to determine the damages of the hero)
I think it's a unsatisfactory answer but it's all I can propose ^^
The "damage unit X from unit Y" actions from the Warcraft 3 editor appear to have been removed in the SC2 editor, so it's probably difficult at best through triggers... might be something in the data editor though.
You can create an effect on a unit from a unit with triggers:
Environment - Create Effect on (Unit A) from (Unit B)
So, just create the units weapons damage effect and you'll have it? :)
So the set effect would randomly choose an effect damage effect? Then how do I make it so the set effect runs when the unit is attacking, or would I just have it so the set effect is periodically run, and would it work properly as a critical strike then?
To get the damage point one has to get data from the Catalog Field Value Get, keep in mind though that there is units with weapons that have 0.00 as Damage Point (Zealot for example) and this cause the behavior to be removed as soon as it was applied since the wait is 0.00 seconds. A way to get around this is to make a "minimum wait time".
noone ever said that Effect of Weapon has to be a WeaponDamage or LaunchMissile effect ;)
and no Sets do not automaticly random stuff, by default they use all Effects in the Set, it is a setting that you can use to use just ONE out of X effects in the Set
i might add a Map with a unit causing Critical Damage(2x) with 20% and stuff using this method
Okay, but I wanted a critical strike ability that was independent of the weapon being used. That is, whether you have critical strike or not depended on whether you leveled the ability, and as you level the ability the % chance of getting a critical strike goes up.
So let's say I changed the effect of the weapon. Is there a way to make it do what I just previously described, so that you only have critical strike if you've learned the ability and as you level the ability you get increased % chance of getting a critical strike?
EDIT: Well, I got it working. I basically did what you said xhatix but with a little modifications. I have the weapon run a set effect which runs 4 other effects, the original weapon damage and then 3 other set effects. Each of the set effects has a validator that corresponds to a level of the critical strike behavior. They also have the weapon damage effect, with the random thing you said, and each one has differing amounts of null effects to get the % chances.
or in other words:
An passive ability calculating the results(critdmg) of (default WeaponDamageModifier + all others WeaponDamageModifiers ) might be some kind of tricky without triggers.
But i will give it a try and test it out tomorrow, triggerless
For the triggering qway of doing it. Couldn't you make a blank ability like Crit strike and have it as something like attacking unit has this buff then do the critical strike stuff else do nothing?
As for the unit that gets killed not giving bounty or exp couldn't you also put in another trigger like. Attacked unit is equal to dead give triggering unit exp and bounty?
I haven't been able to get into triggers and look around I'm just guessing from what I remember was in the wc3 editor.
How would I create a critical strike ability? I want it to be something that has a % chance of adding a certain amount of damage to your regular attacks whenever you attack.
Also, how would I create a pierce ability that give your attacks a % chance to ignore the enemy unit's armor?
@devilesk:
Edit: I messed up the condition, it should be Attacking Unit, not Triggering Unit. Also I'd move the "set bonusdamage" to the "then", above the damage dealer. No point setting that variable if there's no reason too.
This shows you how to randomize crit, as well as how to randomize the damage crit does (you can also control it directly).
You can do a similiar thing for armor penetration I think. But instead of deal damage, choose "Change unit damage" for your hero. I'm not sure if there's an anti-armor option, but you should be able to find something nice.
Small notes: "math - cycle" is actually modulo addition, and "set life" won't give the attacking unit credit for the kill. The "damage unit X from unit Y" actions from the Warcraft 3 editor appear to have been removed in the SC2 editor, so it's probably difficult at best through triggers... might be something in the data editor though.
Why not just use the Switch event, with random = 1 and have it alternate between x instances of regular attack damage and 1 instance of a 'special' damage event that does more damage? :)
well, it wont give credit for the dmg done, but you could make it (i hate to advocate trigger use for something that obviously seems like it should be done with the data editor but...)
if (triggering unit) current life <= ( real (bonuscrit dmg) then ... create effect on triggering unit from attacking unit (a blank effect that just kills the unit to give credit to the attacking unit. shoddy, crappy, so many areas for error (what if the unit has buffs that reduce dmg, then you have to incorporate all that into your trigger too, it just gets messier and sloppier the more i think about it, but for a basic map, say (campaign) it could be a way to make it work within a mintute...).
So there's currently no way to do this in the data editor?
there probably is, i would assume there is. keep looking and keep us informed, haha.
you create a hidden unit owned by the player which kill the unit if the damage of the critical are too high (you randomize the damage, they are 35 and the unit only has 25), you make this unit kills the target (and you give to the hidden unit shared xp in all the map -which can cause a problem if you have two hero at two different place but you can also give the xp by trigger, even if it's difficult cause there is no "add xp" I think I see a thread which explain how to do that...)
If your critical strike is not a bonus damage but a multiplier, I think you can calcultate the exact damages of your hero by checking the life after each auto-attack (the difference between the two last hit is the modified damages) add the armor of the target to have the actual damages -and by checking the attribut type of the unit -biologic, mecanic etc... adding/removing the bonus/malus damages. Once you have the exact damages of your hero (of course if the damages of your hero don't change for all the party no need of such trigger) you check the life of the targer and if it's a fatal blow, kill it with the hidden unit. You have also to check the unit is the same for both hit (so if you kill many unit in one hit it won't be precise, cause it won't be calculate often enough. Even if you don't kill in one hit, an error can happen just after you damages changed -by picking an item-) (it can cause a problem if the first hit of the game is a critical one which have to kill the unit since it need two hit to determine the damages of the hero)
I think it's a unsatisfactory answer but it's all I can propose ^^
You can create an effect on a unit from a unit with triggers:
Environment - Create Effect on (Unit A) from (Unit B)
So, just create the units weapons damage effect and you'll have it? :)
create a Set Effect - having several ( 1/n% ) Entries - choosing 1 maximum, and randoming through them by enabling random
So the set effect would randomly choose an effect damage effect? Then how do I make it so the set effect runs when the unit is attacking, or would I just have it so the set effect is periodically run, and would it work properly as a critical strike then?
I made a behavior named Critical Strike (x2) that causes the host to deal double damage on each attack.
Then I made the following trigger that applies and removes the behavior.
To get the damage point one has to get data from the Catalog Field Value Get, keep in mind though that there is units with weapons that have 0.00 as Damage Point (Zealot for example) and this cause the behavior to be removed as soon as it was applied since the wait is 0.00 seconds. A way to get around this is to make a "minimum wait time".
@devilesk: Go
simply use it as Effect of the Weapon o.O
noone ever said that Effect of Weapon has to be a WeaponDamage or LaunchMissile effect ;)
and no Sets do not automaticly random stuff, by default they use all Effects in the Set, it is a setting that you can use to use just ONE out of X effects in the Set
i might add a Map with a unit causing Critical Damage(2x) with 20% and stuff using this method
@xhatix: Go
Okay, but I wanted a critical strike ability that was independent of the weapon being used. That is, whether you have critical strike or not depended on whether you leveled the ability, and as you level the ability the % chance of getting a critical strike goes up.
So let's say I changed the effect of the weapon. Is there a way to make it do what I just previously described, so that you only have critical strike if you've learned the ability and as you level the ability you get increased % chance of getting a critical strike?
EDIT: Well, I got it working. I basically did what you said xhatix but with a little modifications. I have the weapon run a set effect which runs 4 other effects, the original weapon damage and then 3 other set effects. Each of the set effects has a validator that corresponds to a level of the critical strike behavior. They also have the weapon damage effect, with the random thing you said, and each one has differing amounts of null effects to get the % chances.
If you want to do something like generic criticals might further research has to be done.
Generic CriticalDamage is for me defined as:
Where:
N <- N
xi <- DamageModifiers, i <- N
or in other words:
An passive ability calculating the results(critdmg) of (default WeaponDamageModifier + all others WeaponDamageModifiers ) might be some kind of tricky without triggers.
But i will give it a try and test it out tomorrow, triggerless
For the triggering qway of doing it. Couldn't you make a blank ability like Crit strike and have it as something like attacking unit has this buff then do the critical strike stuff else do nothing?
As for the unit that gets killed not giving bounty or exp couldn't you also put in another trigger like. Attacked unit is equal to dead give triggering unit exp and bounty?
I haven't been able to get into triggers and look around I'm just guessing from what I remember was in the wc3 editor.
I tried to make the crit based on the unit have a behavior but I can't get it to work now. Any suggestions on how to limits it to specific units?