- Joined
- Sep 9, 2006
- Messages
- 92
Using channel as the base spell and it is a point target; trying to get that location to use its x and y values..
clearly not a complete spell but i get an error on the line defining "local real angle" saying "Undeclared variable GetSpellTargetLoc"
(and btw im pretty new to jass; im assumign there's a simple answer to this)
JASS:
scope Orb
globals
private constant integer ABILITY_ID = 'A003' //ability id of Spark Jump
private constant integer DUMMY_ORB_ID = 'h001' //orb id
endglobals
private struct data
static hashtable h = InitHashtable()
unit c
integer lvl
real dist
timer tim = CreateTimer()
static method periodic takes nothing returns nothing
endmethod
static method create takes nothing returns data
local data this = data.allocate()
local real x = GetLocationX(GetUnitLoc(GetTriggerUnit()))
local real y = GetLocationY(GetUnitLoc(GetTriggerUnit()))
local real angle = bj_RADTODEG * Atan2(GetLocationY(GetSpellTargetLoc) - y, GetLocationX(GetSpellTargetLoc) - x)
set .c = GetTriggerUnit()
set .lvl = GetUnitAbilityLevel(.c, ABILITY_ID)
set .dist = 400. + (200. * I2R(.lvl))
call IssuePointOrder(CreateUnit(GetOwningPlayer(.c), DUMMY_ORB_ID, x, y, 0), "move", (x + .dist * Cos(angle * bj_DEGTORAD)), (y + .dist * Sin(angle * bj_DEGTORAD)))
call SaveInteger(.h,GetHandleId(.tim),0,this)
call TimerStart(.tim,.01,true,function data.periodic)
return this
endmethod
static method Conditions takes nothing returns nothing
if GetSpellAbilityId() == ABILITY_ID then
call .create()
endif
endmethod
/////////////////////////////////////////////////////////////////////////////////////////
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( t, function data.Conditions )
endmethod
endstruct
endscope
(and btw im pretty new to jass; im assumign there's a simple answer to this)