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

Casting an Item Spellbook Ability Event?

Status
Not open for further replies.
Level 6
Joined
Aug 12, 2007
Messages
201
If I have a unit casting an ability from within a spellbook that is an item, what is the event I use to see if this happened?

Unit Uses an Item doesn't seem to work, neither does Starts the Effect of an Ability.

EDIT: Apparently Starts the Effect of an Ability DOES work, it was my condition that was getting in the way. Even though it is "Ability Being Cast = MyAbility, it won't continue the trigger.

In this case how do I get the condition Ability being cast to work with a spell that is being cast from within an item spell book?

EDIT: Okay something definitely weird is going on. Right now the trigger gets as far as just before the condition where it sends 'Text' to tell me it got that far, but if I change it to an exact copy of the ability I m trying to check for and cast that instead, it works but wont return that the ability cast for some reason with the text string. Its like it is only firing half of the trigger.

  • BuildingDummyTest
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
    • Actions
      • Game - Display to (All players) the text: AbilityCast!
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Place Fortifications
        • Then - Actions
          • Game - Display to (All players) the text: AbilityCast!
          • Set TempHeroPoint = (Position of (Triggering unit))
          • Set FortificationDummy = (Target unit of ability being cast)
          • Set FortificationDummyPoint = (Position of FortificationDummy)
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Wood Boards) to ((Charges remaining in (Item carried by (Triggering unit) of type Wood Boards)) - 1)
          • Unit - Create 1 FortifyingDummy for (Owner of (Triggering unit)) at TempHeroPoint facing Default building facing degrees
          • Unit - Remove (Target unit of ability being cast) from the game
          • Unit - Order (Last created unit) to build a Window at FortificationDummyPoint
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
This is my trigger right now, without the leak cleanup. It is messy for dev purposes

I got the spell to cast reliably by using a different spell then channel as the dummy, but for some reason it won't remove the building from the game.
 
Last edited:
Level 9
Joined
Oct 11, 2009
Messages
477
Use the Ability comparison in Condition: Ability being cast Equal to Spellbook; why Spellbook? Because you use the ability by a way of using a spellbook and a spellbook item has its own ability in which its spells are listed down and below the Actions, create a loop: If, Then, Else Function and put in its Condition the Ability being cast Equal to <Your Spell>...:cool:
 
Last edited:
Status
Not open for further replies.
Top