- Joined
- Feb 3, 2009
- Messages
- 3,292
Well bellow is the code, and yes this is the trigger causing it, because if i disable it, then map works again. But i really need to make this my trigger work :/
+rep for solutions
+rep for solutions
JASS:
globals
location array p
endglobals
// function for group conditions
function Group_Con takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
// function for group actions
function Group_Act takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(), p[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
endfunction
// function for trigger conditions
function Teleport_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00B'
endfunction
// function for trigger actions
function Teleport_Actions takes nothing returns nothing
local unit x = GetTriggerUnit()
local location px = GetUnitLoc(x)
local group g = GetUnitsInRangeOfLocMatching(500.00, GetUnitLoc(x), Condition(function Group_Con))
local real delay = 1.6 - ((GetUnitAbilityLevel(x, 'A00B') * 0.5))
local string e = "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl"
// End of locals, start of main code.
set p[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetSpellTargetLoc()
call TriggerSleepAction(delay)
call AddSpecialEffectLoc(e , px)
call ForGroup( g, function Group_Act )
// Nulling variables
set x = null
call RemoveLocation(p[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
call RemoveLocation(px)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Teleport takes nothing returns nothing
local trigger Teleport = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( Teleport, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( Teleport, Condition( function Teleport_Conditions ) )
call TriggerAddAction( Teleport, function Teleport_Actions )
endfunction