Friendly fire with scripted area of effect damage?

Summoned

New Member
Reaction score
51
I'm toying with this hero whose ultimate is Chaos Storm, which basically makes a decent radius around him explode in pretty special effects. Is there anyway to make sure it doesn't damage allies? I'm unfamiliar with all the damage types like normal vs. universal vs. whatever. I assume, based on testing, that universal skips resistance mechanics. Code should be fairly straight-forward.
Trigger:
  • Chaos Storm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chaos Storm (Warlord)
    • Actions
      • Set SkillLevel = (Level of Chaos Storm (Warlord) for (Triggering unit))
      • Set SkillLevelReal = (Real(SkillLevel))
      • For each (Integer A) from 1 to 50, do (Actions)
        • Loop - Actions
          • Set Casterpoint = (Position of (Triggering unit))
          • Set Targetpoint = (Random point in (Region centered at Casterpoint with size (600.00, 600.00)))
          • Special Effect - Create a special effect at Targetpoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Unit - Cause (Triggering unit) to damage circular area after 0.05 seconds of radius 150.00 at Targetpoint, dealing (Random real number between 0.00 and (60.00 x SkillLevelReal)) damage of attack type Spells and damage type Normal
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_Targetpoint)
          • Set Targetpoint = (Random point in (Region centered at Casterpoint with size (600.00, 600.00)))
          • Special Effect - Create a special effect at Targetpoint using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Unit - Cause (Triggering unit) to damage circular area after 0.05 seconds of radius 150.00 at Targetpoint, dealing (15.00 + (15.00 x SkillLevelReal)) damage of attack type Spells and damage type Normal
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_Targetpoint)
          • Set Targetpoint = (Random point in (Region centered at Casterpoint with size (600.00, 600.00)))
          • Special Effect - Create a special effect at Targetpoint using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
          • Unit - Cause (Triggering unit) to damage circular area after 0.05 seconds of radius 150.00 at Targetpoint, dealing (Random real number between (15.00 x SkillLevelReal) and (45.00 x SkillLevelReal)) damage of attack type Spells and damage type Normal
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_Targetpoint)
          • Custom script: call RemoveLocation(udg_Casterpoint)
          • Wait 0.25 game-time seconds
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, simply don't use Damage Area, but use a unit group instead, and damage target :D
That way you can filter out any units you want ;) Like magic immune and stuff :D

And also, your trigger leak quite a bit :(

Trigger:
  • Set Targetpoint = (Random point in (Region centered at Casterpoint with size (600.00, 600.00)))


leak a region, which needs to be destroyed.

and also, you need to use the custom script (call RemoveLocation(blahblah)) before setting a variable to a new value, I'm talking about TargetPoint :D
 

Summoned

New Member
Reaction score
51
Woot for quick reply. And those silly leaks will forever elude me. As for the second point, I did use the removelocation before setting a new value. ;)
 

roXplosive

New Member
Reaction score
15
I see in GUI you can only damage a unit or an area and that can't be set to not affect allies . Use this custom text for the first damaging and adapt accordingly for the second :

JASS:

call DamageUnitsInAOELoc(GetOwningPlayer(GetTriggerUnit()),GetRandomReal(0,60*udg_SkillLevelReal),udg_Targetpoint,150.00,false)


The false boolean value is for the condition of targeting allies .

If you want to damage after 0.05 seconds you can make another trigger that is disabled and has a Triggersleepaction and the damage action and execute it for damaging .
 

Summoned

New Member
Reaction score
51
Well, the reason I'm using the GUI is that I've no clue how to JASS. I mean, why type 1 line of code when you can go through the GUI for 10 lines of trigger? :banghead:

Edit: Oops, messed something up.

Trigger:
  • Chaos Storm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chaos Storm (Warlord)
    • Actions
      • Set SkillLevel = (Level of Chaos Storm (Warlord) for (Triggering unit))
      • Set SkillLevelReal = (Real(SkillLevel))
      • For each (Integer A) from 1 to 50, do (Actions)
        • Loop - Actions
          • Set Casterpoint = (Position of (Triggering unit))
          • Set RandomRegion = (Region centered at Casterpoint with size (600.00, 600.00))
          • -------- Fiery Explosion --------
          • Set Targetpoint = (Random point in RandomRegion)
          • Set AnyUnitGroup = (Units within 150.00 of Targetpoint)
          • Special Effect - Create a special effect at Targetpoint using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Unit Group - Pick every unit in AnyUnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is an ally of (Owner of (Triggering unit))) Equal to False
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (30.00 x SkillLevelReal) damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Do nothing
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call DestroyGroup(udg_AnyUnitGroup)
          • Custom script: call RemoveLocation(udg_Targetpoint)
          • -------- Icy Explosion --------
          • Set Targetpoint = (Random point in RandomRegion)
          • Set AnyUnitGroup = (Units within 150.00 of Targetpoint)
          • Special Effect - Create a special effect at Targetpoint using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
          • Unit Group - Pick every unit in AnyUnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is an ally of (Owner of (Triggering unit))) Equal to False
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Random real number between (15.00 x SkillLevelReal) and (45.00 + SkillLevelReal)) damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Do nothing
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call DestroyGroup(udg_AnyUnitGroup)
          • Custom script: call RemoveLocation(udg_Targetpoint)
          • -------- Shock Explosion --------
          • Set Targetpoint = (Random point in RandomRegion)
          • Set AnyUnitGroup = (Units within 150.00 of Targetpoint)
          • Special Effect - Create a special effect at Targetpoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Unit Group - Pick every unit in AnyUnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is an ally of (Owner of (Triggering unit))) Equal to False
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Random real number between 0.00 and (60.00 + SkillLevelReal)) damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Do nothing
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call DestroyGroup(udg_AnyUnitGroup)
          • Custom script: call RemoveLocation(udg_Targetpoint)
          • Custom script: call RemoveRect(udg_RandomRegion)
          • Custom script: call RemoveLocation(udg_Casterpoint)
          • Wait 0.25 game-time seconds
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top