Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
57 stars 45 forks source link

[Change] Snooping distance can be adjusted with the skill range value. #1142

Open canerksk opened 11 months ago

canerksk commented 11 months ago

CCharSkill.cpp found in

if (GetTopDist3D(pCharMark) > 1)
{
    SysMessageDefault(DEFMSG_SNOOPING_REACH);
    return (-SKTRIG_QTY);
}

It is set as 1 frame in the line, but this may vary depending on the servers or it may be requested to be retroactive, in the past it was 2 frames. This can be adjusted based on Skill Range value

eg;

    CSkillDef *pSkillDef = g_Cfg.GetSkillDef(SKILL_SNOOPING);
    int iMaxRange = pSkillDef->m_Range ? pSkillDef->m_Range : 1;
`   if (GetTopDist3D(pCharMark) > iMaxRange)
    {
        SysMessageDefault(DEFMSG_SNOOPING_REACH);
        return (-SKTRIG_QTY);
    }

The codes here are purely examples. Although many have been tested, some may need to be rewritten.

Jhobean commented 11 months ago

Good Idea. Apparently you have the script. Are you ablento push a PR? Important behavior should be to have default 1 if you write nothing