• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Recreating Arrow Spells' Mana Cost

Status
Not open for further replies.
Level 11
Joined
Jun 2, 2004
Messages
849
So my ultimate goal is getting Arrow spells (Searing, Black, Incinerate, Cold, Orb of Annihilation) to work with Barrage. This of course requires triggering the whole damn thing.

I can make the toggle work. I can make the damage on hit work with a damage engine. I can check the unit's mana.

What I can't do is the mana cost, and am needing suggestions on how to accomplish it. Ideally I'd like to somehow detect the attack launching, which is difficult to do for ranged attackers. But if I could get that, then I could hack together something that works 99% of the time.

So yeah, suggestions? Please list implementation details and potential pitfalls if you've got any.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
At the moment there is no attack launched event.

I don't fully understand, how you are doing it so far.
What base spell are you using? Do you want to use the Barrage ability?

An idea:
use arrow ability as base
use high missile speed, so attacking is almost instant. Use damage engine to set damage to 0, detect buff (frost arrow as base ability) and remove buff
This emulates the attack launched event.
You can no longer use the barrage ability, but you will trigger the missiles instead.
Problems: how much damage will the triggered missiles do? If you base it on the damage dealt originally to the target, you have problems if the original target has spirit link, Hardened Skin or other damage modifiers. Armor can ba calculated, though I think it could be more difficult with negative armor. Anyway lots of problems.
mana would work natively as with all arrow abilities
 
Level 11
Joined
Jun 2, 2004
Messages
849
I'm using Barrage. I feel recreating that would be harder than the other way around. Plus it would have similar problems with detecting attach launch to make the projectiles.

I've several Barrage abilities I dynamically add to the unit to make the missile art work. I can also do the effects of the arrow spells pretty easily, since I know how many barrage missiles will fire and can just do their effects on the next X auto attack damage events.

Unfortunately BlzGetUnitAttackCooldown doesn't include modifiers, or I could use a timer after an Attacked event and subtract the mana cost if no attack cancelling orders or death had occurred in the meantime. Keeping track of attack speed bonuses manually would be awful too. I may have to though.
 
Depending on attack speed modifiers the time diffrence between "unit attacked" event and "mana loss" event is 0.13sec (high AS) to 0.19sec. At least on my laptop.
When "unit attacked" is fired remember game time, then on "mana loss" event check if time diffrence is not more then 0.19sec. Also if mana loss value is ~8 (for searing arrow) we can be almost be sure then we catch the moment when mana was deducted by using searing arrow.
Here is mana change event by Wietlol:Detect mana loss?
Maybe this give you ideas how to accomplish your system.
 
Status
Not open for further replies.
Top