From c2b703dfb0d937aba27a995046a71cc4ab4a4a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20K=C4=B1l=C4=B1=C3=A7o=C4=9Flu?= Date: Wed, 4 Dec 2024 13:05:45 +0300 Subject: [PATCH 1/2] Added new CombatFlag ini setting In the old behavior (55i/55r/56b/56c) we were not guilty when we hit a murderer. Now when we attack a criminal or murderer we are guilty towards that person. An ini setting option has been added for this behavior. Although this is a normal behavior in OSI, it can be perceived as a problem since not every server designs games like OSI. --- Changelog.txt | 4 ++++ src/game/CServerConfig.h | 3 ++- src/game/chars/CCharFight.cpp | 11 +++++++---- src/sphere.ini | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 7043f50d6..21c505b0e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -3960,3 +3960,7 @@ Added: 'H' shortcut for variables to get the value as hexadecimal. NOTE; 1. If no ReflectDamage or ReduceDamage values ​​are entered, the system defaults to the Reactive Armor Effect value. 2. No damage amount can be less than 1. + +04-12-2024, canerksk +- Changed: Added new ini CombatFlags setting COMBAT_ATTACK_NOAGGREIVED + In the old behavior (55i/55r/56b/56c) we were not guilty when we hit a murderer. Now when we attack a criminal or murderer we are guilty towards that person. An ini setting option has been added for this behavior. Although this is a normal behavior in OSI, it can be perceived as a problem since not every server designs games like OSI. \ No newline at end of file diff --git a/src/game/CServerConfig.h b/src/game/CServerConfig.h index f47025fc2..be5a22468 100644 --- a/src/game/CServerConfig.h +++ b/src/game/CServerConfig.h @@ -125,7 +125,8 @@ enum COMBATFLAGS_TYPE // WARNING: doesn't work with Gargoyles due to the new animation packet not accepting a custom animation duration! COMBAT_FIRSTHIT_INSTANT = 0x20000, // The first hit in a fight doesn't wait for the recoil time (OSI like) COMBAT_NPC_BONUSDAMAGE = 0x40000, // NPC will get full bonus damage from various sources. - COMBAT_PARALYZE_CANSWING = 0x80000 // Characters can continue attacking while paralyzed. (Old sphere behaviour) + COMBAT_PARALYZE_CANSWING = 0x80000, // Characters can continue attacking while paralyzed. (Old sphere behaviour) + COMBAT_ATTACK_NOAGGREIVED = 0x100000, // Not being criminal when attacking the murderer (Old sphere behaviour) }; /** diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index 182d96b14..d53d35497 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -345,11 +345,14 @@ bool CChar::OnAttackedBy(CChar * pCharSrc, bool fCommandPet, bool fShouldReveal) bool fAggreived = false; word wMemTypes = MEMORY_HARMEDBY | MEMORY_IRRITATEDBY; - if (!pCharSrc->Memory_FindObjTypes(this, MEMORY_AGGREIVED)) + if (!IsSetCombatFlags(COMBAT_ATTACK_NOAGGREIVED)) { - // I'm the one being attacked first - fAggreived = true; - wMemTypes |= MEMORY_AGGREIVED; + if (!pCharSrc->Memory_FindObjTypes(this, MEMORY_AGGREIVED)) + { + // I'm the one being attacked first + fAggreived = true; + wMemTypes |= MEMORY_AGGREIVED; + } } Memory_AddObjTypes(pCharSrc, wMemTypes); Attacker_Add(pCharSrc); diff --git a/src/sphere.ini b/src/sphere.ini index c0cea2587..808ce75b9 100644 --- a/src/sphere.ini +++ b/src/sphere.ini @@ -412,6 +412,7 @@ SuppressCapitals=0 // COMBAT_FIRSTHIT_INSTANT 020000 // The first hit in a fight doesn't wait for the recoil time (OSI like) // COMBAT_NPC_BONUSDAMAGE 040000 // Npc get bonus damage from various sources such as CombatBonus, CombatBonusPercent, IncreaseDam, Anatomy, Tactics etc. See revision from 12-11-2019 for more details. // COMBAT_PARALYZE_CANSWING 080000 // Characters can continue attacking while paralyzed. (Old sphere behaviour) +// COMBAT_ATTACK_NOAGGREIVED 0100000 // Not being criminal when attacking the murderer (Old sphere behaviour) //CombatFlags=0 // If COMBAT_ARCHERYCANMOVE is not enabled, wait this much tenth of seconds (minimum=0) after the player From c0615c96174ba689b5cc1cb88c898e00c89f9396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20K=C4=B1l=C4=B1=C3=A7o=C4=9Flu?= Date: Wed, 4 Dec 2024 13:05:45 +0300 Subject: [PATCH 2/2] Added new CombatFlag ini setting COMBAT_ATTACK_NOAGGREIVED In the old behavior (55i/55r/56b/56c) we were not guilty when we hit a murderer. Now when we attack a criminal or murderer we are guilty towards that person. An ini setting option has been added for this behavior. Although this is a normal behavior in OSI, it can be perceived as a problem since not every server designs games like OSI. --- Changelog.txt | 4 ++++ src/game/CServerConfig.h | 3 ++- src/game/chars/CCharFight.cpp | 11 +++++++---- src/sphere.ini | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 7043f50d6..21c505b0e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -3960,3 +3960,7 @@ Added: 'H' shortcut for variables to get the value as hexadecimal. NOTE; 1. If no ReflectDamage or ReduceDamage values ​​are entered, the system defaults to the Reactive Armor Effect value. 2. No damage amount can be less than 1. + +04-12-2024, canerksk +- Changed: Added new ini CombatFlags setting COMBAT_ATTACK_NOAGGREIVED + In the old behavior (55i/55r/56b/56c) we were not guilty when we hit a murderer. Now when we attack a criminal or murderer we are guilty towards that person. An ini setting option has been added for this behavior. Although this is a normal behavior in OSI, it can be perceived as a problem since not every server designs games like OSI. \ No newline at end of file diff --git a/src/game/CServerConfig.h b/src/game/CServerConfig.h index f47025fc2..be5a22468 100644 --- a/src/game/CServerConfig.h +++ b/src/game/CServerConfig.h @@ -125,7 +125,8 @@ enum COMBATFLAGS_TYPE // WARNING: doesn't work with Gargoyles due to the new animation packet not accepting a custom animation duration! COMBAT_FIRSTHIT_INSTANT = 0x20000, // The first hit in a fight doesn't wait for the recoil time (OSI like) COMBAT_NPC_BONUSDAMAGE = 0x40000, // NPC will get full bonus damage from various sources. - COMBAT_PARALYZE_CANSWING = 0x80000 // Characters can continue attacking while paralyzed. (Old sphere behaviour) + COMBAT_PARALYZE_CANSWING = 0x80000, // Characters can continue attacking while paralyzed. (Old sphere behaviour) + COMBAT_ATTACK_NOAGGREIVED = 0x100000, // Not being criminal when attacking the murderer (Old sphere behaviour) }; /** diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index 182d96b14..d53d35497 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -345,11 +345,14 @@ bool CChar::OnAttackedBy(CChar * pCharSrc, bool fCommandPet, bool fShouldReveal) bool fAggreived = false; word wMemTypes = MEMORY_HARMEDBY | MEMORY_IRRITATEDBY; - if (!pCharSrc->Memory_FindObjTypes(this, MEMORY_AGGREIVED)) + if (!IsSetCombatFlags(COMBAT_ATTACK_NOAGGREIVED)) { - // I'm the one being attacked first - fAggreived = true; - wMemTypes |= MEMORY_AGGREIVED; + if (!pCharSrc->Memory_FindObjTypes(this, MEMORY_AGGREIVED)) + { + // I'm the one being attacked first + fAggreived = true; + wMemTypes |= MEMORY_AGGREIVED; + } } Memory_AddObjTypes(pCharSrc, wMemTypes); Attacker_Add(pCharSrc); diff --git a/src/sphere.ini b/src/sphere.ini index c0cea2587..808ce75b9 100644 --- a/src/sphere.ini +++ b/src/sphere.ini @@ -412,6 +412,7 @@ SuppressCapitals=0 // COMBAT_FIRSTHIT_INSTANT 020000 // The first hit in a fight doesn't wait for the recoil time (OSI like) // COMBAT_NPC_BONUSDAMAGE 040000 // Npc get bonus damage from various sources such as CombatBonus, CombatBonusPercent, IncreaseDam, Anatomy, Tactics etc. See revision from 12-11-2019 for more details. // COMBAT_PARALYZE_CANSWING 080000 // Characters can continue attacking while paralyzed. (Old sphere behaviour) +// COMBAT_ATTACK_NOAGGREIVED 0100000 // Not being criminal when attacking the murderer (Old sphere behaviour) //CombatFlags=0 // If COMBAT_ARCHERYCANMOVE is not enabled, wait this much tenth of seconds (minimum=0) after the player