Implement AIBot_spells_by_type to reduce looping when searching for spells

This commit is contained in:
nytmyr
2024-12-22 22:38:52 -06:00
parent 998f34842b
commit 83d41f00d2
4 changed files with 103 additions and 37 deletions
+18
View File
@@ -81,6 +81,24 @@ struct BotSpells_Struct {
uint8 bucket_comparison;
};
struct BotSpells_Struct_wIndex {
uint32 index; //index of AIBot_spells
uint32 type; // 0 = never, must be one (and only one) of the defined values
int16 spellid; // <= 0 = no spell
int16 manacost; // -1 = use spdat, -2 = no cast time
uint32 time_cancast; // when we can cast this spell next
int32 recast_delay;
int16 priority;
int16 resist_adjust;
uint8 minlevel;
uint8 maxlevel;
int16 min_hp; // >0 won't cast if HP is below
int16 max_hp; // >0 won't cast if HP is above
std::string bucket_name;
std::string bucket_value;
uint8 bucket_comparison;
};
struct BotTimer_Struct {
uint32 timer_id;
uint32 timer_value;