From 1aa0542150d5ed278bddd2a86d361efcba0c70d6 Mon Sep 17 00:00:00 2001 From: David Kindl Date: Wed, 1 Oct 2025 16:35:53 +0200 Subject: [PATCH 1/2] Experimental flag to walk throu monsters (#1455, #1250) --- Changelog.txt | 3 +++ src/game/CServerConfig.cpp | 1 + src/game/CServerConfig.h | 1 + src/game/chars/CCharStatus.cpp | 2 +- src/sphere.ini | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 796b515e0..153af802e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4062,3 +4062,6 @@ When setting a property like MORE to the a spell or skill defname, trying to rea 30-09-2025, Mulambo - Changed: Login rejection (packet `0x82`) is now sent to all clients trying to log in (used to be only to clients, that Sphere could identify). + +01-10-2025, Mulambo +- Added: New experimental flag EF_WalkBypassMonsters. This will override hardcoded client behaviour that prevents stepping over NPCs without max stamina (like GM can). However, this could cause flickering or lags to clients and should be used with caution. diff --git a/src/game/CServerConfig.cpp b/src/game/CServerConfig.cpp index 8ae54cdd1..00a26e3ee 100644 --- a/src/game/CServerConfig.cpp +++ b/src/game/CServerConfig.cpp @@ -4833,6 +4833,7 @@ void CServerConfig::PrintEFOFFlags(bool bEF, bool bOF, CTextConsole *pSrc) if ( IsSetEF(EF_UsePingServer) ) catresname(zExperimentalFlags, "UsePingServer"); if ( IsSetEF(EF_FixCanSeeInClosedConts) ) catresname(zExperimentalFlags, "FixCanSeeInClosedConts"); if ( IsSetEF(EF_WalkCheckHeightMounted) ) catresname(zExperimentalFlags, "WalkCheckHeightMounted"); + if (IsSetEF(EF_WalkBypassMonsters)) catresname(zExperimentalFlags, "WalkBypassMonsters"); if ( zExperimentalFlags[0] != '\0' ) { diff --git a/src/game/CServerConfig.h b/src/game/CServerConfig.h index 534b6b677..91ed5e2a1 100644 --- a/src/game/CServerConfig.h +++ b/src/game/CServerConfig.h @@ -54,6 +54,7 @@ enum EF_TYPE EF_UsePingServer = 0x0008000, // Enable the experimental Ping Server (for showing pings on the server list, uses UDP port 12000) EF_FixCanSeeInClosedConts = 0x0020000, // Change CANSEE to return 0 for items inside containers that a client hasn't opened EF_WalkCheckHeightMounted = 0x0040000, // Unlike the client does, assume an height increased by 4 in walkchecks if the char is mounted. Enabling this may prevent mounted characters to walk under places they could before. + EF_WalkBypassMonsters = 0x0080000 // Allows to bypass client hardcoded behaviour, that prevents characters stepping over NPCs without maximum stamina. This behaviour defaults to GM only. WARNING: This is resource intensive and could cause movement flickering to clients! }; /** diff --git a/src/game/chars/CCharStatus.cpp b/src/game/chars/CCharStatus.cpp index 8e672f18d..dc7298b66 100644 --- a/src/game/chars/CCharStatus.cpp +++ b/src/game/chars/CCharStatus.cpp @@ -680,7 +680,7 @@ byte CChar::GetModeFlag( const CClient *pViewer ) const if ( IsStatFlag(STATF_INVUL) ) mode |= CHARMODE_YELLOW; - if ( GetPrivLevel() > PLEVEL_Player ) + if (GetPrivLevel() > PLEVEL_Player || IsSetEF(EF_WalkBypassMonsters)) mode |= CHARMODE_IGNOREMOBS; if ( IsStatFlag(STATF_WAR) ) mode |= CHARMODE_WAR; diff --git a/src/sphere.ini b/src/sphere.ini index 6efee0d72..ea2c00f3c 100644 --- a/src/sphere.ini +++ b/src/sphere.ini @@ -843,6 +843,7 @@ Secure=1 // EF_UsePingServer 008000 // Enable the experimental Ping Server (for showing pings on the server list, uses UDP port 12000) // EF_FixCanSeeInClosedConts 020000 // Change CANSEE to return 0 for items inside containers that a client hasn't opened // EF_WalkCheckHeightMounted 040000 // Unlike the client does, assume an height increased by 4 in walkchecks if the char is mounted. Enabling this may prevent mounted characters to walk under places they could before. +// EF_WalkBypassMonsters 080000 // Allows to bypass client hardcoded behaviour, that prevents characters stepping over NPCs without maximum stamina. This behaviour defaults to GM only. WARNING: This is resource intensive and could cause movement flickering to clients! Experimental=0 // Option flags From fc9472912344c1ea8a53127bb2697463715c5dbb Mon Sep 17 00:00:00 2001 From: David Kindl Date: Wed, 1 Oct 2025 17:00:26 +0200 Subject: [PATCH 2/2] Optional flag to bypass heal interrupt on hit --- Changelog.txt | 1 + src/game/CServerConfig.h | 3 ++- src/game/chars/CCharFight.cpp | 2 +- src/sphere.ini | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 153af802e..cf94b87b3 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4065,3 +4065,4 @@ When setting a property like MORE to the a spell or skill defname, trying to rea 01-10-2025, Mulambo - Added: New experimental flag EF_WalkBypassMonsters. This will override hardcoded client behaviour that prevents stepping over NPCs without max stamina (like GM can). However, this could cause flickering or lags to clients and should be used with caution. +- Added: New option flag OF_DontInterruptHealOnHit. Healing won't be interrupted on hit. This will allow you to implement your own healing interrupts in combat. diff --git a/src/game/CServerConfig.h b/src/game/CServerConfig.h index 91ed5e2a1..d31cd2d7d 100644 --- a/src/game/CServerConfig.h +++ b/src/game/CServerConfig.h @@ -91,7 +91,8 @@ enum OF_TYPE OF_EnableGuildAlignNotoriety = 0x02000000, // If enabled, guilds with the same alignment will see each other as enemy or ally. OF_NoDclickEquip = 0x04000000, // If enabled, double-click does not equip items. OF_PetBehaviorOwnerNeutral = 0x08000000, // Should my pets always appear natural to me? - OF_NPCMovementOldStyle = 0x10000000 // Required setting to make NPCs run like in the old version. + OF_NPCMovementOldStyle = 0x10000000, // Required setting to make NPCs run like in the old version. + OF_DontInterruptHealOnHit = 0x20000000 // Getting hit won't interrupt healing. You can still implement your own interrupt in triggers (like @Hit / @GetHit). }; /** diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index 10e6451f8..4115ce173 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -2201,7 +2201,7 @@ WAR_SWING_TYPE CChar::Fight_Hit( CChar * pCharTarg ) } // BAD BAD Healing fix.. Cant think of something else -- Radiant - if ( pCharTarg->m_Act_SkillCurrent == SKILL_HEALING ) + if (pCharTarg->m_Act_SkillCurrent == SKILL_HEALING && !IsSetOF(OF_DontInterruptHealOnHit)) { pCharTarg->SysMessageDefault(DEFMSG_HEALING_INTERRUPT); pCharTarg->Skill_Cleanup(); diff --git a/src/sphere.ini b/src/sphere.ini index ea2c00f3c..9376737be 100644 --- a/src/sphere.ini +++ b/src/sphere.ini @@ -877,7 +877,8 @@ Experimental=0 // OF_EnableGuildAlignNotoriety 02000000 // If enabled, guilds with the same alignment (order / chaos) will see each other as allies (green). // OF_NoDclickEquip 04000000 // If enabled, double-click does not equip items. // OF_PetBehaviorOwnerNeutral 08000000 // Should my pets always appear natural to me? -// OF_NPCMovementOldStyle 010000000 // Required setting to make NPCs run like in the old Sphere versions (0.56b). +// OF_NPCMovementOldStyle 010000000 // Required setting to make NPCs run like in the old Sphere versions (0.56b). +// OF_DontInterruptHealOnHit 020000000 // Getting hit won't interrupt healing. You can still implement your own interrupt in triggers (like @Hit / @GetHit). OptionFlags=08|080|0200 // Area flags