Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/modules/Bots/playerbot/strategy/actions/CcActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,17 @@ bool CastCcOnMyTargetAction::Execute(Event event)
return true;
}

float range = AI_VALUE2(float, "spell range", ccSpell);
if (bot->GetDistance(target) > range || bot->IsNonMeleeSpellCasted(false))
if (bot->IsNonMeleeSpellCasted(false))
{
return true;
}

float range = AI_VALUE2(float, "spell range", ccSpell);
if (bot->GetDistance(target) > range)
{
return MoveTo(target, range);
}

uint32 spellId = AI_VALUE2(uint32, "spell id", ccSpell);
if (!spellId)
{
Expand All @@ -191,6 +196,15 @@ bool CastCcOnMyTargetAction::Execute(Event event)
return true;
}

SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
if (spellInfo && bot->GetShapeshiftForm() != FORM_NONE)
{
if (GetErrorAtShapeshiftedCast(spellInfo, bot->GetShapeshiftForm()) == SPELL_FAILED_NOT_SHAPESHIFT)
{
ai->RemoveShapeshift();
}
}

ai->CastSpell(spellId, target);
m_lastCastAttempt = time(0);

Expand Down
Loading