mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[Quest API] Add DoesAugmentFit() to Perl/Lua. (#2688)
# Perl - Add `quest::does_augment_fit(item, augment_id)`. # Lua - Add `eq.does_augment_fit(item, augment_id)`. # Notes - Returns the augment slot index where the augment fits within the item instance provided, returns `-1` if it doesn't fit or has no open slot to fit in.
This commit is contained in:
+16
-1
@@ -3947,7 +3947,8 @@ 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) {
|
||||
bool QuestManager::DoAugmentSlotsMatch(uint32 item_one, uint32 item_two)
|
||||
{
|
||||
const auto* inst_one = database.GetItem(item_one);
|
||||
if (!inst_one) {
|
||||
return false;
|
||||
@@ -3966,3 +3967,17 @@ bool QuestManager::DoAugmentSlotsMatch(uint32 item_one, uint32 item_two) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int8 QuestManager::DoesAugmentFit(EQ::ItemInstance* inst, uint32 augment_id)
|
||||
{
|
||||
if (!inst) {
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
const auto* aug_inst = database.GetItem(augment_id);
|
||||
if (!aug_inst) {
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
return inst->AvailableAugmentSlot(aug_inst->AugType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user