- Joined
- Oct 18, 2007
- Messages
- 930
Ok im fixing the Nether Chains for -BerZeKer- and i dunno why this happens !
Ok i run the thing and it screws at the effects removal.
This is how the whole jass function look like
Any ideas?
Ok i run the thing and it screws at the effects removal.
This is how the whole jass function look like
JASS:
function Trig_Nether_Chains_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00M' ) ) then
return false
endif
return true
endfunction
function Nether_Chains_Group_Conditions_Sub1 takes nothing returns boolean
return ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetTriggerPlayer()) == true )
endfunction
function Nether_Chains_Group_Conditions_Sub2 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Nether_Chains_Group_Conditions takes nothing returns boolean
return GetBooleanAnd( Nether_Chains_Group_Conditions_Sub1(), Nether_Chains_Group_Conditions_Sub2() )
endfunction
function Trig_Nether_Chains_Actions takes nothing returns nothing
//*************************
//* Locals *
//*************************
local location loc1 //*
local unit unit1 //*
local unit unit2 //*
local integer i //*
local real rotation //*
local effect se //*
local effect se2 //*
local integer count //*
local player owner //*
local group Group //*
//*************************
//* End of Locals *
//*************************
set unit1 = GetTriggerUnit()
set loc1 = GetSpellTargetLoc()
set owner = GetOwningPlayer ( unit1 )
set udg_TempLoc9 = GetSpellTargetLoc()
set udg_TempLoc10 = GetSpellTargetLoc()
set rotation = bj_UNIT_FACING
call AddSpecialEffectLoc( "Abilities\\Spells\\Other\\Drain\\DrainCaster.mdl", loc1 )
set se = GetLastCreatedEffectBJ()
set i = 1
set count = ( 2 * GetUnitAbilityLevelSwapped('A00M', unit1) )
loop
exitwhen i > count
call PolledWait( 1.00 )
call AddSpecialEffectLoc( "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl", loc1 )
set se2 = GetLastCreatedEffectBJ()
call CreateNUnitsAtLoc( 1, 'h000', owner, loc1, rotation )
call UnitApplyTimedLife( GetLastCreatedUnit(), 'BTLF', 1.50 )
call UnitAddAbility( GetLastCreatedUnit(), 'A00L' )
call SetUnitAbilityLevelSwapped( 'A00L', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00M', unit1) )
set Group = GetUnitsInRangeOfLocMatching(900.00, loc1, Condition(function Nether_Chains_Group_Conditions))
set unit2 = GroupPickRandomUnit( Group )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "chainlightning", unit2 )
call DestroyGroup ( Group )
// IT WONT REMOVE THIS GOD DAM EFFECT!!
call DestroyEffect( se2 )
set i = i + 1
endloop
// AND THIS EFFECT!!!
call DestroyEffect( se )
call RemoveLocation ( loc1 )
set unit1 = null
set loc1 = null
set owner = null
set se = null
set se2 = null
set Group = null
endfunction
//*********************************************************************************************************
//* END OF SCRIPT *
//*********************************************************************************************************
function InitTrig_Nether_Chains takes nothing returns nothing
set gg_trg_Nether_Chains = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Nether_Chains, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Nether_Chains, Condition( function Trig_Nether_Chains_Conditions ) )
call TriggerAddAction( gg_trg_Nether_Chains, function Trig_Nether_Chains_Actions )
endfunction
Any ideas?