[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 -7
View File
@@ -10173,17 +10173,19 @@ int32 Bot::GetRawItemAC()
return Total;
}
void Bot::SendSpellAnim(uint16 targetid, uint16 spell_id)
void Bot::SendSpellAnim(uint16 target_id, uint16 spell_id)
{
if (!targetid || !IsValidSpell(spell_id))
if (!target_id || !IsValidSpell(spell_id)) {
return;
}
EQApplicationPacket app(OP_Action, sizeof(Action_Struct));
Action_Struct* a = (Action_Struct*)app.pBuffer;
a->target = targetid;
a->source = GetID();
a->type = 231;
a->spell = spell_id;
auto* a = (Action_Struct*) app.pBuffer;
a->target = target_id;
a->source = GetID();
a->type = 231;
a->spell = spell_id;
a->hit_heading = GetHeading();
app.priority = 1;