• 🏆 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!

[General] Quick AOE Not Hit Ally Question

Status
Not open for further replies.
Level 6
Joined
Feb 18, 2010
Messages
153
Basically, i want to set up a simple simple spell, that selects all enemy within for example 300 range, and deal damage to them, however i dont want it to damage ally in range, as setting it up as pick in area and deal damage it damages ally and self.

so it something simple i know but it has been 4 years since i map edited


Basically this is how i have it and it works well, but i prefer it not to have invulnerable part, it works perfectly like this but the invul for short time makes enemy run away. this jsut my work around till i figure out fix

  • Pulse
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Casting unit)) Equal to |cff8000ffMagnus|r
          • (Ability being cast) Equal to |cffff0000P|rulse - (|cffff8080W|r)
        • Then - Actions
          • Set PulseCast = (Casting unit)
          • Wait 0.01 seconds
          • Set PulsePoint = (Target point of ability being cast)
          • Wait 0.01 seconds
          • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Unit - Make (Picked unit) Invulnerable)
          • Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Unit - Make (Picked unit) Invulnerable)
          • Unit Group - Pick every unit in (Units owned by Player 3 (Teal)) and do (Unit - Make (Picked unit) Invulnerable)
          • Unit Group - Pick every unit in (Units owned by Player 4 (Purple)) and do (Unit - Make (Picked unit) Invulnerable)
          • Unit Group - Pick every unit in (Units owned by Player 5 (Yellow)) and do (Unit - Make (Picked unit) Invulnerable)
          • Wait 0.01 seconds
          • Unit Group - Pick every unit in (Units within 750.00 of PulsePoint) and do (Actions)
            • Loop - Actions
              • Set PulseTarget = (Picked unit)
              • Special Effect - Create a special effect attached to the origin of PulseTarget using war3mapImported\TwilightSparkle.mdx
              • Unit - Cause PulseCast to damage PulseTarget, dealing (5.00 x ((Real((Intelligence of PulseCast (Include bonuses)))) x (Real((Hero level of PulseCast))))) damage of attack type Normal and damage type Normal
          • Wait 0.01 seconds
          • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Unit - Make (Picked unit) Vulnerable)
          • Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Unit - Make (Picked unit) Vulnerable)
          • Unit Group - Pick every unit in (Units owned by Player 3 (Teal)) and do (Unit - Make (Picked unit) Vulnerable)
          • Unit Group - Pick every unit in (Units owned by Player 4 (Purple)) and do (Unit - Make (Picked unit) Vulnerable)
          • Unit Group - Pick every unit in (Units owned by Player 5 (Yellow)) and do (Unit - Make (Picked unit) Vulnerable)
          • Wait 1.00 seconds
          • Special Effect - Create a special effect attached to the origin of PulseCast using war3mapImported\TwilightSparkle_Portrait.mdx
          • Wait 0.10 seconds
          • Unit - Set life of PulseCast to ((Life of PulseCast) + (5.00 x ((Real((Hero level of PulseCast))) x (Real((Intelligence of PulseCast (Include bonuses)))))))
        • Else - Actions
          • Do nothing
If someone knows fix, am sure someone does, is it possible for a vJass Code in reply, and maybe normal in case.
 
Last edited:
This is what you're looking for:

  • YourSpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wind Walk
    • Actions
      • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 50000.00 damage of attack type Spells and damage type Normal
Or if you want it in one line:

  • YourSpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wind Walk
    • Actions
      • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal)
 
Last edited:
Level 6
Joined
Feb 18, 2010
Messages
153
ok i set it like that, but it still damaging ally.

  • Pulse
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Casting unit)) Equal to |cff8000ffMagnus|r
          • (Ability being cast) Equal to |cffff0000P|rulse - (|cffff8080W|r)
        • Then - Actions
          • Set PulseCast = (Casting unit)
          • Set PulsePoint = (Target point of ability being cast)
          • Wait 0.01 seconds
          • Unit Group - Pick every unit in (Units within 750.00 of PulsePoint matching (((Picked unit) belongs to an enemy of (Owner of PulseCast)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Set PulseTarget = (Picked unit)
              • Special Effect - Create a special effect attached to the origin of PulseTarget using war3mapImported\TwilightSparkle.mdx
              • Unit - Cause PulseCast to damage PulseTarget, dealing (5.00 x ((Real((Intelligence of PulseCast (Include bonuses)))) x (Real((Hero level of PulseCast))))) damage of attack type Normal and damage type Normal
          • Wait 0.01 seconds
          • Special Effect - Create a special effect attached to the origin of PulseCast using war3mapImported\TwilightSparkle_Portrait.mdx
          • Wait 0.10 seconds
          • Unit - Set life of PulseCast to ((Life of PulseCast) + (5.00 x ((Real((Hero level of PulseCast))) x (Real((Intelligence of PulseCast (Include bonuses)))))))
        • Else - Actions
          • Do nothing
 
Last edited:
You need to put "matching unit" not "picked unit". Please put trigger tags:

[ trigger ]
Post your trigger here
[ /trigger ]

Here:

  • Pulse
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Casting unit)) Equal to |cff8000ffMagnus|r
          • (Ability being cast) Equal to |cffff0000P|rulse - (|cffff8080W|r)
        • Then - Actions
          • Set PulseCast = (Casting unit)
          • Set PulsePoint = (Target point of ability being cast)
          • Wait 0.01 seconds
          • Unit Group - Pick every unit in (Units within 750.00 of PulsePoint matching (((Matching unit) belongs to an enemy of (Owner of PulseCast)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (picked unit) using war3mapImported\TwilightSparkle.mdx
              • Unit - Cause PulseCast to damage (picked unit), dealing (5.00 x ((Real((Intelligence of PulseCast (Include bonuses)))) x (Real((Hero level of PulseCast))))) damage of attack type Normal and damage type Normal
          • Wait 0.01 seconds
          • Special Effect - Create a special effect attached to the origin of PulseCast using war3mapImported\TwilightSparkle_Portrait.mdx
          • Wait 0.10 seconds
          • Unit - Set life of PulseCast to ((Life of PulseCast) + (5.00 x ((Real((Hero level of PulseCast))) x (Real((Intelligence of PulseCast (Include bonuses)))))))
        • Else - Actions
          • Do nothing
I'm on my phone so I can't edit your trigger in the world editor but try the one I did for you there.
 
Last edited:
Level 6
Joined
Feb 18, 2010
Messages
153
Yeah my bad about the [ code ] thing, i remember a long time ago u clicked insert code and choose trigger, but it wasnt there anymore.

anywho it still attacks ally.

EDIT: Ty for help, when it didnt work originally i was testing other ways, and had condition about enemy set to false, so it was targeting ally only. but i realised, ty for help.
 
Last edited:
Yeah my bad about the [ code ] thing, i remember a long time ago u clicked insert code and choose trigger, but it wasnt there anymore.

anywho it still attacks ally.

I am pretty sure my trigger doesn't damage allies. I can check when I come home. Do check if there are any other triggers going off when using the spell.
 
Level 39
Joined
Feb 27, 2007
Messages
5,028
  • Use "starts the effect of" not "begins casting" for the event. BC happens before cooldown and mana cost are applied so it can run triggers even if the spell is cancelled, StEF happens just after cd and mana cost are applied.
  • Don't use Waits like that in your trigger. It will get messy fast and makes it hard to keep your spells MUI (this one, for instance, is not MUI) and leakless.
  • Do Nothing is pointless, never put it in your triggers. You can leave Else actions blank.
  • You are leaking points (locations), unit groups (groups), and special effects (effects). This will seriously degrade map performance over time if they are not cleaned in each of your triggers. I suggest you read these tutorials for a longer explanation of the what/why/how: Things That Leak, Memory Leaks
 
Level 6
Joined
Feb 18, 2010
Messages
153
Ok so i dont need help with this anymore, but on basically the shame subject, i added the leak fix like you said @Pyrogasm if i did it right i dunno, however. i want this ability to deal damage, 0.75 x Hero Level x Hero Damage, however i cant find hero damage in the setting, i know you can do that, but where do i find it? also this is code, let me know if it wrong again, ATM it x intellect but want that to be damage.

  • Shock
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to |cff00ff00Shock|r - (|cffff8080E|r) (Uncommon)
        • Then - Actions
          • Set ShockPoint = (Position of (Target unit of ability being cast))
          • Unit Group - Pick every unit in (Units within 750.00 of ShockPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Set ShockTarget = (Picked unit)
              • Special Effect - Create a special effect attached to the origin of ShockTarget using war3mapImported\Stormfall Fel.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage ShockTarget, dealing (0.75 x ((Real((Hero level of (Triggering unit)))) x (Real((Intelligence of (Triggering unit) (Include bonuses)))))) damage of attack type Magic and damage type Universal
          • Custom script: call RemoveLocation(udg_ShockPoint)
        • Else - Actions
Quick Question, how to i get ability to start on CoolDown

Basically, i am using The Witchers Equipment System, and the spell here is what u get if u equip a specific gem, however if u cast the spell, then UnEquip Gem then Re-Equip gem, it resets cooldown
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,028
You've cleaned all the leaks in that trigger properly, well done. In the 1.30+ WE I believe there is now a function to get a unit's current damage values/ranges, but I'm using the 1.29 WEX one and can't actually check what that function is called/how to find it. It should be an integer, so you will have to look under the integer category. Maybe it's an additional part of Unit - Property? Someone else will have to clarify for you if you can't find it. I know that at least in 1.29 you can get the unit's base damage, number of dice, and sides per dice so that would give you most of the information you need... it just doesn't include damage bonuses from abilities/buffs.
Quick Question, how to i get ability to start on CoolDown
This is not currently possible aside from manually (with a trigger) ordering the unit to use the skill. A possible workaround might be to replace the ability with a passive ability that can trigger a cooldown, like this method: Passive ability with cooldown - Best method!
 
Level 6
Joined
Feb 18, 2010
Messages
153
@Pyrogasm i been using JassNewGen, as WeX won’t even open for me, but I did find out WeX is been implemented to Warcraft 3 Base WE, found the damage sadly, it doesn’t count bonuses only base damage. Anywho ty for the help.
 
Ok so i dont need help with this anymore, but on basically the shame subject, i added the leak fix like you said @Pyrogasm if i did it right i dunno, however. i want this ability to deal damage, 0.75 x Hero Level x Hero Damage, however i cant find hero damage in the setting, i know you can do that, but where do i find it? also this is code, let me know if it wrong again, ATM it x intellect but want that to be damage.

  • Shock
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to |cff00ff00Shock|r - (|cffff8080E|r) (Uncommon)
        • Then - Actions
          • Set ShockPoint = (Position of (Target unit of ability being cast))
          • Unit Group - Pick every unit in (Units within 750.00 of ShockPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Set ShockTarget = (Picked unit)
              • Special Effect - Create a special effect attached to the origin of ShockTarget using war3mapImported\Stormfall Fel.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage ShockTarget, dealing (0.75 x ((Real((Hero level of (Triggering unit)))) x (Real((Intelligence of (Triggering unit) (Include bonuses)))))) damage of attack type Magic and damage type Universal
          • Custom script: call RemoveLocation(udg_ShockPoint)
        • Else - Actions
Quick Question, how to i get ability to start on CoolDown

Basically, i am using The Witchers Equipment System, and the spell here is what u get if u equip a specific gem, however if u cast the spell, then UnEquip Gem then Re-Equip gem, it resets cooldown

If you want to damage everyone within 750 range of ShockPoint you can't only damage ShockTarget as a variable will only hold one value. This means that your trigger as it is at the moment will only damage one unit within 750 range of ShockPoint. Instead of damaging the unit variable just damage picked unit instead.
 
Level 6
Joined
Feb 18, 2010
Messages
153
If you want to damage everyone within 750 range of ShockPoint you can't only damage ShockTarget as a variable will only hold one value. This means that your trigger as it is at the moment will only damage one unit within 750 range of ShockPoint. Instead of damaging the unit variable just damage picked unit instead.

This my new code, i figured a work around x damage, by changing Agility to Survivor Power. anywho spells works on all types, but not sure if it classed as leak as it one trigger, but 6 spells, same Shock Point Var, not sure if i should have a Var each

  • Shock
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to |cff00ff00Shock|r - (|cffff8080E|r) (Mythic)
        • Then - Actions
          • Set ShockPoint = (Target point of ability being cast)
          • Unit Group - Pick every unit in (Units within 750.00 of ShockPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Stormfall Fel.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (4.00 x ((Real((Hero level of (Triggering unit)))) x (Real((Agility of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Poison
          • Custom script: call RemoveLocation(udg_ShockPoint)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to |cff00ff00Shock|r - (|cffff8080E|r) (Legendary)
        • Then - Actions
          • Set ShockPoint = (Target point of ability being cast)
          • Unit Group - Pick every unit in (Units within 750.00 of ShockPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Stormfall Fel.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (3.25 x ((Real((Hero level of (Triggering unit)))) x (Real((Agility of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Poison
          • Custom script: call RemoveLocation(udg_ShockPoint)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to |cff00ff00Shock|r - (|cffff8080E|r) (Epic)
        • Then - Actions
          • Set ShockPoint = (Target point of ability being cast)
          • Unit Group - Pick every unit in (Units within 750.00 of ShockPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Stormfall Fel.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (2.50 x ((Real((Hero level of (Triggering unit)))) x (Real((Agility of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Poison
          • Custom script: call RemoveLocation(udg_ShockPoint)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to |cff00ff00Shock|r - (|cffff8080E|r) (Rare)
        • Then - Actions
          • Set ShockPoint = (Target point of ability being cast)
          • Unit Group - Pick every unit in (Units within 750.00 of ShockPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Stormfall Fel.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (1.75 x ((Real((Hero level of (Triggering unit)))) x (Real((Agility of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Poison
          • Custom script: call RemoveLocation(udg_ShockPoint)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to |cff00ff00Shock|r - (|cffff8080E|r) (Common)
        • Then - Actions
          • Set ShockPoint = (Target point of ability being cast)
          • Unit Group - Pick every unit in (Units within 750.00 of ShockPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Stormfall Fel.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (1.25 x ((Real((Hero level of (Triggering unit)))) x (Real((Agility of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Poison
          • Custom script: call RemoveLocation(udg_ShockPoint)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to |cff00ff00Shock|r - (|cffff8080E|r) (Uncommon)
        • Then - Actions
          • Set ShockPoint = (Target point of ability being cast)
          • Unit Group - Pick every unit in (Units within 750.00 of ShockPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Stormfall Fel.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (0.75 x ((Real((Hero level of (Triggering unit)))) x (Real((Agility of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Poison
          • Custom script: call RemoveLocation(udg_ShockPoint)
        • Else - Actions
Paint.png
 
Last edited:
Status
Not open for further replies.
Top