T
The_Prophet
Guest
ok this spell im making is supposed to make a unit start floating in the air. And as long as the casting unit keeps channeling the spell, the unit stays midair, and once the caster stops the ability the unit plumets to the ground. I based the ability off lifedrain since i though that would be the easiest way to go. Testing it shows the results hi1, and hi3, which means that the bolded part is being skipped. Maby i made some obvious mistake, idk, any suggestions are appreciated.
btw 'Bdcl' is the buff Life Drain (Caster)
btw 'Bdcl' is the buff Life Drain (Caster)
Code:
function Trig_Holy_Light_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A002'
endfunction
function Trig_Holy_Light_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local unit c = GetSpellAbilityUnit()
local location l = GetUnitLoc(u)
local effect e
call PauseUnit( u, true )
set e = AddSpecialEffectLoc("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl", l)
set e = AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\ReviveNightElf\\ReviveNightElf.mdl", l)
call UnitAddAbility(u,ChangeableFlyingHeightAllowerId())
call UnitRemoveAbility(u, ChangeableFlyingHeightAllowerId())
call SetUnitFlyHeight(u, 750, 150 )
call DisplayTextToForce( GetPlayersAll(), "hi1" )
[B] loop
exitwhen not (UnitHasBuffBJ(c, 'Bdcl'))
call TriggerSleepAction(0.5)
call DisplayTextToForce( GetPlayersAll(), "hi2" )
endloop[/B]
call SetUnitFlyHeight(u, 0, 1400 )
call PauseUnit( u, false )
call DisplayTextToForce( GetPlayersAll(), "hi3" )
set u = null
call DestroyEffect(e)
endfunction
//===========================================================================
function InitTrig_Holy_Light takes nothing returns nothing
set gg_trg_Holy_Light = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Holy_Light, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Holy_Light, Condition( function Trig_Holy_Light_Conditions ) )
call TriggerAddAction( gg_trg_Holy_Light, function Trig_Holy_Light_Actions )
endfunction


