Помогите найти ошибку! Код выполняестся до set mana = mana + 10*GetUnitAbilityLevelSwapped('A000', u)
Code
function Trig_IceMana_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_IceMana_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit t = GetSpellTargetUnit()
local integer i = 1
local integer mana
local unit dummy
call CreateNUnitsAtLoc( 1, 'e006', GetOwningPlayer(u), PolarProjectionBJ(GetUnitLoc(t), 100, 0), bj_UNIT_FACING )
set udg_IceUnit[1] = GetLastCreatedUnit()
set udg_IceUnit[2] = t
set dummy = GetLastCreatedUnit()
set udg_Angle[6] = 0.00
call EnableTrigger( gg_trg_MoveIce )
loop
exitwhen i == 6
if GetUnitStateSwap(UNIT_STATE_MANA, t) >=10.00 * I2R(GetUnitAbilityLevelSwapped('A000', u)) then
call SetUnitManaBJ( t, ( GetUnitStateSwap(UNIT_STATE_MANA, t) - 10*GetUnitAbilityLevelSwapped('A000', u) ) )
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",GetUnitLoc(t)))
set mana = mana + 10*GetUnitAbilityLevelSwapped('A000', u)
call PolledWait(1.00)
endif
set i = i+1
endloop
call DisableTrigger( gg_trg_MoveIce )
call RemoveUnit(dummy)
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitLoc(t)))
if mana != 0 then
call UnitDamageTargetBJ(u,t,I2R(mana), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE)
call SetUnitManaBJ( u, ( GetUnitStateSwap(UNIT_STATE_MANA, u) + mana ) )
else
call UnitDamageTargetBJ(u,t,I2R(10*GetUnitAbilityLevelSwapped('A000', u)), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE)
call SetUnitManaBJ( u, ( GetUnitStateSwap(UNIT_STATE_MANA, u) + mana/5 ) )
endif
endfunction
//===========================================================================
function InitTrig_IceMana takes nothing returns nothing
set gg_trg_IceMana = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_IceMana, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_IceMana, Condition( function Trig_IceMana_Conditions ) )
call TriggerAddAction( gg_trg_IceMana, function Trig_IceMana_Actions )
endfunction
Добавлено (24-08-2010, 18:41)
---------------------------------------------
Кароче ненада уже =) Ошибка мя убила.... вся соль в том, что я при создании переменной mana не обнулил её =)