- Joined
- Sep 29, 2006
- Messages
- 447
okay so i made a spell called force choke (yes, like darth vader) and basically what it does is lift a unit off the ground and deal damage over time, then sets it back on the ground after 4 seconds. everything works except that if a hero dies while suspended, when it revives, it stays in the air. how do i fix this? my trigger adds crow form, raises the unit, waits 4 seconds, puts the unit down, and removes crow form. so how can i get it so that when a unit revives it is not suspended anymore?
here's my script:
here's my script:
JASS:
function Trig_force_choke_JASS_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A028'
endfunction
function Trig_force_choke_JASS_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit dummy
local unit TempUnit = GetSpellTargetUnit()
local location TempPoint = GetUnitLoc(TempUnit)
call PauseUnit( TempUnit, true )
call UnitAddAbility( TempUnit, 'Amrf' )
call SetUnitFlyHeight( TempUnit, 120.00, 60.00 )
set dummy = CreateUnitAtLoc( GetOwningPlayer(caster), 'h005', TempPoint, 270.00 )
call UnitAddAbility( dummy, 'A027' )
call SetUnitAbilityLevel( dummy, 'A027', GetUnitAbilityLevel(caster, 'A028') )
call IssueTargetOrder( dummy, "drain", TempUnit )
call UnitApplyTimedLife( dummy, 'BTLF', 7.00 )
call TriggerSleepAction( 4.00 )
call SetUnitFlyHeight( TempUnit, 0.00, 160.00 )
call UnitRemoveAbility( TempUnit, 'Amrf' )
call PauseUnit( TempUnit, false )
call RemoveLocation(TempPoint)
set caster = null
set TempUnit = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_force_choke_JASS takes nothing returns nothing
set gg_trg_force_choke_JASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_force_choke_JASS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_force_choke_JASS, Condition( function Trig_force_choke_JASS_Conditions ) )
call TriggerAddAction( gg_trg_force_choke_JASS, function Trig_force_choke_JASS_Actions )
endfunction