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

Compiling Skull System Different

Ghazer

Member
Joined
Mar 13, 2009
Messages
350
Reaction score
6
I looking for skull system but my source are differents because no is same of other post in otland for skull system...
anyone can help me please? here is my player.cpp

In all post say
delete
Code:
if((player == this || (skull != SKULL_NONE && player->getSkull() < SKULL_RED)) && player->hasAttacked(this))
            return SKULL_YELLOW;
But I dont have this part... I dont want get skull when party, when attack, no yellow skull to use Skull System, please help!


My player.cpp
Lua:
 player.cpp - Pastebin.com[/URL]


Difference: 

[CPP]
Skulls_t Player::getSkullType(const Creature* creature) const
{
    const Player* player = creature->getPlayer();
    if(player && player->getSkull() == SKULL_NONE)
    {
        if(g_game.getWorldType() != WORLDTYPE_OPEN)
            return SKULL_NONE;

        if((skull != SKULL_NONE && player->hasAttacked(this) && !player->isEnemy(this, false)))
            return SKULL_YELLOW;

        if((isPartner(player) || isAlly(player)) && g_game.getWorldType() != WORLDTYPE_OPTIONAL)
            return SKULL_GREEN;
    }

    return Creature::getSkullType(creature);
}

bool Player::hasAttacked(const Player* attacked) const
{
    return !hasFlag(PlayerFlag_NotGainInFight) && attacked &&
        attackedSet.find(attacked->getID()) != attackedSet.end();
}

void Player::addAttacked(const Player* attacked)
{
    if(hasFlag(PlayerFlag_NotGainInFight) || !attacked)
        return;

    uint32_t attackedId = attacked->getID();
    if(attackedSet.find(attackedId) == attackedSet.end())
        attackedSet.insert(attackedId);
}

void Player::setSkullEnd(time_t _time, bool login, Skulls_t _skull)
{
    if(g_game.getWorldType() != WORLDTYPE_OPEN || hasFlag(PlayerFlag_NotGainInFight) ||
            hasCustomFlag(PlayerCustomFlag_NotGainSkull))
        return;

    bool requireUpdate = false;
    if(_time > time(NULL))
    {
        requireUpdate = true;
        setSkull(_skull);
    }
    else if(skull == _skull)
    {
        requireUpdate = true;
        setSkull(SKULL_NONE);
        _time = 0;
    }

    if(requireUpdate)
    {
        skullEnd = _time;
        if(!login)
            g_game.updateCreatureSkull(this);
    }
}
[/CPP]
 
Back
Top