Skip to content

Commit

Permalink
Merge pull request #844 from avirar/paladin_blessings2
Browse files Browse the repository at this point in the history
Paladins use Greater Blessings
  • Loading branch information
liyunfan1223 authored Jan 4, 2025
2 parents 01c2570 + 7392c55 commit a62fa3e
Show file tree
Hide file tree
Showing 18 changed files with 719 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/AiFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const
else
nonCombatEngine->addStrategiesNoInit("dps assist", "bdps", "baoe", nullptr);

nonCombatEngine->addStrategiesNoInit("cure", nullptr);
nonCombatEngine->addStrategiesNoInit("cure", "bgreater", nullptr);
break;
case CLASS_HUNTER:
nonCombatEngine->addStrategiesNoInit("bdps", "dps assist", "pet", nullptr);
Expand Down
23 changes: 22 additions & 1 deletion src/strategy/druid/DruidActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,25 @@ Unit* CastRejuvenationOnNotFullAction::GetTarget()
bool CastRejuvenationOnNotFullAction::isUseful()
{
return GetTarget();
}
}

bool CastMarkOfTheWildOnPartyAction::Execute(Event event)
{
Unit* target = GetTarget();
if (!target)
return false;

// Is the bot in a group?
Group* group = botAI->GetBot()->GetGroup();
if (group)
{
// If the bot can cast "gift of the wild" on this target, do so
if (botAI->CanCastSpell("gift of the wild", target))
{
return botAI->CastSpell("gift of the wild", target);
}
}

// Otherwise, fall back to single-target "mark of the wild"
return botAI->CastSpell("mark of the wild", target);
}
4 changes: 3 additions & 1 deletion src/strategy/druid/DruidActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ class CastMarkOfTheWildAction : public CastBuffSpellAction
class CastMarkOfTheWildOnPartyAction : public BuffOnPartyAction
{
public:
CastMarkOfTheWildOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "mark of the wild") {}
CastMarkOfTheWildOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "gift of the wild") {}

bool Execute(Event event) override;
};

class CastSurvivalInstinctsAction : public CastBuffSpellAction
Expand Down
8 changes: 6 additions & 2 deletions src/strategy/druid/DruidTriggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@

bool MarkOfTheWildOnPartyTrigger::IsActive()
{
return BuffOnPartyTrigger::IsActive() && !botAI->HasAura("gift of the wild", GetTarget());
// Check both Gift & Mark auras
return BuffOnPartyTrigger::IsActive() &&
!botAI->HasAnyAuraOf(GetTarget(), "gift of the wild", "mark of the wild", nullptr);
}

bool MarkOfTheWildTrigger::IsActive()
{
return BuffTrigger::IsActive() && !botAI->HasAura("gift of the wild", GetTarget());
// Same check for single-target scenario
return BuffTrigger::IsActive() &&
!botAI->HasAnyAuraOf(GetTarget(), "gift of the wild", "mark of the wild", nullptr);
}

bool ThornsOnPartyTrigger::IsActive()
Expand Down
21 changes: 21 additions & 0 deletions src/strategy/mage/MageActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,24 @@ bool CastConeOfColdAction::isUseful()
bool targetClose = sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", GetTargetName()), 10.f);
return facingTarget && targetClose;
}

bool CastArcaneIntellectOnPartyAction::Execute(Event event)
{
Unit* target = GetTarget();
if (!target)
return false;

Group* group = botAI->GetBot()->GetGroup();

if (group)
{
if (botAI->CanCastSpell("dalaran brilliance", target))
return botAI->CastSpell("dalaran brilliance", target);

if (botAI->CanCastSpell("arcane brilliance", target))
return botAI->CastSpell("arcane brilliance", target);
}

// If not in a group or we cannot cast brilliance, fall back to arcane intellect
return botAI->CastSpell("arcane intellect", target);
}
1 change: 1 addition & 0 deletions src/strategy/mage/MageActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class CastArcaneIntellectOnPartyAction : public BuffOnPartyAction
{
public:
CastArcaneIntellectOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "arcane intellect") {}
bool Execute(Event event) override;
};

class CastRemoveCurseAction : public CastCureSpellAction
Expand Down
8 changes: 6 additions & 2 deletions src/strategy/mage/MageTriggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@

bool ArcaneIntellectOnPartyTrigger::IsActive()
{
return BuffOnPartyTrigger::IsActive() && !botAI->HasAura("arcane brilliance", GetTarget());
return BuffOnPartyTrigger::IsActive() &&
!botAI->HasAnyAuraOf(GetTarget(), "arcane brilliance", "arcane intellect", "dalaran brilliance",
"dalaran intellect", nullptr);
}

bool ArcaneIntellectTrigger::IsActive()
{
return BuffTrigger::IsActive() && !botAI->HasAura("arcane brilliance", GetTarget());
return BuffTrigger::IsActive() &&
!botAI->HasAnyAuraOf(GetTarget(), "arcane brilliance", "arcane intellect", "dalaran brilliance",
"dalaran intellect", nullptr);
}

bool MageArmorTrigger::IsActive()
Expand Down
Loading

0 comments on commit a62fa3e

Please sign in to comment.