1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Chain Lightning that deals AoE damage: Problem!

Discussion in 'Triggers & Scripts' started by NiX_GR_, May 15, 2007.

  1. NiX_GR_

    NiX_GR_

    Joined:
    May 11, 2007
    Messages:
    53
    Resources:
    2
    Models:
    2
    Resources:
    2
    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

    Code (vJASS):
    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: May 20, 2007
  2. Wolverabid

    Wolverabid

    Joined:
    Oct 23, 2006
    Messages:
    8,302
    Resources:
    5
    Tutorials:
    5
    Resources:
    5
    [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.
     
  3. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Please don't post GUI converts, just post the GUI itself. GUI converts are even harder to read than the GUI itself in some cases.

    And the AOE damage looks fine, can't say why it wouldn't work, but UnitDamagePoint may be buggy.
     
  4. Red Orca

    Red Orca

    Joined:
    May 2, 2007
    Messages:
    141
    Resources:
    0
    Resources:
    0
    Personaly, Id create a dummy unit, then cause the dummy to damage the area then remove the dummy.
     
  5. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    What do you have against the hero doing the damage itself? That way it actually pulls enemies it hits.
     
  6. Diablo-dk

    Diablo-dk

    Joined:
    Nov 10, 2004
    Messages:
    369
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    UnitDamagePoint() also hurts allies, meaning you will have to use something else for the damage.
    And yea, it is damn hard to look through that converted code, my eyes almost start hurting>_<.
     
  7. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    He just restored their life afterwards, which sort of works.
     
  8. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    26,199
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    I fixed his spell up a bit and so now it is not messed up and unefficent (well sort of).

    JASS 1
    GUI 0

    Atleast say thank you. . .