• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Canceling a Spell

Not open for further replies.
I use this trigger to cancel a spell based on custom requirements. I have used it on several other spells but in this case it won't prevent the mana from being used.

A previous issue was that the "Animation - Cast Point" was not greater than 0 on the casting model. That is not the case here. The only difference is that I am using a dummy spell based on Roar which is an instant - the other working spells are all point cast.

How may I insure that the mana is not spent?

  • Kraken Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Kraken Call
    • Actions
      • Set TempLoc202 = (Position of (Triggering unit))
      • Set ErrorPlayer = (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at TempLoc202 of type Floatability is off) Equal to True
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Set ErrorMessage = Must be in water.
          • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
        • Else - Actions
          • Animation - Play (Triggering unit)'s spell animation
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempLoc202 facing Default building facing degrees
          • Unit - Add Blizzard (Kraken Call) to (Last created unit)
          • Unit - Order (Last created unit) to Human Archmage - Blizzard TempLoc202
          • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempLoc202)
Level 26
Sep 26, 2009
I don't know what you mean by your last question. Anyway, use a "Unit is issued order with no target" event.
Check if the order == order for Roar spell. Also check if it's correct unit-type, because the event fires for that specific order. It does not differentiate between original Roar and custom Roar, so you have to differentiate it.
Level 7
Jun 15, 2010
you should indeed check the order like nichilus says. the animation cast point is the time between the order and the unit begins casting an ability. So you might set it higher then 0 to be sure that the mana is not spend.
If you have more unit-types that use this roar then i suggest to check if the level of the ability is greater then or equal to 1 instead to make sure the right roar is being used.
Level 26
Sep 26, 2009
Actually the cast point is time between "unit begins casting an ability" and "unit starts the effect of an ability".
The event "unit is issued an order ..." fires when the order is actually issued - for example if the cast range of a spell is 500.00 and you order the unit to cast that spell while it is 1000.00 range away from the target, the unit will ran towards the target to close the range. The issued order event will fire when it starts closing the range.
Pause, stop, unpause.

This. The problem only exists for instant cast no-target abilities. For those abilities, WC3 actually "queues" the stop command instead of executing it instantly. That's why the mana still gets removed. Pausing the unit before issueing stop will combat this because blizzard.
Not open for further replies.