Forcing Unit to cast Spell on target Unit

xAnaMorphine

Active Member
Hey,
I want a creep to cast a spell with a random chance when attacked on the unit who is being targeted by the creep.
Imagine 3 units attack the creep. Unit 1 is being attacked by the creep, while firing the trigger it might happen that Unit 2 or 3 attack and Unit 1 has his "attack-cooldown".

So I came up with this (ignore that there are no chances for spells because I only got 1 at the time and that spell should be cast at 100%)

Trigger:
  • Creep Poison
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Creep
      • (Life of (Attacked unit)) Less than 50
    • Actions
      • Set TEMP_UnitGroup = (Units in Area <gen> matching ((Matching unit) Equal to (Attacking unit)))
      • Unit - Order (Attacked unit) to Night Elf Warden - Shadow Strike (Random unit from TEMP_UnitGroup)
      • Custom script: call DestroyGroup(udg_TEMP_UnitGroup)
 

TomTTT

New Member
Well... is there a problem?
The trigger seems fine to me. Thought if there is a problem maybe the creep just dont have the ability, or that he is being attacked with more than 50 hitpoints every hit, so he usually just can't react cause he's dying right away.
 

vypur85

Hibernate
> Set TEMP_UnitGroup = (Units in Area <gen> matching ((Matching unit) Equal to (Attacking unit)))

This line seems redundant. You might as well set 'Set TempUnit = (Attacking unit)'.


You probably want this:
Code:
Set TEMP_UnitGroup = (Units in within 600.00 area of (Triggering unit) matching ((Current order of (Matching unit) Equal to Attack)) and (Matching unit) belongs to an enemy of (Triggering unit) Equal to True.....etc
 

xAnaMorphine

Active Member
> Set TEMP_UnitGroup = (Units in Area <gen> matching ((Matching unit) Equal to (Attacking unit)))

This line seems redundant. You might as well set 'Set TempUnit = (Attacking unit)'.


You probably want this:
Code:
Set TEMP_UnitGroup = (Units in within 600.00 area of (Triggering unit) matching ((Current order of (Matching unit) Equal to Attack)) and (Matching unit) belongs to an enemy of (Triggering unit) Equal to True.....etc
First of all, thanks for the help.
I have tried that before, the following result is that the creep might jump around through targets, that means if Unit 1 is not attacking at the moment when the creep is able to cast a spell Unit 2 gets hit by the spell while Unit 1 is still focused and attacked by the creep just not by his spell. So I want my System to force the creep to cast everything on the Unit he targets.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • tom_mai78101 tom_mai78101:
    Thanks for the context.
    +1
  • The Helper The Helper:
    Happy Hump Day!!!
  • Blackveiled Blackveiled:
    TH old fart gotta have a beer with me one of these days
  • The Helper The Helper:
    I am down anytime Blackveiled
  • Blackveiled Blackveiled:
    count on it then cause you don't live that far from me hah
  • The Helper The Helper:
    really that is cool!
  • The Helper The Helper:
    Hey Tom I added a new Weird tag to the News Prefixes
  • The Helper The Helper:
    What is up Blackveiled?
  • Blackveiled Blackveiled:
    Chillin', lurkin'. :D
  • The Helper The Helper:
    I am working on a bunch of site projects right now doing a bunch of behind the scenes stuff and trying to clean up some stuff that I let slide when I got lazy with the site for a few years...
  • The Helper The Helper:
    Are you in Houston Blackveiled or just in Texas?
  • Blackveiled Blackveiled:
    Houston
  • Blackveiled Blackveiled:
    I've been living here since 2014.
  • The Helper The Helper:
    OK banlord we need to get together soon! The only other member of the site I know in Houston is XXX Conan
  • The Helper The Helper:
    and he does not want none lol
  • The Helper The Helper:
    he put up a picture of his mom one time and she was HOT!
  • The Helper The Helper:
    I wish we still had that
  • Blackveiled Blackveiled:
    Lmao you scared him off I see.
  • The Helper The Helper:
    he will be back
  • The Helper The Helper:
    Conan was like 12 when he started here
  • The Helper The Helper:
    I literally think I was his male role model
  • Blackveiled Blackveiled:
    Yeah I was 12 when I started here as well.
  • The Helper The Helper:
    you guys were just kids
  • The Helper The Helper:
    I was in my 30s when i got the Blizzard MVP
  • The Helper The Helper:
    I am 53

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top