HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to detect critical strike (sort of)

01-29-2005, 10:05 PM#1
wikidme
ok i dont know if this has come up before and i dont remember anyone mentioning this, or if this has been thought of before.

anyway, the problem is there is no way to detect passive abilities, well, i kind of stumbled across a very subtle and buggy way.

use orb of lightning and make it use wand of illusion, then use a trigger to detect when a 'unit spawns a summoned unit' and u can make the conditions such that the summoning unit has the orb ability and so on.

this allows us to detect exactly when the hit connects, and without having to use the terrible 'unit is attacked' event, and without creating unit is damaged triggers on the fly. it also works seemleasly with ranged units.


the next problem, which im half stuck on is now we have to 'get' the attacked unit. none of the unit functions seem to return the attacked unit, despite the fact it was 'the target of an ability' most recently cast. , you cannot use orb abilities that leave a buff, becuase orbs do not stack. the other option which im currently using is to search within a very small area of the summoned unit for other units with equal life.

however this has the problem that it sometimes messes up if 2 units of the same type are very close together, since unit of the same type are most likely to have the same life.

Another interesting side effect i found here was the ability from orb of lightning is cast, and the trigger fires, both BEFORE the actual combat damage is dealt from the attackers hit. which is mostly why my searching for units of life equal to summoned units life fails.

So, if anyone can think of a better way to 'get' the attacked unit, please do tell.
01-29-2005, 10:43 PM#2
wikidme
its ok i figured it out. how to solve the dilemma.