function Trig_Lightning_Orb_Conditions takes nothing returns boolean if( UnitHasItemOfTypeBJ(GetAttacker(), 'I01W') == true )then return true endif if( UnitHasItemOfTypeBJ(GetAttacker(), 'I02W') == true )then return true endif return false endfunction function Trig_Lightning_Orb_Actions takes nothing returns nothing local integer ran=GetRandomInt(1, 100) if( UnitHasItemOfTypeBJ(GetAttacker(), 'I01W') == true )then if( ran <= 20 )then call CreateNUnitsAtLoc( 1, 'h006', GetOwningPlayer(GetAttacker()), GetUnitLoc(GetAttacker()), bj_UNIT_FACING ) call UnitApplyTimedLife( GetLastCreatedUnit(), 1, 1 ) call UnitAddAbilityBJ( 'A04U', GetLastCreatedUnit() ) call IssueTargetOrder( GetLastCreatedUnit(), "chainlightning", GetAttackedUnitBJ() ) set ran = GetRandomInt(1, 100) endif endif if( UnitHasItemOfTypeBJ(GetAttacker(), 'I02W') == true )then if( ran <= 20 )then call CreateNUnitsAtLoc( 1, 'h006', GetOwningPlayer(GetAttacker()), GetUnitLoc(GetAttacker()), bj_UNIT_FACING ) call UnitApplyTimedLife( GetLastCreatedUnit(), 1, 1 ) call UnitAddAbilityBJ( 'A05K', GetLastCreatedUnit() ) call IssueTargetOrder( GetLastCreatedUnit(), "chainlightning", GetAttackedUnitBJ() ) endif endif endfunction function InitTrig_Lightning_Orb takes nothing returns nothing set gg_trg_Lightning_Orb = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Lightning_Orb, EVENT_PLAYER_UNIT_ATTACKED ) call TriggerAddCondition( gg_trg_Lightning_Orb, Condition( function Trig_Lightning_Orb_Conditions ) ) call TriggerAddAction( gg_trg_Lightning_Orb, function Trig_Lightning_Orb_Actions ) endfunction