diff --git a/Changelog.txt b/Changelog.txt index 7851b5d90..7cd80f591 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -3792,3 +3792,10 @@ Added: 'H' shortcut for variables to get the value as hexadecimal. 26-06-2024, Jhobean - Changed: @NPCRESTOCK References modification. Now SRC:Server I:NPC (Before it was always server) + +30-06-2024, DavideRei +- Fixed: hallucination spell duration (before it was fixed at 1000 seconds) +- Fixed: wrong layer checked for potion delay to set the memory name +- Modified: blocked spelleffect on ridden chars for spells with flag SPELLFLAG_FIELD or SPELLFLAG_AREA +- Fixed: NPC_Act_Follow use combat target even if the npc is not in combat +- Fixed: wrong highest threat when there are no attackers diff --git a/src/game/chars/CCharAct.cpp b/src/game/chars/CCharAct.cpp index 5d863ddb4..58fafeeb2 100644 --- a/src/game/chars/CCharAct.cpp +++ b/src/game/chars/CCharAct.cpp @@ -1593,7 +1593,7 @@ void CChar::SoundChar( CRESND_TYPE type ) default: if (id < 0x4D6) // before the crane sound the sound IDs are ordered in a way... id += (SOUND_TYPE)type; - else if (id < 0x5D5) // starting with the crane and ending before absymal infernal there's another scheme + else if (id < 0x5D4) // starting with the crane and ending before absymal infernal there's another scheme { switch (type) { diff --git a/src/game/chars/CCharAttacker.cpp b/src/game/chars/CCharAttacker.cpp index d582548d5..c43e8ecbd 100644 --- a/src/game/chars/CCharAttacker.cpp +++ b/src/game/chars/CCharAttacker.cpp @@ -116,7 +116,7 @@ int CChar::Attacker_GetHighestThreat() const { ADDTOCALLSTACK("CChar::Attacker_GetHighestThreat"); if (m_lastAttackers.empty()) - return -1; + return 0; int highThreat = 0; for (const LastAttackers & refAttacker : m_lastAttackers) diff --git a/src/game/chars/CCharNPCAct.cpp b/src/game/chars/CCharNPCAct.cpp index e316da040..4c24b8535 100644 --- a/src/game/chars/CCharNPCAct.cpp +++ b/src/game/chars/CCharNPCAct.cpp @@ -1279,8 +1279,10 @@ bool CChar::NPC_Act_Follow(bool fFlee, int maxDistance, bool fMoveAway) //If the NPC action is following somebody, directly assign the character from the m_Act_UID value. if (Skill_GetActive() == NPCACT_FOLLOW_TARG) pChar = m_Act_UID.CharFind(); - else + else if (Fight_IsActive()) pChar = m_Fight_Targ_UID.IsValidUID() ? m_Fight_Targ_UID.CharFind() : m_Act_UID.CharFind(); + else + pChar = m_Act_UID.CharFind(); if (pChar == nullptr) { // free to do as i wish ! diff --git a/src/game/chars/CCharSpell.cpp b/src/game/chars/CCharSpell.cpp index 0612646fd..33522ef2f 100644 --- a/src/game/chars/CCharSpell.cpp +++ b/src/game/chars/CCharSpell.cpp @@ -2042,7 +2042,7 @@ CItem * CChar::Spell_Effect_Create( SPELL_TYPE spell, LAYER_TYPE layer, int iEff switch ( layer ) { case LAYER_FLAG_Criminal: pSpell->SetName("Criminal Timer"); break; - case LAYER_FLAG_Potion: pSpell->SetName("Potion Cooldown"); break; + case LAYER_FLAG_PotionUsed: pSpell->SetName("Potion Cooldown"); break; case LAYER_FLAG_Drunk: pSpell->SetName("Drunk Effect"); break; case LAYER_FLAG_Hallucination: pSpell->SetName("Hallucination Effect"); break; case LAYER_FLAG_Murders: pSpell->SetName("Murder Decay"); break; @@ -3536,6 +3536,8 @@ bool CChar::OnSpellEffect( SPELL_TYPE spell, CChar * pCharSrc, int iSkillLevel, return false; if ( spell == SPELL_Poison_Field && IsStatFlag(STATF_POISONED) ) return false; + if (IsStatFlag(STATF_RIDDEN) && (pSpellDef->IsSpellType(SPELLFLAG_FIELD) || pSpellDef->IsSpellType(SPELLFLAG_AREA))) + return false; iSkillLevel = (iSkillLevel / 2) + g_Rand.GetVal(iSkillLevel / 2); // randomize the potency int iEffect = g_Cfg.GetSpellEffect(spell, iSkillLevel); @@ -3922,7 +3924,7 @@ bool CChar::OnSpellEffect( SPELL_TYPE spell, CChar * pCharSrc, int iSkillLevel, case SPELL_Hallucination: { - CItem * pItem = Spell_Effect_Create( spell, LAYER_FLAG_Hallucination, iEffect, 100*MSECS_PER_TENTH, pCharSrc ); + CItem * pItem = Spell_Effect_Create( spell, LAYER_FLAG_Hallucination, iEffect, iDuration, pCharSrc ); ASSERT(pItem); pItem->m_itSpell.m_spellcharges = g_Rand.GetVal(30); }