HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Arrow special attack event?

07-05-2009, 01:54 PM#1
cohadar
Is there any event that can detect when unit attacks with a cold arrow or flaming arrow?
I need the exact moment when unit casts the arrow spell.

The EVENT_PLAYER_UNIT_SPELL_EFFECT only detects when you manually cast the arrow, not when it is on autocast
07-05-2009, 02:00 PM#2
Fledermaus
Trigger the autocast =/ it's really lame but it's the best you'll do.
07-05-2009, 02:05 PM#3
Opossum
There's a "MultipleColdArrow" spell that somehow detects when an autocast is fired.
http://www.wc3c.net/showthread.php?t=100292
The code is pretty outdated imo and doesn't use vJass but it should help you though. I think it uses the EVENT_UNIT_TARGET_IN_RANGE thingy or something like that.
07-05-2009, 02:06 PM#4
rain.mon
Whenever the unit get ordered to active the autocast set a bool to true(false if he orders to disable it) and then use attack event and if the bool is true and the unit has more mana then the autocast cost then he is autocasting. Its lame but meh...its a solution.
07-05-2009, 02:12 PM#5
cohadar
Quote:
Originally Posted by rain.mon
Whenever the unit get ordered to active the autocast set a bool to true(false if he orders to disable it) and then use attack event and if the bool is true and the unit has more mana then the autocast cost then he is autocasting. Its lame but meh...its a solution.

I did that, but it does not work.
Attack event sometimes fires before and sometimes after the arrow effect uses mana.
It is really lame.

I'll check that cold arrow spell...
07-05-2009, 04:45 PM#6
cohadar
Quote:
Originally Posted by Litany
Sometimes after? I doubt it.

Expand JASS:

Does not work, it has about 30% chance to fail when unit has below needed mana, than when mana regenerates, auto attack spell fires before ATTACKED event.

Has anyone ever made any autocast on-attack spell that worked?
07-05-2009, 05:27 PM#7
rain.mon
Another thing you can do is when he attacks and the boolean is true, to order the unit to cast the spell manually which means you should dish the mana check too. When he gets bellow the needed mana for the autocast, order the unit to disable the autocast or else he will be tryin to cast it everytime he attacks and by having no mana the unit will just do nothing.
07-05-2009, 05:39 PM#8
cohadar
I was hoping someone already had this problem and solved it.
Dusk?
07-05-2009, 05:53 PM#9
ToukoAozaki
Quote:
Originally Posted by rain.mon
When he gets bellow the needed mana for the autocast, order the unit to disable the autocast or else he will be tryin to cast it everytime he attacks and by having no mana the unit will just do nothing.

I think it would just silently fail... IssueTargetOrder should return false for that.
07-05-2009, 06:25 PM#10
cohadar
I solved it.
The trick is to use cold arrows and than detect and remove a buff.

Should have used that from the start, but I was hoping to avoid using orb effects...
07-05-2009, 09:35 PM#11
Blubb-Tec
this is the kind of thing you should request in the RtC thread.
09-22-2009, 07:20 AM#12
Newuser
Quote:
Originally Posted by cohadar
I solved it.
The trick is to use cold arrows and than detect and remove a buff.

Should have used that from the start, but I was hoping to avoid using orb effects...

Sorry if it is against the rules to necro bump this thread, I'm only read the rule about bumping your own thread and only if it's more than 48 or more hours old.

Any new info on if it's possible to detect Searing Arrow autocast?

I'm trying to make add an effect to the default Searing Arrows, the reason why I want and need to use Searing Arrows is to make it work with Barrage.

I am trying to add a 25% chance that there will be AoE damage effect to Searing Arrows and also make it stack with Barrage(so each multi shot explodes).

Since Searing Arrows seem to be the only auto cast ability that stacks with Barrage, I am forced to use it.

Of course there are some other alternatives but I really want to attach the effect to Searing Arrows instead of making it a passive ability or something.

So does anyone know if it's possible to detect Searing Arrow autocast attacks?
09-22-2009, 11:36 AM#13
Fledermaus
You sure it doesn't work with Freezing/Poison/Black/Incinerate Arrows as well? Otherwise it's kinda tricky..
09-22-2009, 11:39 AM#14
TKF
Dunno.

You can detect activation of autocast right? So add a condition for when you attack and got enough mana for the attack.
09-22-2009, 01:11 PM#15
Fledermaus
That can fail because there is a gap between when a unit attacks and when the projectile is created and they could regen enough mana in that duration.