mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 15:08:22 +00:00
[Quest API] Add GetAugmentIDs() to Perl/Lua (#4114)
# Perl - Add `$questitem->GetAugmentIDs()`. # Lua - Add `iteminst:GetAugmentIDs()`. # Notes - Allows operators to get a list of augment IDs from an item instance directly without using the inventory method.
This commit is contained in:
@@ -317,6 +317,26 @@ void Lua_ItemInst::ItemSay(const char* text, uint8 language_id) // @categories I
|
||||
quest_manager.GetInitiator()->ChannelMessageSend(self->GetItem()->Name, 0, ChatChannel_Say, language_id, Language::MaxValue, text);
|
||||
}
|
||||
|
||||
luabind::object Lua_ItemInst::GetAugmentIDs(lua_State* L)
|
||||
{
|
||||
auto lua_table = luabind::newtable(L);
|
||||
|
||||
if (d_) {
|
||||
auto self = reinterpret_cast<NativeType*>(d_);
|
||||
|
||||
const auto& augment_ids = self->GetAugmentIDs();
|
||||
|
||||
int index = 1;
|
||||
|
||||
for (auto augment_id : augment_ids) {
|
||||
lua_table[index] = augment_id;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
return lua_table;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_iteminst() {
|
||||
return luabind::class_<Lua_ItemInst>("ItemInst")
|
||||
.def(luabind::constructor<>())
|
||||
@@ -331,6 +351,7 @@ luabind::scope lua_register_iteminst() {
|
||||
.def("CountAugmentByID", (int(Lua_ItemInst::*)(uint32))&Lua_ItemInst::CountAugmentByID)
|
||||
.def("DeleteCustomData", (void(Lua_ItemInst::*)(const std::string &))&Lua_ItemInst::DeleteCustomData)
|
||||
.def("GetAugment", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugment)
|
||||
.def("GetAugmentIDs", (luabind::object(Lua_ItemInst::*)(lua_State*))&Lua_ItemInst::GetAugmentIDs)
|
||||
.def("GetAugmentItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugmentItemID)
|
||||
.def("GetAugmentType", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetAugmentType)
|
||||
.def("GetCharges", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetCharges)
|
||||
|
||||
Reference in New Issue
Block a user