Spell not working properly

Shadow

TH.net Regular
Reaction score
23
I triggered a spell so once cast you hit 7 random units with 400 radius of you're hero Problem is I don't want the hero to hit the same unit twice I tried removing unit from unit group but didn't seem to do the trick.

Trigger:
  • Ferocity Cast
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Ferocity
    • Actions
      • Set FerocityCaster = (Casting unit)
      • Unit - Create 1 Ferocity Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
      • Set FerocityDummy = (Last created unit)
      • Set FerocityUnitGroup = (Units within 400.00 of (Position of FerocityCaster) matching (((Matching unit) Not equal to (Casting unit)) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of FerocityCaster)) Equal to True))))
      • Trigger - Turn on Ferocity <gen>
      • Trigger - Run Ferocity <gen> (checking conditions)


Trigger:
  • Ferocity
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If ((FerocityRandomTarget is dead) Equal to True) then do (Unit Group - Remove FerocityRandomTarget from FerocityUnitGroup) else do (Do nothing)
          • Unit Group - Pick every unit in (Random 1 units from FerocityUnitGroup) and do (Set FerocityRandomTarget = (Picked unit))
          • Unit - Move FerocityCaster instantly to (Position of FerocityRandomTarget)
          • Animation - Play FerocityCaster's attack 2 animation
          • Special Effect - Create a special effect attached to the origin of FerocityRandomTarget using Objects\Spawnmodels\Human\HumanBlood\HumanBloodFootman.mdl
          • Special Effect - Create a special effect attached to the origin of FerocityRandomTarget using Objects\Spawnmodels\Orc\OrcLargeDeathExplode\OrcLargeDeathExplode.mdl
          • Unit - Cause FerocityCaster to damage FerocityRandomTarget, dealing 150.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the origin of FerocityRandomTarget using war3mapImported\DarkLightning.mdx
          • Unit Group - Remove FerocityRandomTarget from FerocityUnitGroup
          • Wait 0.40 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Integer A) Greater than or equal to 7) or ((FerocityUnitGroup is empty) Equal to True)
        • Then - Actions
          • Unit - Move FerocityCaster instantly to (Position of FerocityDummy)
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
          • Wait 0.50 seconds
          • Set FerocityRandomTarget = No unit
          • Unit - Remove FerocityDummy from the game
          • Trigger - Turn off (This trigger)
        • Else - Actions
 

shiFt

Member
Reaction score
8
Use starts the effect of an ability

Use triggering unit instead of casting unit

Set the position of the caster into a variable, so you can remove it later with udg_RemoveLocation

Please destroy your effects with destroy last created special effect.

Destroy your unit groups after you have used them...

You have a wait inside the loop...this will bug

This can all be in 1 trigger why have u made them into 2??

What exactly does not work with it?
 

Shadow

TH.net Regular
Reaction score
23
Use starts the effect of an ability

When i do that the the spell doesn't have cool down

Not sure why I made into two triggers

the wait i put in so you can see the attack animation else you don't see it.

Special effects i will destroy :p just making sure everything else works

What doesn't work is say there's only 1 unit near you like a hero the ability will allow you to hit him 7 times doing fatal damage I want it so you can only hit the unit once.

I tried to remove from unit group but doesn't seem like it worked
 

Moridin

Snow Leopard
Reaction score
144
Use starts the effect of an ability

Use triggering unit instead of casting unit

Set the position of the caster into a variable, so you can remove it later with udg_RemoveLocation

Please destroy your effects with destroy last created special effect.

Destroy your unit groups after you have used them...

You have a wait inside the loop...this will bug

This can all be in 1 trigger why have u made them into 2??

You've said a lot of things without answering his question...which is:
I don't want the hero to hit the same unit twice I tried removing unit from unit group but didn't seem to do the trick.

Also. the wait in the loop should work fine. I can't see any values being overwritten during the wait....though this spell isn't MUI.

---- back to the q at hand

I actually think removing it from the group should work. If it doesn't...maybe try adding it to a "finished" group and check if the unit is in the group or not? (Boolean comparison)
 

Shadow

TH.net Regular
Reaction score
23
Well the remove unit from group didn't work as you can see in my loop it says remove FerocityRandomTarget from FerocityUnitGroup unless something is adding him back in where I can't see it happening your idea might work by make another unit group and checking but out of curiosity how would i make this mui I know it can't have waits in the trigger but how do i improvise for that?
 

Moridin

Snow Leopard
Reaction score
144
Well.

Effects = Waits = not MUI

UNLESS you use hashtables or lots of arrays. I suggest hashtables as they will not only be easier and more efficient, they will teach you something new (if you haven't used it before).
 

Shadow

TH.net Regular
Reaction score
23
How do i check if a unit is in unit group? I don't see that option in boolean.

NM right in plain site was looking under Unit Group - and not Unit -

Btw the make of a SafeGroup worked thanks!
 

Happy

Well-Known Member
Reaction score
71
game - show to all players the text : (substring(FerocityRandomTarget))
after the pick every unit and do ...
 

fyor

New Member
Reaction score
7
Referring to your MUI question.

Using Waits and Triggering Unit can still make a spell MUI. As long as you use a separate unit group for each unit that casts (aka indexing) it should be MUI.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top