Skip to content

Commit c0baac5

Browse files
canerkskcbnolok
andauthored
Added new CombatFlag ini setting COMBAT_ATTACK_NOAGGREIVED (#1342)
* 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. --------- Co-authored-by: cbnolok <cbnolok@gmail.com>
1 parent 94d4791 commit c0baac5

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Changelog.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -3957,9 +3957,9 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.
39573957
LOCAL.ReflectDamage (r/w) = The amount of damage that will be reflected to this other party
39583958
LOCAL.ReduceDamage (r/w) = Amount to be deducted from damage received
39593959
LOCAL.DamageType (r/w) = Type of damage received (Default: DAMAGE_FIXED andDAMAGE_REACTIVE)
3960-
NOTE:
3961-
1. If no ReflectDamage or ReduceDamage values are entered, the system defaults to the Reactive Armor Effect value.
3962-
2. No damage amount can be less than 1.
3960+
NOTE:
3961+
1. If no ReflectDamage or ReduceDamage values ​​are entered, the system defaults to the Reactive Armor Effect value.
3962+
2. No damage amount can be less than 1.
39633963

39643964
4-12-2024, canerksk
39653965
- Fixed: Sphere crash troubleshooting if a player has no CHATNAME value and remove a channel.
@@ -4021,3 +4021,5 @@ NOTE:
40214021
22-04-2024, canerksk
40224022
- Added: New item function, CARVECORPSE: carves a corpse with SRC = char carving the corpse.
40234023
- Added: New ini RevealFlag setting REVEALF_ONHORSE, to allow or disallow stealth walking if you are on a mount.
4024+
- Added: new ini CombatFlags setting COMBAT_ATTACK_NOAGGREIVED.
4025+
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.

src/game/CServerConfig.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ enum COMBATFLAGS_TYPE
126126
// WARNING: doesn't work with Gargoyles due to the new animation packet not accepting a custom animation duration!
127127
COMBAT_FIRSTHIT_INSTANT = 0x20000, // The first hit in a fight doesn't wait for the recoil time (OSI like)
128128
COMBAT_NPC_BONUSDAMAGE = 0x40000, // NPC will get full bonus damage from various sources.
129-
COMBAT_PARALYZE_CANSWING = 0x80000 // Characters can continue attacking while paralyzed. (Old sphere behaviour)
129+
COMBAT_PARALYZE_CANSWING = 0x80000, // Characters can continue attacking while paralyzed. (Old sphere behaviour)
130+
COMBAT_ATTACK_NOAGGREIVED = 0x100000, // Not being criminal when attacking the murderer (Old sphere behaviour)
130131
};
131132

132133
/**

src/game/chars/CCharFight.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,14 @@ bool CChar::OnAttackedBy(CChar * pCharSrc, bool fCommandPet, bool fShouldReveal)
345345

346346
bool fAggreived = false;
347347
word wMemTypes = MEMORY_HARMEDBY | MEMORY_IRRITATEDBY;
348-
if (!pCharSrc->Memory_FindObjTypes(this, MEMORY_AGGREIVED))
348+
if (!IsSetCombatFlags(COMBAT_ATTACK_NOAGGREIVED))
349349
{
350-
// I'm the one being attacked first
351-
fAggreived = true;
352-
wMemTypes |= MEMORY_AGGREIVED;
350+
if (!pCharSrc->Memory_FindObjTypes(this, MEMORY_AGGREIVED))
351+
{
352+
// I'm the one being attacked first
353+
fAggreived = true;
354+
wMemTypes |= MEMORY_AGGREIVED;
355+
}
353356
}
354357
Memory_AddObjTypes(pCharSrc, wMemTypes);
355358
Attacker_Add(pCharSrc);

src/sphere.ini

+1
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ SuppressCapitals=0
419419
// COMBAT_FIRSTHIT_INSTANT 020000 // The first hit in a fight doesn't wait for the recoil time (OSI like)
420420
// 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.
421421
// COMBAT_PARALYZE_CANSWING 080000 // Characters can continue attacking while paralyzed. (Old sphere behaviour)
422+
// COMBAT_ATTACK_NOAGGREIVED 0100000 // Not being criminal when attacking the murderer (Old sphere behaviour)
422423
//CombatFlags=0
423424

424425
// If COMBAT_ARCHERYCANMOVE is not enabled, wait this much tenth of seconds (minimum=0) after the player

0 commit comments

Comments
 (0)