Добавлен Kolya12
У меня предмет дает +50% ловкости на 7 сек.Однако баф не сбрасывается.
function Trig_Agility_Blade_Remove_Agi_Actions takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer h = GetHandleId(t)
local unit caster = LoadUnitHandle(udg_hash,h,1)
local integer bonus = LoadInteger(udg_hash,h,2)
local effect ef = LoadEffectHandle(udg_hash,h,3)
local effect ef2 = LoadEffectHandle(udg_hash,h,4)
local integer clearagi = GetHeroAgi(caster,false)
function Trig_Agility_Blade_Remove_Agi_Actions takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer h = GetHandleId(t)
local unit caster = LoadUnitHandle(udg_hash,h,1)
local integer bonus = LoadInteger(udg_hash,h,2)
local effect ef = LoadEffectHandle(udg_hash,h,3)
local effect ef2 = LoadEffectHandle(udg_hash,h,4)
local integer clearagi = GetHeroAgi(caster,false)
call SetHeroAgi(caster,clearagi-bonus,true)
call FlushChildHashtable(udg_hash,h)
call DestroyTimer(t)
call DestroyEffect(ef)
call DestroyEffect(ef2)
call DestroyTimer(t)
call DestroyEffect(ef)
call DestroyEffect(ef2)
set caster = null
set ef = null
set ef2= null
set t = null
endfunction
set ef = null
set ef2= null
set t = null
endfunction
function Trig_Agility_Blade_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local integer agi = GetHeroAgi(caster,true)
local integer clearagi = GetHeroAgi(caster,false)
local integer bonus = R2I(agi/2)
local effect ef = AddSpecialEffectTarget("Abilities\\Spells\\Other\\AcidBomb\\BottleImpact.mdl",caster,"weapon")
local effect ef2= AddSpecialEffectTarget("Abilities\\Spells\\Other\\Drain\\DrainCaster.mdl",caster,"head")
local timer t = CreateTimer()
local integer h = GetHandleId(t)
local unit caster = GetSpellAbilityUnit()
local integer agi = GetHeroAgi(caster,true)
local integer clearagi = GetHeroAgi(caster,false)
local integer bonus = R2I(agi/2)
local effect ef = AddSpecialEffectTarget("Abilities\\Spells\\Other\\AcidBomb\\BottleImpact.mdl",caster,"weapon")
local effect ef2= AddSpecialEffectTarget("Abilities\\Spells\\Other\\Drain\\DrainCaster.mdl",caster,"head")
local timer t = CreateTimer()
local integer h = GetHandleId(t)
call SetHeroAgi(caster,clearagi+bonus,true)
call SaveUnitHandle(udg_hash,h,1,caster)
call SaveInteger(udg_hash,h,2,bonus)
call SaveEffectHandle(udg_hash,h,3,ef)
call SaveEffectHandle(udg_hash,h,4,ef2)
call SaveInteger(udg_hash,h,2,bonus)
call SaveEffectHandle(udg_hash,h,3,ef)
call SaveEffectHandle(udg_hash,h,4,ef2)
call TimerStart(t,7.00,false,function Trig_Agility_Blade_Remove_Agi_Actions)
set caster = null
set ef = null
set ef2= null
set t = null
endfunction
set ef = null
set ef2= null
set t = null
endfunction
function Trig_Agility_Blade_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0IE'
endfunction
===========================================================================
function InitTrig_Agility_Blade takes nothing returns nothing
local integer index = 0
set gg_trg_Agility_Blade = CreateTrigger( )
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_Agility_Blade, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT , null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition( gg_trg_Agility_Blade, Condition( function Trig_Agility_Blade_Conditions ) )
call TriggerAddAction( gg_trg_Agility_Blade, function Trig_Agility_Blade_Actions )
endfunction
return GetSpellAbilityId() == 'A0IE'
endfunction
===========================================================================
function InitTrig_Agility_Blade takes nothing returns nothing
local integer index = 0
set gg_trg_Agility_Blade = CreateTrigger( )
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_Agility_Blade, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT , null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition( gg_trg_Agility_Blade, Condition( function Trig_Agility_Blade_Conditions ) )
call TriggerAddAction( gg_trg_Agility_Blade, function Trig_Agility_Blade_Actions )
endfunction
Принятый ответ
Я на этом моменте, когда только начинал учить джасс, всегда запарывался
короче, вот карта, всё у тебя работает)
Добавил просто udg_hash = InitHashtable() внизу события
короче, вот карта, всё у тебя работает)
Добавил просто udg_hash = InitHashtable() внизу события
Загруженные файлы
`
ОЖИДАНИЕ РЕКЛАМЫ...
Чтобы оставить комментарий, пожалуйста, войдите на сайт.
И о чем говорит приставка приват private hashtable H = InitHashtable()
короче, в твоём случае решил проверить, выгружается ли юнит вообще с помощью
Хз с чем это связано, если GetSpellAbilityUnit() в действиях спокойно добавлял агилу юниту