• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Item attributes in Server log

Joined
Apr 16, 2009
Messages
121
Reaction score
4
Location
/dev/null/ aka Poland
Find in container.cpp this:
Code:
        if(!begin)
            s << ", ";
        else
            begin = false;
        s << (*it)->getNameDescription();

And after it add:
Code:
        int atk = (*it)->getAttack();
        int def = (*it)->getDefense();
        int arm = (*it)->getArmor();
        if(atk > 0 && def > 0) { s << " (Attack: " << atk << ", defence: " << def << ")"; }
        else if(def > 0) { s << " (Defence: " << def << ")"; }
        else if(arm > 0) { s << " (Armor: " << arm << ")"; }

And example:
21:12 Loot of a goblin: a bag, a leather armor (Armor: 8), a short sword (Attack: 15, defence: 14), a leather helmet (Armor: 5), a machete (Attack: 15, defence: 11), 8 gold coins, 9 worms, a bone club (Attack: 14, defence: 11), a moldy cheese, a bone, a fish, 2 small stones, a small axe.
 
Last edited:
Find in container.cpp this:
Code:
        if(!begin)
            s << ", ";
        else
            begin = false;
        s << (*it)->getNameDescription();

And after it add:
Code:
        int atk = (*it)->getAttack();
        int def = (*it)->getDefense();
        int arm = (*it)->getArmor();
        if(atk > 0 && def > 0) { s << " (Attack: " << atk << ", defence: " << def << ")"; }
        else if(def > 0) { s << " (Defence: " << def << ")"; }
        else if(arm > 0) { s << " (Armor: " << arm << ")"; }

And example:

Test TFS 0.4

Code:
std::stringstream& Container::getContentDescription(std::stringstream& s) const
{
    bool begin = true;
    Container* evil = const_cast<Container*>(this);
    for(ContainerIterator it = evil->begin(); it != evil->end(); ++it)
    {
        if(!begin)
            s << ", ";
        else
            begin = false;

        int atk = (*it)->getAttack();
        int def = (*it)->getDefense();
        int arm = (*it)->getArmor();
        std::string desc = (*it)->getNameDescription();
        if(atk > 0 && def > 0)
        {
       
        s << desc << " (Attack: " << atk << ", defence: " << def << ")";
       
        }
        else if(def > 0)
        {
       
        s << desc << " (Defence: " << def << ")";
       
        }
        else if(arm > 0)
        {
       
        s << desc << " (Armor: " << arm << ")";
       
        }
    }

    if(begin)
        s << "nothing";

    return s;
}

08:43 Loot of a Ancient Dinosaur: a Brolly Bracelet (Defence: 33), a C16 Armor (Armor: 120), a Glove of Honor (Attack: 18, defence: 18), a Gohan Armor (Armor: 120).
 
Back
Top