Hello, I have a problem with my super nova ability, its supposed to fall towards the ground and then explode and deal damage overtime. But there is a problem if another spell is cast during its landing the supernova ability disappears. Another problem is if the supernova has already landed, and another spell is being used. The supernova will stop dealing damage completely, though the animation of the nuke will still continue. I attached two video files, one with the bug happening and other how the spell acts normally. I dont know what is interfering/overwriting the ability.
Code:
function Trig_Super_Nova_Func027001003 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetSpellAbilityUnit()))==true)
endfunction
function Trig_Super_Nova_Func027A takes nothing returns nothing
call UnitDamageTargetBJ(GetSpellAbilityUnit(),GetEnumUnit(),(I2R(GetHeroStatBJ(bj_HEROSTAT_INT,GetSpellAbilityUnit(),false))*(I2R(GetUnitAbilityLevelSwapped('A06E',GetSpellAbilityUnit()))*1.50)),ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
endfunction
function Trig_Super_Nova_Func030001003 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetSpellAbilityUnit()))==true)
endfunction
function Trig_Super_Nova_Func030A takes nothing returns nothing
call UnitDamageTargetBJ(GetSpellAbilityUnit(),GetEnumUnit(),(I2R(GetHeroStatBJ(bj_HEROSTAT_INT,GetSpellAbilityUnit(),false))*(I2R(GetUnitAbilityLevelSwapped('A06E',GetSpellAbilityUnit()))*1.50)),ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
endfunction
function Trig_Super_Nova_Func033001003 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetSpellAbilityUnit()))==true)
endfunction
function Trig_Super_Nova_Func033A takes nothing returns nothing
call UnitDamageTargetBJ(GetSpellAbilityUnit(),GetEnumUnit(),(I2R(GetHeroStatBJ(bj_HEROSTAT_INT,GetSpellAbilityUnit(),false))*(I2R(GetUnitAbilityLevelSwapped('A06E',GetSpellAbilityUnit()))*1.50)),ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
endfunction
function Trig_Super_Nova_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
set udg_DeathBallPoint=GetSpellTargetLoc()
set udg_Loc=GetUnitLoc(GetSpellAbilityUnit())
set udg_Caster[GetConvertedPlayerId(GetTriggerPlayer())] = GetTriggerUnit()
call CreateNUnitsAtLocFacingLocBJ(1,'h045',p,udg_Loc,udg_Loc)
call SetUnitTimeScalePercent(GetLastCreatedUnit(),150.00)
call SetUnitVertexColorBJ(GetLastCreatedUnit(),100,70.00,0.00,0)
call UnitApplyTimedLifeBJ(1.00,'BTLF',GetLastCreatedUnit())
call SetUnitAnimation(GetTriggerUnit(),"Spell Channel")
call CreateNUnitsAtLocFacingLocBJ(1,'h044',p,udg_Loc,udg_DeathBallPoint)
call IssuePointOrderLoc(GetLastCreatedUnit(),"move",udg_DeathBallPoint)
set udg_deathballreqs[1]=GetLastCreatedUnit()
call EnableTrigger(gg_trg_falling_nova)
call IssuePointOrderLoc(udg_deathballreqs[1],"move",udg_DeathBallPoint)
call RemoveLocation(udg_Loc)
loop
call BJDebugMsg("loop")
exitwhen((GetUnitFlyHeight(udg_deathballreqs[1])<=10.00))
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL,0.10))
endloop
call BJDebugMsg("end loop")
call DisableTrigger(gg_trg_falling_nova)
call RemoveUnit(udg_deathballreqs[1])
call CreateNUnitsAtLoc(1,'h03R',p,udg_DeathBallPoint,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(5.00,'BTLF',GetLastCreatedUnit())
call CreateNUnitsAtLoc(1,'h02L',p,udg_DeathBallPoint,bj_UNIT_FACING)
call SetUnitScalePercent(bj_lastCreatedUnit,(600.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)),(600.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)),(600.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)))
call SetUnitTimeScalePercent(bj_lastCreatedUnit,50.00)
call SetUnitAnimation(GetLastCreatedUnit(),"birth")
call CreateNUnitsAtLoc(1,'h02W',p,udg_DeathBallPoint,bj_UNIT_FACING)
call SetUnitFlyHeightBJ(GetLastCreatedUnit(),3000.00,100.00)
call UnitApplyTimedLifeBJ(2.00,'BTLF',GetLastCreatedUnit())
set bj_wantDestroyGroup=true
call ForGroupBJ(GetUnitsInRangeOfLocMatching(700.00,udg_DeathBallPoint,Condition(function Trig_Super_Nova_Func027001003)),function Trig_Super_Nova_Func027A)
call TriggerSleepAction(1.00)
set bj_wantDestroyGroup=true
call ForGroupBJ(GetUnitsInRangeOfLocMatching(700.00,udg_DeathBallPoint,Condition(function Trig_Super_Nova_Func030001003)),function Trig_Super_Nova_Func030A)
call TriggerSleepAction(1.00)
set bj_wantDestroyGroup=true
call ForGroupBJ(GetUnitsInRangeOfLocMatching(700.00,udg_DeathBallPoint,Condition(function Trig_Super_Nova_Func033001003)),function Trig_Super_Nova_Func033A)
call RemoveLocation(udg_DeathBallPoint)
endfunction