HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Custom Critical Strike; Trigger-based - Part 2

06-03-2009, 04:28 PM#1
Kul'thran
Okay, those of you who might remember me asking about this earlier thought that this was solved with a spellbook trick. Well, I discovered that it doesn't work when all the action buttons have been filled, so I reverted to a trigger-based custom critical strike.

I went through a lot to get this far, but I'm still trapped by possible leaks and some problems.

Here are the triggers:

Trigger:
FuryStanceCrit1
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to Therista (Fury Stance)
((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
((Attacked unit) is A structure) Equal to False
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Attacked unit) is in AttackedUnitGroup) Equal to True
Collapse Then - Actions
Trigger - Add to FuryStanceCrit2 <gen> the event (Unit - (Attacked unit) Takes damage)
Collapse Else - Actions
Unit Group - Add (Attacked unit) to AttackedUnitGroup
Trigger - Add to FuryStanceCrit2 <gen> the event (Unit - (Attacked unit) Takes damage)

Part 2

Trigger:
FuryStanceCrit2
Events
Collapse Conditions
(Unit-type of (Damage source)) Equal to Therista (Fury Stance)
Collapse Actions
Set CritChance = (Random integer number between 1 and 100)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
CritChance Less than or equal to 15
Collapse Then - Actions
Set AttackedUnit = (Triggering unit)
Set DamageSourceCrit = (Damage source)
Set TheristaDamage = (Damage taken)
Unit - Cause DamageSourceCrit to damage AttackedUnit, dealing TheristaDamage damage of attack type Hero and damage type Normal
Floating Text - Create floating text that reads ((String((Integer((2.00 x TheristaDamage))))) + !) above DamageSourceCrit with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
Set AttackedUnit = No unit
Set DamageSourceCrit = No unit
Else - Actions

Problems:

1) Are there are any still possible leaks and how do I fix them? (Give me an example)
2) The critical strikes stack sometimes, as in, I get a double critical in one strike, making Therista deal way too much damage. How do I fix that?
3) How do I prevent abilities like Whirlwind and Thunder Clap from critically striking?

Thanks for your help ahead of time. :)
06-03-2009, 08:27 PM#2
Anitarf
1) and 2): Don't add the event under "then" actions, only under "else" actions.

3) Tricky. You could turn off the damage detection trigger when the spell is cast (or maybe when the unit begins casting the spell) and then turn it back on on the next attack event.
06-04-2009, 03:04 PM#3
Kul'thran
oh nice. What you suggested for #1 and #2 worked!

Okay, for number 3, I tried this:

Trigger:
ThunderClapWhirlwind1
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Ability being cast) Equal to Whirlwind
(Ability being cast) Equal to Thunder Clap (Therista)
Collapse Actions
Trigger - Turn off FuryStanceCrit1 <gen>

Trigger:
ThunderClapWhirlwind2
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Ability being cast) Equal to Whirlwind
(Ability being cast) Equal to Thunder Clap (Therista)
Collapse Actions
Trigger - Turn on FuryStanceCrit1 <gen>

It doesn't work. I still get a critical strike on both. :/ What do you suggest?
06-04-2009, 09:27 PM#4
rain.mon
Make the second event a unit is attacked and if the attacker is your crit hero then turn the trigger on
06-05-2009, 07:53 PM#5
Kul'thran
Hey! That worked! :D Thank you!

Trigger:
ThunderClapWhirlwind1
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Ability being cast) Equal to Whirlwind
(Ability being cast) Equal to Thunder Clap (Therista)
Collapse Actions
Trigger - Turn off FuryStanceCrit1 <gen>
Trigger:
ThunderClapWhirlwind2
Collapse Events
Unit - A unit Is attacked
Unit - A unit Finishes casting an ability
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to Therista (Fury Stance)
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Ability being cast) Equal to Whirlwind
(Ability being cast) Equal to Thunder Clap (Therista)
Collapse Actions
Trigger - Turn on FuryStanceCrit1 <gen>

Okay... is there anything that's leaking and what do I do to stop the leaking?
06-05-2009, 08:21 PM#6
Anitarf
Wait, that works?

About the leaks, forget it, there's nothing more you can do about it in GUI.
06-06-2009, 06:45 PM#7
Kul'thran
Wait, actually, it doesn't. I tested it again, and she's getting crits on Whirlwind and Thunder Clap. Do'h. :S

What do I do?
06-06-2009, 10:19 PM#8
Anitarf
Well, I was kind of expecting the second trigger not to work but since you still gt crits on spells, it would seem the first one doesn't work either. I now see why, you're supposed to turn off the damage detection trigger (FuryStanceCrit2), not the trigger that adds events to the damage detect trigger (FuryStanceCrit1). Also, the ThunderClapWhirlwind2 trigger is not needed at all, simply add the "turn trigger on" action to the FuryStanceCrit1's actions (and, of course, change it to turn on FuryStanceCrit2).
06-08-2009, 08:01 PM#9
Kul'thran
Tried it. And that didn't work. :/

Here are the current triggers:

Trigger:
ThunderClapWhirlwind
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Ability being cast) Equal to Whirlwind
(Ability being cast) Equal to Thunder Clap (Therista)
Collapse Actions
Trigger - Turn off FuryStanceCrit2 <gen>

Trigger:
FuryStanceCrit1
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to Therista (Fury Stance)
((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
((Attacked unit) is A structure) Equal to False
Collapse Actions
Trigger - Turn on FuryStanceCrit2 <gen>
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Attacked unit) is in AttackedUnitGroup) Equal to True
Then - Actions
Collapse Else - Actions
Unit Group - Add (Attacked unit) to AttackedUnitGroup
Trigger - Add to FuryStanceCrit2 <gen> the event (Unit - (Attacked unit) Takes damage)

The crit still works, but it criticals with Whirlwind still. What do I do?
06-08-2009, 08:42 PM#10
Hans_Maulwurf
Add
Trigger:
((Attacking unit) has buff Whirlwind (caster)) Equal to False
to the conditions of FuryStanceCrit1
06-09-2009, 12:46 AM#11
Kul'thran
Nope. That doesn't work either. :S
06-12-2009, 03:27 PM#12
Kul'thran
I didn't see any rules against it (unless there's something I missed. If so, I'm really sorry about this. :( ), so I'm going to bump this because I still need help.
06-17-2009, 07:10 PM#13
Kul'thran
Still need help. :S
06-19-2009, 08:45 PM#14
Kul'thran
Bump. Anyone? :x
06-19-2009, 10:05 PM#15
Silvenon
That's weird, it should turn the crit trigger off when the whirlwind is cast. Are you sure it's the right whirlwind? Otherwise this would be some kind of a bug as far as I can see...