Merge pull request #1 from kjack9/item-links

Add item links and small refinements
This commit is contained in:
Revision
2023-05-18 14:34:28 +02:00
committed by GitHub

View File

@@ -13,7 +13,7 @@ public:
{
SendTransactionInformation(player, item, count);
player->ModifyMoney(item->GetTemplate()->SellPrice * count);
player->DestroyItemCount(item, count, true);
player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
}
}
@@ -23,7 +23,7 @@ private:
std::string name;
if (count > 1)
{
name = Acore::StringFormat("[%s] x %i", item->GetTemplate()->Name1, count);
name = Acore::StringFormat("[%s]x%i", item->GetTemplate()->Name1, count);
}
else
{
@@ -35,39 +35,41 @@ private:
uint32 silver = (money % GOLD) / SILVER;
uint32 copper = (money % GOLD) % SILVER;
std::string itemLink = Acore::StringFormat("|cff9d9d9d|Hitem:%i::::::::80:::::|h%s|h|r", item->GetTemplate()->ItemId, name);
std::string info;
if (money < SILVER)
{
info = Acore::StringFormat("%s was sold for %i copper.", name, copper);
info = Acore::StringFormat("%s sold for %i copper.", itemLink, copper);
}
else if (money < GOLD)
{
if (copper > 0)
{
info = Acore::StringFormat("%s was sold for %i silver and %i copper.", name, silver, copper);
info = Acore::StringFormat("%s sold for %i silver and %i copper.", itemLink, silver, copper);
}
else
{
info = Acore::StringFormat("%s was sold for %i silver.", name, silver);
info = Acore::StringFormat("%s sold for %i silver.", itemLink, silver);
}
}
else
{
if (copper > 0 && silver > 0)
{
info = Acore::StringFormat("%s was sold for %i gold, %i silver and %i copper.", name, gold, silver, copper);
info = Acore::StringFormat("%s sold for %i gold, %i silver and %i copper.", itemLink, gold, silver, copper);
}
else if (copper > 0)
{
info = Acore::StringFormat("%s was sold for %i gold and %i copper.", name, gold, copper);
info = Acore::StringFormat("%s sold for %i gold and %i copper.", itemLink, gold, copper);
}
else if (silver > 0)
{
info = Acore::StringFormat("%s was sold for %i gold and %i silver.", name, gold, silver);
info = Acore::StringFormat("%s sold for %i gold and %i silver.", itemLink, gold, silver);
}
else
{
info = Acore::StringFormat("%s was sold for %i gold.", name, gold);
info = Acore::StringFormat("%s sold for %i gold.", itemLink, gold);
}
}