bozimmerman / CoffeeMud

Full featured, mature MUD supporting MSP, MXP, OLC, with a web server, mail server, and MORE!
Apache License 2.0
191 stars 100 forks source link

[Question] How to make mob death survive server restart #32

Closed dandew closed 4 years ago

dandew commented 4 years ago

Thanks a lot for this amazing MUD server, the amount of work you put in it is mind-boggling.

I'm trying to have some mobs, like arch villains players should really have to slay only once and for all, stay dead when they die. Setting their rejuv to 0 helps but when I take the server down for maintenance and restart it, these mobs reinsert.

Is it possible to make their death permanent?

If not I was thinking of using scripting to send them to a limbo room when they die but I'm afraid they will reinsert at their original spawn point on server restart.

Any suggestion welcome 😊

bozimmerman commented 4 years ago

Interesting problem -- not sure I ever heard this one before.

Here's my suggestion:

Make the room private property, with yourself as the owner of the room. Prop_RoomForSale should do it.

LMK if this works. It's not what it was designed for, but I think it will do the trick.

dandew commented 4 years ago

So I have tried a death script that sends the dying mob (with rejuv=0) to a room (with Prop_RoomForSale) in a limbo area and I managed to end up with the corpse in there, which is quite fun to witness already! Unfortunately after restarting the server this rascal was back on its feet 😅

Maybe this is a feature request? Like for the introduction of a new Prop_NoRejuv or Prop_DeathMeansDeath property? 😊

While typing this, I do realize this project has a very long history and it's not a good sign that I'm the first one asking for this, aka I'm well aware it's quite possible that I'm doing it wrong 😜

bozimmerman commented 4 years ago

Well, it's not an entirely crazy request, if that's what you're worried about. I'm sure there's some existing way to do it -- I just need to dig a bit more to figure out what that is.

bozimmerman commented 4 years ago

So, I might have misunderstood what you tried. What I was suggesting is that, in room X, you add Prop_RoomForSale AND you add the mob with rejuv=0 to the same room X. When the mob is killed, he does not come back to room X during reboot provided the mud was properly shut down and not just killed.

Since the prop_roomforsale is not on the same room in which he was originally born and saved, it can't save and update his dead state, thus he comes back.

dandew commented 4 years ago

Ha! This works, indeed the dead mob stays dead even after a shutdown/restart cycle of the server!

One thing: the MOB's corpse stays in the room, even if looted away (I tried with a rabbit MOB so it's easy to kill and loot). Not a big deal, I'm super stoked already that dead means dead 😊