• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] order dummy to cast stun on all picked units

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2009
Messages
21
Greetings. I have a problem where this skill only stuns one unit from the picked group


Here is my trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Blast
    • Actions
      • Set Location[1] = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of Location[1] matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Triggering player)) Equal to True
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is Mechanical) Equal to False
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of boss (Least) for (Picked unit)) Not equal to 1
                • Then - Actions
                  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Location[1] facing Default building facing degrees
                  • Unit - Add stun 1 sec (Neutral Hostile) to (Last created unit)
                  • Unit - Order (Last created unit) to Neutral - Firebolt (Picked unit)
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                • Else - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (0.00 + (1.25 x (Real((Agility of (Triggering unit) (Include bonuses)))))) damage of attack type Hero and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Location[1])
 
Level 3
Joined
Aug 18, 2009
Messages
21
Hmmm I see... I'm not so sure if I get it but I think what you mean is it checks again if a unit casts a spell and since the spell cast by the dummy is not Mana Blast it ends the trigger. Thanks for the reply ^_^

Oh XD I didn't see that I put a condition in the picked units part haha thanks
 
set ug= units with 1000 of location[1] matching : matching unit is not a boss and matching unit is alive and matching unit is a mechanical equalls to false and matching unit is magic immune equalls to false and ... etc.
pick every unit in ug and do {
}
Custom script "call DestroyGroup(udg_ug)"
fixing the lag and making everying more simple, to allow you to find the blind spot that made your ability not working.
On another question "make the ability damage only one unit among the unit group?"
pick every unit in unit group{
set UNIT = PICKED UNIT
}
do something with that randomed unit from that unit group
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Blast
    • Actions
      • Set Unit = (Triggering unit)
      • Set Player = (Triggering player)
      • Set Location = (Position of Unit)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of Location) and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempPickedUnit belongs to an enemy of Player) Equal to True
              • (TempPickedUnit is alive) Equal to True
              • (TempPickedUnit is Mechanical) Equal to False
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of boss (Least) for TempPickedUnit) Not equal to 1
                • Then - Actions
                  • Unit - Create 1 Dummy for Player) at Location facing Default building facing degrees
                  • Unit - Add stun 1 sec (Neutral Hostile) to (Last created unit)
                  • Unit - Order (Last created unit) to Neutral - Firebolt TempPickedUnit
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                • Else - Actions
              • Unit - Cause Unit to damage TempPickedUnit, dealing (0.00 + (1.25 x (Real((Agility of Unit (Include bonuses)))))) damage of attack type Hero and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Location)
 
Last edited:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Blast
    • Actions
      • Set Unit = (Triggering unit)
      • Set Player = (Triggering player)
      • Set Location = (Position of Unit)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of Location) and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempPickedUnit belongs to an enemy of Player) Equal to True
              • (TempPickedUnit is alive) Equal to True
              • (TempPickedUnit is Mechanical) Equal to False
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of boss (Least) for TempPickedUnit) Not equal to 1
                • Then - Actions
                  • Unit - Create 1 Dummy for Player) at Location facing Default building facing degrees
                  • Unit - Add stun 1 sec (Neutral Hostile) to (Last created unit)
                  • Unit - Order (Last created unit) to Neutral - Firebolt (Picked unit)
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                • Else - Actions
              • Unit - Cause Unit to damage TempPickedUnit, dealing (0.00 + (1.25 x (Real((Agility of Unit (Include bonuses)))))) damage of attack type Hero and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Location)
:]
Its amazing how you done everything right exepts for 1 things, I AM impressed.
Instead of Player = triggered player -> use Player = owner of Triggered Unit.
As it is right now, the computer does not know who is the player, since Trigger Player reffering to player who used chat. Since the trigger does not know whos the player, the game would probably crash - or create dummy units for the wrong player, and you cant go storm bolt on ally unit.
Tell me if it is still not working.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Blast
    • Actions
      • Set Unit = (Triggering unit)
      • Set Player = (Triggering player)
      • Set Location = (Position of Unit)
      • Unit - Create 1 Dummy for Player) at Location facing Default building facing degrees
      • Unit - Add stun 1 sec (Neutral Hostile) to (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of Location) and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempPickedUnit belongs to an enemy of Player) Equal to True
              • (TempPickedUnit is alive) Equal to True
              • (TempPickedUnit is Mechanical) Equal to False
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of boss (Least) for TempPickedUnit) Not equal to 1
                • Then - Actions
                  • Unit - Order (Last created unit) to Neutral - Firebolt TempPickedUnit
                • Else - Actions
              • Unit - Cause Unit to damage TempPickedUnit, dealing (0.00 + (1.25 x (Real((Agility of Unit (Include bonuses)))))) damage of attack type Hero and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Location)

In jass I would not create the unit if the was no units to cast the ability on.
 
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Blast
    • Actions
      • Set Unit = (Triggering unit)
      • Set Player = (Triggering player)
      • Set Location = (Position of Unit)
      • Unit - Create 1 Dummy for Player) at Location facing Default building facing degrees
      • Unit - Add stun 1 sec (Neutral Hostile) to (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of Location) and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempPickedUnit belongs to an enemy of Player) Equal to True
              • (TempPickedUnit is alive) Equal to True
              • (TempPickedUnit is Mechanical) Equal to False
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of boss (Least) for TempPickedUnit) Not equal to 1
                • Then - Actions
                  • Unit - Order (Last created unit) to Neutral - Firebolt TempPickedUnit
                • Else - Actions
              • Unit - Cause Unit to damage TempPickedUnit, dealing (0.00 + (1.25 x (Real((Agility of Unit (Include bonuses)))))) damage of attack type Hero and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Location)

In jass I would not create the unit if the was no units to cast the ability on.
I know that this sounds odd but this is the truth: a single dummy unit for a group will only target one unit, the reason is not known, even a dummy with 0.0 cast animation time and is flying and turn rate is 1.00, still will only target one unit and ignore the others I noticed this on my maps and either I don't know how to fix this or its impossible.
 
Set the movement speed to 0 in object editor or remove move ability from the unit. Then as long as the unit can see the target, it will cast it on as many as you need.

I am going to check it, if it works, I would rep you tommorow as I allready given maximum rep alloweded for a day. Really hope you are correct brother.
Edit:
HAHA Its AMAZING! Its working! No more 25 casters for 25 units hahaha this is so much help for my costum spells THANK YOU
 
Last edited:
it's not completed yet, but here it is

giving a unit attack damage of "0"? the unit will still attack but with 0 damage, If you want a dummy to damage with poison sting, go shift enter and give it -9999 so even a kodo beast wont add to its damage and only the poison applies, if you do not want that, set the unit's "attack enable" to "none". Either way, as it is right now the dummy will attack even with 0 damage as its attack power. (Intenses that you do not need like "unit was attacked" and "unit got damaged").
 
Status
Not open for further replies.
Top