- Joined
- Feb 22, 2013
- Messages
- 161
So I am making a Spell pack that is similar to Ashe.. However, I can't seem to figure out how I to stack the focus buff to 100 as it does in League.. Can someone tell me how to make buffs stackable?
Some spell wont show buff even if u give them one. I think instead of giving a buff, why dont u try using something like the periodic trigger to make that 100 stack?
function EnableFocusNotAttacking takes nothing returns nothing
call EnableTrigger(gg_trg_FocusNotAttacking)
if TriggerEvaluate(gg_trg_FocusNotAttacking) then
call TriggerExecute(gg_trg_FocusNotAttacking)
endif
endfunction
function FocusInCombat takes nothing returns nothing
local timer t = CreateTimer()
local integer focusGain = udg_FC_initialGainInCombat + udg_FC_gainPerLevelInCombat*GetHeroLevel(udg_TestHero)
if udg_TestHero == GetAttacker() and udg_FC_focusStack < 100 then
set udg_FC_focusStack = udg_FC_focusStack + focusGain
call TimerStart(t, 3.00, false, function EnableFocusNotAttacking)
call DisableTrigger(gg_trg_FocusNotAttacking)
elseif udg_FC_focusStack >= 100 then
set udg_FC_focusStack = 100
return
endif
set t = null
endfunction
function InitTrig_FocusInCombat takes nothing returns nothing
local integer index
set gg_trg_FocusInCombat = CreateTrigger( )
set index = 0
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_FocusInCombat, Player(index), EVENT_PLAYER_UNIT_ATTACKED, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddAction( gg_trg_FocusInCombat, function FocusInCombat )
endfunction
globals
timer focusLoopTimer = CreateTimer()
endglobals
function FocusNotAttackingGain takes nothing returns nothing
local integer focusGain = udg_FC_initialGainNoCombat + udg_FC_gainPerLevelNoCombat*GetHeroLevel(udg_TestHero)
set udg_FC_focusStack = udg_FC_focusStack + focusGain
call SetUnitAbilityLevel(udg_TestHero, 'FC00', udg_FC_focusStack)
if GetUnitAbilityLevel(udg_TestHero, 'FC00') >= 100 then
call PauseTimer(focusLoopTimer)
set udg_FC_focusStack = 100
call SetUnitAbilityLevel(udg_TestHero, 'FC00', udg_FC_focusStack)
endif
endfunction
function FocusNotAttackingStart takes nothing returns nothing
if IsTriggerEnabled(GetTriggeringTrigger()) == true then
call TimerStart(focusLoopTimer, 1.00, true, function FocusNotAttackingGain)
else
call PauseTimer(focusLoopTimer)
endif
endfunction
function InitTrig_FocusNotAttacking takes nothing returns nothing
set gg_trg_FocusNotAttacking = CreateTrigger( )
call TriggerAddAction( gg_trg_FocusNotAttacking, function FocusNotAttackingStart )
endfunction
if its a triggered spell u have to make a dummy unit to cast the buff on the unit.