mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-11-02 12:56:23 +01:00
introduce coloured loot message
This commit is contained in:
@@ -155,8 +155,19 @@ std::ostringstream& Container::getContentDescription(std::ostringstream& os) con
|
||||
} else {
|
||||
os << ", ";
|
||||
}
|
||||
|
||||
os << item->getNameDescription();
|
||||
|
||||
if (item->getCost() >= 50000) {
|
||||
os << "[#BA90C7:" << item->getNameDescription() << "]";
|
||||
}
|
||||
else if (item->getCost() >= 15000) {
|
||||
os << "[#F3E84A:" << item->getNameDescription() << "]";
|
||||
}
|
||||
else if (item->getCost() >= 1000) {
|
||||
os << "[#629AC4:" << item->getNameDescription() << "]";
|
||||
}
|
||||
else {
|
||||
os << item->getNameDescription();
|
||||
}
|
||||
}
|
||||
|
||||
if (firstitem) {
|
||||
|
||||
@@ -1182,6 +1182,12 @@ std::string Item::getWeightDescription() const
|
||||
return getWeightDescription(weight);
|
||||
}
|
||||
|
||||
uint32_t Item::getCost() const
|
||||
{
|
||||
const ItemType& it = items[id];
|
||||
return it.cost;
|
||||
}
|
||||
|
||||
bool Item::canDecay() const
|
||||
{
|
||||
if (isRemoved()) {
|
||||
|
||||
@@ -565,6 +565,7 @@ class Item : virtual public Thing
|
||||
std::string getDescription(int32_t lookDistance) const final;
|
||||
std::string getNameDescription() const;
|
||||
std::string getWeightDescription() const;
|
||||
uint32_t getCost() const;
|
||||
|
||||
//serialization
|
||||
virtual Attr_ReadValue readAttr(AttrTypes_t attr, PropStream& propStream);
|
||||
|
||||
@@ -423,6 +423,8 @@ bool Items::loadItems()
|
||||
items[id].lightColor = script.readNumber();
|
||||
} else if (identifier == "extrahitchance") {
|
||||
items[id].extraHitChance = script.readNumber();
|
||||
} else if (identifier == "cost") {
|
||||
items[id].cost = script.readNumber();
|
||||
} else if (identifier == "extraattack") {
|
||||
items[id].extraAttack = script.readNumber();
|
||||
} else if (identifier == "totalexpiretime") {
|
||||
|
||||
@@ -208,6 +208,7 @@ class ItemType
|
||||
uint32_t minReqLevel = 0;
|
||||
uint32_t minReqMagicLevel = 0;
|
||||
uint32_t charges = 0;
|
||||
uint32_t cost = 0;
|
||||
int32_t attackStrength = 0;
|
||||
int32_t attackVariation = 0;
|
||||
int32_t manaConsumption = 0;
|
||||
@@ -222,7 +223,7 @@ class ItemType
|
||||
int32_t runeLevel = 0;
|
||||
int32_t nutrition = 0;
|
||||
int32_t destroyTarget = 0;
|
||||
|
||||
|
||||
CombatType_t combatType = COMBAT_NONE;
|
||||
CombatType_t damageType = COMBAT_NONE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user