• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Its stops at a se add

Status
Not open for further replies.
Level 18
Joined
Oct 18, 2007
Messages
930
Ok im fixing the Nether Chains for -BerZeKer- and i dunno why this happens :mad:!

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?
 
Level 16
Joined
Feb 22, 2006
Messages
960
JASS:
function Trig_Nether_Chains_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00M'
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 unit dummy
    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
    set se = AddSpecialEffectLoc( "Abilities\\Spells\\Other\\Drain\\DrainCaster.mdl", loc1 )
    set i = 1
    set count = ( 2 * GetUnitAbilityLevelSwapped('A00M', unit1) )
    loop
        exitwhen i > count
        call PolledWait( 1.00 )
        set se2 = AddSpecialEffectLoc( "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl", loc1 )
        set dummy = CreateNUnitsAtLoc( 1, 'h000', owner, loc1, rotation )
        call UnitApplyTimedLife(dummy, 'BTLF', 1.50 )
        call UnitAddAbility(dummy, 'A00L' )
        call SetUnitAbilityLevelSwapped( 'A00L', dummy, GetUnitAbilityLevelSwapped('A00M', unit1) )
        set Group = GetUnitsInRangeOfLocMatching(900.00, loc1, Condition(function Nether_Chains_Group_Conditions))
        set unit2 = GroupPickRandomUnit( Group )
        call IssueTargetOrderBJ(dummy, "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 unit 2 = null
    set dummy = 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
  local trigger nc = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(nc, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(nc, Condition( function Trig_Nether_Chains_Conditions ) )
    call TriggerAddAction(nc, function Trig_Nether_Chains_Actions )
  set nc = null
endfunction

try this one, should work
 
Status
Not open for further replies.
Top