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

[Spell] Begins casting an ability problem

Status
Not open for further replies.
Level 3
Joined
Nov 22, 2014
Messages
50
Allright, I have two spells that that requires certain conditions to be met. When the conditions are met the Integer AnastasiaElement will be not equal to 0.
So I need those spells not to go on cooldown when you try to use the spell, but to get an error message.

Now when I cast a spell, the trigger does run, as i do get the message, however, the spell still goes on cooldown.

I have tried a workaround, removing and adding the spell beïng cast, but even that doesn't work. If I do that, the weird thing occurs that the spellcaster gets in an continues state of spellcasting, and doesn't listen to orders anymore, (only to be interrupted from this state by casting another spell.)

So why does the spell casted still goes on cooldown, and how do I solve it?

  • GreaterCNoOrb
    • Events
      • Unit - Anastasia 0005 <gen> Begins casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Greater Conjuring
          • (Ability being cast) Equal to Discharge
      • AnastasiaElement Equal to 0
    • Actions
      • Unit - Order (Triggering unit) to Stop
      • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player))) the text: |c00F78181Cast an o...
      • Sound - Play Error <gen>
 
Level 3
Joined
Nov 22, 2014
Messages
50
I have, it doesn't work.

I thought this would be one of the very few applications in which you would use Begin casting an ability, as this event happens before the spell?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This method aborts anything, even Defend.
  • Untitled Trigger 005
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(defend))
    • Actions
      • Unit - Pause (Triggering unit)
      • Unit - Order (Triggering unit) to Stop
      • Unit - Unpause (Triggering unit)

You also propably want to use that type of event, since it triggers before "Begins casting" or "Starts the effect".

For example with point or unit targeted spells, if the unit/point is not in range, the unit will walk towards the target until it is in range. Only then it would abort the spell if you used "Begins casting event". "Starts the effect" triggers 0.3-0-5 seconds after Begins casting, defined by Art - cast point in object editor for the unit type.
 
Status
Not open for further replies.
Top