[Feature] Add Comment to Item Data/Quest API (#3669)

* [Feature] Add Comment to Item Data/Quest API

# Perl
- Add `quest::getitemcomment(item_id)`.
- Add `quest::getitemlore(item_id)`.
- Add `$questitemdata->GetComment()`.

# Lua
- Add `eq.get_item_comment(item_id)`.
- Add `eq.get_item_lore(item_id)`.
- Add `item:Comment()`.
# Notes
- Added the ability for operators to pull these fields from item data without a database hit.
- Fixed a bug in `embparser_api.cpp` where `GetZoneGravity` was connected to the wrong methods.

* Update embparser_api.cpp
This commit is contained in:
Alex King
2023-11-07 18:12:39 -05:00
committed by GitHub
parent 6094ec9c7b
commit 853739b538
9 changed files with 69 additions and 5 deletions
+22 -1
View File
@@ -3198,8 +3198,29 @@ std::string QuestManager::varlink(
return linker.GenerateLink();
}
std::string QuestManager::getitemcomment(uint32 item_id) {
const auto* item_data = database.GetItem(item_id);
if (!item_data) {
return "INVALID ITEM ID IN GETITEMCOMMENT";
}
std::string item_comment = item_data->Comment;
return item_comment;
}
std::string QuestManager::getitemlore(uint32 item_id) {
const auto* item_data = database.GetItem(item_id);
if (!item_data) {
return "INVALID ITEM ID IN GETITEMLORE";
}
std::string item_lore = item_data->Lore;
return item_lore;
}
std::string QuestManager::getitemname(uint32 item_id) {
const EQ::ItemData* item_data = database.GetItem(item_id);
const auto* item_data = database.GetItem(item_id);
if (!item_data) {
return "INVALID ITEM ID IN GETITEMNAME";
}