Hello all, I'm making a system that allows normal units to gain experience and get ranks however I'm getting quite some compile errors and I don't see 'em:S
I think it might be because 1 missplaced ) but I looked at it 100's of times and I can't seem to find it. So I'm hoping any of you can help me^.^
Here's my trigger:
The errors are alot of expected ) and expected endif
I think it might be because 1 missplaced ) but I looked at it 100's of times and I can't seem to find it. So I'm hoping any of you can help me^.^
Here's my trigger:
JASS:
function Trig_UES_Conditions takes nothing returns boolean
return(( GetUnitAbilityLevel(GetKillingUnit(), 039;A008039;) > 0 )And(GetUnitAbilityLevel(GetKillingUnit(), 039;A008039;) < 95)And(IsPlayerEnemy(GetOwningPlayer(GetKillingUnit()),GetOwningPlayer(GetDyingUnit()))))
endfunction
function Trig_UES_Actions takes nothing returns nothing
set udg_KillingUnit = GetKillingUnit()
set udg_DyingUnit = GetTriggerUnit()
set udg_KillingUnitLife = R2I(GetUnitState(udg_KillingUnit, UNIT_STATE_MAX_LIFE ))
set udg_DyingUnitLife = R2I(GetUnitState(udg_DyingUnit, UNIT_STATE_MAX_LIFE ))
if(udg_DyingUnitLife >= udg_KillingUnitLife)then
if((udg_DyingUnitLife / udg_KillingUnitLife) > 5) then
set udg_UnitExperience = (GetUnitAbilityLevel(udg_KillingUnit, 039;A008039;) + 8)
else
set udg_UnitExperience = ((udg_DyingUnitLife / udg_KillingUnitLife) + (GetUnitAbilityLevel(udg_KillingUnit, 039;A008039;) + 2))
endif
else
if((udg_KillingUnitLife / udg_DyingUnitLife) > 3)then
set udg_UnitExperience = (GetUnitAbilityLevel(udg_KillingUnit, 039;A008039;) + 3)
else
set udg_UnitExperience = (GetUnitAbilityLevel(udg_KillingUnit, 039;A008039;) + 4)
endif
endif
call SetUnitAbilityLevel(udg_KillingUnit, 039;A008039;, udg_UnitExperience)
if((udg_UnitExperience >= 9)And(udg_UnitExperience <= 23))then
if(GetUnitAbilityLevel(udg_KillingUnit, 039;A009039;) > 0) then
else
call UnitAddAbility(udg_KillingUnit, 039;A009039;)
endif
else
if((udg_UnitExperience >= 24)And(udg_UnitExperience <= 44))then
if(GetUnitAbilityLevel(udg_KillingUnit, 039;A00A039;) > 0) then
else
call UnitRemoveAbility(udg_KillingUnit, 039;A009039;)
call UnitAddAbility(udg_KillingUnit, 039;A00A039;)
endif
else
if(UnitExperience >= 45) then
if(GetUnitAbilityLevel(udg_KillingUnit, 039;A00B039;) > 0) then
else
call UnitRemoveAbility(udg_KillingUnit, 039;A00A039;)
call UnitAddAbility(udg_KillingUnit, 039;A00B039;)
endif
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_UES takes nothing returns nothing
set gg_trg_UES = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_UES, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_UES, Condition( function Trig_UES_Conditions ) )
call TriggerAddAction( gg_trg_UES, function Trig_UES_Actions )
endfunction
The errors are alot of expected ) and expected endif