mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Bard bot song twisting update
This commit is contained in:
+20
-4
@@ -76,7 +76,6 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, glm
|
||||
SetAltOutOfCombatBehavior(GetClass() == BARD); // will need to be updated if more classes make use of this flag
|
||||
SetShowHelm(true);
|
||||
SetPauseAI(false);
|
||||
CalcChanceToCast();
|
||||
rest_timer.Disable();
|
||||
SetFollowDistance(BOT_DEFAULT_FOLLOW_DISTANCE);
|
||||
// Do this once and only in this constructor
|
||||
@@ -151,7 +150,6 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
|
||||
SetTaunting((GetClass() == WARRIOR || GetClass() == PALADIN || GetClass() == SHADOWKNIGHT) && (GetBotStance() == BotStanceAggressive));
|
||||
SetPauseAI(false);
|
||||
|
||||
CalcChanceToCast();
|
||||
rest_timer.Disable();
|
||||
SetFollowDistance(BOT_DEFAULT_FOLLOW_DISTANCE);
|
||||
strcpy(this->name, this->GetCleanName());
|
||||
@@ -7639,6 +7637,24 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (iSpellTypes == SpellType_HateRedux) {
|
||||
if (!caster->IsEngaged())
|
||||
return false;
|
||||
|
||||
if (caster->HasGroup()) {
|
||||
Group *g = caster->GetGroup();
|
||||
if (g) {
|
||||
for (int i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (g->members[i] && caster->GetNeedsHateRedux(g->members[i])) {
|
||||
if (caster->AICastSpell(g->members[i], caster->GetChanceToCastBySpellType(SpellType_HateRedux), SpellType_HateRedux))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8017,7 +8033,7 @@ bool Bot::GetNeedsHateRedux(Mob *tar) {
|
||||
// This really should be a scalar function based in class Mob that returns 'this' state..but, is inline with current Bot coding...
|
||||
// TODO: Good starting point..but, can be refined..
|
||||
// TODO: Still awaiting bot spell rework..
|
||||
if (!tar || !tar->HasTargetReflection())
|
||||
if (!tar || !tar->IsEngaged() || !tar->HasTargetReflection() || !tar->GetTarget()->IsNPC())
|
||||
return false;
|
||||
|
||||
if (tar->IsClient()) {
|
||||
@@ -8031,7 +8047,7 @@ bool Bot::GetNeedsHateRedux(Mob *tar) {
|
||||
else if (tar->IsBot()) {
|
||||
switch (tar->GetClass()) {
|
||||
case ROGUE:
|
||||
if (tar->CastToBot()->evade_timer.Check(false))
|
||||
if (tar->CanFacestab() || tar->CastToBot()->evade_timer.Check(false))
|
||||
return false;
|
||||
case CLERIC:
|
||||
case DRUID:
|
||||
|
||||
+9
-6
@@ -47,8 +47,6 @@ const int MaxSpellTimer = 15;
|
||||
const int MaxDisciplineTimer = 10;
|
||||
const int DisciplineReuseStart = MaxSpellTimer + 1;
|
||||
const int MaxTimer = MaxSpellTimer + MaxDisciplineTimer;
|
||||
const int MaxStances = 7;
|
||||
const int MaxSpellTypes = 16;
|
||||
|
||||
enum BotStanceType {
|
||||
BotStancePassive,
|
||||
@@ -58,7 +56,8 @@ enum BotStanceType {
|
||||
BotStanceAggressive,
|
||||
BotStanceBurn,
|
||||
BotStanceBurnAE,
|
||||
BotStanceUnknown
|
||||
BotStanceUnknown,
|
||||
MaxStances = BotStanceUnknown
|
||||
};
|
||||
|
||||
#define BOT_STANCE_COUNT 8
|
||||
@@ -125,7 +124,12 @@ enum SpellTypeIndex {
|
||||
SpellType_CharmIndex,
|
||||
SpellType_SlowIndex,
|
||||
SpellType_DebuffIndex,
|
||||
SpellType_CureIndex
|
||||
SpellType_CureIndex,
|
||||
SpellType_ResurrectIndex,
|
||||
SpellType_HateReduxIndex,
|
||||
SpellType_InCombatBuffSongIndex,
|
||||
SpellType_OutOfCombatBuffSongIndex,
|
||||
MaxSpellTypes
|
||||
};
|
||||
|
||||
class Bot : public NPC {
|
||||
@@ -296,7 +300,6 @@ public:
|
||||
bool GetNeedsHateRedux(Mob *tar);
|
||||
bool HasOrMayGetAggro();
|
||||
void SetDefaultBotStance();
|
||||
void CalcChanceToCast();
|
||||
|
||||
inline virtual int32 GetMaxStat();
|
||||
inline virtual int32 GetMaxResist();
|
||||
@@ -417,6 +420,7 @@ public:
|
||||
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, uint32 spellType);
|
||||
static std::list<BotSpell_wPriority> GetPrioritizedBotSpellsBySpellType(Bot* botCaster, uint32 spellType);
|
||||
static BotSpell GetFirstBotSpellBySpellType(Bot* botCaster, uint32 spellType);
|
||||
static BotSpell GetBestBotSpellForFastHeal(Bot* botCaster);
|
||||
static BotSpell GetBestBotSpellForHealOverTime(Bot* botCaster);
|
||||
@@ -669,7 +673,6 @@ private:
|
||||
uint32 timers[MaxTimer];
|
||||
bool _hasBeenSummoned;
|
||||
glm::vec3 m_PreSummonLocation;
|
||||
uint8 _spellCastingChances[MaxStances][MaxSpellTypes];
|
||||
|
||||
Timer evade_timer;
|
||||
|
||||
|
||||
@@ -5117,7 +5117,6 @@ void bot_subcommand_bot_stance(Client *c, const Seperator *sep)
|
||||
|
||||
if (!current_flag) {
|
||||
bot_iter->SetBotStance(bst);
|
||||
bot_iter->CalcChanceToCast();
|
||||
bot_iter->Save();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,10 @@ struct BotSpell {
|
||||
int16 ManaCost;
|
||||
};
|
||||
|
||||
struct BotSpell_wPriority : public BotSpell {
|
||||
uint8 Priority;
|
||||
};
|
||||
|
||||
struct BotAA {
|
||||
uint32 aa_id;
|
||||
uint8 req_level;
|
||||
|
||||
+3285
-1173
File diff suppressed because it is too large
Load Diff
+4
-21
@@ -333,13 +333,6 @@ bool Group::AddMember(Mob* newmember, const char *NewMemberName, uint32 Characte
|
||||
database.SetGroupID(NewMemberName, GetID(), owner->CharacterID(), true);
|
||||
}
|
||||
}
|
||||
#ifdef BOTS
|
||||
for (i = 0;i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (members[i] != nullptr && members[i]->IsBot()) {
|
||||
members[i]->CastToBot()->CalcChanceToCast();
|
||||
}
|
||||
}
|
||||
#endif //BOTS
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -496,16 +489,11 @@ void Group::MemberZoned(Mob* removemob) {
|
||||
SetLeader(nullptr);
|
||||
|
||||
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (members[i] == removemob) {
|
||||
members[i] = nullptr;
|
||||
//should NOT clear the name, it is used for world communication.
|
||||
break;
|
||||
}
|
||||
#ifdef BOTS
|
||||
if (members[i] != nullptr && members[i]->IsBot()) {
|
||||
members[i]->CastToBot()->CalcChanceToCast();
|
||||
if (members[i] == removemob) {
|
||||
members[i] = nullptr;
|
||||
//should NOT clear the name, it is used for world communication.
|
||||
break;
|
||||
}
|
||||
#endif //BOTS
|
||||
}
|
||||
|
||||
if(removemob->IsClient() && HasRole(removemob, RoleAssist))
|
||||
@@ -661,11 +649,6 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender)
|
||||
if(members[i]->IsClient())
|
||||
members[i]->CastToClient()->QueuePacket(outapp);
|
||||
}
|
||||
#ifdef BOTS
|
||||
if (members[i] != nullptr && members[i]->IsBot()) {
|
||||
members[i]->CastToBot()->CalcChanceToCast();
|
||||
}
|
||||
#endif //BOTS
|
||||
}
|
||||
|
||||
if (!ignoresender)
|
||||
|
||||
Reference in New Issue
Block a user