- Joined
- Aug 21, 2008
- Messages
- 533
![Archian Considering :con: :con:](/forums/images_all/smilies/orcrolleyesarchian.gif)
JASS:
function Trig_the_system_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_RANGED_ATTACKER) == true ) ) then
return false
endif
return true
endfunction
function misslespeed takes unit u returns real
local real r
if ( GetUnitTypeId(u) == 'hrif') then
set r = 400.00
elseif ( GetUnitTypeId(u) == 'hsor') then
set r = 600.00
endif
return r
endfunction
function Trig_the_system_Actions takes nothing returns nothing
local unit uA = GetEventDamageSource()
local unit uD = GetTriggerUnit()
local location lA = GetUnitLoc(uA)
local location lD = GetUnitLoc(uD)
local real d = GetEventDamage()
local real speed= misslespeed(uA)
endfunction
function Trig_addaction_Actions takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_the_system, GetTriggerUnit(), EVENT_UNIT_DAMAGED )
endfunction
//===========================================================================
function InitTrig_the_system takes nothing returns nothing
set gg_trg_the_system = CreateTrigger( )
call TriggerAddCondition( gg_trg_the_system, Condition( function Trig_the_system_Conditions ) )
call TriggerAddAction( gg_trg_the_system, function Trig_the_system_Actions )
set gg_trg_addaction = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_addaction, GetPlayableMapRect() )
call TriggerAddAction( gg_trg_addaction, function Trig_addaction_Actions )
endfunction
pls help me