Somatic
You can change this now in User CP.
- Reaction score
- 84
JASS:
function Trig_Emp_Shell_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A02J039; ) ) then
return false
endif
return true
endfunction
function Shell_Check takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) != true )
endfunction
function Mechnical_ID takes unit f returns boolean
if ( not ( IsUnitType(f, UNIT_TYPE_MECHANICAL) == true ) ) then
return false
endif
return true
endfunction
function Trig_Emp_Shell_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local location Temp_Point = GetUnitLoc(Caster)
local location Temp_Point2 = GetSpellTargetLoc()
local group Temp_Group = CreateGroup()
local unit f
set Temp_Group = GetUnitsInRangeOfLocMatching(500.00, Temp_Point2, Condition(function Shell_Check))
set f = FirstOfGroup(Temp_Group)
loop
exitwhen f == null
if ( Mechnical_ID(f) ) then
call UnitDamageTargetBJ( Caster, f, 500, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
call DoNothing( )
endif
call CreateNUnitsAtLoc( 1, 039;nvul039;, GetOwningPlayer(Caster), Temp_Point2, bj_UNIT_FACING )
call ShowUnitHide( GetLastCreatedUnit() )
call UnitAddAbilityBJ( 039;A02W039;, GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "purge", f )
call UnitApplyTimedLifeBJ( 1.00, 039;BTLF039;, GetLastCreatedUnit() )
call GroupRemoveUnit(Temp_Group,f)
endloop
set Caster = null
set f = null
call DestroyGroup (Temp_Group)
call RemoveLocation(Temp_Point)
call RemoveLocation(Temp_Point2)
endfunction
//===========================================================================
function InitTrig_Emp_Shell takes nothing returns nothing
set gg_trg_Emp_Shell = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Emp_Shell, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Emp_Shell, Condition( function Trig_Emp_Shell_Conditions ) )
call TriggerAddAction( gg_trg_Emp_Shell, function Trig_Emp_Shell_Actions )
endfunction
I have a problem when running this trigger, I get a Massive Lag and then after the purge effect runs off then it recovers from the lag. I wonder if its because of the Code (I am trying to remove the bj but i dunno what natives to use)
Btw Is it possible to lag a game if you set a purge spell wrongly?