mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
[Bots] [Quest API] Add ^clickitem, ^timer, fix GetBestBotSpellForCure (#3755)
* [Bots][Quest API] Add ^clickitem, ^timer, revamp bot timers, fix GetBestBotSpellForCure This adds the command **^clickitem** for bots. Bots can click items they are wearing with the provided slot ID, players can use **^invlist** on their bots to see items and slot IDs. This supports actionables. **^itemclick 13 byclass 11** would command all Necromancer bots to attempt to click their Primary item. This adds and supports charges for items to bots, when an item is used, it will lose a charge and cannot be clicked once no charges remain. This adds the following rules: **Bots, BotsClickItemsMinLvl** - Minimum level bots can use **^clickitem**. **Bots, BotsCanClickItems** - Whether or not **^clickitem** is allowed for bots. **Bots, CanClickMageEpicV1** - Whether or not players are allowed to command their bots to use the Magician Epic 1.0 This adds quest methods to Perl/Lua for: ClearDisciplineReuseTimer, ClearItemReuseTimer, ClearSpellRecastTimer GetDisciplineReuseTimer, GetItemReuseTimer, GetSpellRecastTimer SetDisciplineReuseTimer, SetItemReuseTimer, SetSpellRecastTimer Discipline and Spell methods use the spell_id to check, get and set. Item uses the item_id. Clear and Get support wildcards (no spell/item id) to clear all timers of the type or get the first timer of the type. Get will return the remaining time on the chosen timer, if any. Set supports a wildcard (no recast/reuse provided) to use the default of the provided type, you can also specify a recast/reuse timer to set that timer to the chosen value. **^timer** has been added as a bot command, defaulted for GM access. This can be used to set, get and clear timers of different types. Use **^timer help** for info. This revamps the way timers are set, stored, loaded for bots. **GetBestBotSpellForCure** was previously checking only the first spell found and not properly iterating through the checks. This requires modifications to the **bot_timers** table and is included in this commit. * Rebase Conflicts * Update queries to use repositories * Minor adjustment * Formatting * Handle delete as well * Cleanup. * Adjust primary keys to prevent conflicts --------- Co-authored-by: Akkadius <akkadius1@gmail.com> Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
+110
-1
@@ -255,11 +255,101 @@ void Perl_Bot_Stand(Bot* self) // @categories Script Utility
|
||||
self->Stand();
|
||||
}
|
||||
|
||||
uint32 Perl_Bot_GetSpellRecastTimer(Bot* self)
|
||||
{
|
||||
return self->GetSpellRecastRemainingTime();
|
||||
}
|
||||
|
||||
uint32 Perl_Bot_GetSpellRecastTimer(Bot* self, uint16 spell_id)
|
||||
{
|
||||
return self->GetSpellRecastRemainingTime(spell_id);
|
||||
}
|
||||
|
||||
void Perl_Bot_ClearSpellRecastTimer(Bot* self)
|
||||
{
|
||||
return self->ClearSpellRecastTimer();
|
||||
}
|
||||
|
||||
void Perl_Bot_ClearSpellRecastTimer(Bot* self, uint16 spell_id)
|
||||
{
|
||||
return self->ClearSpellRecastTimer(spell_id);
|
||||
}
|
||||
|
||||
uint32 Perl_Bot_GetDisciplineReuseTimer(Bot* self)
|
||||
{
|
||||
return self->GetDisciplineReuseRemainingTime();
|
||||
}
|
||||
|
||||
uint32 Perl_Bot_GetDisciplineReuseTimer(Bot* self, uint16 spell_id)
|
||||
{
|
||||
return self->GetDisciplineReuseRemainingTime(spell_id);
|
||||
}
|
||||
|
||||
void Perl_Bot_ClearDisciplineReuseTimer(Bot* self)
|
||||
{
|
||||
return self->ClearDisciplineReuseTimer();
|
||||
}
|
||||
|
||||
void Perl_Bot_ClearDisciplineReuseTimer(Bot* self, uint16 spell_id)
|
||||
{
|
||||
return self->ClearDisciplineReuseTimer(spell_id);
|
||||
}
|
||||
|
||||
void Perl_Bot_SetDisciplineReuseTimer(Bot* self, uint16 spell_id)
|
||||
{
|
||||
return self->SetDisciplineReuseTimer(spell_id);
|
||||
}
|
||||
|
||||
void Perl_Bot_SetDisciplineReuseTimer(Bot* self, uint16 spell_id, uint32 recast_delay)
|
||||
{
|
||||
return self->SetDisciplineReuseTimer(spell_id);
|
||||
}
|
||||
|
||||
void Perl_Bot_SetItemReuseTimer(Bot* self, uint32 item_id)
|
||||
{
|
||||
return self->SetItemReuseTimer(item_id);
|
||||
}
|
||||
|
||||
void Perl_Bot_SetItemReuseTimer(Bot* self, uint32 item_id, uint32 reuse_timer)
|
||||
{
|
||||
return self->SetItemReuseTimer(item_id, reuse_timer);
|
||||
}
|
||||
|
||||
void Perl_Bot_SetSpellRecastTimer(Bot* self, uint16 spell_id)
|
||||
{
|
||||
return self->SetSpellRecastTimer(spell_id);
|
||||
}
|
||||
|
||||
void Perl_Bot_SetSpellRecastTimer(Bot* self, uint16 spell_id, uint32 recast_delay)
|
||||
{
|
||||
return self->SetSpellRecastTimer(spell_id, recast_delay);
|
||||
}
|
||||
|
||||
int Perl_Bot_GetItemIDAt(Bot* self, int16 slot_id) // @categories Inventory and Items
|
||||
{
|
||||
return self->GetItemIDAt(slot_id);
|
||||
}
|
||||
|
||||
uint32 Perl_Bot_GetItemReuseTimer(Bot* self)
|
||||
{
|
||||
return self->GetItemReuseRemainingTime();
|
||||
}
|
||||
|
||||
uint32 Perl_Bot_GetItemReuseTimer(Bot* self, uint32 item_id)
|
||||
{
|
||||
return self->GetItemReuseRemainingTime(item_id);
|
||||
}
|
||||
|
||||
void Perl_Bot_ClearItemReuseTimer(Bot* self)
|
||||
{
|
||||
return self->ClearItemReuseTimer();
|
||||
}
|
||||
|
||||
void Perl_Bot_ClearItemReuseTimer(Bot* self, uint32 item_id)
|
||||
{
|
||||
return self->ClearItemReuseTimer(item_id);
|
||||
}
|
||||
|
||||
int Perl_Bot_GetAugmentIDAt(Bot* self, int16 slot_id, uint8 aug_slot) // @categories Inventory and Items
|
||||
{
|
||||
return self->GetAugmentIDAt(slot_id, aug_slot);
|
||||
@@ -555,7 +645,13 @@ void perl_register_bot()
|
||||
package.add("ApplySpellRaid", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_ApplySpellRaid);
|
||||
package.add("ApplySpellRaid", (void(*)(Bot*, int, int, int, bool, bool))&Perl_Bot_ApplySpellRaid);
|
||||
package.add("Camp", (void(*)(Bot*))&Perl_Bot_Camp);
|
||||
package.add("Camp", (void(*)(Bot*, bool))&Perl_Bot_Camp);
|
||||
package.add("Camp", (void(*)(Bot*, bool))&Perl_Bot_Camp);
|
||||
package.add("ClearDisciplineReuseTimer", (void(*)(Bot*))&Perl_Bot_ClearDisciplineReuseTimer);
|
||||
package.add("ClearDisciplineReuseTimer", (void(*)(Bot*, uint16))&Perl_Bot_ClearDisciplineReuseTimer);
|
||||
package.add("ClearItemReuseTimer", (void(*)(Bot*))&Perl_Bot_ClearItemReuseTimer);
|
||||
package.add("ClearItemReuseTimer", (void(*)(Bot*, uint32))&Perl_Bot_ClearItemReuseTimer);
|
||||
package.add("ClearSpellRecastTimer", (void(*)(Bot*))&Perl_Bot_ClearSpellRecastTimer);
|
||||
package.add("ClearSpellRecastTimer", (void(*)(Bot*, uint16))&Perl_Bot_ClearSpellRecastTimer);
|
||||
package.add("CountAugmentEquippedByID", &Perl_Bot_CountAugmentEquippedByID);
|
||||
package.add("CountBotItem", &Perl_Bot_CountBotItem);
|
||||
package.add("CountItemEquippedByID", &Perl_Bot_CountItemEquippedByID);
|
||||
@@ -594,6 +690,13 @@ void perl_register_bot()
|
||||
package.add("HasBotItem", &Perl_Bot_HasBotItem);
|
||||
package.add("HasBotSpellEntry", &Perl_Bot_HasBotSpellEntry);
|
||||
package.add("HasItemEquippedByID", &Perl_Bot_HasItemEquippedByID);
|
||||
package.add("GetDisciplineReuseTimer", (uint32(*)(Bot*))&Perl_Bot_GetDisciplineReuseTimer);
|
||||
package.add("GetDisciplineReuseTimer", (uint32(*)(Bot*, uint16))&Perl_Bot_GetDisciplineReuseTimer);
|
||||
package.add("GetItemEquippedByID", &Perl_Bot_HasItemEquippedByID);
|
||||
package.add("GetItemReuseTimer", (uint32(*)(Bot*))&Perl_Bot_GetItemReuseTimer);
|
||||
package.add("GetItemReuseTimer", (uint32(*)(Bot*, uint32))&Perl_Bot_GetItemReuseTimer);
|
||||
package.add("GetSpellRecastTimer", (uint32(*)(Bot*))&Perl_Bot_GetSpellRecastTimer);
|
||||
package.add("GetSpellRecastTimer", (uint32(*)(Bot*, uint16))&Perl_Bot_GetSpellRecastTimer);
|
||||
package.add("IsGrouped", &Perl_Bot_IsGrouped);
|
||||
package.add("IsSitting", &Perl_Bot_IsSitting);
|
||||
package.add("IsStanding", &Perl_Bot_IsStanding);
|
||||
@@ -608,6 +711,10 @@ void perl_register_bot()
|
||||
package.add("SendSpellAnim", &Perl_Bot_SendSpellAnim);
|
||||
package.add("SetExpansionBitmask", (void(*)(Bot*, int))&Perl_Bot_SetExpansionBitmask);
|
||||
package.add("SetExpansionBitmask", (void(*)(Bot*, int, bool))&Perl_Bot_SetExpansionBitmask);
|
||||
package.add("SetDisciplineReuseTimer", (void(*)(Bot*, uint16))&Perl_Bot_SetDisciplineReuseTimer);
|
||||
package.add("SetDisciplineReuseTimer", (void(*)(Bot*, uint16, uint32))&Perl_Bot_SetDisciplineReuseTimer);
|
||||
package.add("SetItemReuseTimer", (void(*)(Bot*, uint32))&Perl_Bot_SetItemReuseTimer);
|
||||
package.add("SetItemReuseTimer", (void(*)(Bot*, uint32, uint32))&Perl_Bot_SetItemReuseTimer);
|
||||
package.add("SetSpellDuration", (void(*)(Bot*, int))&Perl_Bot_SetSpellDuration);
|
||||
package.add("SetSpellDuration", (void(*)(Bot*, int, int))&Perl_Bot_SetSpellDuration);
|
||||
package.add("SetSpellDuration", (void(*)(Bot*, int, int, int))&Perl_Bot_SetSpellDuration);
|
||||
@@ -621,6 +728,8 @@ void perl_register_bot()
|
||||
package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int))&Perl_Bot_SetSpellDurationRaid);
|
||||
package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_SetSpellDurationRaid);
|
||||
package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int, bool, bool))&Perl_Bot_SetSpellDurationRaid);
|
||||
package.add("SetSpellRecastTimer", (void(*)(Bot*, uint16))&Perl_Bot_SetSpellRecastTimer);
|
||||
package.add("SetSpellRecastTimer", (void(*)(Bot*, uint16, uint32))&Perl_Bot_SetSpellRecastTimer);
|
||||
package.add("Signal", &Perl_Bot_Signal);
|
||||
package.add("Sit", &Perl_Bot_Sit);
|
||||
package.add("Stand", &Perl_Bot_Stand);
|
||||
|
||||
Reference in New Issue
Block a user