• 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.

[Trigger] Check wether channeling spell was interrupted

Status
Not open for further replies.
Level 3
Joined
Dec 22, 2007
Messages
28
Hiya.

I got the following problem.
I did triggers for a spell that starts after 5 seconds channeling. Now, if you interrupt the channeling after 1 second, the effect also starts (after 4 more seconds).

How can I check wether the channeling of that spell had a duration of 5 seconds?
 
Level 3
Joined
Dec 22, 2007
Messages
28
What is the order string for casting/channeling (the spell bases on Blizzard)?
Order(..)?
 
Last edited:
Level 3
Joined
Dec 22, 2007
Messages
28
Strange. The ID it displayed was A000; but when I tried that, it didn't work.
So I did
  • Game - Display to (All players) the text: (String((Current order of (Triggering unit))))
It said the ID is "blizzard". So I tried with blizzard as order and it worked. But what if someone casts now the real blizzard? Don't these 2 spells have the same ID?
 
Level 3
Joined
Apr 29, 2009
Messages
32
  • YourAbility
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to YourAbility
    • Actions
      • Unit Group - Add (Casting unit) to YourAbilityUnitGroup
      • Hashtable - Save 5 as (Key YourAbility) of (Key (Casting unit)) in AbilityHashtable
The above trigger saves the channeling time.
When the below creates the effect at the right time.

  • YourAbility 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in YourAbilityUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key YourAbility) of (Key (Picked unit)) from AbilityHashtable) Equal to 0
            • Then - Actions
              • -------- Do your actions here --------
              • Unit Group - Remove (Picked unit) from YourAbilityUnitGroup
            • Else - Actions
              • Hashtable - Save ((Load (Key YourAbility) of (Key (Picked unit)) from AbilityHashtable) - 1) as (Key YourAbility) of (Key (Picked unit)) in AbilityHashtable
Is this what you want?
 
Level 3
Joined
Dec 22, 2007
Messages
28
Not really. This is pretty similar to my script. But what do you do if you interrupt the channeling (manually)?
I'm trying to solve the problem by checking the order. Now I figured out, that my spell's (what is based on blizzard) ID is "blizzard" (it didn't work with the raw data, "A000").
 
Ah sorry my bad, I was thinking about something else hehe.
But what you can do is still check for the blizzard order but also add an ability check.
Like if his order is blizzard and has "custom blizzard" skill, do actions. This will make it work only for you custom skill and none other. Unless the unit/hero has 2 blizzard skills with the same order id.
 
Level 3
Joined
Dec 22, 2007
Messages
28
Well, I let it be. It should work this way and I won't make another ability based on blizzard aviable for that hero.

Ty for your help :cwink: +rep
 
you can use a boolean to set if the the unit is still casting...

  • Event
    • Unit - A Unit starts the effect of Channel
  • Actions
    • Set Casting = true
then set it to false when that unit stops/moves or whatever....
  • Event
    • Unit - Stops casting an ability
    • Unit - Finishes casting an ability
  • Action
    • Set Casting = false
then just check that variable before you run the trigger that will happen after 5 seconds of casting time.... this way it will work even if you use abilities with the same order ID..
 
Status
Not open for further replies.
Top