• Hello Guest! Did you know that ProjectKorra has an official Discord server? A lot of discussion about the official server, development process, and community discussion happens over there. Feel free to join now by clicking the link below.

    Join the Discord Server

onAbilityInstancedEvent (API Expansion Suggestion)

Status
Not open for further replies.

dookoo782

Verified Member
Hello, this is a suggestion regarding API Expansion.

I'd like to suggest a onAbilityInstancedEvent because I need to know when an ability has been used, who used the ability and if the ability killed someone(if that is possible).
I know I could do this by using jed's way of checking most recently used abilities and constantly looping, etc. but I want to do this more efficiently and with less pressure on server CPU and you know, with a separate thread running for each ability already and a new instance of the ability being instantiated for every time a player uses an ability already happening. I wouldn't want to weigh down the server any more.

Thank you for reading and I hope this gets added to 1.7.0 and that 1.7.0 development comes quickly! :)
 

jedk1

New Member
this event would be great... except would also require ALL addon abilities to update to work effectively...
 

jedk1

New Member
How would it? :O
you want to check if a player is using the ability. The combo manager works by checking shifting or clicking with a move on a slot. It DOESN'T detect if it's been initialised. To detect if an ability has been initialised the ability would have to tell the code "Hey! I'm being initialised, fire the event!". The stock abilities could have this done... as for addons... they would all be required to update. Now you could run something to check each ability to get it's main ability class and check when something is added to the instances map, that is, assuming they've called it instances. But when you add water arms which has at least 5 instance maps it wouldn't go so well.
 

dookoo782

Verified Member
Ah I see what you mean, I've just skim read the ComboManager and how it calls the addComboAbility method everytime. Couldn't we just fire the event when addRecentAbility is called? That would save everyone updating their abilities and I only need to know who used the ability and which ability was used, not the details of the instantiation(not even a word apparently but you get what I'm saying).
 

jedk1

New Member
Ah I see what you mean, I've just skim read the ComboManager and how it calls the addComboAbility method everytime. Couldn't we just fire the event when addRecentAbility is called? That would save everyone updating their abilities and I only need to know who used the ability and which ability was used, not the details of the instantiation(not even a word apparently but you get what I'm saying).
hmm i understand what you mean, but combo manager ignores cooldowns etc.
 

jedk1

New Member
Hmm.. anyway, I'll let the PK Devs deal with this. Just a note for the PK Devs, I need this ASAP.
while you wait for them to add it or something, why not make yourself a custom pk? either clone the git to desktop or fork it and make your own custom pk, just dont redistribute it.
 

AlexTheCoder

Staff member
Plugin Developer
Verified Member
For now you can listen for when a cooldown is added and take that as the move being used
 
Status
Not open for further replies.
Top