Damage Area (but not damage the allied units)

Discussion in 'World Editor Help' started by Largs, Aug 13, 2007.

  1. Largs

    Largs Guest

    Ratings:
    +0 / 0 / -0
    How do I make to damage only enemies in the area??
    I tried that but it isn't works
    Code:
    Arcane Explosion
        Events
            Unit - A unit Starts the effect of an ability
        Conditions
            (Ability being cast) Equal to Arcane Explosion 
        Actions
            Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 500.00 at (Position of (Casting unit)), dealing 800.00 damage of attack type Spells and damage type Fire
    
     
  2. Ghan

    Ghan Administrator - Servers are fun Staff Member

    Ratings:
    +773 / 0 / -0
    Try this:

    Code:
    Damage Unit
        Events
        Conditions
        Actions
            Set TempPoint = <Some Point>
            Set TempGroup = (Units within 300.00 of TempPoint)
            Unit Group - Pick every unit in TempGroup and do (Actions)
                Loop - Actions
                    Unit - Cause <Some Unit> to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
            Custom script:   call DestroyGroup(udg_TempGroup)
            Custom script:   call RemoveLocation(udg_TempPoint)
     
  3. Mapster

    Mapster New Member

    Ratings:
    +4 / 0 / -0
    I've wanted to do that before but didn't know how, thanks Ghan lol, even though i wasn't asking lol.
     
  4. Largs

    Largs Guest

    Ratings:
    +0 / 0 / -0
    Man i tried that:
    Code:
    Arcane Explosion ON
        Events
            Unit - A unit Starts the effect of an ability
        Conditions
            (Ability being cast) Equal to Arcane Explosion 
        Actions
            Unit Group - Pick every unit in (Units within 800.00 of (Position of Arcane_explosion_caster)) and do (Actions)
                Loop - Actions
                    Unit - Cause Arcane_explosion_caster to damage (Picked unit), dealing 800.00 damage of attack type Spells and damage type Normal
    
    But that doesn't works¬¬'
    and why Set TempPoint = <Some Point>???
     
  5. RedRage

    RedRage New Member

    Ratings:
    +7 / 0 / -0
    Here is copy of my spell which doesn't damage allies

    Code:
    Untitled Trigger 009
        Events
            Unit - A unit Starts the effect of an ability
        Conditions
            (Ability being cast) Equal to Smite 
        Actions
            Set Intelligence = (Intelligence of (Triggering unit) (Include bonuses))
            Set Convert = (Real(Intelligence))
            Set TargetPoint = (Position of (Triggering unit))
            Set UnitGroup = (Units within 700.00 of TargetPoint matching ((((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to False) and (((Matching unit) is alive) Equal to True)))
            Wait 0.30 seconds
            Unit Group - Pick every unit in UnitGroup and do (Actions)
                Loop - Actions
                    Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Convert x 4.00) damage of attack type Spells and damage type Normal
                    Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                    Special Effect - Destroy (Last created special effect)
                    Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Slow\SlowCaster.mdl
                    Special Effect - Destroy (Last created special effect)
                    Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                    Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                    Camera - Shake the camera for (Owner of (Triggering unit)) with magnitude 3.00
            Wait 1.00 seconds
            Camera - Stop swaying/shaking the camera for (Owner of (Triggering unit))
            Custom script:   call DestroyGroup(udg_UnitGroup)
            Custom script:   call RemoveLocation(udg_TargetPoint)

    You just gotta set who it damages, then make an damage unit loop to damage all the units.
     
  6. Mapster

    Mapster New Member

    Ratings:
    +4 / 0 / -0
    Thats a good idea but why not this:

    Code:
    Event: A unit Begins casting an ability
    Condition: Ability is equal to (Kaboom)
    Action:
    
      Unit group - Pick every unit in (with 700 range if targeted area) and do actions:
    Loop:
            If: (picked unit) is not equal to (picked unit is an ally of (owner of casting unit))
        Then: Cause Casting unit to Damage Picked unit with....
      Else:
    
    
    No variables required except for the intelligence.
     
  7. RedRage

    RedRage New Member

    Ratings:
    +7 / 0 / -0
    I hope you're planning on using variables because that will leak
     
  8. Largs

    Largs Guest

    Ratings:
    +0 / 0 / -0
    Code:
    (Units within 700.00 of TargetPoint matching ((((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to False) and (((Matching unit) is alive) Equal to True)))
    where did you found that???
     
  9. RedRage

    RedRage New Member

    Ratings:
    +7 / 0 / -0
    1
     
  10. Largs

    Largs Guest

    Ratings:
    +0 / 0 / -0
    Where are the matching options so??
     
  11. RedRage

    RedRage New Member

    Ratings:
    +7 / 0 / -0
    I its actually Point
    Units In Range Matching Condition
    The condition is And
     
  12. Largs

    Largs Guest

    Ratings:
    +0 / 0 / -0
    can you show me again your spell??
     
  13. RedRage

    RedRage New Member

    Ratings:
    +7 / 0 / -0
    Code:
    Untitled Trigger 009
        Events
            Unit - A unit Starts the effect of an ability
        Conditions
            (Ability being cast) Equal to Smite 
        Actions
            Set Intelligence = (Intelligence of (Triggering unit) (Include bonuses))
            Set Convert = (Real(Intelligence))
            Set TargetPoint = (Position of (Triggering unit))
            Set UnitGroup = (Units within 700.00 of TargetPoint matching ((((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to False) and (((Matching unit) is alive) Equal to True)))
            Wait 0.30 seconds
            Unit Group - Pick every unit in UnitGroup and do (Actions)
                Loop - Actions
                    Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Convert x 4.00) damage of attack type Spells and damage type Normal
                    Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                    Special Effect - Destroy (Last created special effect)
                    Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Slow\SlowCaster.mdl
                    Special Effect - Destroy (Last created special effect)
                    Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                    Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                    Camera - Shake the camera for (Owner of (Triggering unit)) with magnitude 3.00
            Wait 1.00 seconds
            Camera - Stop swaying/shaking the camera for (Owner of (Triggering unit))
            Custom script:   call DestroyGroup(udg_UnitGroup)
            Custom script:   call RemoveLocation(udg_TargetPoint)
    Set UnitGroup = (Units within 700.00 of TargetPoint matching ((((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to False) and (((Matching unit) is alive) Equal to True)))
    For this:
    The variable is point
    and that is Units In Range Matching Condition
    and the condition is And
     
  14. Largs

    Largs Guest

    Ratings:
    +0 / 0 / -0
    Thxxx man it's working now!!!
     

Share This Page