mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-22 06:22:28 +00:00
[Quest API] Add getinventoryslotname(slot_id) to Perl/Lua. (#1406)
- Add quest::getinventoryslotname(slot_id) to Perl. - Add eq.get_inventory_slot_name(slot_id) to Lua. Co-authored-by: Chris Miles <akkadius1@gmail.com>
This commit is contained in:
parent
f1d1731fc7
commit
ed6e53be54
@ -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);
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user