Skip to content

Commit

Permalink
Merge branch 'dev' into t_multi_addon
Browse files Browse the repository at this point in the history
  • Loading branch information
GladieUO authored Dec 2, 2024
2 parents e8c45de + 3faad4d commit 7ec2f01
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 58 deletions.
30 changes: 28 additions & 2 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3915,12 +3915,38 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.
13-10-2024, Jhobean
- Added: @PetRelease trigger work like @petdesert and return 1 to prevent the pet from being released.

26-10-2024, canerksk
- Fixed: Memory OnTick link char if not, the skill will not fail.
If the memory owner is not present, skills do not fail when taking damage, but if the memory owner is alive, skills fail when taking damage.

- Fixed: The entity was jumping frames in flooded pet commands (come, guard)

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.

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.

27-11-2024, canerksk
- 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)

27-11-2024, Gladie
- Fixed: Redeeding t_multi_addon outside of housing system. Before it was only looking for owner of the multi, but in our case we need to know uid of the redeeding char.
=======
02-11-2024, raydie
- Added: Add LAYER_SPELL_Explosion for use delayed explosion spell. Now if set Duration to spell explosion, these duration is the delay to execute the explosion (From UOGuide, explosion spell: 2 second delay between targetting and explosion)
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
9 changes: 6 additions & 3 deletions src/game/chars/CCharAct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,14 @@ void CChar::LayerAdd( CItem * pItem, LAYER_TYPE layer )
return;
}

if (!pItem->IsTypeSpellable() && !pItem->m_itSpell.m_spell && !pItem->IsType(IT_WAND)) // can this item have a spell effect ? If so we do not send
{
//if (!pItem->IsTypeSpellable() && !pItem->m_itSpell.m_spell && !pItem->IsType(IT_WAND)) // can this item have a spell effect ? If so we do not send
// Since most of the memories came with a morex information by default, almost no memory was triggered.
if (!(pItem->IsTypeSpellable() || pItem->IsType(IT_WAND)))
{
if ((IsTrigUsed(TRIGGER_MEMORYEQUIP)) || (IsTrigUsed(TRIGGER_ITEMMEMORYEQUIP)))
{
CScriptTriggerArgs pArgs;
//CScriptTriggerArgs pArgs;
CScriptTriggerArgs pArgs(pItem); // added "argo" argument
pArgs.m_iN1 = layer;
if (pItem->OnTrigger(ITRIG_MemoryEquip, this, &pArgs) == TRIGRET_RET_TRUE)
{
Expand Down
14 changes: 10 additions & 4 deletions src/game/chars/CCharNPCPet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,20 @@ bool CChar::NPC_OnHearPetCmd( lpctstr pszCmd, CChar *pSrc, bool fAllPets )
break;

case PC_GUARD_ME:
m_Act_UID = pSrc->GetUID();
Skill_Start(NPCACT_GUARD_TARG);
if ((m_Act_UID != pSrc->GetUID()) || (Skill_GetActive() != NPCACT_GUARD_TARG)) // When you do all guard flood, the mount jumps one frame.
{
m_Act_UID = pSrc->GetUID();
Skill_Start(NPCACT_GUARD_TARG);
}
break;

case PC_COME:
case PC_FOLLOW_ME:
m_Act_UID = pSrc->GetUID();
Skill_Start(NPCACT_FOLLOW_TARG);
if ((m_Act_UID != pSrc->GetUID()) || (Skill_GetActive() != NPCACT_FOLLOW_TARG)) // When you do all come flood, the mount jumps one frame.
{
m_Act_UID = pSrc->GetUID();
Skill_Start(NPCACT_FOLLOW_TARG);
}
break;

case PC_FOLLOW:
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
Loading

0 comments on commit 7ec2f01

Please sign in to comment.