I've created a pretty basic leap spell but I'm not sure on how to make it MUI. I've implemented KaTTaNa's Local Handle Vars into the map which I'm not even sure is required anyway heres the trigger.
Could somebody please explain to me how to make this MUI or even do it for me
I can attach the map if necessary
JASS:
function MoveFwd takes nothing returns nothing
local trigger Fwd = GetTriggeringTrigger()
local unit Caster = GetHandleUnit( udg_Cache, "Caster" )
local real DistanceMax = 1000.00
local real DistanceCurrent = GetHandleReal( udg_Cache, "DC" )
local location TempLoc1 = PolarProjectionBJ(GetUnitLoc(Caster), 20.00, GetUnitFacing(Caster))
local location TempLoc2 = PolarProjectionBJ(GetUnitLoc(Caster), 200.00, GetUnitFacing(Caster))
local effect Flame1 = GetHandleEffect( udg_Cache, "Flame1" )
local effect Flame2 = GetHandleEffect( udg_Cache, "Flame2" )
local effect Flame3 = GetHandleEffect( udg_Cache, "Flame3" )
call SetUnitPathing( Caster, false )
call ClearSelectionForPlayer( GetOwningPlayer(Caster) )
if DistanceCurrent >= DistanceMax then
call SetUnitPositionLoc( Caster, TempLoc1 )
call RemoveLocation(TempLoc1)
call SelectUnitAddForPlayer( Caster, GetOwningPlayer(Caster) )
call SetUnitTimeScale( Caster, 1.00 )
call SetHandleHandle( udg_Cache, "Caster", null )
call SetHandleReal( udg_Cache, "DC", 0 )
call SetUnitPathing( Caster, true )
call IssuePointOrderLoc( Caster, "move", TempLoc2 )
call RemoveLocation(TempLoc2)
call DestroyEffect(Flame1)
call DestroyEffect(Flame2)
call DestroyEffect(Flame3)
call DestroyTrigger(Fwd)
else
call SetUnitPositionLoc( Caster, TempLoc1 )
call RemoveLocation(TempLoc1)
set DistanceCurrent = DistanceCurrent + 20
call SetHandleReal( udg_Cache, "DC", DistanceCurrent )
endif
endfunction
function LeapSetup takes nothing returns nothing
local trigger Fwd = CreateTrigger()
local timer LeapTimer = CreateTimer()
local unit Caster = GetTriggerUnit()
local effect Flame1 = AddSpecialEffectTarget( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", Caster, "weapon" )
local effect Flame2 = AddSpecialEffectTarget( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", Caster, "foot, left" )
local effect Flame3 = AddSpecialEffectTarget( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", Caster, "foot, right" )
call SetHandleHandle( udg_Cache, "Flame1", Flame1 )
call SetHandleHandle( udg_Cache, "Flame2", Flame2 )
call SetHandleHandle( udg_Cache, "Flame3", Flame3 )
call IssueImmediateOrder( Caster, "stop" )
call SetUnitAnimation( Caster, "slam" )
call SetUnitTimeScale( Caster, 0.5 )
call SetHandleHandle( udg_Cache, "Caster", Caster )
call TimerStart( LeapTimer, 0.03, true, null )
call TriggerRegisterTimerExpireEvent( Fwd, LeapTimer )
call TriggerAddAction( Fwd, function MoveFwd )
endfunction
//===========================================================================
function InitTrig_Leap takes nothing returns nothing
local trigger Leap = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( Leap, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( Leap, function LeapSetup )
endfunction
Could somebody please explain to me how to make this MUI or even do it for me
I can attach the map if necessary