dudeim
New Member
- Reaction score
- 22
Well as you can read in the title i'm getting this error: "Scope symbol redeclared: integer"
in this trigger
I've been out of jassing for some time now so should probably be a real simple stupid mistake I made but I can't find it.
For those who want to know what the spell does: When you get below x% of your health all damage taken for y hits will be reduced by z%.
Thanks
in this trigger
JASS:
scope ABlessedShield initializer Init
globals
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
//\\//\\//\\//\\//\\//\\//\\//\\CONFIG BELOW//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
private static real PERCENTAGE = 90 //this will trigger the ability at 90%
private static integer AID = 039;Amls039; //the abilities id
private static integer CHARGES = 5 //how many times the damage is reduced
private static integer REDUCTION = 50 //how much percent is reduced in this case 50%
private static boolean STACK = false //if set to true charges can go above the initial value otherwise they can't
private static integer MAXCHARGES = 5 //if you want the charges to stack but have a limit input it here if you want no limit input 0
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
//\\//\\//\\//\\//\\//\\//\\//\\END OF CONFIG//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
integer array currentcharges //to keep track of the current unit charges
endglobals
private function Cons takes nothing returns boolean
local real percent = (GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)/GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_LIFE))*100
if GetUnitAbilityLevel(GetTriggerUnit(),AID) > 0 and percent =< 35 then
return true
else
return false
endif
endfunction
private function Const takes nothing returns boolean
if currentcharges[GetUnitId(GetTriggerUnit())] > 0 then
return true
else
return false
endif
endfunction //this line
//and this line it says it's previous declared
private function Remove takes nothing returns nothing
set currentcharges[GetUnitId(GetTriggerUnit())] = currentcharges[GetUnitId(GetTriggerUnit())] - 1
call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE) + (GetEventDamage() * (REDUCTION/100)))
call BJDebugMsg("-1 op " + GetUnitName(GetTriggerUnit()))
endfunction
private function add takes nothing returns nothing
if currentcharges[GetUnitId(GetTriggerUnit())] = 0 then
set currentcharges[GetUnitId(GetTriggerUnit())] = 0
endif
if STACK == true then
if MAXCHARGES > 0 then
if (currentcharges + 5) < MAXCHARGES then
set currentcharges[GetUnitId(GetTriggerUnit())] = currentcharges[GetUnitId(GetTriggerUnit())] + CHARGES
else
set currentcharges[GetUnitId(GetTriggerUnit())] = MAXCHARGES
endif
else
set currentcharges[GetUnitId(GetTriggerUnit())] = currentcharges[GetUnitId(GetTriggerUnit())] + CHARGES
endif
else
set currentcharges[GetUnitId(GetTriggerUnit())] = CHARGES
endif
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local trigger t2 = CreateTrigger()
call Damage_RegisterEvent(t)
call TriggerAddCondition(t, Filter(function Cons))
call TriggerAddAction(t, function add)
call TriggerAddCondition(t2, Filter(function Const))
call TriggerAddAction(t2, function remove)
endfunction
endscope
I've been out of jassing for some time now so should probably be a real simple stupid mistake I made but I can't find it.
For those who want to know what the spell does: When you get below x% of your health all damage taken for y hits will be reduced by z%.
Thanks