D.V.D
Make a wish
- Reaction score
- 73
Ok, I made another spell called Dragon's Souls that I wanted to post on The helper but it's got some glitches. There are no Jass errors but the effects won't die. The spell makes fire appear around a circle and red balls fly up after a unit with a effect dies but the effects just stay there.Here's the code:
JASS:
function Trig_Dragon_Souls_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;AHtb039; ) ) then
return false
endif
return true
endfunction
function Trig_Dragon_Souls_Actions takes nothing returns nothing
call UnitAddAbilityBJ( 039;ANpi039;, GetSpellTargetUnit() )
endfunction
//===========================================================================
function InitTrig_Dragon_Souls takes nothing returns nothing
set gg_trg_Dragon_Souls = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dragon_Souls, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dragon_Souls, Condition( function Trig_Dragon_Souls_Conditions ) )
call TriggerAddAction( gg_trg_Dragon_Souls, function Trig_Dragon_Souls_Actions )
endfunction
JASS:
function Trig_Dragon_Souls_Death_Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped(039;ANpi039;, GetDyingUnit()) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Dragon_Souls_Death_Actions takes nothing returns nothing
local unit Target = GetDyingUnit()
local unit array Effect
local effect array Fire
local integer ArrayNumber = 0
local integer UnitArray = 0
local real Angle = 0.00
if ( Trig_Dragon_Souls_Death_Func001C() ) then
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h001039;, GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetDyingUnit()), GetUnitLoc(GetTriggerUnit()) )
set Effect[0] = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 5, 039;BTLK039;, Effect[0] )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(GetUnitLoc(GetDyingUnit()), 400.00, Angle), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
set Fire[ArrayNumber] = GetLastCreatedEffectBJ()
set Angle = Angle + 36
set ArrayNumber = ArrayNumber + 1
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 40
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h000039;, GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(GetDyingUnit()), 500.00, 500.00)), GetRandomReal(0.00, 500.00), GetRandomDirectionDeg()), GetUnitLoc(GetTriggerUnit()) )
set Effect[UnitArray] = GetLastCreatedUnit()
call PauseUnitBJ( true, Effect[UnitArray] )
call UnitAddAbilityBJ( 039;Amrf039;, Effect[UnitArray] )
call UnitApplyTimedLifeBJ( 2.00, 039;BTLF039;, Effect[UnitArray] )
call SetUnitFlyHeightBJ( Effect[UnitArray], 1000.00, 1000.00 )
call TriggerSleepAction( 0.10 )
set UnitArray = UnitArray + 1
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DestroyEffectBJ( Fire[ArrayNumber] )
else
endif
endfunction
//===========================================================================
function InitTrig_Dragon_Souls_Death takes nothing returns nothing
set gg_trg_Dragon_Souls_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dragon_Souls_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Dragon_Souls_Death, function Trig_Dragon_Souls_Death_Actions )
endfunction