Magic

Magic

190k Downloads

Getting 'active' spells?

alexayalamcs opened this issue ยท 2 comments

commented

Not sure if this is handled in a particular way (or at all), but I can't seem to find a way to get a list of spells that are currently active or in progress. For example, if a spell is cast has a projectile that lasts x amount of seconds, I want to get a list that shows that spell is active until it's completed.

Current functions such as getActiveSpells() (on Mage) or isActive (under MageSpell) only return correct information about spells that has active costs (Such as LevitateSpell).

commented

Mage.getPendingBatches is maybe what you want. It's the only thing that tracks in-progress ActionSpells running.

You can get the name of the batch, which I think is the name of the spell. There is not currently a way via the API to reference back to the spell that started the batch, though I think that could be added or you could do some non-API casting to figure it out.

commented

That worked, thanks!