• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Dummy not casting spell

Status
Not open for further replies.
I have a script that is supposed to make a dummy cast a spell on a unit everytime it is damaged by a specific enemy (based on chance).
Problem is, for some reason, it won't fire.

This is how the code snippet looks:
JASS:
set dummy = CreateUnitAtLoc(GetOwningPlayer(u2), 'h00N', loc, 0.)
call UnitAddAbility(dummy, 'A009')
call IssueTargetOrder( dummy, "cripple", u2)
call UnitApplyTimedLife(dummy , 'BTLF', 10.00 )
call PauseUnit(u2, true)
call BJDebugMsg("Immobilized")
call RemoveLocation(loc)

i am sure there's nothing wrong with the variables, and i have bugchecked and noticed that the unit IS infact created, so the problem lies in the spell.
The variable "u2" is set to "Triggering Unit", of a trigger with the event "x unit takes damage". It works with the "PauseUnit" call, so it must be right.

I can't screenshot the spell in the object editor, byt i can type some of the important properties:

Code:
Check Dependencies: False
Cast Range: 9999
Cooldown: 0.10
Duration: 9999
Mana Cost: 0
Targets Allowed: Ground, Enemy, Friend, Allied, Mechanical.

The dummy unit has the following abilities:

Code:
Locust
Invurnerability

The dummy has no model file.


And well.. i don't know what other information could be neccesary. The problem just seems really silly to me. :(

EDIT: Debug also shows that the unit BEGINS casting the ability (which means the dummy is created, gains the ability, knows the target, begins casting, but can't). This is really confusing me.
EDIT: Gave the dummy ability to a regular ground unit and ordered it to cast it on the target. Worked like a charm. But somehow, the dummy refuses to do the same! Why?!
It lives for 10 seconds, so it should have well enough time..
 
Last edited:
Status
Not open for further replies.
Top