mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-24 09:28:21 +00:00
Add GetBuffTargets helper
This commit is contained in:
+12
-30
@@ -6216,16 +6216,7 @@ bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spe
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!noGroupSpell) {
|
if (!noGroupSpell) {
|
||||||
std::vector<Mob*> v;
|
for (Mob* m : GetBuffTargets(spellTarget)) {
|
||||||
|
|
||||||
if (RuleB(Bots, RaidBuffing)) {
|
|
||||||
v = GetSpellTargetList();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
v = GatherSpellTargets(false, spellTarget);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Mob* m : v) {
|
|
||||||
if (IsEffectInSpell(thespell, SE_AbsorbMagicAtt) || IsEffectInSpell(thespell, SE_Rune)) {
|
if (IsEffectInSpell(thespell, SE_AbsorbMagicAtt) || IsEffectInSpell(thespell, SE_Rune)) {
|
||||||
for (int i = 0; i < m->GetMaxTotalSlots(); i++) {
|
for (int i = 0; i < m->GetMaxTotalSlots(); i++) {
|
||||||
uint32 buff_count = m->GetMaxTotalSlots();
|
uint32 buff_count = m->GetMaxTotalSlots();
|
||||||
@@ -6252,7 +6243,7 @@ bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spe
|
|||||||
SpellOnTarget(thespell, m->GetPet());
|
SpellOnTarget(thespell, m->GetPet());
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMana(GetMana() - (GetActSpellCost(thespell, spells[thespell].mana) * (v.size() - 1)));
|
SetMana(GetMana() - (GetActSpellCost(thespell, spells[thespell].mana) * (GetBuffTargets(spellTarget).size() - 1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6282,16 +6273,7 @@ bool Bot::DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spel
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (spellTarget->IsOfClientBotMerc()) {
|
if (spellTarget->IsOfClientBotMerc()) {
|
||||||
std::vector<Mob*> v;
|
for (Mob* m : GetBuffTargets(spellTarget)) {
|
||||||
|
|
||||||
if (RuleB(Bots, RaidBuffing)) {
|
|
||||||
v = GetSpellTargetList();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
v = GatherSpellTargets(false, spellTarget);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Mob* m : v) {
|
|
||||||
if (m == this && spellTarget != this) {
|
if (m == this && spellTarget != this) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -10048,17 +10030,9 @@ bool Bot::IsTargetAlreadyReceivingSpell(Mob* tar, uint16 spell_id) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Mob*> v;
|
|
||||||
uint16 target_id = tar->GetID();
|
uint16 target_id = tar->GetID();
|
||||||
|
|
||||||
if (RuleB(Bots, CrossRaidBuffingAndHealing)) {
|
for (Mob* m : GetSpellTargetList()) {
|
||||||
v = GetSpellTargetList();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
v = GetGroupSpellTargetList();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Mob* m : v) {
|
|
||||||
if (
|
if (
|
||||||
m->IsBot() &&
|
m->IsBot() &&
|
||||||
m->IsCasting() &&
|
m->IsCasting() &&
|
||||||
@@ -12381,3 +12355,11 @@ void Bot::AssignBotSpellsToTypes(std::vector<BotSpells_Struct>& AIBot_spells, st
|
|||||||
AIBot_spells_by_type[spell.type].emplace_back(spell_with_index);
|
AIBot_spells_by_type[spell.type].emplace_back(spell_with_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<Mob*> Bot::GetBuffTargets(Mob* spellTarget) {
|
||||||
|
if (RuleB(Bots, RaidBuffing)) {
|
||||||
|
return GetSpellTargetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return GatherSpellTargets(false, spellTarget);
|
||||||
|
}
|
||||||
|
|||||||
@@ -517,6 +517,7 @@ public:
|
|||||||
void SetSpellTargetList(std::vector<Mob*> spell_target_list) { _spellTargetList = spell_target_list; }
|
void SetSpellTargetList(std::vector<Mob*> spell_target_list) { _spellTargetList = spell_target_list; }
|
||||||
std::vector<Mob*> GetGroupSpellTargetList() { return _groupSpellTargetList; }
|
std::vector<Mob*> GetGroupSpellTargetList() { return _groupSpellTargetList; }
|
||||||
void SetGroupSpellTargetList(std::vector<Mob*> spell_target_list) { _groupSpellTargetList = spell_target_list; }
|
void SetGroupSpellTargetList(std::vector<Mob*> spell_target_list) { _groupSpellTargetList = spell_target_list; }
|
||||||
|
std::vector<Mob*> GetBuffTargets(Mob* spellTarget);
|
||||||
Raid* GetStoredRaid() { return _storedRaid; }
|
Raid* GetStoredRaid() { return _storedRaid; }
|
||||||
void SetStoredRaid(Raid* stored_raid) { _storedRaid = stored_raid; }
|
void SetStoredRaid(Raid* stored_raid) { _storedRaid = stored_raid; }
|
||||||
bool GetVerifiedRaid() { return _verifiedRaid; }
|
bool GetVerifiedRaid() { return _verifiedRaid; }
|
||||||
|
|||||||
Reference in New Issue
Block a user