Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new CombatFlag ini setting COMBAT_ATTACK_NOAGGREIVED #1342

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion src/game/CServerConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};

/**
Expand Down
11 changes: 7 additions & 4 deletions src/game/chars/CCharFight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/sphere.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down