HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Poison Arrows won't cooperate

09-25-2007, 04:06 PM#1
zeroXD
I'm trying to create an ability based on the ability Poison Arrows, but: the buff of the ability won't show up on its target, not as long as the attacker is a melee unit.
I need the buff to detect a unit attacking with the arrows on.

Is there a way to make an autocast arrows ability have any effect, or is there a different way to detect autocast?

Help would be apreciated.
09-25-2007, 05:50 PM#2
Castlemaster
I've seen this problem w/detecting autocast several times, and there is a solution, albeit moderately difficult.

There are two ways to detect an auto-attack cast spell: manual cast, and auto-cast cast.

The first one is not hard. Just use the "Unit-Starts the effect of an ability" event and go from there.

To account for right clicking an auto-cast (as most will do) you need a separate trigger with the event "Unit-Is given an order with no target". The order will be the "turnon" command in the object editor. Make this trigger turn on another trigger that will be the attack detection trigger. In the same "order command event" trigger, add a line that will turn off your attack detection trigger when the command is the "turnoff" command.

This will turn an attack detection trigger on and off that will create your desired effect on auto attack. The event in this ability will be "Unit is attacked", and make the condition when the attacking unit is the one with poisen arrows (the one that recieved the "turnon" command). Now under this attack detection trigger, put all the stuff you want to happen when he attacks.

This should be the algorithm
No autocast on --> nothing happens
Manual cast Poison Arrows --> desired effect
Right-Click Poison Arrows to "on" --> Turns on attack detection --> desired effect on attack
Right-Click Poison Arrows to "off" --> Turns off attack detection --> no effect on attack.

The final part is to add a condition for the attack detection to only fire if the attack unit has enough mana. Otherwise the unit can use all it's mana and still get the effect.

Lemme know if that's confusing.
09-26-2007, 04:58 AM#3
Fluff
What if you made the melee unit a ranged unit. Just give him lower range, maybe even a projectile (such as the almost invisible rifleman one?) Just do all you can so that the game thinks it's ranged.
09-26-2007, 11:39 AM#4
zeroXD
Castlemaster:
The solution is a bit extreme, I think I'll try to do whatever I can to make the game think it's a ranged unit first.

FLUFF:
I'll try to figure it out.

Edit: I managed to make the game think it's a ranged unit. Thanks for the tip!
09-27-2007, 05:20 PM#5
Castlemaster
hmmm, I am a complicated man. Plus I probably didn't spend enough time thinking about what you actually wanted.