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

Adding BossSummon Permissions #113

Open
Netroshin1 opened this issue Feb 21, 2023 · 7 comments
Open

Adding BossSummon Permissions #113

Netroshin1 opened this issue Feb 21, 2023 · 7 comments

Comments

@Netroshin1
Copy link

This mod has a huge varity of group permissions but what about the permission to be able to spawn Bosses like in the tshock.NPC.BossSummon permission?
I am running a communityserver and the players only should be able to proceed while I'm streaming.
In my Vanilla Server I found the permission to summon Bosses and I gave the permission to my mods and the admin group only.

The perfect extention would be:
Only be able to spawn a Boss as a new player if it's already fainted in the world. Admins and Mods can spawn Bosses that aren't fainted already, thus no "BossSummon-Griefing" is possible.

Is this even possible? I already made a mod for tmodLoader 1.4 but I'm a newbie at this point.
My only solution to have an "Anti-BossSummon-Grief" is to have a world backup every 2 hours and if there was any kind of grief then I choose the last backup the Boss isn't fainted yet.

@JavidPack
Copy link
Owner

That's certainly a good idea. It sounds like a feature many would be interested in.

I'm not really sure a good way to implement something like that at the moment. I'm also busy and probably won't be able to implement this myself, but maybe someone will see this and be willing to give it a try.

@JavidPack
Copy link
Owner

What about natural spawns?

@JavidPack
Copy link
Owner

K, I added a SpawnBosses permission in v0.4.12. By default it is true for all roles, but you can remove it. It'll take more work to get a working permission for allowing users to spawn already defeated bosses, but for now that permission should do what you want. I'm not 100% sure how natural boss spawns interact with the feature.

@Netroshin1 Netroshin1 reopened this Mar 5, 2023
@Netroshin1
Copy link
Author

What about natural spawns?

As for natural spawns no one can prevent them if they are farming on the server. Mostly my community dies anyway bc of the difficulty but sometimes they don't fight the bosses, they die on purpose.

K, I added a SpawnBosses permission in v0.4.12. By default it is true for all roles, but you can remove it. It'll take more work to get a working permission for allowing users to spawn already defeated bosses, but for now that permission should do what you want. I'm not 100% sure how natural boss spawns interact with the feature.

That sounds very nice, thank you very much!
Well... There must be some kind of code for the bosses to be able to spawn naturally. I don't know much about it for now (and you probably thought about that) but can't we implement the permissions instead of "natural spawn" e.g.:
if (PlayerMaxHealth >= 200) {
EyeOfCthulhu.CanSpawn()
} to

if (PlayerPermission.SpawnBoss == true OR [Boss name].IsDefeatedInWorld == true) {
EyeOfCthulhu.CanSpawn()
}

Something like this...? You also have "permissions" to be able to spawn golem after you fought plantera. I don't know if we can mod the vanilla files to this or we need to override the code with something else. If we can mod the vanilla code, I can look it up if u want. I can help for a bit.

@JavidPack
Copy link
Owner

I'm leaving the other permission to allow spawning downed bosses for later, when I'm feeling up to it. Making a system where the admin determines conditions would be too much work.

For natural spawns, I'll have to investigate more, I can probably find some way of detecting them.

@Netroshin1
Copy link
Author

I had a look at some code and found out something interesting for "NPC, when is it a boss?"
and some downedBoss values. I made comments within the new lines.
Hope this helps.

@JavidPack
Copy link
Owner

Thanks. There is actually a lot more to it when dealing with modded bosses, where we'll have to do some boss checklist integration, but your notes are helpful.

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

No branches or pull requests

2 participants