mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Quest API] Add Augment Slot support to does_augment_fit (#2813)
* [Quest API] Add Augment Slot support to does_augment_fit # Notes - Allows you to check if the supplied augment ID fits in the specified augment slot of the item instance provided. * Update item_instance.cpp
This commit is contained in:
@@ -3981,6 +3981,11 @@ int8 Perl__does_augment_fit(EQ::ItemInstance* inst, uint32 augment_id)
|
||||
return quest_manager.DoesAugmentFit(inst, augment_id);
|
||||
}
|
||||
|
||||
int8 Perl__does_augment_fit(EQ::ItemInstance* inst, uint32 augment_id, uint8 augment_slot)
|
||||
{
|
||||
return quest_manager.DoesAugmentFit(inst, augment_id, augment_slot);
|
||||
}
|
||||
|
||||
void perl_register_quest()
|
||||
{
|
||||
perl::interpreter perl(PERL_GET_THX);
|
||||
@@ -4326,7 +4331,8 @@ void perl_register_quest()
|
||||
package.add("doanim", (void(*)(int, int, bool))&Perl__doanim);
|
||||
package.add("doanim", (void(*)(int, int, bool, int))&Perl__doanim);
|
||||
package.add("do_augment_slots_match", &Perl__do_augment_slots_match);
|
||||
package.add("does_augment_fit", &Perl__does_augment_fit);
|
||||
package.add("does_augment_fit", (int8(*)(EQ::ItemInstance*, uint32))&Perl__does_augment_fit);
|
||||
package.add("does_augment_fit", (int8(*)(EQ::ItemInstance*, uint32, uint8))&Perl__does_augment_fit);
|
||||
package.add("echo", &Perl__echo);
|
||||
package.add("emote", &Perl__emote);
|
||||
package.add("enable_proximity_say", &Perl__enable_proximity_say);
|
||||
|
||||
@@ -3700,6 +3700,11 @@ int8 lua_does_augment_fit(Lua_ItemInst inst, uint32 augment_id)
|
||||
return quest_manager.DoesAugmentFit(inst, augment_id);
|
||||
}
|
||||
|
||||
int8 lua_does_augment_fit(Lua_ItemInst inst, uint32 augment_id, uint8 augment_slot)
|
||||
{
|
||||
return quest_manager.DoesAugmentFit(inst, augment_id, augment_slot);
|
||||
}
|
||||
|
||||
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
||||
cur = table[#name]; \
|
||||
if(luabind::type(cur) != LUA_TNIL) { \
|
||||
@@ -4217,7 +4222,8 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("do_anim", (void(*)(int,int,bool))&lua_do_anim),
|
||||
luabind::def("do_anim", (void(*)(int,int,bool,int))&lua_do_anim),
|
||||
luabind::def("do_augment_slots_match", &lua_do_augment_slots_match),
|
||||
luabind::def("does_augment_fit", &lua_does_augment_fit),
|
||||
luabind::def("does_augment_fit", (int8(*)(Lua_ItemInst, uint32))&lua_does_augment_fit),
|
||||
luabind::def("does_augment_fit", (int8(*)(Lua_ItemInst, uint32, uint8))&lua_does_augment_fit),
|
||||
/*
|
||||
Cross Zone
|
||||
*/
|
||||
|
||||
+8
-1
@@ -3969,7 +3969,7 @@ bool QuestManager::DoAugmentSlotsMatch(uint32 item_one, uint32 item_two)
|
||||
return true;
|
||||
}
|
||||
|
||||
int8 QuestManager::DoesAugmentFit(EQ::ItemInstance* inst, uint32 augment_id)
|
||||
int8 QuestManager::DoesAugmentFit(EQ::ItemInstance* inst, uint32 augment_id, uint8 augment_slot)
|
||||
{
|
||||
if (!inst) {
|
||||
return INVALID_INDEX;
|
||||
@@ -3980,5 +3980,12 @@ int8 QuestManager::DoesAugmentFit(EQ::ItemInstance* inst, uint32 augment_id)
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
if (
|
||||
augment_slot != 255 &&
|
||||
!inst->IsAugmentSlotAvailable(aug_inst->AugType, augment_slot)
|
||||
) {
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
return inst->AvailableAugmentSlot(aug_inst->AugType);
|
||||
}
|
||||
|
||||
+1
-1
@@ -346,7 +346,7 @@ public:
|
||||
std::string GetRecipeName(uint32 recipe_id);
|
||||
bool HasRecipeLearned(uint32 recipe_id);
|
||||
bool DoAugmentSlotsMatch(uint32 item_one, uint32 item_two);
|
||||
int8 DoesAugmentFit(EQ::ItemInstance* inst, uint32 augment_id);
|
||||
int8 DoesAugmentFit(EQ::ItemInstance* inst, uint32 augment_id, uint8 augment_slot = 255);
|
||||
|
||||
Bot *GetBot() const;
|
||||
Client *GetInitiator() const;
|
||||
|
||||
Reference in New Issue
Block a user