mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[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:
@@ -356,6 +356,7 @@ namespace EQ
|
||||
struct ItemData {
|
||||
// Non packet based fields
|
||||
uint8 MinStatus {};
|
||||
char Comment[255] {};
|
||||
|
||||
// Packet based fields
|
||||
uint8 ItemClass {}; // Item Type: 0=common, 1=container, 2=book
|
||||
|
||||
+9
-3
@@ -51,7 +51,9 @@ namespace ItemField
|
||||
#define F(x) x,
|
||||
#include "item_fieldlist.h"
|
||||
#undef F
|
||||
updated
|
||||
updated,
|
||||
minstatus,
|
||||
comment,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -965,7 +967,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
#define F(x) "`"#x"`,"
|
||||
#include "item_fieldlist.h"
|
||||
#undef F
|
||||
"updated FROM items ORDER BY id";
|
||||
"updated, minstatus, comment FROM items ORDER BY id";
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return;
|
||||
@@ -977,9 +979,13 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
// Unique Identifier
|
||||
item.ID = Strings::ToUnsignedInt(row[ItemField::id]);
|
||||
|
||||
// Name and Lore
|
||||
// Minimum Status
|
||||
item.MinStatus = static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::minstatus]));
|
||||
|
||||
// Name, Lore, and Comment
|
||||
strn0cpy(item.Name, row[ItemField::name], sizeof(item.Name));
|
||||
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
||||
strn0cpy(item.Comment, row[ItemField::comment], sizeof(item.Comment));
|
||||
|
||||
// Flags
|
||||
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
||||
|
||||
Reference in New Issue
Block a user