diff --git a/src/graysvr/CCharNPCStatus.cpp b/src/graysvr/CCharNPCStatus.cpp index fe447614..40cb3fb1 100644 --- a/src/graysvr/CCharNPCStatus.cpp +++ b/src/graysvr/CCharNPCStatus.cpp @@ -628,35 +628,21 @@ int CChar::NPC_GetAttackMotivation( CChar * pChar, int iMotivation ) const // Am I stronger than he is ? Should I continue fighting ? // Take into consideration AC, health, skills, etc.. // RETURN: - // <-1 = dead meat. (run away) - // 0 = I'm have no interest. - // 50 = even match. - // 100 = he's a push over. + // < 0 = dead meat. (run away) + // 0 = I'm have no interest. + // 50 = even match. + // 100 = he's a push over. if ( !m_pNPC || !pChar || !pChar->m_pArea ) return 0; - if ( Stat_GetVal(STAT_STR) <= 0 ) - return -1; // I'm dead - // Is the target interesting ? - if ( pChar->m_pArea->IsFlag( REGION_FLAG_SAFE )) // universal + if ( IsStatFlag(STATF_DEAD) || pChar->IsStatFlag(STATF_DEAD) ) return 0; - if ( pChar->IsStatFlag(STATF_DEAD) && pChar->m_pNPC && pChar->m_pNPC->m_bonded ) + if ( pChar->m_pArea->IsFlag(REGION_FLAG_SAFE) ) return 0; - // If the area is guarded then think better of this. - if ( pChar->m_pArea->IsGuarded() && m_pNPC->m_Brain != NPCBRAIN_GUARD ) // too smart for this. - { - iMotivation -= Stat_GetAdjusted(STAT_INT) / 20; - } - - // Owned by or is one of my kind ? - - iMotivation += NPC_GetHostilityLevelToward( pChar ); + iMotivation += NPC_GetHostilityLevelToward(pChar); if ( iMotivation > 0 ) - { - // Am i injured etc ? - iMotivation = NPC_GetAttackContinueMotivation( pChar, iMotivation ); - } + iMotivation = NPC_GetAttackContinueMotivation(pChar, iMotivation); // Am i injured etc ? + return iMotivation; } - diff --git a/src/graysvr/CItemMulti.cpp b/src/graysvr/CItemMulti.cpp index 2337aba9..de7b6953 100644 --- a/src/graysvr/CItemMulti.cpp +++ b/src/graysvr/CItemMulti.cpp @@ -446,6 +446,7 @@ void CItemMulti::r_Write( CScript & s ) m_pRegion->r_WriteBody( s, "REGION." ); } } + bool CItemMulti::r_WriteVal( LPCTSTR pszKey, CGString & sVal, CTextConsole * pSrc ) { ADDTOCALLSTACK("CItemMulti::r_WriteVal"); @@ -507,60 +508,9 @@ bool CItemMulti::r_LoadVal( CScript & s ) EXC_DEBUG_END; return false; } + void CItemMulti::DupeCopy( const CItem * pItem ) { ADDTOCALLSTACK("CItemMulti::DupeCopy"); CItem::DupeCopy(pItem); } - - -size_t CItemMulti::Multi_ListObjs(CObjBase ** ppObjList) -{ - ADDTOCALLSTACK("CItemMulti::Multi_ListObjs"); - // List all the objects in the structure. - - if (!IsTopLevel()) - return 0; - - int iMaxDist = Multi_GetMaxDist(); - - // always list myself first. All other items must see my new region ! - size_t iCount = 0; - ppObjList[iCount++] = this; - - CWorldSearch AreaChar(GetTopPoint(), iMaxDist); - AreaChar.SetAllShow(true); - AreaChar.SetSearchSquare(true); - while (iCount < MAX_MULTI_CONTENT) - { - CChar * pChar = AreaChar.GetChar(); - if (pChar == NULL) - break; - if (!m_pRegion->IsInside2d(pChar->GetTopPoint())) - continue; - if (pChar->IsDisconnected() && pChar->m_pNPC) - continue; - - ppObjList[iCount++] = pChar; - } - - CWorldSearch AreaItem(GetTopPoint(), iMaxDist); - AreaItem.SetSearchSquare(true); - while (iCount < MAX_MULTI_CONTENT) - { - CItem * pItem = AreaItem.GetItem(); - if (pItem == NULL) - break; - if (pItem == this) // already listed. - continue; - if (!Multi_IsPartOf(pItem)) - { - if (!m_pRegion->IsInside2d(pItem->GetTopPoint())) - continue; - if (!pItem->IsMovable()) - continue; - } - ppObjList[iCount++] = pItem; - } - return(iCount); -} \ No newline at end of file diff --git a/src/graysvr/CObjBase.h b/src/graysvr/CObjBase.h index e5eba080..cd0a1a2d 100644 --- a/src/graysvr/CObjBase.h +++ b/src/graysvr/CObjBase.h @@ -1751,7 +1751,6 @@ protected: public: int Multi_GetMaxDist() const; - size_t Multi_ListObjs(CObjBase ** ppObjList); struct ShipSpeed // speed of a ship { unsigned char period; // time between movement