Skip to content
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
5 changes: 5 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4077,3 +4077,8 @@ When setting a property like MORE to the a spell or skill defname, trying to rea
- Changed: Object timers are now saved in worldsave files as TIMERMS, to avoid ambiguity and reliance on git build number to determine if TIMER expressed a number in seconds or milliseconds.
- Changed: Added 5 seconds timeout to DNS hostname resolution at startup (avoid getting stuck when connectivity is enabled but not working).
- Changed: CANMASK formatted in worldsave files as hexadecimal number, instead of decimal.

19-11-2025, DavideRei
- Changed: @STEPSTEALTH trigger to set in ARGN1 how many steps are consumed. Default 2 steps if running or hovering, 1 otherwise.
- Changed: no sound and no animation when a char with CAN_C_STATUE takes damage.
- Fixed: set char Owner.
30 changes: 15 additions & 15 deletions src/game/chars/CChar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,20 @@ bool CChar::r_GetRef( lpctstr & ptcKey, CScriptObj * & pRef )
return true;
}
return false;
case CHR_MEMORYFINDTYPE: // FInd a type of memory.
pRef = Memory_FindTypes((word)(Exp_GetSingle(ptcKey)));
SKIP_SEPARATORS(ptcKey);
return true;
case CHR_MEMORYFIND: // Find a memory of a UID
pRef = Memory_FindObj((CUID)Exp_GetSingle(ptcKey));
SKIP_SEPARATORS(ptcKey);
return true;
case CHR_OWNER:
pRef = GetOwner();
return true;
case CHR_REGION:
pRef = m_pArea;
return true;
case CHR_SHIP:
if (m_pPlayer)
{
Expand All @@ -2245,23 +2259,9 @@ bool CChar::r_GetRef( lpctstr & ptcKey, CScriptObj * & pRef )
return true;
}
return false;
case CHR_MEMORYFINDTYPE: // FInd a type of memory.
pRef = Memory_FindTypes((word)(Exp_GetSingle(ptcKey)));
SKIP_SEPARATORS(ptcKey);
return true;
case CHR_MEMORYFIND: // Find a memory of a UID
pRef = Memory_FindObj( (CUID) Exp_GetSingle( ptcKey ));
SKIP_SEPARATORS(ptcKey);
return true;
case CHR_OWNER:
pRef = GetOwner();
return true;
case CHR_WEAPON:
pRef = m_uidWeapon.ObjFind();
return true;
case CHR_REGION:
pRef = m_pArea;
return true;
}
}

Expand Down Expand Up @@ -4795,7 +4795,7 @@ bool CChar::r_Verb( CScript &s, CTextConsole * pSrc ) // Execute command from sc

CChar * pChar = CUID::CharFindFromUID(s.GetArgDWVal()); // otherwise we try to run it from the CChar with the given UID.
if (pChar)
return pChar->NPC_PetSetOwner(this);
return NPC_PetSetOwner(pChar);
return false; // Something went wrong, giving a warning of it.
}

Expand Down
9 changes: 6 additions & 3 deletions src/game/chars/CCharAct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4844,13 +4844,16 @@ void CChar::CheckRevealOnMove()
if ( !IsStatFlag(STATF_INVISIBLE|STATF_HIDDEN|STATF_SLEEPING) )
return;

if ( IsTrigUsed(TRIGGER_STEPSTEALTH) )
OnTrigger(CTRIG_StepStealth, CScriptParserBufs::GetCScriptTriggerArgsPtr(), this);
CScriptTriggerArgsPtr pScriptArgs = CScriptParserBufs::GetCScriptTriggerArgsPtr();
pScriptArgs->m_iN1 = IsStatFlag(STATF_FLY | STATF_HOVERING) ? 2 : 1; // Steps consumed

if (IsTrigUsed(TRIGGER_STEPSTEALTH))
OnTrigger(CTRIG_StepStealth, pScriptArgs, this);

if (g_Cfg.m_iRevealFlags & REVEALF_ONHORSE && IsStatFlag(STATF_ONHORSE))
Reveal();

m_StepStealth -= IsStatFlag(STATF_FLY|STATF_HOVERING) ? 2 : 1;
m_StepStealth -= (int)pScriptArgs->m_iN1;
if ( m_StepStealth <= 0 )
Reveal();
}
Expand Down
5 changes: 3 additions & 2 deletions src/game/chars/CCharFight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,8 @@ int CChar::OnTakeDamage( int iDmg, CChar * pSrc, DAMAGE_TYPE uiType, int iDmgPhy
return 0;

// Apply damage
SoundChar(CRESND_GETHIT);
if (!Can(CAN_C_STATUE))
SoundChar(CRESND_GETHIT);
UpdateStatVal( STAT_STR, -iDmg);
if ( pSrc->IsClientActive() )
pSrc->GetClientActive()->addHitsUpdate( this ); // always send updates to src
Expand Down Expand Up @@ -1057,7 +1058,7 @@ int CChar::OnTakeDamage( int iDmg, CChar * pSrc, DAMAGE_TYPE uiType, int iDmgPhy
return iDmg;
}

if (m_atFight.m_iWarSwingState != WAR_SWING_SWINGING) // don't interrupt my swing animation
if (m_atFight.m_iWarSwingState != WAR_SWING_SWINGING && !Can(CAN_C_STATUE)) // don't interrupt my swing animation
UpdateAnimate(ANIM_GET_HIT);

return iDmg;
Expand Down
2 changes: 1 addition & 1 deletion src/game/chars/CCharUse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void CChar::Use_CarveCorpse( CItemCorpse * pCorpse, CItem * pItemCarving )
for (size_t i = 0; i < iResourceTotalQty; ++i)
{
const CResourceID& rid = pCorpseDef->m_BaseResources[i].GetResourceID();
if (rid.GetResType() != RES_ITEMDEF)
if (rid.GetResType() != RES_ITEMDEF && rid.GetResType() != RES_TEMPLATE)
continue;

ITEMID_TYPE id = (ITEMID_TYPE)(rid.GetResIndex());
Expand Down
2 changes: 1 addition & 1 deletion src/game/clients/CClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ bool CClient::r_Verb( CScript & s, CTextConsole * pSrc ) // Execute command from
addTargetCancel();
break;
}
return false;
return true;
case CV_SHOWSKILLS:
addSkillWindow((SKILL_TYPE)(g_Cfg.m_iMaxSkill)); // Reload the real skills
break;
Expand Down