Skip to content

Commit

Permalink
Merge branch 'dev' into mini-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
raydienull authored Dec 2, 2024
2 parents 6d27afb + 909fd6a commit e04b8c3
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 25 deletions.
22 changes: 21 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3923,4 +3923,24 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.

08-11-2024
- Fixed: ITEMMEMORYEQUIP is not triggered in many default memories.
Previously, many memories did not have morex information, but now for some reason many memories have morex information and for this reason the trigger was not triggered in almost most of the memories, the morex query was removed. Also, the slang did not represent the memory item.
Previously, many memories did not have morex information, but now for some reason many memories have morex information and for this reason the trigger was not triggered in almost most of the memories, the morex query was removed. Also, the slang did not represent the memory item.

27-11-2024, canerksk
- Added: All skills that have a distance query have been adjusted to take the RANGE values ​​of that skill.
All skills to be used in RANGE;
BLACKSMITHING
MINING // It was added before.
FISHING // It was added before.
LUMBERJACKING // It was added before.
PEACEMAKING
ENTICEMENT
PROVOCATION
COOKING
TAMING
THROWING
SNOOPING
STEALING
Also added BREATH.MAXDIST to Breath. If this property is not given, the default is 14 distance.
- Added: Added NOREJOIN tag for corpses, If the NOREJOIN tag is one, the player cannot come back to life on that corpse. That is, the player comes back to life but not on the corpse.
This tag does not prevent the player from coming back to life, it just prevents them from respawning on that corpse. The player always comes back to life, but not on that corpse.
- Fixed: If you are around an entity that you own and you are trying to open a bank next to a bank, the "bank" command is perceived as a pet command and the bank does not open. There is no problem when you type "bank" after mounting the mount, but "bank" does not work when you dismount. (Issue #1331)
2 changes: 2 additions & 0 deletions cmake/toolchains/include/OSX-AppleClang_common.inc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function(toolchain_exe_stuff_common)
HINT
"/usr/local/opt/mariadb-connector-c/lib/mariadb"
"/opt/homebrew/var/mariadb-connector-c/lib/mariadb"
"/opt/homebrew/opt/mariadb-connector-c/lib/mariadb"
"/opt/homebrew/opt/mariadb-connector-c/lib"
"/opt/homebrew/lib/mariadb"
)
message(STATUS "Library ${lib_name}: ${lib_${lib_name}_with_path}")
Expand Down
4 changes: 2 additions & 2 deletions src/game/chars/CChar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2510,7 +2510,7 @@ bool CChar::r_WriteVal( lpctstr ptcKey, CSString & sVal, CTextConsole * pSrc, bo
}
case CHC_BREATH:
{
if( !strnicmp(ptcKey, "BREATH.DAM", 10) )
if (!strnicmp(ptcKey, "BREATH.MAXDIST", 14) || !strnicmp(ptcKey, "BREATH.DAM", 10))
{
CVarDefCont * pVar = GetDefKey(ptcKey, true);
sVal.FormatLLVal(pVar ? pVar->GetValNum() : 0);
Expand Down Expand Up @@ -3808,7 +3808,7 @@ bool CChar::r_LoadVal( CScript & s )
break;
case CHC_BREATH:
{
if ( !strnicmp(ptcKey, "BREATH.DAM", 10) || !strnicmp(ptcKey, "BREATH.HUE", 10) || !strnicmp(ptcKey, "BREATH.ANIM", 11) || !strnicmp(ptcKey, "BREATH.TYPE", 11) || !strnicmp(ptcKey, "BREATH.DAMTYPE", 14))
if ( !strnicmp(ptcKey, "BREATH.MAXDIST", 14) || !strnicmp(ptcKey, "BREATH.DAM", 10) || !strnicmp(ptcKey, "BREATH.HUE", 10) || !strnicmp(ptcKey, "BREATH.ANIM", 11) || !strnicmp(ptcKey, "BREATH.TYPE", 11) || !strnicmp(ptcKey, "BREATH.DAMTYPE", 14))
{
SetDefNum(s.GetKey(), s.GetArgLLVal());
return true;
Expand Down
119 changes: 97 additions & 22 deletions src/game/chars/CCharSkill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,10 +1078,21 @@ bool CChar::Skill_Mining_Smelt( CItem * pItemOre, CItem * pItemTarg )
return true;
}

if ( pItemTarg != nullptr && pItemTarg->IsTopLevel() && pItemTarg->IsType( IT_FORGE ))
m_Act_p = pItemTarg->GetTopPoint();
else
m_Act_p = CWorldMap::FindItemTypeNearby( GetTopPoint(), IT_FORGE, 3, false );
if (pItemTarg != nullptr && pItemTarg->IsTopLevel() && pItemTarg->IsType(IT_FORGE))
{
m_Act_p = pItemTarg->GetTopPoint();
}
else
{
CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_BLACKSMITHING);
int iMaxRange = pSkillDef->m_Range;
if (!iMaxRange)
{
g_Log.EventError("Blacksmith skill doesn't have a value for RANGE, defaulting to 3\n");
iMaxRange = 3;
}
m_Act_p = CWorldMap::FindItemTypeNearby(GetTopPoint(), IT_FORGE, iMaxRange, false);
}

if ( !m_Act_p.IsValidPoint() || !CanTouch(m_Act_p))
{
Expand Down Expand Up @@ -1405,7 +1416,7 @@ int CChar::Skill_Mining( SKTRIG_TYPE stage )
const CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_MINING);
const int iTargRange = GetTopPoint().GetDist(m_Act_p);
int iMaxRange = pSkillDef->m_Range;
if ( !iMaxRange )
if (!iMaxRange)
{
g_Log.EventError("Mining skill doesn't have a value for RANGE, defaulting to 2\n");
iMaxRange = 2;
Expand Down Expand Up @@ -1501,7 +1512,7 @@ int CChar::Skill_Fishing( SKTRIG_TYPE stage )
CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_FISHING);
int iTargRange = GetTopPoint().GetDist(m_Act_p);
int iMaxRange = pSkillDef->m_Range;
if ( !iMaxRange )
if (!iMaxRange)
{
g_Log.EventError("Fishing skill doesn't have a value for RANGE, defaulting to 4\n");
iMaxRange = 4;
Expand Down Expand Up @@ -1603,7 +1614,7 @@ int CChar::Skill_Lumberjack( SKTRIG_TYPE stage )
CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_LUMBERJACKING);
int iTargRange = GetTopPoint().GetDist(m_Act_p);
int iMaxRange = pSkillDef->m_Range;
if ( !pSkillDef->m_Range )
if (!iMaxRange)
{
g_Log.EventError("Lumberjacking skill doesn't have a value for RANGE, defaulting to 2\n");
iMaxRange = 2;
Expand Down Expand Up @@ -1825,7 +1836,15 @@ int CChar::Skill_Peacemaking( SKTRIG_TYPE stage )
{
int peace = Skill_GetAdjusted(SKILL_PEACEMAKING);
int iRadius = ( peace / 100 ) + 2; // 2..12
auto Area = CWorldSearchHolder::GetInstance(GetTopPoint(), iRadius);

CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_PEACEMAKING);
int iMaxRadius = pSkillDef->m_Range;
if (!iMaxRadius)
{
//g_Log.EventError("Peacemaking skill doesn't have a value for RANGE, defaulting to (Peacemaking skill level / 100 + 2) \n");
iMaxRadius = iRadius;
}
auto Area = CWorldSearchHolder::GetInstance(GetTopPoint(), iMaxRadius);
for (;;)
{
CChar *pChar = Area->GetChar();
Expand Down Expand Up @@ -1951,9 +1970,15 @@ int CChar::Skill_Enticement( SKTRIG_TYPE stage )
SysMessagef("%s %s.", pChar->GetName(), g_Cfg.GetDefaultMsg(DEFMSG_ENTICEMENT_BATTLE));
return -SKTRIG_ABORT;
}

CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_ENTICEMENT);
int iMaxRange = pSkillDef->m_Range;
if (!iMaxRange)
{
//g_Log.EventError("Enticement skill doesn't have a value for RANGE, defaulting 3\n");
iMaxRange = 3;
}
pChar->m_Act_p = GetTopPoint();
pChar->NPC_WalkToPoint( ( pChar->m_Act_p.GetDist(pChar->GetTopPoint()) > 3) );
pChar->NPC_WalkToPoint((pChar->m_Act_p.GetDist(pChar->GetTopPoint()) > iMaxRange));
return 0;
}

Expand All @@ -1969,6 +1994,9 @@ int CChar::Skill_Provocation(SKTRIG_TYPE stage)
// m_Act_Prv_UID = provoke this person
// m_Act_UID = against this person.

CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_PROVOCATION);
int iMaxRange = pSkillDef->m_Range;

if ( stage == SKTRIG_ABORT )
return -SKTRIG_ABORT;

Expand Down Expand Up @@ -2070,8 +2098,14 @@ int CChar::Skill_Provocation(SKTRIG_TYPE stage)

pCharProv->Memory_AddObjTypes(this, MEMORY_AGGREIVED|MEMORY_IRRITATEDBY);

if (!iMaxRange)
{
//g_Log.EventError("Provocation skill doesn't have a value for RANGE, defaulting to UO_MAP_VIEW_SIGHT(14) \n");
iMaxRange = UO_MAP_VIEW_SIGHT;
}

// If out of range we might get attacked ourself.
if ( (pCharProv->GetTopDist3D(pCharTarg) > UO_MAP_VIEW_SIGHT) || (pCharProv->GetTopDist3D(this) > UO_MAP_VIEW_SIGHT) )
if ((pCharProv->GetTopDist3D(pCharTarg) > iMaxRange) || (pCharProv->GetTopDist3D(this) > iMaxRange))
{
// Check that only "evil" monsters attack provoker back
if ( pCharProv->Noto_IsEvil() )
Expand Down Expand Up @@ -2183,7 +2217,13 @@ int CChar::Skill_Cooking( SKTRIG_TYPE stage )
// m_Act_p = the heat source
// m_Act_UID = the skill tool

int iMaxDist = 3;
CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_COOKING);
int iMaxDist = pSkillDef->m_Range;
if (!iMaxDist)
{
g_Log.EventError("Cooking skill doesn't have a value for RANGE, defaulting to 3\n");
iMaxDist = 3;
}

if ( stage == SKTRIG_START )
{
Expand Down Expand Up @@ -2239,10 +2279,13 @@ int CChar::Skill_Taming( SKTRIG_TYPE stage )
}

CSkillDef* pSkillDef = g_Cfg.GetSkillDef(SKILL_TAMING);
if (pSkillDef->m_Range <= 0)
pSkillDef->m_Range = 10;

if ( GetTopDist3D(pChar) > pSkillDef->m_Range)
int iMaxRange = pSkillDef->m_Range;
if (!iMaxRange)
{
g_Log.EventError("Taming skill doesn't have a value for RANGE, defaulting to 10\n");
iMaxRange = 10;
}
if (GetTopDist3D(pChar) > iMaxRange)
{
SysMessageDefault( DEFMSG_TAMING_REACH );
return -SKTRIG_QTY;
Expand Down Expand Up @@ -3237,8 +3280,16 @@ int CChar::Skill_Act_Breath( SKTRIG_TYPE stage )
return -SKTRIG_QTY;

const CPointMap& pntMe = GetTopPoint();
if ( pntMe.GetDist( m_Act_p ) > UO_MAP_VIEW_SIGHT )
m_Act_p.StepLinePath( pntMe, UO_MAP_VIEW_SIGHT );

int iMaxDist = (int)(GetDefNum("BREATH.MAXDIST", true));
if (!iMaxDist)
{
//g_Log.EventError("Breath skill doesn't have a value for RANGE, defaulting to UO_MAP_VIEW_SIGHT(14) \n");
iMaxDist = UO_MAP_VIEW_SIGHT;
}

if (pntMe.GetDist(m_Act_p) > iMaxDist)
m_Act_p.StepLinePath(pntMe, iMaxDist);

int iDamage = (int)(GetDefNum("BREATH.DAM", true));

Expand Down Expand Up @@ -3319,8 +3370,17 @@ int CChar::Skill_Act_Throwing( SKTRIG_TYPE stage )
return -SKTRIG_QTY;

const CPointMap pntMe(GetTopPoint());
if ( pntMe.GetDist( m_Act_p ) > UO_MAP_VIEW_SIGHT )
m_Act_p.StepLinePath( pntMe, UO_MAP_VIEW_SIGHT );

CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_THROWING);
int iMaxRange = pSkillDef->m_Range;
if (!iMaxRange)
{
//g_Log.EventError("Throwing skill doesn't have a value for RANGE, defaulting to UO_MAP_VIEW_SIGHT(14) \n");
iMaxRange = UO_MAP_VIEW_SIGHT;
}

if (pntMe.GetDist(m_Act_p) > iMaxRange)
m_Act_p.StepLinePath(pntMe, iMaxRange);

SoundChar( CRESND_GETHIT );

Expand Down Expand Up @@ -4055,7 +4115,15 @@ int CChar::Skill_Snooping(SKTRIG_TYPE stage)
if (!IsTakeCrime(pCont, &pCharMark) || pCharMark == nullptr)
return 0; // Not a crime really.

if (GetTopDist3D(pCharMark) > 1)
CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_SNOOPING);
int iMaxRange = pSkillDef->m_Range;
if (!iMaxRange)
{
g_Log.EventError("Snooping skill doesn't have a value for RANGE, defaulting to 1\n");
iMaxRange = 1;
}

if (GetTopDist3D(pCharMark) > iMaxRange)
{
SysMessageDefault(DEFMSG_SNOOPING_REACH);
return (-SKTRIG_QTY);
Expand Down Expand Up @@ -4207,7 +4275,14 @@ int CChar::Skill_Stealing(SKTRIG_TYPE stage)
bool fGround = false;
if (pCharMark != nullptr)
{
if (GetTopDist3D(pCharMark) > 2)
CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_STEALING);
int iMaxRange = pSkillDef->m_Range;
if (!iMaxRange)
{
g_Log.EventError("Stealing skill doesn't have a value for RANGE, defaulting to 2\n");
iMaxRange = 2;
}
if (GetTopDist3D(pCharMark) > iMaxRange)
{
SysMessageDefault(DEFMSG_STEALING_MARK);
return -SKTRIG_QTY;
Expand Down
9 changes: 9 additions & 0 deletions src/game/clients/CClientEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,15 @@ void CClient::Event_Talk_Common(lpctstr pszText) // PC speech
break;
}
*/
// NPC's with special key words ?
if (pChar->m_pNPC)
{
if (pChar->m_pNPC->m_Brain == NPCBRAIN_BANKER)
{
if (FindStrWord(pszText, "BANK") > 0)
break;
}
}
}

if ( !pChar )
Expand Down
2 changes: 2 additions & 0 deletions src/game/items/CItemCorpse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ CItemCorpse *CChar::FindMyCorpse( bool ignoreLOS, int iRadius ) const
break;
if ( !pItem->IsType(IT_CORPSE) )
continue;
if (pItem->m_TagDefs.GetKeyNum("NOREJOIN")) // The owner should not rejoin this body even if resurrected on top of it.
continue;
CItemCorpse *pCorpse = dynamic_cast<CItemCorpse*>(pItem);
if ( !pCorpse || (pCorpse->m_uidLink != GetUID()) )
continue;
Expand Down

0 comments on commit e04b8c3

Please sign in to comment.