• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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