- Joined
- Aug 21, 2008
- Messages
- 533
I begann to make a systemw hich converts attacks from ranged units to missles are like the fireball from D2. So you can have you ranged unit behind your meele units and easily evade long ranged attacks.After i made some basic things i tried to test it but it the doesnt start like i had a syntax error,alltought the jasshelper did not find any
pls help me
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