• 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.

Chain Lightning that deals AoE damage: Problem!

Status
Not open for further replies.
Level 8
Joined
May 11, 2007
Messages
54
I try to create a spell from chain lightning that deals AoE damage to the first target without dealing damage to the allies of the casting unit, with this

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

function Trig_Spell_AoE_Damage_Func006001003 takes nothing returns boolean
    return IsUnitAlly(GetEnumUnit(),GetOwningPlayer(GetSpellAbilityUnit())) == true
endfunction

function Trig_Spell_AoE_Damage_Func006A takes nothing returns nothing
    call SetUnitLifeBJ(GetEnumUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE, GetEnumUnit())+( 150*udg_FlameTouchLevel)))
endfunction

function Trig_Spell_AoE_Damage_Actions takes nothing returns nothing
    local location l = GetUnitLoc(GetSpellTargetUnit())
    set udg_FlameTouchLevel = GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetSpellAbilityUnit())
    call UnitDamagePointLoc(GetSpellAbilityUnit(),0,300,l,(150* udg_FlameTouchLevel),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(300.00,l,Condition(function Trig_Spell_AoE_Damage_Func006001003)),function Trig_Spell_AoE_Damage_Func006A)
    call RemoveLocation(l)
    set l = null
endfunction

function InitTrig_Spell_AoE_Damage takes nothing returns nothing
    set gg_trg_Spell_AoE_Damage = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Spell_AoE_Damage, EVENT_PLAYER_UNIT_SPELL_FINISH )
    call TriggerAddCondition( gg_trg_Spell_AoE_Damage, Condition( function Trig_Spell_AoE_Damage_Conditions ) )
    call TriggerAddAction( gg_trg_Spell_AoE_Damage, function Trig_Spell_AoE_Damage_Actions )
endfunction

Can someone tell me why doesn't the AoE damage work? Plz reply soon!
:eekani: :confused: :eekani:
 
Last edited by a moderator:
Level 32
Joined
Oct 23, 2006
Messages
5,291
[off-topic]

NiX_GR_: hopefully someone will be able to help.

When creating new threads please give them good titles.

What is wrong with that thing? is not very helpful: the site's search engine (and we users)
don't know EXACTLY what you need help with.

Always try to make thread title as specific as possible. Thanks.

~ Thread renamed.
 
Status
Not open for further replies.
Top