- Joined
- Jul 9, 2008
- Messages
- 253
Hi everybody, I've got this spell that does an effect everytime you hit a unit, but the thing is that the first time it hits it causes a freeze of like 1 second. And all hits following make the map freeze for like 0.3 seconds.
Can anyone tell me the cause of this?
I use GUI-Friendly Damage Detection -- v1.2.0 -- by Weep
I'll post the trigger
Trigger:
Can anyone tell me the cause of this?
I use GUI-Friendly Damage Detection -- v1.2.0 -- by Weep
I'll post the trigger
Trigger:
JASS:
// Spell ID //
constant function Infecting_Claws_ID takes nothing returns integer
return 'A00J'
endfunction
// Dummy Unit ID //
constant function Infecting_Claws_Unit_ID takes nothing returns integer
return 'h006'
endfunction
// Dummy Increase Spell ID //
constant function Infecting_Claws_Attack_ID takes nothing returns integer
return 'A00I'
endfunction
// Dummy Slow Spell ID //
constant function Infecting_Claws_Move_ID takes nothing returns integer
return 'A00V'
endfunction
function Trig_Infecting_Claws_Actions takes nothing returns nothing
local unit attacker = udg_GDD_DamageSource
local unit attacked = udg_GDD_DamagedUnit
local real cx = GetUnitX( attacker )
local real cy = GetUnitY( attacker )
local real tx = GetUnitX( attacked )
local real ty = GetUnitY( attacked )
local unit dummyone
local unit dummytwo
local player p = GetOwningPlayer( attacker )
local real facing = GetUnitFacing( attacker )
local integer level = GetUnitAbilityLevel( attacker , Infecting_Claws_ID() )
//
set dummyone = CreateUnit( p , Infecting_Claws_Unit_ID() , cx , cy , facing )
call UnitAddAbility( dummyone , Infecting_Claws_Attack_ID() )
call SetUnitAbilityLevel( dummyone , Infecting_Claws_Attack_ID() , level )
call UnitApplyTimedLife( dummyone , 'BTLF' , 1. )
call IssueTargetOrder( dummyone , "bloodlust" , attacker )
//
set dummytwo = CreateUnit( p , Infecting_Claws_Unit_ID() , tx , ty , facing )
call UnitAddAbility( dummytwo , Infecting_Claws_Move_ID() )
call SetUnitAbilityLevel( dummytwo , Infecting_Claws_Move_ID() , level )
call UnitApplyTimedLife( dummytwo , 'BTLF' , 1. )
call IssueTargetOrder( dummytwo , "cripple" , attacked )
//
set attacker = null
set attacked = null
set dummyone = null
set dummytwo = null
set p = null
endfunction
// Spell Condition //
function Trig_Infecting_Claws_Conditions takes nothing returns boolean
return GetUnitAbilityLevel( udg_GDD_DamageSource , Infecting_Claws_ID() ) > 0
endfunction
//===========================================================================
function InitTrig_Infecting_Claws takes nothing returns nothing
local trigger t = CreateTrigger( )
local integer i = 0
loop
exitwhen i == 16
call TriggerRegisterVariableEvent( t , "udg_GDD_Event" , EQUAL , 0 )
set i = i + 1
endloop
call TriggerAddCondition( t , Condition( function Trig_Infecting_Claws_Conditions ) )
call TriggerAddAction( t , function Trig_Infecting_Claws_Actions )
set t = null
endfunction