• 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!

OTClient Help adding and displaying Icons for custom Conditions in OTClient?

Narg

Member
Joined
Jul 11, 2012
Messages
78
Reaction score
24
So, for the past 2 hours I've been trying to add new icons to OTClient with zero success.

I have created tons of new Conditions for my OT and I want to display my shiny new icons for them... but they don't appear ingame.

I appreciate anyone who can help.

OTClient const.h
C++:
enum PlayerStates {
        IconNone = 0,
        IconPoison = 1,
        IconBurn = 2,
        IconEnergy = 4,
        IconDrunk = 8,
        IconManaShield = 16,
        IconParalyze = 32,
        IconHaste = 64,
        IconSwords = 128,
        IconDrowning = 256,
        IconFreezing = 512,
        IconDazzled = 1024,
        IconCursed = 2048,
        IconPartyBuff = 4096,
        IconPzBlock = 8192,
        IconPz = 16384,
        IconBleeding = 32768,
        IconHungry = 65536,
        IconSilenced = 131072,
        IconDisarmed = 262144,
        IconRooted = 524288,
        IconStunned = 1048576,
        IconBlinded = 2097152,
        IconVengeance = 4194304
    };

OTClient Modules Player.lua
LUA:
PlayerStates = {
  None = 0,
  Poison = 1,
  Burn = 2,
  Energy = 4,
  Drunk = 8,
  ManaShield = 16,
  Paralyze = 32,
  Haste = 64,
  Swords = 128,
  Drowning = 256,
  Freezing = 512,
  Dazzled = 1024,
  Cursed = 2048,
  PartyBuff = 4096,
  PzBlock = 8192,
  Pz = 16384,
  Bleeding = 32768,
  Hungry = 65536,
  Silenced = 131072,
  Disarmed = 262144,
  Rooted = 524288,
  Stunned = 1048576,
  Blinded = 2097152,
  Vengeance = 4194304
}

Client Modules Healthinfo.lua
LUA:
Icons = {}
Icons[PlayerStates.Poison] = { tooltip = tr('You are poisoned'), path = '/images/game/states/poisoned', id = 'condition_poisoned' }
Icons[PlayerStates.Burn] = { tooltip = tr('You are burning'), path = '/images/game/states/burning', id = 'condition_burning' }
Icons[PlayerStates.Energy] = { tooltip = tr('You are electrified'), path = '/images/game/states/electrified', id = 'condition_electrified' }
Icons[PlayerStates.Drunk] = { tooltip = tr('You are drunk'), path = '/images/game/states/drunk', id = 'condition_drunk' }
Icons[PlayerStates.ManaShield] = { tooltip = tr('You are protected by a magic shield'), path = '/images/game/states/magic_shield', id = 'condition_magic_shield' }
Icons[PlayerStates.Paralyze] = { tooltip = tr('You are paralysed'), path = '/images/game/states/slowed', id = 'condition_slowed' }
Icons[PlayerStates.Haste] = { tooltip = tr('You are hasted'), path = '/images/game/states/haste', id = 'condition_haste' }
Icons[PlayerStates.Swords] = { tooltip = tr('You may not logout during a fight'), path = '/images/game/states/logout_block', id = 'condition_logout_block' }
Icons[PlayerStates.Drowning] = { tooltip = tr('You are drowning'), path = '/images/game/states/drowning', id = 'condition_drowning' }
Icons[PlayerStates.Freezing] = { tooltip = tr('You are freezing'), path = '/images/game/states/freezing', id = 'condition_freezing' }
Icons[PlayerStates.Freezing] = { tooltip = tr('You are chilled'), path = '/images/game/states/freezing', id = 'condition_chilled' }
Icons[PlayerStates.Dazzled] = { tooltip = tr('You are dazzled'), path = '/images/game/states/dazzled', id = 'condition_dazzled' }
Icons[PlayerStates.Cursed] = { tooltip = tr('You are cursed'), path = '/images/game/states/cursed', id = 'condition_cursed' }
Icons[PlayerStates.PartyBuff] = { tooltip = tr('You are strengthened'), path = '/images/game/states/strengthened', id = 'condition_strengthened' }
Icons[PlayerStates.PzBlock] = { tooltip = tr('You may not logout or enter a protection zone'), path = '/images/game/states/protection_zone_block', id = 'condition_protection_zone_block' }
Icons[PlayerStates.Pz] = { tooltip = tr('You are within a protection zone'), path = '/images/game/states/protection_zone', id = 'condition_protection_zone' }
Icons[PlayerStates.Bleeding] = { tooltip = tr('You are bleeding'), path = '/images/game/states/bleeding', id = 'condition_bleeding' }
Icons[PlayerStates.Hungry] = { tooltip = tr('You are hungry'), path = '/images/game/states/hungry', id = 'condition_hungry' }
Icons[PlayerStates.Silenced] = { tooltip = tr('You are silenced'), path = '/images/game/states/silenced', id = 'condition_silence' }
Icons[PlayerStates.Silenced] = { tooltip = tr('You have silenced yourself'), path = '/images/game/states/silenced', id = 'condition_selfsilence' }
Icons[PlayerStates.Disarmed] = { tooltip = tr('You are disarmed'), path = '/images/game/states/disarmed', id = 'condition_disarm' }
Icons[PlayerStates.Disarmed] = { tooltip = tr('You have disarmed yourself'), path = '/images/game/states/disarmed', id = 'condition_selfdisarm' }
Icons[PlayerStates.Rooted] = { tooltip = tr('You are rooted'), path = '/images/game/states/rooted', id = 'condition_root' }
Icons[PlayerStates.Rooted] = { tooltip = tr('You are prevented from moving'), path = '/images/game/states/rooted', id = 'condition_selfroot' }
Icons[PlayerStates.Stunned] = { tooltip = tr('You are stunned'), path = '/images/game/states/stunned', id = 'condition_stunned' }
Icons[PlayerStates.Blinded] = { tooltip = tr('You are blinded'), path = '/images/game/states/blinded', id = 'condition_blinded' }
Icons[PlayerStates.Vengeance] = { tooltip = tr('You have been marked for vengeance'), path = '/images/game/states/vengeance', id = 'condition_vengeance' }

TFS condition.cpp, using ConditionGeneric as example (I have other conditions with their own getIcons() too
C++:
uint32_t ConditionGeneric::getIcons() const
{
    uint32_t icons = Condition::getIcons();

    switch (conditionType) {
        case CONDITION_MANASHIELD:
        case CONDITION_LIGHTMANASHIELD:
        case CONDITION_GREATMANASHIELD:
            icons |= ICON_MANASHIELD;
            break;

        case CONDITION_INFIGHT:
            icons |= ICON_SWORDS;
            break;

        case CONDITION_DRUNK:
            icons |= ICON_DRUNK;
            break;

        case CONDITION_SELFAMPLIFY:
        case CONDITION_AMPLIFYDMG:
        case CONDITION_HEALRDCT:
        case CONDITION_HEALBLOCK:
            icons |= ICON_CURSED;
            break;

        case CONDITION_REDCTDMG:
        case CONDITION_HEALAMP:
        case CONDITION_HEAL:
            icons |= ICON_DAZZLED;
            break;

        case CONDITION_ROOT:
        case CONDITION_SELFROOT:
            icons |= ICON_ROOT;
            break;

        case CONDITION_STUN:
            icons |= ICON_STUN;
            break;

        case CONDITION_SILENCE:
        case CONDITION_SELFSILENCE:
            icons |= ICON_SILENCE;
            break;

        case CONDITION_DISARM:
        case CONDITION_SELFDISARM:
            icons |= ICON_DISARM;
            break;

        case CONDITION_VENGEANCE:
            icons |= ICON_VENGEANCE;
            break;

        case CONDITION_BLIND:
        case CONDITION_STRONGBLIND:
        case CONDITION_SOFTBLIND:
            icons |= ICON_BLIND;
            break;

        default:
            break;
    }

    return icons;
}

Server const.h
C++:
enum Icons_t {
    ICON_POISON = 1 << 0,
    ICON_BURN = 1 << 1,
    ICON_ENERGY =  1 << 2,
    ICON_DRUNK = 1 << 3,
    ICON_MANASHIELD = 1 << 4,
    ICON_PARALYZE = 1 << 5,
    ICON_HASTE = 1 << 6,
    ICON_SWORDS = 1 << 7,
    ICON_DROWNING = 1 << 8,
    ICON_FREEZING = 1 << 9,
    ICON_DAZZLED = 1 << 10,
    ICON_CURSED = 1 << 11,
    ICON_PARTY_BUFF = 1 << 12,
    ICON_REDSWORDS = 1 << 13,
    ICON_PIGEON = 1 << 14,
    ICON_BLEEDING = 1 << 15,
    ICON_HUNGRY = 1 << 16,
    ICON_SILENCE = 1 << 17,
    ICON_DISARM = 1 << 18,
    ICON_ROOT = 1 << 19,
    ICON_STUN = 1 << 20,
    ICON_BLIND = 1 << 21,
    ICON_VENGEANCE = 1 << 22,
};

Can someone explain what am I missing here?
 
So, for the past 2 hours I've been trying to add new icons to OTClient with zero success.

I have created tons of new Conditions for my OT and I want to display my shiny new icons for them... but they don't appear ingame.

I appreciate anyone who can help.

OTClient const.h
C++:
enum PlayerStates {
        IconNone = 0,
        IconPoison = 1,
        IconBurn = 2,
        IconEnergy = 4,
        IconDrunk = 8,
        IconManaShield = 16,
        IconParalyze = 32,
        IconHaste = 64,
        IconSwords = 128,
        IconDrowning = 256,
        IconFreezing = 512,
        IconDazzled = 1024,
        IconCursed = 2048,
        IconPartyBuff = 4096,
        IconPzBlock = 8192,
        IconPz = 16384,
        IconBleeding = 32768,
        IconHungry = 65536,
        IconSilenced = 131072,
        IconDisarmed = 262144,
        IconRooted = 524288,
        IconStunned = 1048576,
        IconBlinded = 2097152,
        IconVengeance = 4194304
    };

OTClient Modules Player.lua
LUA:
PlayerStates = {
  None = 0,
  Poison = 1,
  Burn = 2,
  Energy = 4,
  Drunk = 8,
  ManaShield = 16,
  Paralyze = 32,
  Haste = 64,
  Swords = 128,
  Drowning = 256,
  Freezing = 512,
  Dazzled = 1024,
  Cursed = 2048,
  PartyBuff = 4096,
  PzBlock = 8192,
  Pz = 16384,
  Bleeding = 32768,
  Hungry = 65536,
  Silenced = 131072,
  Disarmed = 262144,
  Rooted = 524288,
  Stunned = 1048576,
  Blinded = 2097152,
  Vengeance = 4194304
}

Client Modules Healthinfo.lua
LUA:
Icons = {}
Icons[PlayerStates.Poison] = { tooltip = tr('You are poisoned'), path = '/images/game/states/poisoned', id = 'condition_poisoned' }
Icons[PlayerStates.Burn] = { tooltip = tr('You are burning'), path = '/images/game/states/burning', id = 'condition_burning' }
Icons[PlayerStates.Energy] = { tooltip = tr('You are electrified'), path = '/images/game/states/electrified', id = 'condition_electrified' }
Icons[PlayerStates.Drunk] = { tooltip = tr('You are drunk'), path = '/images/game/states/drunk', id = 'condition_drunk' }
Icons[PlayerStates.ManaShield] = { tooltip = tr('You are protected by a magic shield'), path = '/images/game/states/magic_shield', id = 'condition_magic_shield' }
Icons[PlayerStates.Paralyze] = { tooltip = tr('You are paralysed'), path = '/images/game/states/slowed', id = 'condition_slowed' }
Icons[PlayerStates.Haste] = { tooltip = tr('You are hasted'), path = '/images/game/states/haste', id = 'condition_haste' }
Icons[PlayerStates.Swords] = { tooltip = tr('You may not logout during a fight'), path = '/images/game/states/logout_block', id = 'condition_logout_block' }
Icons[PlayerStates.Drowning] = { tooltip = tr('You are drowning'), path = '/images/game/states/drowning', id = 'condition_drowning' }
Icons[PlayerStates.Freezing] = { tooltip = tr('You are freezing'), path = '/images/game/states/freezing', id = 'condition_freezing' }
Icons[PlayerStates.Freezing] = { tooltip = tr('You are chilled'), path = '/images/game/states/freezing', id = 'condition_chilled' }
Icons[PlayerStates.Dazzled] = { tooltip = tr('You are dazzled'), path = '/images/game/states/dazzled', id = 'condition_dazzled' }
Icons[PlayerStates.Cursed] = { tooltip = tr('You are cursed'), path = '/images/game/states/cursed', id = 'condition_cursed' }
Icons[PlayerStates.PartyBuff] = { tooltip = tr('You are strengthened'), path = '/images/game/states/strengthened', id = 'condition_strengthened' }
Icons[PlayerStates.PzBlock] = { tooltip = tr('You may not logout or enter a protection zone'), path = '/images/game/states/protection_zone_block', id = 'condition_protection_zone_block' }
Icons[PlayerStates.Pz] = { tooltip = tr('You are within a protection zone'), path = '/images/game/states/protection_zone', id = 'condition_protection_zone' }
Icons[PlayerStates.Bleeding] = { tooltip = tr('You are bleeding'), path = '/images/game/states/bleeding', id = 'condition_bleeding' }
Icons[PlayerStates.Hungry] = { tooltip = tr('You are hungry'), path = '/images/game/states/hungry', id = 'condition_hungry' }
Icons[PlayerStates.Silenced] = { tooltip = tr('You are silenced'), path = '/images/game/states/silenced', id = 'condition_silence' }
Icons[PlayerStates.Silenced] = { tooltip = tr('You have silenced yourself'), path = '/images/game/states/silenced', id = 'condition_selfsilence' }
Icons[PlayerStates.Disarmed] = { tooltip = tr('You are disarmed'), path = '/images/game/states/disarmed', id = 'condition_disarm' }
Icons[PlayerStates.Disarmed] = { tooltip = tr('You have disarmed yourself'), path = '/images/game/states/disarmed', id = 'condition_selfdisarm' }
Icons[PlayerStates.Rooted] = { tooltip = tr('You are rooted'), path = '/images/game/states/rooted', id = 'condition_root' }
Icons[PlayerStates.Rooted] = { tooltip = tr('You are prevented from moving'), path = '/images/game/states/rooted', id = 'condition_selfroot' }
Icons[PlayerStates.Stunned] = { tooltip = tr('You are stunned'), path = '/images/game/states/stunned', id = 'condition_stunned' }
Icons[PlayerStates.Blinded] = { tooltip = tr('You are blinded'), path = '/images/game/states/blinded', id = 'condition_blinded' }
Icons[PlayerStates.Vengeance] = { tooltip = tr('You have been marked for vengeance'), path = '/images/game/states/vengeance', id = 'condition_vengeance' }

TFS condition.cpp, using ConditionGeneric as example (I have other conditions with their own getIcons() too
C++:
uint32_t ConditionGeneric::getIcons() const
{
    uint32_t icons = Condition::getIcons();

    switch (conditionType) {
        case CONDITION_MANASHIELD:
        case CONDITION_LIGHTMANASHIELD:
        case CONDITION_GREATMANASHIELD:
            icons |= ICON_MANASHIELD;
            break;

        case CONDITION_INFIGHT:
            icons |= ICON_SWORDS;
            break;

        case CONDITION_DRUNK:
            icons |= ICON_DRUNK;
            break;

        case CONDITION_SELFAMPLIFY:
        case CONDITION_AMPLIFYDMG:
        case CONDITION_HEALRDCT:
        case CONDITION_HEALBLOCK:
            icons |= ICON_CURSED;
            break;

        case CONDITION_REDCTDMG:
        case CONDITION_HEALAMP:
        case CONDITION_HEAL:
            icons |= ICON_DAZZLED;
            break;

        case CONDITION_ROOT:
        case CONDITION_SELFROOT:
            icons |= ICON_ROOT;
            break;

        case CONDITION_STUN:
            icons |= ICON_STUN;
            break;

        case CONDITION_SILENCE:
        case CONDITION_SELFSILENCE:
            icons |= ICON_SILENCE;
            break;

        case CONDITION_DISARM:
        case CONDITION_SELFDISARM:
            icons |= ICON_DISARM;
            break;

        case CONDITION_VENGEANCE:
            icons |= ICON_VENGEANCE;
            break;

        case CONDITION_BLIND:
        case CONDITION_STRONGBLIND:
        case CONDITION_SOFTBLIND:
            icons |= ICON_BLIND;
            break;

        default:
            break;
    }

    return icons;
}

Server const.h
C++:
enum Icons_t {
    ICON_POISON = 1 << 0,
    ICON_BURN = 1 << 1,
    ICON_ENERGY =  1 << 2,
    ICON_DRUNK = 1 << 3,
    ICON_MANASHIELD = 1 << 4,
    ICON_PARALYZE = 1 << 5,
    ICON_HASTE = 1 << 6,
    ICON_SWORDS = 1 << 7,
    ICON_DROWNING = 1 << 8,
    ICON_FREEZING = 1 << 9,
    ICON_DAZZLED = 1 << 10,
    ICON_CURSED = 1 << 11,
    ICON_PARTY_BUFF = 1 << 12,
    ICON_REDSWORDS = 1 << 13,
    ICON_PIGEON = 1 << 14,
    ICON_BLEEDING = 1 << 15,
    ICON_HUNGRY = 1 << 16,
    ICON_SILENCE = 1 << 17,
    ICON_DISARM = 1 << 18,
    ICON_ROOT = 1 << 19,
    ICON_STUN = 1 << 20,
    ICON_BLIND = 1 << 21,
    ICON_VENGEANCE = 1 << 22,
};

Can someone explain what am I missing here?
Have you solved it already? Got the same issue
 
Back
Top