- Joined
- Jun 7, 2008
- Messages
- 37
What does it mean? I keep getting an error whenever I save my map.
Here are my triggers where I use globals:
Here are my triggers where I use globals:
JASS:
globals
group udg_Targets
endglobals
function Trig_Mark_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00I'
endfunction
function Trig_Mark_Actions takes nothing returns nothing
local unit r
local unit c = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local integer targetamount
local integer amount = 3*GetUnitAbilityLevel(c, 'A00I')
call GroupAddUnit(udg_Targets, t)
set targetamount = CountUnitsInGroup(udg_Targets)
if targetamount > amount then
set r = FirstOfGroup(udg_Targets)
call GroupRemoveUnit(udg_Targets, r)
call UnitRemoveBuffs(r, true, true)
endif
set r = null
set c = null
set t = null
endfunction
//===========================================================================
function InitTrig_Mark takes nothing returns nothing
set gg_trg_Mark = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mark, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mark, Condition( function Trig_Mark_Conditions ) )
call TriggerAddAction( gg_trg_Mark, function Trig_Mark_Actions )
endfunction
JASS:
globals
group udg_Targets
endglobals
function Trig_Throw_Knives_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00J'
endfunction
function Trig_Throw_Knives_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local location l = GetUnitLoc(c)
local real level = 30*GetUnitAbilityLevel(c, 'A00J')
local unit t
local unit r
local real damage = 60*level
local integer loops = CountUnitsInGroup(udg_Targets)
loop
set t = FirstOfGroup(udg_Targets)
call CreateUnitAtLoc(GetOwningPlayer(c), 'o00A', l, 0.)
set r = GetLastCreatedUnit()
call IssueTargetOrder(r, "attackonce", t)
call UnitDamageTarget(c, t, damage, true, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE, WEAPON_TYPE_METAL_LIGHT_SLICE)
call UnitApplyTimedLife(r, 'B003', 4.)
set loops = loops - 1
exitwhen loops == 0
endloop
endfunction
//===========================================================================
function InitTrig_Throw_Knives takes nothing returns nothing
set gg_trg_Throw_Knives = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Throw_Knives, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mark, Condition( function Trig_Throw_Knives_Conditions ) )
call TriggerAddAction( gg_trg_Throw_Knives, function Trig_Throw_Knives_Actions )
endfunction