- Joined
- Aug 26, 2004
- Messages
- 150
Hi Ihav troubles with a dummy spell, this is the code I did to order the dummy to target a point:
and I call it in this function:
problem is that it doesnt cast the spell, ive given the dummy unit a visible model to see if it atleast works and the function created the dummy unit but it doesnt cast the spell it just stands there until the expiration timer end n it dies. This is happening everytime I use this function.
JASS:
function DUMMYCAST2POINT takes unit realCaster, location spawnLoc, integer abilityRawCode, location attackLoc, real waitTime, string ORDER, real expirationTimer returns nothing
local unit dummyCaster
call TriggerSleepAction(waitTime)
call CreateNUnitsAtLoc( 1, 'n001', GetOwningPlayer(realCaster), spawnLoc, 180 )
set dummyCaster = GetLastCreatedUnit()
call UnitApplyTimedLife( dummyCaster, 'BTLF', expirationTimer )
call UnitAddAbility( dummyCaster, abilityRawCode )
call IssuePointOrderLoc( dummyCaster, ORDER, attackLoc )
call UnitRemoveAbility( dummyCaster, abilityRawCode )
call RemoveLocation(attackLoc)
call RemoveLocation(spawnLoc)
set attackLoc = null
set spawnLoc = null
set realCaster = null
set dummyCaster = null
endfunction
and I call it in this function:
JASS:
function Trig_Elemental_Bolt_Actions takes nothing returns nothing
local unit caster = GetAttacker()
local unit target = GetTriggerUnit()
local location loccaster = GetUnitLoc(caster)
local location loctarget = GetUnitLoc(target)
call DUMMYCAST2POINT(caster,loccaster, 'AOsh', loctarget, 0.00, "impale", 15.00)
call RemoveLocation(loccaster)
set loccaster = null
set target = null
set caster = null
endfunction
problem is that it doesnt cast the spell, ive given the dummy unit a visible model to see if it atleast works and the function created the dummy unit but it doesnt cast the spell it just stands there until the expiration timer end n it dies. This is happening everytime I use this function.