13 years
edited 13 years
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)
1 function Spelldamage_Func003C takes unit Target returns boolean
2 if ( not ( IsUnitType(Target, UNIT_TYPE_HERO) == true ) ) then
3 return false
4 endif5 return true
6 endfunction7 8 function Spelldamage_Func004C takes unit Target, unit Caster returns boolean
9 if ( not ( udg_spellarmor[GetConvertedPlayerId(GetOwningPlayer(Target))] > udg_spellpenetration[GetConvertedPlayerId(GetOwningPlayer(Caster))] ) ) then
10 return false
11 endif12 return true
13 endfunction14 15 function Spelldamage_Func007Func001C takes unit Caster, unit Target returns boolean
16 if ( not ( ( GetRandomInt(1, 40) + GetHeroStatBJ(bj_HEROSTAT_INT, Caster, true) ) <= ( GetRandomInt(1, 35) + GetHeroStatBJ(bj_HEROSTAT_INT, Target, true) ) ) ) then
17 return false
18 endif19 return true
20 endfunction21 22 function Spelldamage_Func007C takes unit Target returns boolean
23 if ( not ( IsUnitType(Target, UNIT_TYPE_HERO) == true ) ) then
24 return false
25 endif26 return true
27 endfunction28 29 function Spelldamage_Actions takes unit Target, unit Caster, real basedamage returns bolean
30 local real spelldamage; tempspellarmor
31 local bolean32 set spelldamage = ( basedamage + udg_spelldamagebonus[GetConvertedPlayerId(GetOwningPlayer(Caster))] * udg_spelldamagebonuspercent[GetConvertedPlayerId(GetOwningPlayer(udg_FSCaster))])
33 if ( Spelldamage_Func003C( Target ) ) then
34 set tempspellarmor = udg_spellarmor[GetConvertedPlayerId(GetOwningPlayer(Target))]
35 else36 endif37 if ( Trig_Spelldamage_Func004C( Target, Caster ) ) then
38 set tempspellarmor = tempspellarmor - udg_spellpenetration[GetConvertedPlayerId(GetOwningPlayer(Caster))]
39 set spelldamage = ( spelldamage * ( 1 - ( ( tempspellarmor * 0.06 ) / ( 1 + ( 0.06 * tempspellarmor ) ) ) ) )
40 else41 endif42 set tempspelldamage = (( tempspelldamage - udg_spellreduction[GetConvertedPlayerId(GetOwningPlayer(Target))]* ( 1 - udg_spelldamagereductionpercent[GetConvertedPlayerId(GetOwningPlayer(Target) )) )
43 if ( Trig_Spelldamage_Func007C( Caster, Target ) ) then
44 if ( Trig_Spelldamage_Func007Func001C( Target ) ) then
45 set tempdamage = ( udg_FSSheepdealsdamage * 0.50 )
46 set SDsave = true
47 else48 set save = false
49 endif50 else51 endif52 call UnitDamageTargetBJ( udg_FSCaster, udg_FSSheepDealsTarget, udg_FSSheepdealsdamage, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
53 return SDsave54 endfunction
I hope you feel at home here 

