- Joined
- Feb 28, 2007
- Messages
- 3,479
Short question. How do I make this MUI?
JASS:
scope Blink initializer Init
globals
private unit caster
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00E'
endfunction
private function RemoveBlink takes nothing returns nothing
call UnitRemoveAbility(caster,'A00N')
set caster = null
endfunction
private function Actions takes nothing returns nothing
local location spellLoc = GetSpellTargetLoc()
local timer t = NewTimer()
set caster = GetSpellAbilityUnit()
call UnitAddAbility(caster,'A00N')
call IssuePointOrderLoc(caster,"blink",spellLoc)
call RemoveLocation(spellLoc)
call TimerStart(t,0.35,false,function RemoveBlink)
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function Conditions))
call TriggerAddAction(t,function Actions)
set t = null
endfunction
endscope