aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 376fd0da969..ea62d0ca55b 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -1174,7 +1174,7 @@ public:
name = itemTemplate->GetName(handler->GetSessionDbcLocale());
if (!name)
name = "Unknown item";
- handler->PSendSysMessage(alternateString ? LANG_COMMAND_NPC_SHOWLOOT_ENTRY_2 : LANG_COMMAND_NPC_SHOWLOOT_ENTRY,
+ handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_ENTRY, alternateString ? 6 : 3 /*number of bytes from following string*/, "\xE2\x94\x80\xE2\x94\x80",
itemCount, ItemQualityColors[itemTemplate ? static_cast<ItemQualities>(itemTemplate->GetQuality()) : ITEM_QUALITY_POOR], itemId, name, itemId);
}
@@ -1190,6 +1190,23 @@ public:
count, ItemQualityColors[currency ? static_cast<ItemQualities>(currency->Quality) : ITEM_QUALITY_POOR], currencyId, count, name, currencyId);
}
+ static void _ShowLootTrackingQuestCurrencyEntry(ChatHandler* handler, uint32 questId, bool alternateString = false)
+ {
+ Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
+ std::string_view name;
+ if (quest)
+ {
+ name = quest->GetLogTitle();
+ if (handler->GetSessionDbLocaleIndex() != LOCALE_enUS)
+ if (QuestTemplateLocale const* localeData = sObjectMgr->GetQuestLocale(questId))
+ ObjectMgr::GetLocaleString(localeData->LogTitle, handler->GetSessionDbLocaleIndex(), name);
+ }
+ if (name.empty())
+ name = "Unknown quest";
+ handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_TRACKING_QUEST, alternateString ? 6 : 3 /*number of bytes from following string*/, "\xE2\x94\x80\xE2\x94\x80",
+ questId, STRING_VIEW_FMT_ARG(name), questId);
+ }
+
static void _IterateNotNormalLootMap(ChatHandler* handler, NotNormalLootItemMap const& map, std::vector<LootItem> const& items)
{
for (NotNormalLootItemMap::value_type const& pair : map)
@@ -1212,6 +1229,9 @@ public:
case LootItemType::Currency:
_ShowLootCurrencyEntry(handler, item.itemid, item.count, true);
break;
+ case LootItemType::TrackingQuest:
+ _ShowLootTrackingQuestCurrencyEntry(handler, item.itemid, true);
+ break;
}
}
}
@@ -1237,6 +1257,9 @@ public:
case LootItemType::Currency:
_ShowLootCurrencyEntry(handler, item.itemid, item.count);
break;
+ case LootItemType::TrackingQuest:
+ _ShowLootTrackingQuestCurrencyEntry(handler, item.itemid);
+ break;
}
}
}
@@ -1256,6 +1279,9 @@ public:
case LootItemType::Currency:
_ShowLootCurrencyEntry(handler, item.itemid, item.count);
break;
+ case LootItemType::TrackingQuest:
+ _ShowLootTrackingQuestCurrencyEntry(handler, item.itemid);
+ break;
}
}
}