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

[Solved] Spell not working

Status
Not open for further replies.
Level 14
Joined
Jul 12, 2011
Messages
1,370
Hey people!
There is another spell I'm working on today and it isn't working.
The spell teleports your hero to the targeted unit and after a short while back to his initial position. After 2 seconds the targeted unit explodes.
Trigger:
  • Magic Bolt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Bolt
    • Actions
      • Set Point004 = (Position of (Triggering unit))
      • Set Point005 = (Target point of ability being cast)
      • Wait 0.20 seconds
      • Unit - Create 1 Feral Effect Dummy for (Owner of (Triggering unit)) at Point004 facing (Random angle) degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 Feral Effect Dummy for (Owner of (Triggering unit)) at Point005 facing (Random angle) degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Move (Triggering unit) instantly to Point005
      • Unit - Create 1 Arcane Nova Inv Dummy for (Owner of (Triggering unit)) at Point005 facing 270.00 degrees
      • Unit - Set mana of (Last created unit) to 100.00
      • Unit - Add a 8.00 second Generic expiration timer to (Last created unit)
      • Wait 1.00 seconds
      • Unit - Order (Last created unit) to Undead Lich - Frost Nova (Target unit of ability being cast)
      • Wait 0.20 seconds
      • Unit - Move (Triggering unit) instantly to Point004
      • Unit - Create 1 Feral Effect Dummy for (Owner of (Triggering unit)) at Point004 facing (Random angle) degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 Feral Effect Dummy for (Owner of (Triggering unit)) at Point005 facing (Random angle) degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Point004)
      • Custom script: call RemoveLocation (udg_Point005)
However, the only thing that is not working is this:
  • Unit - Order (Last created unit) to Undead Lich - Frost Nova (Target unit of ability being cast)
The "last created unit" is a dummy unit who has a spell based on frost nova (Lich's frost nova with item spell checked) and the spell has a casting time of 2 seconds.

Can this be fixed somehow, or I should go with the Pick every units and do actions blah, blah, blah?
 
Last edited:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Level 25
Joined
Sep 26, 2009
Messages
2,378
Check if:
- you can cast the ability yourself. Give it to inv dummy, but remove locust and make it visible, select the unit and try to cast the ability yourself manually. If it can be casts, then problem is somewhere else,
- after 1.00 second wait your inv dummy does not have to be the (Last created unit). That variable is global, so if you create another unit within that 1 second, it will point to different unit altogether. Just save it into variable.
- also, if the targeted unit is supposed to explode, why don't you damage it via triggers? unless you're going for the "Frozen" effect you can do everything via trigger.

Some other things:
- this ain't MUI and if you use Point004 and 005, then it is also prone to bug your whole spell,
- don't use "pick every unit" to pick the dummy. This is not only a heavy process, but you wouldn't pick up a unit with locust (unless you went for "pick every unit OF PLAYER")
- if your dummy casts the Frost Nova spell, why do you set the spell as "item" ability and give it mana cost? Those things are redundant for dummy and all it achieves is that you need to do more stuff like add mana via trigger to the dummy unit, etc.
 
Level 14
Joined
Jul 12, 2011
Messages
1,370
The unit was able to do the spell in "normal form".
Also there is no action such as Neutral-Frost Nova thing. I think the problem is with what Bribe mentioned......
However, I though that the last created unit was mented only for the specific trigger, or not?
 
Status
Not open for further replies.
Top