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

Spell end cast vs Spell finish

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

What is the difference between these two events?

EVENT_PLAYER_UNIT_SPELL_FINISH

EVENT_PLAYER_UNIT_SPELL_ENDCAST

How can a spell be finished and also not have its cast ended?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Correct me if I'm wrong, but I would guess the GUI equivalents are:
Unit - Unit Stops casting an ability
Unit - Unit Finishes casting an ability

The first one happens when your unit gets interrupted - by getting stunned, by moving, by issuing another order.

The second one happens only when units casts the spell the whole time and the spell does end - it does not fire when the caster gets interrupted by outside source.

For comparison, let's say a Priestess of the Moon is channeling her Starfall ability. Let's say the ability lasts for 30 seconds.
If during that 30 seconds she gets stunned/moves/gets new order, she interrupts the spell and the "Unit stops casting an ability" event fire.
If she channels the spell for the whole 30 seconds, then the spell ends (simply because that's how long its effect lasts), so the "Unit finishes casting an ability" even fire.
 
Level 12
Joined
Nov 3, 2013
Messages
989
I think endcast refers to anytime a unit stops casting and finish refers to anytime a cast is completed.

i.e. endcast would happen if a unit gets interrupted or cancel channel etc while for finish the unit has to complete the entire channel duration.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Stops casting event (ENDCAST) always fires whether unit succesfully casted spell or got interrupted.

Finish casting event (FINISH) only fires if unit completed spell with all animations etc.

Also if a unit succesfully finish a spell, finish event fires first then endcast event fires later.
 
Status
Not open for further replies.
Top