Temp Safe Flag
The Temporary Safety Flag (Tempsafe Flag) is a bit flag that is set when a player is PKed and grants that player a guardian angel for three hours (time can be changed via system setting). The player must be innocent, under 100hp and not have a soldier shield to receive the flag. This system is enabled for all players, but can be opted-out via a client setting, in Game -> Preferences -> Special effects (last option). A message is displayed to the player whenever a ### Safety on/off message is displayed telling them of their temp safety status (opted in, out or invalid).
This system is intended to lessen the blow of being PKed for newbies, by allowing them a chance to get their stuff back and continue building uninterrupted for a short period, and provide an incentive to not react to a PKing by just logging off. This system is intended to work alongside other 'social/PK fixes' such as a proposed new lowest guild rank (no guild benefits, not attackable in town) but can also work with more comprehensive systems such as the PK flag setting. I actually made the initial pull request for this in February but until recently didn't have the skills to finish it.
GetTempSafeTime() - Time in minutes the player is protected.
StartTempSafe() - Called when the player takes penalties from being killed by another player. Sets the flag.
EndTempSafe() - Called by timer from StartTempSafe(). Removes the flag.
piTempSafeMinutes = 180 - Default 180 minute protection time.
UC_TEMPSAFE = 9 - New user command used to determine whether the player has the Client option checked to enable the temp safe flag on death.
TEMPSAFE_YES = 0x1000 - Overlaps with APPLY_YES, but will not cause any ill effects as players cannot be applied to anything. Also overlaps with MINION_SELF, but again cannot cause any issues. This is sent to the client if the player has opted in to the temp safety system.
PFLAG_TEMP_SAFETY = 0x040000 - This is the player flag that is set if the player opts in to the temp safety system. This bit is also set in PFLAG_MASK so it cannot be removed using ResetPlayerFlagList.
PFLAG2_TEMPSAFE = 0x002000 - This is the flag that is set when the player has the temporary angel activated (i.e. upon being PKed).
OF_TEMPSAFE = 0x00001000 - The matching client flag for TEMPSAFE_YES. Same overlaps, but no issues.
Misc new client functions and code to enable the new client option.
Not sure if it's possible to attempt to 'apply' a player in the new 3D client. If so, the OF_APPLYABLE/APPLY_YES overlap may cause issues.
Players still get killed at least once to be protected by this system. While I believe there should be some risk involved with the game there are other viewpoints on this, and also some players wish to play without participating in PvP at all. However, this system is not mutually exclusive with an overarching PvP-off flag and in the event that system is also implemented, this flag will still provide protection for newer players who opt-in to the PvP system.
Guilded players are protected if PKed; this is by design as often newbies who dare to join guilds are singled out as 'known soft targets', thus this protection is more relevant for them than for most players.
The on/off confirmation messages that are displayed alongside the safety messages add to the message clutter building up when a player logs on/off or a system save occurs. It may be necessary to keep these as players might play on more than one character, possibly with different flag values and will need to verify whether the flag is set or not.