Bard bot song twisting update

This commit is contained in:
Uleat 2017-02-20 21:41:15 -05:00
parent 8177f7d9bb
commit d9633dfee4
11 changed files with 3482 additions and 1208 deletions

View File

@ -1,5 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 02/20/2017 ==
Uleat: Reworked bard bot spell twisting and updated their spell (song) list
== 01/31/2017 ==
Uleat: Modifed bot movement behavior in an attempt to 'normalize' it. This is a hack fix and will be revisited at some point. (Probably just need a follow function rather than use movement, when the leader of the follow chain is moving.)

View File

@ -65,8 +65,8 @@ enum SpellTypes : uint32
SpellType_Cure = (1 << 15),
SpellType_Resurrect = (1 << 16),
SpellType_HateRedux = (1 << 17),
SpellType_InCombatBuffSong = (1 << 18),
SpellType_OutOfCombatBuffSong = (1 << 19),
SpellType_InCombatBuffSong = (1 << 18), // bard in-combat group/ae buffs
SpellType_OutOfCombatBuffSong = (1 << 19), // bard out-of-combat group/ae buffs
SpellTypes_Detrimental = (SpellType_Nuke | SpellType_Root | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Charm | SpellType_Debuff | SpellType_Slow),
SpellTypes_Beneficial = (SpellType_Heal | SpellType_Buff | SpellType_Escape | SpellType_Pet | SpellType_InCombatBuff | SpellType_Cure | SpellType_HateRedux | SpellType_InCombatBuffSong | SpellType_OutOfCombatBuffSong),

View File

@ -32,7 +32,7 @@
#define CURRENT_BINARY_DATABASE_VERSION 9105
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9009
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9010
#else
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0
#endif

View File

@ -8,6 +8,7 @@
9007|2016_06_23_bots_camel_case_name_rule.sql|SELECT * FROM `rule_values` WHERE `rule_name` LIKE 'Bots:AllowCamelCaseNames'|empty|
9008|2016_06_28_bots_inventory_charges_update.sql|SELECT * FROM `information_schema`.`COLUMNS` isc WHERE isc.`TABLE_SCHEMA` = DATABASE() AND isc.`TABLE_NAME` = 'bot_inventories' AND isc.`COLUMN_NAME` = 'inst_charges' AND isc.`DATA_TYPE` = 'tinyint'|not_empty|
9009|2017_02_15_bots_bot_spells_entries.sql|SELECT `id` FROM `npc_spells_entries` WHERE `npc_spells_id` >= 701 AND `npc_spells_id` <= 712|not_empty|
9010|2017_02_20_bots_bard_spell_update.sql|SELECT * FROM `bot_spells_entries` WHERE (`type` & 0xFFFF0000) = 0xFFFF0000|empty|
# Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1,153 @@
DELETE FROM `bot_spells_entries` WHERE `npc_spells_id` = '711';
INSERT INTO `bot_spells_entries`(`npc_spells_id`,`spellid`,`type`,`minlevel`,`maxlevel`,`manacost`,`recast_delay`,`priority`,`resist_adjust`) VALUES
-- versioning entry
('711', '0', '4294901760', '0', '0', '-1', '-1', '0', NULL), -- 0xFFFF0000
-- nuke
('711', '704', '1', '12', '54', '-1', '-1', '1', NULL),
('711', '1747', '1', '55', '127', '-1', '-1', '1', NULL),
-- escape
('711', '1749', '16', '60', '127', '-1', '-1', '1', NULL),
-- dot
('711', '743', '256', '38', '64', '-1', '-1', '1', NULL),
('711', '3367', '256', '65', '69', '-1', '-1', '1', NULL),
('711', '5385', '256', '70', '79', '-1', '-1', '1', NULL),
('711', '14074', '256', '80', '84', '-1', '-1', '1', NULL),
('711', '18059', '256', '85', '89', '-1', '-1', '1', NULL),
('711', '26084', '256', '90', '94', '-1', '-1', '1', NULL),
('711', '29182', '256', '95', '127', '-1', '-1', '1', NULL),
('711', '3566', '256', '50', '62', '-1', '-1', '2', NULL),
('711', '3370', '256', '63', '67', '-1', '-1', '2', NULL),
('711', '5378', '256', '68', '77', '-1', '-1', '2', NULL),
('711', '14071', '256', '78', '82', '-1', '-1', '2', NULL),
('711', '18056', '256', '83', '87', '-1', '-1', '2', NULL),
('711', '26033', '256', '88', '92', '-1', '-1', '2', NULL),
('711', '29128', '256', '93', '127', '-1', '-1', '2', NULL),
('711', '744', '256', '46', '62', '-1', '-1', '3', NULL),
('711', '3373', '256', '63', '66', '-1', '-1', '3', NULL),
('711', '5379', '256', '67', '76', '-1', '-1', '3', NULL),
('711', '14068', '256', '77', '81', '-1', '-1', '3', NULL),
('711', '18053', '256', '82', '86', '-1', '-1', '3', NULL),
('711', '26003', '256', '87', '91', '-1', '-1', '3', NULL),
('711', '29101', '256', '92', '127', '-1', '-1', '3', NULL),
('711', '3567', '256', '42', '60', '-1', '-1', '4', NULL),
('711', '3363', '256', '61', '65', '-1', '-1', '4', NULL),
('711', '5371', '256', '66', '75', '-1', '-1', '4', NULL),
('711', '14065', '256', '76', '80', '-1', '-1', '4', NULL),
('711', '18050', '256', '81', '85', '-1', '-1', '4', NULL),
('711', '25976', '256', '86', '90', '-1', '-1', '4', NULL),
('711', '29077', '256', '91', '127', '-1', '-1', '4', NULL),
('711', '707', '256', '30', '59', '-1', '-1', '5', NULL),
('711', '4210', '256', '60', '127', '-1', '-1', '5', NULL),
-- slow
('711', '738', '8192', '23', '50', '-1', '-1', '1', NULL),
('711', '1751', '8192', '51', '59', '-1', '-1', '1', NULL),
('711', '1748', '8192', '60', '63', '-1', '-1', '1', NULL),
('711', '3066', '8192', '64', '127', '-1', '-1', '1', NULL),
('711', '738', '8192', '51', '63', '-1', '-1', '2', NULL),
('711', '1751', '8192', '64', '127', '-1', '-1', '2', NULL),
('711', '738', '8192', '64', '127', '-1', '-1', '3', NULL),
-- cure
('711', '3682', '32768', '45', '85', '-1', '-1', '1', NULL),
('711', '25958', '32768', '86', '90', '-1', '-1', '1', NULL),
('711', '29059', '32768', '91', '127', '-1', '-1', '1', NULL),
('711', '3681', '32768', '52', '127', '-1', '-1', '2', NULL),
('711', '10448', '32768', '74', '78', '-1', '-1', '3', NULL),
('711', '14029', '32768', '79', '83', '-1', '-1', '3', NULL),
('711', '18023', '32768', '84', '127', '-1', '-1', '3', NULL),
-- hate redux
('711', '1754', '131072', '53', '127', '-1', '-1', '1', NULL),
('711', '10436', '131072', '73', '127', '-1', '-1', '2', NULL),
-- in-combat buff songs
('711', '2606', '262144', '52', '59', '-1', '-1', '1', NULL),
('711', '2610', '262144', '60', '127', '-1', '-1', '1', NULL),
('711', '700', '262144', '1', '9', '-1', '-1', '2', NULL),
('711', '701', '262144', '10', '35', '-1', '-1', '2', NULL),
('711', '740', '262144', '36', '41', '-1', '-1', '2', NULL),
('711', '702', '262144', '42', '49', '-1', '-1', '2', NULL),
('711', '747', '262144', '50', '61', '-1', '-1', '2', NULL),
('711', '3374', '262144', '62', '64', '-1', '-1', '2', NULL),
('711', '4871', '262144', '65', '67', '-1', '-1', '2', NULL),
('711', '5376', '262144', '68', '78', '-1', '-1', '2', NULL),
('711', '14080', '262144', '79', '83', '-1', '-1', '2', NULL),
('711', '18065', '262144', '84', '88', '-1', '-1', '2', NULL),
('711', '26042', '262144', '89', '93', '-1', '-1', '2', NULL),
('711', '29143', '262144', '94', '127', '-1', '-1', '2', NULL),
('711', '7', '262144', '6', '19', '-1', '-1', '2', NULL),
('711', '1287', '262144', '20', '31', '-1', '-1', '3', NULL),
('711', '723', '262144', '32', '33', '-1', '-1', '3', NULL),
('711', '1448', '262144', '34', '54', '-1', '-1', '3', NULL),
('711', '1759', '262144', '55', '61', '-1', '-1', '3', NULL),
('711', '3651', '262144', '62', '66', '-1', '-1', '3', NULL),
('711', '5377', '262144', '67', '70', '-1', '-1', '3', NULL),
('711', '10421', '262144', '71', '75', '-1', '-1', '3', NULL),
('711', '14008', '262144', '76', '80', '-1', '-1', '3', NULL),
('711', '18008', '262144', '81', '87', '-1', '-1', '3', NULL),
('711', '26015', '262144', '88', '92', '-1', '-1', '3', NULL),
('711', '29107', '262144', '93', '127', '-1', '-1', '3', NULL),
('711', '734', '262144', '7', '8', '-1', '-1', '4', NULL),
('711', '710', '262144', '9', '12', '-1', '-1', '4', NULL),
('711', '711', '262144', '13', '16', '-1', '-1', '4', NULL),
('711', '709', '262144', '17', '40', '-1', '-1', '4', NULL),
('711', '714', '262144', '41', '46', '-1', '-1', '4', NULL),
('711', '748', '262144', '47', '57', '-1', '-1', '4', NULL),
('711', '1763', '262144', '58', '72', '-1', '-1', '4', NULL),
('711', '11881', '262144', '73', '77', '-1', '-1', '4', NULL),
('711', '14056', '262144', '78', '82', '-1', '-1', '4', NULL),
('711', '18041', '262144', '83', '87', '-1', '-1', '4', NULL),
('711', '26027', '262144', '88', '92', '-1', '-1', '4', NULL),
('711', '29122', '262144', '93', '127', '-1', '-1', '4', NULL),
('711', '734', '262144', '9', '24', '-1', '-1', '5', NULL),
('711', '712', '262144', '25', '28', '-1', '-1', '5', NULL),
('711', '715', '262144', '29', '32', '-1', '-1', '5', NULL),
('711', '713', '262144', '33', '36', '-1', '-1', '5', NULL),
('711', '716', '262144', '37', '44', '-1', '-1', '5', NULL),
('711', '4083', '262144', '45', '52', '-1', '-1', '5', NULL),
('711', '4084', '262144', '53', '63', '-1', '-1', '5', NULL),
('711', '3362', '262144', '64', '64', '-1', '-1', '5', NULL),
('711', '4872', '262144', '65', '68', '-1', '-1', '5', NULL),
('711', '5382', '262144', '69', '75', '-1', '-1', '5', NULL),
('711', '14062', '262144', '76', '80', '-1', '-1', '5', NULL),
('711', '18047', '262144', '81', '85', '-1', '-1', '5', NULL),
('711', '25961', '262144', '86', '90', '-1', '-1', '5', NULL),
('711', '29062', '262144', '91', '127', '-1', '-1', '5', NULL),
('711', '734', '262144', '25', '43', '-1', '-1', '6', NULL),
('711', '4085', '262144', '44', '51', '-1', '-1', '6', NULL),
('711', '4086', '262144', '52', '62', '-1', '-1', '6', NULL),
('711', '4087', '262144', '63', '68', '-1', '-1', '6', NULL),
('711', '5374', '262144', '69', '71', '-1', '-1', '6', NULL),
('711', '10439', '262144', '72', '76', '-1', '-1', '6', NULL),
('711', '14020', '262144', '77', '81', '-1', '-1', '6', NULL),
('711', '18014', '262144', '82', '86', '-1', '-1', '6', NULL),
('711', '25991', '262144', '87', '127', '-1', '-1', '6', NULL),
('711', '734', '262144', '30', '82', '-1', '-1', '7', NULL),
('711', '18020', '262144', '83', '127', '-1', '-1', '7', NULL),
('711', '734', '262144', '83', '127', '-1', '-1', '8', NULL),
('711', '2603', '262144', '30', '127', '-1', '-1', '9', NULL),
-- out-of-combat buff songs
('711', '7', '524288', '6', '19', '-1', '-1', '1', NULL),
('711', '1287', '524288', '20', '31', '-1', '-1', '1', NULL),
('711', '723', '524288', '32', '33', '-1', '-1', '1', NULL),
('711', '1448', '524288', '34', '54', '-1', '-1', '1', NULL),
('711', '1759', '524288', '55', '61', '-1', '-1', '1', NULL),
('711', '3651', '524288', '62', '66', '-1', '-1', '1', NULL),
('711', '5377', '524288', '67', '70', '-1', '-1', '1', NULL),
('711', '10421', '524288', '71', '75', '-1', '-1', '1', NULL),
('711', '14008', '524288', '76', '80', '-1', '-1', '1', NULL),
('711', '18008', '524288', '81', '87', '-1', '-1', '1', NULL),
('711', '26015', '524288', '88', '92', '-1', '-1', '1', NULL),
('711', '29107', '524288', '93', '127', '-1', '-1', '1', NULL),
('711', '717', '524288', '5', '29', '-1', '-1','2', NULL),
('711', '2603', '524288', '30', '127', '-1', '-1','2', NULL),
('711', '717', '524288', '30', '48', '-1', '-1','3', NULL),
('711', '2605', '524288', '49', '127', '-1', '-1','3', NULL),
('711', '2602', '524288', '15', '127', '-1', '-1','4', NULL);

View File

@ -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:

View File

@ -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;

View File

@ -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();
}

View File

@ -56,6 +56,10 @@ struct BotSpell {
int16 ManaCost;
};
struct BotSpell_wPriority : public BotSpell {
uint8 Priority;
};
struct BotAA {
uint32 aa_id;
uint8 req_level;

File diff suppressed because it is too large Load Diff

View File

@ -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)