I just started using jass and I made this spell based on roar and it suppost to increase the caster's stats by 2x. But when i test it, it doesnt work. Need help
function Essence_of_Darkness_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A029' ) ) then
return false
endif
return true
endfunction
function Essence_of_Darkness takes nothing returns nothing
local unit d = GetSpellAbilityUnit()
local real e = +I2R(GetHeroStatBJ(bj_HEROSTAT_STR, d, true))*2.0
local real b = +I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, d, true))*2.0
local real j = +I2R(GetHeroStatBJ(bj_HEROSTAT_INT, d, true))*2.0
call Bonuser(d,R2I(e),"hero-a")
call Bonuser(d,R2I(b),"hero-s")
call Bonuser(d,R2I(j),"hero-i")
call PolledWait(16)
if(UnitHasBuffBJ(d, 'B001') == false )then
call Remove(d,"hero-a")
call Remove(d,"hero-s")
call Remove(d,"hero-i")
endif
set d = null
endfunction
//===========================================================================
function InitTrig_Essence_of_Darkness takes nothing returns nothing
set gg_trg_Essence_of_Darkness = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Essence_of_Darkness, EVENT_PLAYER_UNIT_SPELL_CAST )
endfunction
function Essence_of_Darkness_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A029' ) ) then
return false
endif
return true
endfunction
function Essence_of_Darkness takes nothing returns nothing
local unit d = GetSpellAbilityUnit()
local real e = +I2R(GetHeroStatBJ(bj_HEROSTAT_STR, d, true))*2.0
local real b = +I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, d, true))*2.0
local real j = +I2R(GetHeroStatBJ(bj_HEROSTAT_INT, d, true))*2.0
call Bonuser(d,R2I(e),"hero-a")
call Bonuser(d,R2I(b),"hero-s")
call Bonuser(d,R2I(j),"hero-i")
call PolledWait(16)
if(UnitHasBuffBJ(d, 'B001') == false )then
call Remove(d,"hero-a")
call Remove(d,"hero-s")
call Remove(d,"hero-i")
endif
set d = null
endfunction
//===========================================================================
function InitTrig_Essence_of_Darkness takes nothing returns nothing
set gg_trg_Essence_of_Darkness = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Essence_of_Darkness, EVENT_PLAYER_UNIT_SPELL_CAST )
endfunction