• 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] Barrage - Lightning Effect

Status
Not open for further replies.
Level 9
Joined
Feb 14, 2009
Messages
316
Is there any way to make Barrage to fire lightning effects like Chain Lightning - Secondary instead of rockets?

Using the lightning effect option in the ability doesn't help.
This does not help either:
JASS:
function Trig_barrage_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_barrage_Actions takes nothing returns nothing
    local lightning lght
    call AddLightningLoc( "CLSB", GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc() )
    set lght = GetLastCreatedLightningBJ()
    call PolledWait(0.20)
    call DestroyLightning(lght)
endfunction

//===========================================================================
function InitTrig_barrage takes nothing returns nothing
    set gg_trg_barrage = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_barrage, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_barrage, Condition( function Trig_barrage_Conditions ) )
    call TriggerAddAction( gg_trg_barrage, function Trig_barrage_Actions )
endfunction
 
Level 17
Joined
Jun 17, 2007
Messages
1,433
It works fine for me like this:

JASS:
function Trig_barrage_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Trig_barrage_Actions takes nothing returns nothing
    local location l = GetUnitLoc(GetTriggerUnit())
    local location l2 = GetUnitLoc(GetSpellTargetUnit())
    local lightning lght = AddLightningEx("CLSB", true, GetLocationX(l), GetLocationY(l), GetLocationZ(l), GetLocationX(l2), GetLocationY(l2), GetLocationZ(l2))
    call PolledWait(.2)
    call DestroyLightning(lght)
    call RemoveLocation(l)
    call RemoveLocation(l2)
    set l = null
    set l2 = null
    set lght = null
endfunction

function InitTrig_barrage takes nothing returns nothing
    set gg_trg_barrage = CreateTrigger( )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_barrage, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_barrage, Condition( function Trig_barrage_Conditions ) )
    call TriggerAddAction( gg_trg_barrage, function Trig_barrage_Actions )
endfunction
 
Status
Not open for further replies.
Top