[Bot] Add Buff support for Bards under AI_IdleCastChecks (#2590)

* [Bot] Add Buff support for Bards under AI_IdleCastChecks

* Add InCombatBuffSong to Idle Bard cast Logic

* Fixes a number of Buffs that would fail to land on the Bot, causing casting loops

* Accidently removed If Statement added back.

* Update bot.cpp

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
Aeadoin 2022-11-28 16:35:51 -05:00 committed by GitHub
parent 200c6cccaf
commit e928754df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 94 deletions

View File

@ -7725,94 +7725,31 @@ bool Bot::CastSpell(
}
bool Bot::SpellOnTarget(uint16 spell_id, Mob* spelltar) {
bool Result = false;
if(!IsValidSpell(spell_id))
if (!IsValidSpell(spell_id)) {
return false;
if(spelltar) {
if(spelltar->IsBot() && (spells[spell_id].target_type == ST_GroupTeleport)) {
switch(spell_id) {
// Paladin
case 3577: // Wave of Life
case 4065: // Blessing of Austerity
case 1455: // Wave of Healing
case 2589: // Healing Wave of Prexus
case 3427: // Wave of Marr
case 3683: // Ethereal Cleansing
case 1283: // Celestial Cleansing
case 3485: // Supernal Cleansing
case 5293: // Pious Cleansing
case 4893: // Wave of Trushar
case 5295: // Jeron's Mark
case 5296: // Wave of Piety
// Bard
case 4085: // Forpar's Aria of Affliction
case 4083: // Rizlona's Embers
case 4086: // Forpar's Psalm of Pain
case 4084: // Rizlona's Fire
case 6734: // Song of the Storm
case 3651: // Wind of Marr
case 4087: // Forpar's Verse of Venom
case 3362: // Rizlona's Call of Flame
case 4112: // Call of the Muse
case 4872: // Echo of the Trusik
case 4873: // Dark Echo
case 5377: // Cantata of Life
case 5380: // Yelhun's Mystic Call
case 5382: // Eriki's Psalm of Power
case 6666: // Storm Blade
case 5388: // Ancient Call of Power
// Cleric
case 134: // Word of Health
case 136: // Word of Healing
case 1520: // Word of Vigor
case 1521: // Word of Restoration
case 1523: // Word of Redemption
case 3471: // Word of Replenishment
case 5270: // Word of Vivification
case 2502: // Celestial Remedy
case 2175: // Celestial Health
case 1444: // Celestial Healing
case 1522: // Celestial Elixir
case 2180: // Etherial Elixir
case 3047: // Kazad's Mark
case 3475: // Supernal Elixir
case 4053: // Blessing of Temperance
case 4108: // Aura of Reverence
case 4882: // Holy Elixir
case 5259: // Pious Elixir
case 5272: // Aura of Devotion
case 5277: // Balikor's Mark
// Enchanter
case 5517: // Circle of Alendar
case 6671: // Rune of Rikkukin
case 6739: // Rune of the Scale
// Shaman
case 2521: // Talisman of the Beast
case 4055: // Pack Shrew
case 3842: // Blood of Nadox
case 5417: // Champion
// Druid
case 4058: // Feral Pack
case 2520: // Natures Recovery
break;
default:
return false;
}
}
if(((IsDetrimentalSpell(spell_id) && spelltar->IsBot()) || (IsDetrimentalSpell(spell_id) && spelltar->IsClient())) && !IsResurrectionEffects(spell_id))
return false;
if(spelltar->IsPet()) {
for(int i= 0; i < EFFECT_COUNT; ++i) {
if(spells[spell_id].effect_id[i] == SE_Illusion)
return false;
}
}
Result = Mob::SpellOnTarget(spell_id, spelltar);
}
return Result;
if (spelltar) {
if (
IsDetrimentalSpell(spell_id) &&
(spelltar->IsBot() || spelltar->IsClient()) &&
!IsResurrectionEffects(spell_id)
) {
return false;
}
if (spelltar->IsPet()) {
for (int i = 0; i < EFFECT_COUNT; ++i) {
if (spells[spell_id].effect_id[i] == SE_Illusion) {
return false;
}
}
}
return Mob::SpellOnTarget(spell_id, spelltar);
}
return false;
}
bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) {

View File

@ -1291,7 +1291,6 @@ bool Bot::AI_IdleCastCheck() {
if (!AICastSpell(this, 100, SpellType_Buff)) {
if (!AICastSpell(GetPet(), 100, SpellType_Heal)) {
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Buff)) {
//
}
}
}
@ -1313,7 +1312,6 @@ bool Bot::AI_IdleCastCheck() {
if (!AICastSpell(GetPet(), 100, SpellType_Heal)) {
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_PreCombatBuff)) {
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Buff)) {
//
}
}
}
@ -1331,7 +1329,6 @@ bool Bot::AI_IdleCastCheck() {
if (!AICastSpell(this, 100, SpellType_Buff)) {
if (!AICastSpell(GetPet(), 100, SpellType_Heal)) {
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Buff)) {
//
}
}
}
@ -1347,17 +1344,21 @@ bool Bot::AI_IdleCastCheck() {
case BARD: {
if (pre_combat) {
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) {
if (!AICastSpell(this, 100, SpellType_PreCombatBuffSong)) {
if (!AICastSpell(this, 100, SpellType_InCombatBuffSong)) {
//
if (!AICastSpell(this, 100, SpellType_Buff)) {
if (!AICastSpell(this, 100, SpellType_PreCombatBuffSong)) {
if (!AICastSpell(this, 100, SpellType_InCombatBuffSong)) {
}
}
}
}
}
else {
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) {
if (!AICastSpell(this, 100, SpellType_OutOfCombatBuffSong)) {
//
if (!AICastSpell(this, 100, SpellType_Buff)) {
if (!AICastSpell(this, 100, SpellType_OutOfCombatBuffSong)) {
if (!AICastSpell(this, 100, SpellType_InCombatBuffSong)) {
}
}
}
}
}