[Quest API] Add Bot Methods to Lua. (#2731)

# Perl
- Minor cleanup of variable types.

 # Lua
- Add `bot:GetAugmentAt(slot_id, augment_index)`.
- Add `bot:GetItemAt(slot_id)`.
- Add `bot:SendSpellAnim(target_id, spell_id)`.
- Properly implemented `bot:GetItemIDAt(slot_id)`.

# Notes
- `bot:GetItemIDAt` existed in Lua, but didn't have a bind definition, so was non-functional.
- This makes Perl/Lua bot methods 1:1 as Perl had 75 and Lua had 72, they now both have 75.
This commit is contained in:
Alex King
2023-01-14 10:16:11 -05:00
committed by GitHub
parent f5523b40d2
commit bd3e8b2afc
7 changed files with 81 additions and 45 deletions
+9 -9
View File
@@ -101,13 +101,13 @@ void Perl_Bot_RemoveBotItem(Bot* self, uint32 item_id)
return self->RemoveBotItem(item_id);
}
EQ::ItemInstance* Perl_Bot_GetAugmentAt(Bot* self, uint32 slot, uint32 aug_slot)
EQ::ItemInstance* Perl_Bot_GetAugmentAt(Bot* self, int16 slot_id, uint8 augment_index)
{
EQ::ItemInstance* inst = self->GetInv().GetItem(slot);
if (inst)
{
return inst->GetAugment(aug_slot);
auto* inst = self->GetInv().GetItem(slot_id);
if (inst) {
return inst->GetAugment(augment_index);
}
return nullptr;
}
@@ -161,9 +161,9 @@ bool Perl_Bot_IsSitting(Bot* self) // @categories Account and Character
return self->IsSitting();
}
void Perl_Bot_SendSpellAnim(Bot* self, uint16 targetid, uint16 spell_id)
void Perl_Bot_SendSpellAnim(Bot* self, uint16 target_id, uint16 spell_id)
{
self->SendSpellAnim(targetid, spell_id);
self->SendSpellAnim(target_id, spell_id);
}
void Perl_Bot_Signal(Bot* self, int signal_id)
@@ -286,9 +286,9 @@ int Perl_Bot_GetInstrumentMod(Bot* self, uint16 spell_id) // @categories Spells
return self->GetInstrumentMod(spell_id);
}
EQ::ItemInstance* Perl_Bot_GetItemAt(Bot* self, uint32 slot) // @categories Inventory and Items
EQ::ItemInstance* Perl_Bot_GetItemAt(Bot* self, int16 slot_id) // @categories Inventory and Items
{
return self->GetInv().GetItem(slot);
return self->GetInv().GetItem(slot_id);
}
bool Perl_Bot_IsGrouped(Bot* self) // @categories Account and Character, Group