• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Lua Conditions without icon

douglasscherner

New Member
Joined
Aug 15, 2014
Messages
26
Reaction score
1
Hello guys. I am in trouble because this condiction is conflicting with hasted mode of elfbot and magebot.

I am using tfs 1.0

local conditionHaste = Condition(CONDITION_HASTE)
conditionHaste:setParameter(CONDITION_PARAM_SUBID, 100)
conditionHaste:setParameter(CONDITION_PARAM_TICKS, 5000)
conditionHaste:setParameter(CONDITION_PARAM_SPEED, 10)
player:addCondition(conditionHaste)

I want that the icon of haste near the battle icon don't show with this condition.

I tried:

conditionHaste:setParameter(CONDITION_PARAM_ICON, -1)
conditionHaste:setParameter(CONDITION_HASTE_SHOWICON, false)

But nothing.

Even tried in source in conditioncs.cpp:


if (icon) {
if (CONDITION_PARAM_SUBID != 100) {
icons |= ICON_HASTE;
}
}

or
if (icon) {
if (CONDITION_PARAM_SPEED != 10) {
icons |= ICON_HASTE;
}
}
But can't do this.

Can someone expert help me?
Apreciate
 

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,632
Solutions
77
Reaction score
2,558
Location
Poland
GitHub
gesior
SUBID of current condition is in subId.
In condition.cpp ( forgottenserver/condition.cpp at 1.0 · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/1.0/src/condition.cpp#L1556-L1572) ) replace:
C++:
uint32_t ConditionSpeed::getIcons() const
{
    uint32_t icons = Condition::getIcons();
    switch (conditionType) {
        case CONDITION_HASTE:
            icons |= ICON_HASTE;
            break;

        case CONDITION_PARALYZE:
            icons |= ICON_PARALYZE;
            break;

        default:
            break;
    }
    return icons;
}
with:
C++:
uint32_t ConditionSpeed::getIcons() const
{
    uint32_t icons = Condition::getIcons();
    if (subId == 100) {
        return icons;
    }

    switch (conditionType) {
        case CONDITION_HASTE:
            icons |= ICON_HASTE;
            break;

        case CONDITION_PARALYZE:
            icons |= ICON_PARALYZE;
            break;

        default:
            break;
    }
    return icons;
}
 
Top