- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright, I'm trying to create a Mass Teleport spell using blink and trigger based special effects. Also, instead of normal mass teleport that only moves your units, this can move allied units as well.
The blink has a 1.2 second cast time, to allow the special effects to do what they need to do.
My biggest problem here is that I have issues with Wait type commands and Select every unit in location.
I wanted to set pick every unit in location and attach them to a local variable, then refer to that variable afterward, but the pick every unit in location I know how to do creates a new function, which doesn't work with local variables. I was thinking of placing them in a struct, but I'm only on the fringe of knowledge with structs and am not sure if this'd work or exactly how to set it up.
Right now, it's a single unit blink spell with special effects.
The spell HAS to be MUI/MPI. Anyways, here it is:
The blink has a 1.2 second cast time, to allow the special effects to do what they need to do.
My biggest problem here is that I have issues with Wait type commands and Select every unit in location.
I wanted to set pick every unit in location and attach them to a local variable, then refer to that variable afterward, but the pick every unit in location I know how to do creates a new function, which doesn't work with local variables. I was thinking of placing them in a struct, but I'm only on the fringe of knowledge with structs and am not sure if this'd work or exactly how to set it up.
Right now, it's a single unit blink spell with special effects.
The spell HAS to be MUI/MPI. Anyways, here it is:
JASS:
function Trig_Blink_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'Blin' ) ) then
return false
endif
return true
endfunction
function Trig_Blink_Copy_Actions takes nothing returns nothing
local effect SFX
local effect SFX2
call AddSpecialEffectLocBJ( GetUnitLoc(GetTriggerUnit()), "Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl" )
set SFX = GetLastCreatedEffectBJ()
call PolledWait( 0.60 )
call AddSpecialEffectLocBJ( GetSpellTargetLoc(), "Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl" )
set SFX2 = GetLastCreatedEffectBJ()
call PolledWait( 0.30 )
call DestroyEffect( SFX )
call PolledWait( 1.20 )
call DestroyEffect( SFX2 )
endfunction
//===========================================================================
function InitTrig_Blink_Copy takes nothing returns nothing
set gg_trg_Blink_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Blink_Copy, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Blink_Copy, Condition( function Trig_Blink_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Blink_Copy, function Trig_Blink_Copy_Actions )
endfunction