- Joined
- Mar 21, 2011
- Messages
- 1,611
Hi, i'm using Missile by BPower and got a problem with a trigger.
Missile should act like a knockback in this case, but i get an error when saving the map: "m is not a type that allows .syntax"
what did i do wrong?
Missile should act like a knockback in this case, but i get an error when saving the map: "m is not a type that allows .syntax"
JASS:
scope Bash initializer Event
private struct CreateEx extends array
implement MissileStruct
endstruct
function Actions takes nothing returns boolean
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real x2 = GetSpellTargetX()
local real y2 = GetSpellTargetY()
local real x3
local real y3
local real angle = bj_RADTODEG * Atan2(y2 - y, x2 - x)
local real angle2
local unit FoG
local group g = CreateGroup()
local Missle m
call GroupEnumUnitsInRange(g, x, y, 225.00, null)
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
set x3 = GetUnitX(FoG)
set y3 = GetUnitY(FoG)
set angle2 = bj_RADTODEG * Atan2(y3 - y, x3 - x)
if (angle > angle2 - 40.00) and (angle < angle2 + 40.00) and UnitAlive(FoG) and IsUnitEnemy(FoG, GetTriggerPlayer()) then
call UnitDamageTarget(u, FoG, 300.00, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
set m = Missile.createEx(FoG, x3 + 500*Cos(angle2), y3 + 500*Sin(angle2), 0)
set m.speed = 15.
set m.collision = 32
set m.acceleration = -0.2
call CreateEx.launch(m)
endif
endloop
call DestroyGroup(g)
set g = null
set u = null
return false
endfunction
private function Event takes nothing returns nothing
call RegisterSpellEffectEvent('Absh', function Actions)
endfunction
endscope
what did i do wrong?