mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Quest API] Add DoAugmentSlotsMatch() to Perl/Lua. (#2687)
# Perl - Add `quest::do_augment_slots_match(item_one, item_two)`. # Lua - Add `eq.do_augment_slots_match(item_one, item_two)`. # Notes - Allows operators to see if augments slots across two items match for something like moving augments from one item to another.
This commit is contained in:
parent
501ea4b736
commit
3a4ba6f422
@ -3975,6 +3975,11 @@ std::string Perl__varlink(uint32 item_id, int16 charges, uint32 aug1, uint32 aug
|
||||
return quest_manager.varlink(item_id, charges, aug1, aug2, aug3, aug4, aug5, aug6, attuned);
|
||||
}
|
||||
|
||||
bool Perl__do_augment_slots_match(uint32 item_one, uint32 item_two)
|
||||
{
|
||||
return quest_manager.DoAugmentSlotsMatch(item_one, item_two);
|
||||
}
|
||||
|
||||
void perl_register_quest()
|
||||
{
|
||||
perl::interpreter perl(PERL_GET_THX);
|
||||
@ -4321,6 +4326,7 @@ void perl_register_quest()
|
||||
package.add("doanim", (void(*)(int, int))&Perl__doanim);
|
||||
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("echo", &Perl__echo);
|
||||
package.add("emote", &Perl__emote);
|
||||
package.add("enable_proximity_say", &Perl__enable_proximity_say);
|
||||
|
||||
@ -3686,6 +3686,11 @@ std::string lua_item_link(uint32 item_id, int16 charges, uint32 aug1, uint32 aug
|
||||
return quest_manager.varlink(item_id, charges, aug1, aug2, aug3, aug4, aug5, aug6, attuned);
|
||||
}
|
||||
|
||||
bool lua_do_augment_slots_match(uint32 item_one, uint32 item_two)
|
||||
{
|
||||
return quest_manager.DoAugmentSlotsMatch(item_one, item_two);
|
||||
}
|
||||
|
||||
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
||||
cur = table[#name]; \
|
||||
if(luabind::type(cur) != LUA_TNIL) { \
|
||||
@ -4201,6 +4206,7 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("do_anim", (void(*)(int,int))&lua_do_anim),
|
||||
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),
|
||||
/*
|
||||
Cross Zone
|
||||
*/
|
||||
|
||||
@ -3946,3 +3946,23 @@ void QuestManager::marquee(uint32 type, uint32 priority, uint32 fade_in, uint32
|
||||
|
||||
initiator->SendMarqueeMessage(type, priority, fade_in, fade_out, duration, message);
|
||||
}
|
||||
|
||||
bool QuestManager::DoAugmentSlotsMatch(uint32 item_one, uint32 item_two) {
|
||||
const auto* inst_one = database.GetItem(item_one);
|
||||
if (!inst_one) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto* inst_two = database.GetItem(item_two);
|
||||
if (!inst_two) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++) {
|
||||
if (inst_one->AugSlotType[i] != inst_two->AugSlotType[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -345,6 +345,7 @@ public:
|
||||
int GetRecipeMadeCount(uint32 recipe_id);
|
||||
std::string GetRecipeName(uint32 recipe_id);
|
||||
bool HasRecipeLearned(uint32 recipe_id);
|
||||
bool DoAugmentSlotsMatch(uint32 item_one, uint32 item_two);
|
||||
|
||||
#ifdef BOTS
|
||||
Bot *GetBot() const;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user