Heres a spell that is like Tinki's GUI Time Stop, but its in vJASS and actually makes a effect at the enemy units inside the AoE.
Time Stop - Freezes the passage of time for enemy units inside a AoE, causing them to be unable to move.
The problem is, it doesnt work. The AbilId is correct and I've checked the ability a bunch of times now.. If anyone helps, +rep.
Time Stop - Freezes the passage of time for enemy units inside a AoE, causing them to be unable to move.
The problem is, it doesnt work. The AbilId is correct and I've checked the ability a bunch of times now.. If anyone helps, +rep.
JASS:
scope TimeStop
globals
private constant integer AbilId = 039;A00B039;
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == AbilId
endfunction
private function TimeStopConditions takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD) == false
endfunction
private function Callback takes nothing returns nothing
endfunction
private function TimeStop_Actions takes nothing returns nothing
local group g
local group g2
local unit c = GetTriggerUnit()
local unit PickedUnit
local location Loc = GetSpellTargetLoc()
local real x = GetLocationX(Loc)
local real y = GetLocationY(Loc)
local real PickedUnitX
local real PickedUnitY
local integer Level = GetUnitAbilityLevel(c, AbilId)
call GroupEnumUnitsInRange(g, x, y, 200,Condition(function TimeStopConditions))
loop
set PickedUnit = FirstOfGroup(g)
exitwhen PickedUnit == null
if IsUnitEnemy(PickedUnit,GetOwningPlayer(c)) then
set PickedUnitX = GetUnitX(PickedUnit)
set PickedUnitY = GetUnitY(PickedUnit)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl", PickedUnitX, PickedUnitY))
call SetUnitTimeScale(PickedUnit, 0)
call PauseUnit(PickedUnit, true)
call GroupAddUnit(g2, PickedUnit)
endif
call GroupRemoveUnit(g, PickedUnit)
endloop
set PickedUnit = null
call TriggerSleepAction(2+Level)
call ForGroup(g2,function Callback)
loop
set PickedUnit = FirstOfGroup(g2)
exitwhen PickedUnit == null
set PickedUnitX = GetUnitX(PickedUnit)
set PickedUnitY = GetUnitY(PickedUnit)
call SetUnitTimeScale(PickedUnit, 100)
call PauseUnit(PickedUnit, false)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl", PickedUnitX, PickedUnitY))
call GroupRemoveUnit(g2, PickedUnit)
endloop
set PickedUnit = null
endfunction
//===========================================================================
function InitTrig_Time_Stop takes nothing returns nothing
local trigger Time_Stop = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(Time_Stop, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition( Time_Stop,Condition(function Conditions))
call TriggerAddAction( Time_Stop, function TimeStop_Actions )
endfunction
endscope