Add Support to define a valid HP range for NPC casting

These will allow us to define a valid HP range (HP of the caster) that
an NPC will cast a spell. For example NPC casting a defensive spell at
This commit is contained in:
Michael Cook (mackal)
2018-02-01 18:32:40 -05:00
parent d71dbd1751
commit 3c794cfc07
9 changed files with 37 additions and 12 deletions
+3 -1
View File
@@ -61,6 +61,8 @@ struct AISpells_Struct {
int32 recast_delay;
int16 priority;
int16 resist_adjust;
int8 min_hp; // >0 won't cast if HP is below
int8 max_hp; // >0 won't cast if HP is above
};
struct AISpellsEffects_Struct {
@@ -378,7 +380,7 @@ public:
void NPCSlotTexture(uint8 slot, uint16 texture); // Sets new material values for slots
uint32 GetAdventureTemplate() const { return adventure_template_id; }
void AddSpellToNPCList(int16 iPriority, int16 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust);
void AddSpellToNPCList(int16 iPriority, int16 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp);
void AddSpellEffectToNPCList(uint16 iSpellEffectID, int32 base, int32 limit, int32 max);
void RemoveSpellFromNPCList(int16 spell_id);
Timer *GetRefaceTimer() const { return reface_timer; }