- Joined
- Jul 26, 2008
- Messages
- 1,009
Hi, I'm trying to make a spell that shoot a breath effect from the caster.
Simple enough. The way it works is the play channels the ability, and whatever way they're facing is the way the breath shoots.
I know I got the angle wrong because the effect shoots from odd angles, mainly facing to the east (0). Could someone help me figure out the right formula? .c is the Caster.
Simple enough. The way it works is the play channels the ability, and whatever way they're facing is the way the breath shoots.
I know I got the angle wrong because the effect shoots from odd angles, mainly facing to the east (0). Could someone help me figure out the right formula? .c is the Caster.
JASS:
local real a = GetUnitFacing(.c)
local real x = GetUnitX(.c) + 180 * Cos(a)
local real y = GetUnitY(.c) + 180 * Sin(a)
if GetUnitCurrentOrder(.c) == OrderId("breathoffrost")then
call DestroyEffect(AddSpecialEffect(GetAbilityEffectById(SPELLID, EFFECT_TYPE_MISSILE, 0), x, y))