Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No hook for bosses dying #66

Open
Mrcactus1215 opened this issue Jun 14, 2022 · 2 comments
Open

No hook for bosses dying #66

Mrcactus1215 opened this issue Jun 14, 2022 · 2 comments

Comments

@Mrcactus1215
Copy link

I'm trying to make a plugin for DPS and % contribution to bosses calculation.

The way it works is by using TSAPI's extension of the Npc.Strike hook I add each boss to a dictionary with the needed information for the calculation. And then when the boss dies, using TSAPI's extension of the Npc.Killed hook I remove the boss from the dictionary.

It works fine for bosses like King Slime, Eye of Cthulhu and such (one part) bosses, but it gets very complicated when dealing with multiple part bosses (Skeletron Prime, Skeletron not included because their arms are not part of the boss's max health).
Eater of Worlds specifically can't be removed from the dictionary because while a part of it dies, the 'boss' is still alive.

I tried to go around it by getting the total number of segments of the boss (head and tail don't count, only type ID 14) and then only removing it after the number of segments dead is the same as total but that seemed to be less reliable as the boss split apart, and then some other bugs where I used a strong weapon and hit the boss after it was dead. All of my calculations would be possible, and easier to do if there was a hook for bosses dying with the Terraria.NPC property in it.

With such a hook, all I'd have to do is remove the NPC from my dictionary and it's done, no counting or anything.

@punchready

This comment was marked as off-topic.

@Mrcactus1215
Copy link
Author

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants