Updated npc spell types to 32-bit mask

This commit is contained in:
Uleat
2017-02-09 17:57:55 -05:00
parent d3dff3760a
commit 38651258fc
12 changed files with 54 additions and 47 deletions
+1 -1
View File
@@ -7495,7 +7495,7 @@ bool Bot::GroupHasClass(Group* group, uint8 classId) {
return result;
}
bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes) {
bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint32 iSpellTypes) {
if((iSpellTypes&SpellTypes_Detrimental) != 0) {
Log.Out(Logs::General, Logs::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
return false;
+5 -5
View File
@@ -235,7 +235,7 @@ public:
virtual void Depop();
void CalcBotStats(bool showtext = true);
uint16 BotGetSpells(int spellslot) { return AIspells[spellslot].spellid; }
uint16 BotGetSpellType(int spellslot) { return AIspells[spellslot].type; }
uint32 BotGetSpellType(int spellslot) { return AIspells[spellslot].type; }
uint16 BotGetSpellPriority(int spellslot) { return AIspells[spellslot].priority; }
virtual float GetProcChances(float ProcBonus, uint16 hand);
virtual int GetHandToHandDamage(void);
@@ -350,7 +350,7 @@ public:
void DoEnduranceUpkeep(); //does the endurance upkeep
// AI Methods
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes);
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes);
virtual bool AI_EngagedCastCheck();
virtual bool AI_PursueCastCheck();
virtual bool AI_IdleCastCheck();
@@ -416,8 +416,8 @@ public:
static uint32 GetDisciplineRemainingTime(Bot *caster, int timer_index);
static std::list<BotSpell> GetBotSpellsForSpellEffect(Bot* botCaster, int spellEffect);
static std::list<BotSpell> GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, int spellEffect, SpellTargetType targetType);
static std::list<BotSpell> GetBotSpellsBySpellType(Bot* botCaster, uint16 spellType);
static BotSpell GetFirstBotSpellBySpellType(Bot* botCaster, uint16 spellType);
static std::list<BotSpell> GetBotSpellsBySpellType(Bot* botCaster, uint32 spellType);
static BotSpell GetFirstBotSpellBySpellType(Bot* botCaster, uint32 spellType);
static BotSpell GetBestBotSpellForFastHeal(Bot* botCaster);
static BotSpell GetBestBotSpellForHealOverTime(Bot* botCaster);
static BotSpell GetBestBotSpellForPercentageHeal(Bot* botCaster);
@@ -467,7 +467,7 @@ public:
bool GetRangerAutoWeaponSelect() { return _rangerAutoWeaponSelect; }
BotRoleType GetBotRole() { return _botRole; }
BotStanceType GetBotStance() { return _botStance; }
uint8 GetChanceToCastBySpellType(uint16 spellType);
uint8 GetChanceToCastBySpellType(uint32 spellType);
bool IsGroupPrimaryHealer();
bool IsGroupPrimarySlower();
bool IsBotCaster() { return IsCasterClass(GetClass()); }
+4 -4
View File
@@ -29,7 +29,7 @@
#define BotAI_DEBUG_Spells -1
#endif
bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
if (!tar) {
return false;
@@ -1417,7 +1417,7 @@ std::list<BotSpell> Bot::GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster,
return result;
}
std::list<BotSpell> Bot::GetBotSpellsBySpellType(Bot* botCaster, uint16 spellType) {
std::list<BotSpell> Bot::GetBotSpellsBySpellType(Bot* botCaster, uint32 spellType) {
std::list<BotSpell> result;
if(botCaster && botCaster->AI_HasSpells()) {
@@ -1444,7 +1444,7 @@ std::list<BotSpell> Bot::GetBotSpellsBySpellType(Bot* botCaster, uint16 spellTyp
return result;
}
BotSpell Bot::GetFirstBotSpellBySpellType(Bot* botCaster, uint16 spellType) {
BotSpell Bot::GetFirstBotSpellBySpellType(Bot* botCaster, uint32 spellType) {
BotSpell result;
result.SpellId = 0;
@@ -3324,7 +3324,7 @@ void Bot::CalcChanceToCast() {
_spellCastingChances[botStance][SpellType_CureIndex] = castChance;
}
uint8 Bot::GetChanceToCastBySpellType(uint16 spellType) {
uint8 Bot::GetChanceToCastBySpellType(uint32 spellType) {
int index = 0;
int botStance = (int)GetBotStance();
uint8 chance = 0;
+2 -2
View File
@@ -413,7 +413,7 @@ public:
Mob* AICheckCloseAggro(Mob* sender, float iAggroRange, float iAssistRange);
int GetHatedCount(Mob *attacker, Mob *exclude);
void AIYellForHelp(Mob* sender, Mob* attacker);
bool AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint16 iSpellTypes);
bool AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint32 iSpellTypes);
bool Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, float iRange, uint32 iSpellTypes);
Mob* GetTargetForMez(Mob* caster);
uint32 CheckNPCsClose(Mob *center);
@@ -502,7 +502,7 @@ private:
Bot* GetBotByBotName(std::string botName);
std::list<Bot*> GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID);
bool Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes); // TODO: Evaluate this closesly in hopes to eliminate
bool Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint32 iSpellTypes); // TODO: Evaluate this closesly in hopes to eliminate
void ShowSpawnWindow(Client* client, int Distance, bool NamedOnly); // TODO: Implement ShowSpawnWindow in the bot class but it needs entity list stuff
private:
std::list<Bot*> bot_list;
+4 -4
View File
@@ -1985,7 +1985,7 @@ bool Merc::AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDon
return result;
}
bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
if(!AI_HasSpells())
return false;
@@ -2746,7 +2746,7 @@ int32 Merc::GetActSpellCasttime(uint16 spell_id, int32 casttime)
return casttime;
}
int8 Merc::GetChanceToCastBySpellType(int16 spellType) {
int8 Merc::GetChanceToCastBySpellType(uint32 spellType) {
int mercStance = (int)GetStance();
int8 mercClass = GetClass();
int8 chance = 0;
@@ -2888,7 +2888,7 @@ bool Merc::CheckStance(int16 stance) {
return false;
}
std::list<MercSpell> Merc::GetMercSpellsBySpellType(Merc* caster, int spellType) {
std::list<MercSpell> Merc::GetMercSpellsBySpellType(Merc* caster, uint32 spellType) {
std::list<MercSpell> result;
if(caster && caster->AI_HasSpells()) {
@@ -2918,7 +2918,7 @@ std::list<MercSpell> Merc::GetMercSpellsBySpellType(Merc* caster, int spellType)
return result;
}
MercSpell Merc::GetFirstMercSpellBySpellType(Merc* caster, int spellType) {
MercSpell Merc::GetFirstMercSpellBySpellType(Merc* caster, uint32 spellType) {
MercSpell result;
result.spellid = 0;
+5 -5
View File
@@ -78,8 +78,8 @@ public:
virtual void AI_Stop();
virtual void AI_Process();
//virtual bool AICastSpell(Mob* tar, int8 iChance, int16 iSpellTypes);
virtual bool AICastSpell(int8 iChance, int32 iSpellTypes);
//virtual bool AICastSpell(Mob* tar, int8 iChance, uint32 iSpellTypes);
virtual bool AICastSpell(int8 iChance, uint32 iSpellTypes);
virtual bool AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
virtual bool AI_EngagedCastCheck();
//virtual bool AI_PursueCastCheck();
@@ -97,7 +97,7 @@ public:
// Merc Spell Casting Methods
virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime);
virtual int32 GetActSpellCost(uint16 spell_id, int32 cost);
int8 GetChanceToCastBySpellType(int16 spellType);
int8 GetChanceToCastBySpellType(uint32 spellType);
void SetSpellRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay);
void SetDisciplineRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay);
void SetSpellTimeCanCast(uint16 spellid, uint32 recast_delay);
@@ -108,8 +108,8 @@ public:
static int32 GetDisciplineRemainingTime(Merc *caster, uint16 timer_id);
static std::list<MercSpell> GetMercSpellsForSpellEffect(Merc* caster, int spellEffect);
static std::list<MercSpell> GetMercSpellsForSpellEffectAndTargetType(Merc* caster, int spellEffect, SpellTargetType targetType);
static std::list<MercSpell> GetMercSpellsBySpellType(Merc* caster, int spellType);
static MercSpell GetFirstMercSpellBySpellType(Merc* caster, int spellType);
static std::list<MercSpell> GetMercSpellsBySpellType(Merc* caster, uint32 spellType);
static MercSpell GetFirstMercSpellBySpellType(Merc* caster, uint32 spellType);
static MercSpell GetFirstMercSpellForSingleTargetHeal(Merc* caster);
static MercSpell GetMercSpellBySpellID(Merc* caster, uint16 spellid);
static MercSpell GetBestMercSpellForVeryFastHeal(Merc* caster);
+2 -2
View File
@@ -47,7 +47,7 @@ extern Zone *zone;
#endif
//NOTE: do NOT pass in beneficial and detrimental spell types into the same call here!
bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
if (!tar)
return false;
@@ -344,7 +344,7 @@ bool NPC::AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain
return CastSpell(AIspells[i].spellid, tar->GetID(), EQEmu::CastingSlot::Gem2, AIspells[i].manacost == -2 ? 0 : -1, mana_cost, oDontDoAgainBefore, -1, -1, 0, &(AIspells[i].resist_adjust));
}
bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint16 iSpellTypes) {
bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint32 iSpellTypes) {
if((iSpellTypes&SpellTypes_Detrimental) != 0) {
//according to live, you can buff and heal through walls...
//now with PCs, this only applies if you can TARGET the target, but
+2 -2
View File
@@ -54,7 +54,7 @@ typedef struct {
} NPCProximity;
struct AISpells_Struct {
uint16 type; // 0 = never, must be one (and only one) of the defined values
uint32 type; // 0 = never, must be one (and only one) of the defined values
uint16 spellid; // <= 0 = no spell
int16 manacost; // -1 = use spdat, -2 = no cast time
uint32 time_cancast; // when we can cast this spell next
@@ -453,7 +453,7 @@ protected:
uint32* pDontCastBefore_casting_spell;
std::vector<AISpells_Struct> AIspells;
bool HasAISpell;
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes);
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes);
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
AISpellsVar_Struct AISpellVar;
int16 GetFocusEffect(focusType type, uint16 spell_id);