diff --git a/Changelog.txt b/Changelog.txt index eb6bead1f..8f27d49ba 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -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. diff --git a/src/game/chars/CChar.cpp b/src/game/chars/CChar.cpp index 412f89309..97b005b3f 100644 --- a/src/game/chars/CChar.cpp +++ b/src/game/chars/CChar.cpp @@ -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) { @@ -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; } } @@ -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. } diff --git a/src/game/chars/CCharAct.cpp b/src/game/chars/CCharAct.cpp index 6f1e9fd1a..bad6e8936 100644 --- a/src/game/chars/CCharAct.cpp +++ b/src/game/chars/CCharAct.cpp @@ -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(); } diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index 10e6451f8..70918e529 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -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 @@ -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; diff --git a/src/game/chars/CCharUse.cpp b/src/game/chars/CCharUse.cpp index e9a1861b9..c94ee5a51 100644 --- a/src/game/chars/CCharUse.cpp +++ b/src/game/chars/CCharUse.cpp @@ -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()); diff --git a/src/game/clients/CClient.cpp b/src/game/clients/CClient.cpp index 45637dc8e..75f8e0159 100644 --- a/src/game/clients/CClient.cpp +++ b/src/game/clients/CClient.cpp @@ -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;