mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
[Quest API] Add GetBotItem() and GetBotItemIDBySlot() to Perl/Lua. (#2350)
- Add $bot->GetBotItem() to Perl. - Add $bot->GetBotItemIDBySlot() to Perl. - Add bot:GetBotItem() to Lua. - Add bot:GetBotItemIDBySlot() to Lua.
This commit is contained in:
parent
a24a6f1160
commit
b0da836f5a
@ -588,6 +588,7 @@ public:
|
|||||||
uint32 augment_six = 0
|
uint32 augment_six = 0
|
||||||
);
|
);
|
||||||
uint32 CountBotItem(uint32 item_id);
|
uint32 CountBotItem(uint32 item_id);
|
||||||
|
uint32 GetBotItemBySlot(uint16 slot_id);
|
||||||
bool HasBotItem(uint32 item_id);
|
bool HasBotItem(uint32 item_id);
|
||||||
void RemoveBotItem(uint32 item_id);
|
void RemoveBotItem(uint32 item_id);
|
||||||
uint32 GetTotalPlayTime();
|
uint32 GetTotalPlayTime();
|
||||||
@ -733,7 +734,6 @@ private:
|
|||||||
// Private "Inventory" Methods
|
// Private "Inventory" Methods
|
||||||
void GetBotItems(EQ::InventoryProfile &inv, std::string* error_message);
|
void GetBotItems(EQ::InventoryProfile &inv, std::string* error_message);
|
||||||
void BotAddEquipItem(uint16 slot_id, uint32 item_id);
|
void BotAddEquipItem(uint16 slot_id, uint32 item_id);
|
||||||
uint32 GetBotItemBySlot(uint16 slot_id);
|
|
||||||
|
|
||||||
// Private "Pet" Methods
|
// Private "Pet" Methods
|
||||||
bool LoadPet(); // Load and spawn bot pet if there is one
|
bool LoadPet(); // Load and spawn bot pet if there is one
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "bot.h"
|
#include "bot.h"
|
||||||
#include "lua_bot.h"
|
#include "lua_bot.h"
|
||||||
|
#include "lua_iteminst.h"
|
||||||
#include "lua_mob.h"
|
#include "lua_mob.h"
|
||||||
|
|
||||||
void Lua_Bot::AddBotItem(uint16 slot_id, uint32 item_id) {
|
void Lua_Bot::AddBotItem(uint16 slot_id, uint32 item_id) {
|
||||||
@ -73,6 +74,16 @@ void Lua_Bot::RemoveBotItem(uint32 item_id) {
|
|||||||
self->RemoveBotItem(item_id);
|
self->RemoveBotItem(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Lua_ItemInst Lua_Bot::GetBotItem(uint16 slot_id) {
|
||||||
|
Lua_Safe_Call_Class(Lua_ItemInst);
|
||||||
|
return self->GetBotItem(slot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Bot::GetBotItemIDBySlot(uint16 slot_id) {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetBotItemBySlot(slot_id);
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_bot() {
|
luabind::scope lua_register_bot() {
|
||||||
return luabind::class_<Lua_Bot, Lua_Mob>("Bot")
|
return luabind::class_<Lua_Bot, Lua_Mob>("Bot")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@ -86,6 +97,8 @@ luabind::scope lua_register_bot() {
|
|||||||
.def("AddBotItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32,uint32,uint32,uint32))&Lua_Bot::AddBotItem)
|
.def("AddBotItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32,uint32,uint32,uint32))&Lua_Bot::AddBotItem)
|
||||||
.def("AddBotItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32,uint32,uint32,uint32,uint32))&Lua_Bot::AddBotItem)
|
.def("AddBotItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32,uint32,uint32,uint32,uint32))&Lua_Bot::AddBotItem)
|
||||||
.def("CountBotItem", (uint32(Lua_Bot::*)(uint32))&Lua_Bot::CountBotItem)
|
.def("CountBotItem", (uint32(Lua_Bot::*)(uint32))&Lua_Bot::CountBotItem)
|
||||||
|
.def("GetBotItem", (Lua_ItemInst(Lua_Bot::*)(uint16))&Lua_Bot::GetBotItem)
|
||||||
|
.def("GetBotItemIDBySlot", (uint32(Lua_Bot::*)(uint16))&Lua_Bot::GetBotItemIDBySlot)
|
||||||
.def("GetOwner", (Lua_Mob(Lua_Bot::*)(void))&Lua_Bot::GetOwner)
|
.def("GetOwner", (Lua_Mob(Lua_Bot::*)(void))&Lua_Bot::GetOwner)
|
||||||
.def("HasBotItem", (bool(Lua_Bot::*)(uint32))&Lua_Bot::HasBotItem)
|
.def("HasBotItem", (bool(Lua_Bot::*)(uint32))&Lua_Bot::HasBotItem)
|
||||||
.def("RemoveBotItem", (void(Lua_Bot::*)(uint32))&Lua_Bot::RemoveBotItem);
|
.def("RemoveBotItem", (void(Lua_Bot::*)(uint32))&Lua_Bot::RemoveBotItem);
|
||||||
|
|||||||
@ -37,6 +37,8 @@ public:
|
|||||||
void AddBotItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four, uint32 augment_five);
|
void AddBotItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four, uint32 augment_five);
|
||||||
void AddBotItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four, uint32 augment_five, uint32 augment_six);
|
void AddBotItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four, uint32 augment_five, uint32 augment_six);
|
||||||
uint32 CountBotItem(uint32 item_id);
|
uint32 CountBotItem(uint32 item_id);
|
||||||
|
Lua_ItemInst GetBotItem(uint16 slot_id);
|
||||||
|
uint32 GetBotItemIDBySlot(uint16 slot_id);
|
||||||
Lua_Mob GetOwner();
|
Lua_Mob GetOwner();
|
||||||
bool HasBotItem(uint32 item_id);
|
bool HasBotItem(uint32 item_id);
|
||||||
void RemoveBotItem(uint32 item_id);
|
void RemoveBotItem(uint32 item_id);
|
||||||
|
|||||||
@ -71,6 +71,16 @@ void Perl_Bot_RemoveBotItem(Bot* self, uint32 item_id)
|
|||||||
return self->RemoveBotItem(item_id);
|
return self->RemoveBotItem(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EQ::ItemInstance* Perl_Bot_GetBotItem(Bot* self, uint16 slot_id)
|
||||||
|
{
|
||||||
|
return self->GetBotItem(slot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Perl_Bot_GetBotItemIDBySlot(Bot* self, uint16 slot_id)
|
||||||
|
{
|
||||||
|
return self->GetBotItemBySlot(slot_id);
|
||||||
|
}
|
||||||
|
|
||||||
void perl_register_bot()
|
void perl_register_bot()
|
||||||
{
|
{
|
||||||
perl::interpreter state(PERL_GET_THX);
|
perl::interpreter state(PERL_GET_THX);
|
||||||
@ -87,6 +97,8 @@ void perl_register_bot()
|
|||||||
package.add("AddBotItem", (void(*)(Bot*, uint16, uint32, uint16, bool, uint32, uint32, uint32, uint32, uint32))&Perl_Bot_AddBotItem);
|
package.add("AddBotItem", (void(*)(Bot*, uint16, uint32, uint16, bool, uint32, uint32, uint32, uint32, uint32))&Perl_Bot_AddBotItem);
|
||||||
package.add("AddBotItem", (void(*)(Bot*, uint16, uint32, uint16, bool, uint32, uint32, uint32, uint32, uint32, uint32))&Perl_Bot_AddBotItem);
|
package.add("AddBotItem", (void(*)(Bot*, uint16, uint32, uint16, bool, uint32, uint32, uint32, uint32, uint32, uint32))&Perl_Bot_AddBotItem);
|
||||||
package.add("CountBotItem", &Perl_Bot_CountBotItem);
|
package.add("CountBotItem", &Perl_Bot_CountBotItem);
|
||||||
|
package.add("GetBotItem", &Perl_Bot_GetBotItem);
|
||||||
|
package.add("GetBotItemIDBySlot", &Perl_Bot_GetBotItemIDBySlot);
|
||||||
package.add("GetOwner", &Perl_Bot_GetOwner);
|
package.add("GetOwner", &Perl_Bot_GetOwner);
|
||||||
package.add("HasBotItem", &Perl_Bot_HasBotItem);
|
package.add("HasBotItem", &Perl_Bot_HasBotItem);
|
||||||
package.add("RemoveBotItem", &Perl_Bot_RemoveBotItem);
|
package.add("RemoveBotItem", &Perl_Bot_RemoveBotItem);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user