From 809925dc3e2eab4928e558cd7959a1c288505b4d Mon Sep 17 00:00:00 2001 From: badcaptain Date: Sat, 12 Oct 2013 00:47:15 -0400 Subject: [PATCH] Bots- added out of combat bard songs & #bot bardoutofcombat on|off command to turn them on/off. --- changelog.txt | 1 + .../2013_10_12_Bot_Bard_OOC_Songs.sql | 18 ++++++++++ zone/bot.cpp | 35 +++++++++++++++++++ zone/bot.h | 3 ++ zone/botspellsai.cpp | 2 +- 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 utils/sql/git/optional/2013_10_12_Bot_Bard_OOC_Songs.sql diff --git a/changelog.txt b/changelog.txt index bd650a214..28dc10d68 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 10/11/2013 == Bad_Captain: Fixed merc crash issue by updating special_abilities & vwMercNpcTypes (Sorvani). +Bad_Captain: Bots- added out of combat bard songs & #bot bardoutofcombat on|off command to turn them on/off. JJ: (demonstar55) Allow use of Go Home button when Tutorial still selected in RoF. == 10/10/2013 == diff --git a/utils/sql/git/optional/2013_10_12_Bot_Bard_OOC_Songs.sql b/utils/sql/git/optional/2013_10_12_Bot_Bard_OOC_Songs.sql new file mode 100644 index 000000000..c3d792c7d --- /dev/null +++ b/utils/sql/git/optional/2013_10_12_Bot_Bard_OOC_Songs.sql @@ -0,0 +1,18 @@ +UPDATE `npc_spells_entries` SET `type` = 1024 WHERE `npc_spells_id` = 711 and `type` = 8; + +REPLACE INTO `npc_spells_entries` (`npc_spells_id`, `spellid`, `type`, `minlevel`, `maxlevel`, `priority`) VALUES +(711, 717, 8, 5, 24, 1), +(711, 4395, 8, 25, 255, 2), +(711, 2605, 8, 49, 255, 1), +(711, 735, 8, 24, 64, 3), +(711, 2602, 8, 15, 64, 3), +(711, 1765, 8, 59, 255, 3), +(711, 2603, 8, 30, 64, 3); + +-- 717 - "Selo's Accelerando" +-- 4395 - "Selo's Rhythm of Speed" (indoor usable) +-- 2605 - "Selo's Accelerating Chorus" +-- 735 - "Lyssa's Veracious Concord" +-- 2602 - "Song of Sustenance" +-- 1765 - "Solon's Charismatic Concord" +-- 2603 - "Amplification" \ No newline at end of file diff --git a/zone/bot.cpp b/zone/bot.cpp index 5512903e0..b5596f4ff 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -66,6 +66,7 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, 0, 0, 0, 0, SetHealRotationNextHealTime(0); SetHealRotationTimer(0); SetNumHealRotationMembers(0); + SetBardUseOutOfCombatSongs(GetClass() == BARD); CalcChanceToCast(); rest_timer.Disable(); @@ -11691,6 +11692,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { // c->Message(0, "#bot illusion - Enchanter Bot cast an illusion buff spell on you or your target."); c->Message(0, "#bot pull [] [target] - Bot Pulling Target NPC's"); c->Message(0, "#bot setinspectmessage - Copies your inspect message to a targeted bot that you own"); + c->Message(0, "#bot bardoutofcombat [on|off] - Determines wheter bard bots use out of combat songs."); return; } @@ -15980,6 +15982,39 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } } } + + if(!strcasecmp(sep->arg[1], "bardoutofcombat")) { + bool useOutOfCombatSongs = false; + + if(sep->arg[2] && sep->arg[3]){ + if(!strcasecmp(sep->arg[2], "on")) + useOutOfCombatSongs = true; + else if (!strcasecmp(sep->arg[2], "off")) + useOutOfCombatSongs = false; + else { + c->Message(0, "Usage #bot bardoutofcombat [on|off]"); + return; + } + + Mob *target = c->GetTarget(); + + if(target->IsBot() && (c == target->GetOwner()->CastToClient())) { + Bot* bardBot = target->CastToBot(); + + if(bardBot) { + bardBot->SetBardUseOutOfCombatSongs(useOutOfCombatSongs); + c->Message(0, "Bard use of out of combat songs updated."); + } + } + else { + c->Message(0, "Your target must be a bot that you own."); + } + } + else { + c->Message(0, "Usage #bot bardoutofcombat [on|off]"); + } + return; + } } // franck: EQoffline diff --git a/zone/bot.h b/zone/bot.h index 9134a8695..9d6fc2ae5 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -464,6 +464,7 @@ public: uint8 GetNumHealRotationMembers () { return _numHealRotationMembers; } uint32 GetHealRotationNextHealTime() { return _healRotationNextHeal; } uint32 GetHealRotationTimer () { return _healRotationTimer; } + bool GetBardUseOutOfCombatSongs() { return _bardUseOutOfCombatSongs;} inline virtual int16 GetAC() const { return AC; } inline virtual int16 GetSTR() const { return STR; } inline virtual int16 GetSTA() const { return STA; } @@ -548,6 +549,7 @@ public: void SetHealRotationNextHealTime( uint32 nextHealTime ) { _healRotationNextHeal = nextHealTime; } void SetHealRotationTimer( uint32 timer ) { _healRotationTimer = timer; } void SetNumHealRotationMembers( uint8 numMembers ) { _numHealRotationMembers = numMembers; } + void SetBardUseOutOfCombatSongs(bool useOutOfCombatSongs) { _bardUseOutOfCombatSongs = useOutOfCombatSongs;} // Class Destructors virtual ~Bot(); @@ -621,6 +623,7 @@ private: uint8 _numHealRotationMembers; std::map botAAs; InspectMessage_Struct _botInspectMessage; + bool _bardUseOutOfCombatSongs; // Private "base stats" Members int16 _baseMR; diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 359330262..3f0f25bd8 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -1025,7 +1025,7 @@ bool Bot::AI_IdleCastCheck() { // bard bots if(!AICastSpell(this, 100, SpellType_Cure)) { if(!AICastSpell(this, 100, SpellType_Heal)) { - if(!RuleB(Bots, BotBardUseOutOfCombatSongs) || !AICastSpell(this, 100, SpellType_Buff)) { // skips if rule is false + if((!RuleB(Bots, BotBardUseOutOfCombatSongs) || !GetBardUseOutOfCombatSongs()) || !AICastSpell(this, 100, SpellType_Buff)) { // skips if rule is false if(!AICastSpell(this, 100, SpellType_InCombatBuff)) { // this tries to keep some combat buffs on the group until engaged code can pick up the buffing // }