diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index d25b346d7..94af4cdee 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -6774,6 +6774,21 @@ XS(XS__getcleannpcnamebyid) { XSRETURN(1); } +XS(XS__getinventoryslotname); +XS(XS__getinventoryslotname) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: quest::getinventoryslotname(int16 slot_id)"); + + dXSTARG; + int16 slot_id = (int16) SvIV(ST(0)); + auto slot_name = quest_manager.getinventoryslotname(slot_id); + sv_setpv(TARG, slot_name.c_str()); + XSprePUSH; + PUSHTARG; + XSRETURN(1); +} + XS(XS__rename); XS(XS__rename) { dXSARGS; @@ -7029,6 +7044,7 @@ EXTERN_C XS(boot_quest) { newXS(strcpy(buf, "getguildnamebyid"), XS__getguildnamebyid, file); newXS(strcpy(buf, "getguildidbycharid"), XS__getguildidbycharid, file); newXS(strcpy(buf, "getgroupidbycharid"), XS__getgroupidbycharid, file); + newXS(strcpy(buf, "getinventoryslotname"), XS__getinventoryslotname, file); newXS(strcpy(buf, "getraididbycharid"), XS__getraididbycharid, file); newXS(strcpy(buf, "getracename"), XS__getracename, file); newXS(strcpy(buf, "getspellname"), XS__getspellname, file); diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index f83fd76d9..896bb4051 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -2459,6 +2459,11 @@ std::string lua_get_clean_npc_name_by_id(uint32 npc_id) { return quest_manager.getcleannpcnamebyid(npc_id); } + +std::string lua_get_inventory_slot_name(int16 slot_id) { + return quest_manager.getinventoryslotname(slot_id); +} + void lua_rename(std::string name) { quest_manager.rename(name); } @@ -3028,7 +3033,9 @@ luabind::scope lua_register_general() { luabind::def("cross_zone_add_ldon_loss_by_expedition_id", &lua_cross_zone_add_ldon_loss_by_expedition_id), luabind::def("cross_zone_add_ldon_points_by_expedition_id", &lua_cross_zone_add_ldon_points_by_expedition_id), luabind::def("cross_zone_add_ldon_win_by_expedition_id", &lua_cross_zone_add_ldon_win_by_expedition_id), + luabind::def("get_inventory_slot_name", &lua_get_inventory_slot_name), luabind::def("rename", &lua_rename), + /** * Expansions */ diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 8848f7eda..83ed76ce7 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -4624,3 +4624,7 @@ void QuestManager::CrossZoneLDoNUpdate(uint8 type, uint8 subtype, int identifier worldserver.SendPacket(pack); safe_delete(pack); } + +std::string QuestManager::getinventoryslotname(int16 slot_id) { + return EQ::invslot::GetInvPossessionsSlotName(slot_id); +} \ No newline at end of file diff --git a/zone/questmgr.h b/zone/questmgr.h index 5b3a21629..bf615835b 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -381,6 +381,7 @@ public: double GetEXPModifierByCharID(uint32 character_id, uint32 zone_id) const; void SetAAEXPModifierByCharID(uint32 character_id, uint32 zone_id, double aa_modifier); void SetEXPModifierByCharID(uint32 character_id, uint32 zone_id, double exp_modifier); + std::string getinventoryslotname(int16 slot_id); Client *GetInitiator() const; NPC *GetNPC() const;