I have imported a spell (Web-Demo made by Av3n from this site) I have follawed instructions step by step. The Spell dont works right only a first part works right. The Spell deosnt make my hero invisible and doesnt increase his life points regeneration. Here is the JASS trigger:
PLS HELP
JASS:
constant function CreateWeb_id takes nothing returns integer
return 'A01N'
endfunction
constant function CreateWeb_aurabuff takes nothing returns integer
return 'A01L'
endfunction
constant function CreateWeb_permhide takes nothing returns integer
return 'A01M'
endfunction
constant function CreateWeb_regen takes nothing returns integer
return 'A01J'
endfunction
constant function CreateWeb_lasttime takes nothing returns real
return 30.00
endfunction
constant function CreateWeb_ltx takes nothing returns boolean
return true
endfunction
constant function CreateWeb_ltadd takes nothing returns real
return 0.00
endfunction
function CreateWeb_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A01N'
endfunction
function CreateWeb_Actions takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local integer l = GetUnitAbilityLevel(c,'A01N')
local real check = 0.00
local real limit = CreateWeb_lasttime() - 1.00
local real add = CreateWeb_ltadd()*I2R(l)
call UnitAddAbility(c,'A01M')
call UnitAddAbility(c,'A01J')
if CreateWeb_ltx() == true then
set limit = limit*I2R(l)
endif
set limit = limit+add
loop
exitwhen check > limit
if UnitHasBuffBJ(c,'A01L') == true then
call UnitAddAbility(c,'A01M)
call SetUnitAbilityLevel(c,'A01M,l)
call UnitAddAbility(c,'A01J)
call SetUnitAbilityLevel(c,'A01J',l)
else
call UnitRemoveAbility(c,'A01M')
call UnitRemoveAbility(c,'A01J')
endif
call TriggerSleepAction(0.90)
set check = check + 0.90
endloop
call UnitRemoveAbility(c,'A01M')
call UnitRemoveAbility(c,'A01J')
set c = null
endfunction
function InitTrig_Create_Web takes nothing returns nothing
set gg_trg_Create_Web = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Create_Web, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Create_Web, Condition( function CreateWeb_Conditions ) )
call TriggerAddAction( gg_trg_Create_Web, function CreateWeb_Actions )
endfunction