Hello friends! I am completely new at jass (and programing overall) so perhaps this is a little to big step for me, but I am trying to create my own damaging system and thought that it should be easier to use a pre-made function in the map-script that I could call that does the math that every spell uses. (yes, it requires one more "call"/spell, but it simplifies things and helps me get an understanding of jass). Now, this script is basically a bunch of GUI-actions and conditions that I have modified. But I just seems to get a whole bunch of error-messages on compiling. Any help?
(the first line with error (function Spelldamage_actions...) seems to be line 414)
(the first line with error (function Spelldamage_actions...) seems to be line 414)
function Spelldamage_Func003C takes unit Target returns boolean
if ( not ( IsUnitType(Target, UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Spelldamage_Func004C takes unit Target, unit Caster returns boolean
if ( not ( udg_spellarmor[GetConvertedPlayerId(GetOwningPlayer(Target))] > udg_spellpenetration[GetConvertedPlayerId(GetOwningPlayer(Caster))] ) ) then
return false
endif
return true
endfunction
function Spelldamage_Func007Func001C takes unit Caster, unit Target returns boolean
if ( not ( ( GetRandomInt(1, 40) + GetHeroStatBJ(bj_HEROSTAT_INT, Caster, true) ) <= ( GetRandomInt(1, 35) + GetHeroStatBJ(bj_HEROSTAT_INT, Target, true) ) ) ) then
return false
endif
return true
endfunction
function Spelldamage_Func007C takes unit Target returns boolean
if ( not ( IsUnitType(Target, UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Spelldamage_Actions takes unit Target, unit Caster, real basedamage returns bolean
local real spelldamage; tempspellarmor
local bolean
set spelldamage = ( basedamage + udg_spelldamagebonus[GetConvertedPlayerId(GetOwningPlayer(Caster))] * udg_spelldamagebonuspercent[GetConvertedPlayerId(GetOwningPlayer(udg_FSCaster))])
if ( Spelldamage_Func003C( Target ) ) then
set tempspellarmor = udg_spellarmor[GetConvertedPlayerId(GetOwningPlayer(Target))]
else
endif
if ( Trig_Spelldamage_Func004C( Target, Caster ) ) then
set tempspellarmor = tempspellarmor - udg_spellpenetration[GetConvertedPlayerId(GetOwningPlayer(Caster))]
set spelldamage = ( spelldamage * ( 1 - ( ( tempspellarmor * 0.06 ) / ( 1 + ( 0.06 * tempspellarmor ) ) ) ) )
else
endif
set tempspelldamage = (( tempspelldamage - udg_spellreduction[GetConvertedPlayerId(GetOwningPlayer(Target))]* ( 1 - udg_spelldamagereductionpercent[GetConvertedPlayerId(GetOwningPlayer(Target) )) )
if ( Trig_Spelldamage_Func007C( Caster, Target ) ) then
if ( Trig_Spelldamage_Func007Func001C( Target ) ) then
set tempdamage = ( udg_FSSheepdealsdamage * 0.50 )
set SDsave = true
else
set save = false
endif
else
endif
call UnitDamageTargetBJ( udg_FSCaster, udg_FSSheepDealsTarget, udg_FSSheepdealsdamage, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
return SDsave
endfunction
I hope you feel at home here 
