mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-16 10:20:27 +00:00
Dungeon code cleanup
Consistent code, easier to read logic flow and some missing nullptr checks
This commit is contained in:
@@ -7,10 +7,8 @@
|
||||
float PrinceKelesethMultiplier::GetValue(Action* action)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "prince keleseth");
|
||||
if (!boss)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
if (!boss) { return 1.0f; }
|
||||
|
||||
if (dynamic_cast<DpsAssistAction*>(action))
|
||||
{
|
||||
return 0.0f;
|
||||
@@ -20,13 +18,9 @@ float PrinceKelesethMultiplier::GetValue(Action* action)
|
||||
|
||||
float SkarvaldAndDalronnMultiplier::GetValue(Action* action)
|
||||
{
|
||||
// Unit* skarvald = AI_VALUE2(Unit*, "find target", "skarvald the constructor");
|
||||
Unit* dalronn = AI_VALUE2(Unit*, "find target", "dalronn the controller");
|
||||
|
||||
if (!dalronn)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
// Only need to deal with Dalronn here. If he's dead, just fall back to normal dps strat
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "dalronn the controller");
|
||||
if (!boss) { return 1.0f; }
|
||||
|
||||
if (dynamic_cast<DpsAssistAction*>(action))
|
||||
{
|
||||
@@ -39,10 +33,7 @@ float IngvarThePlundererMultiplier::GetValue(Action* action)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer");
|
||||
bool isTank = botAI->IsTank(bot);
|
||||
if (!boss)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
if (!boss) { return 1.0f; }
|
||||
|
||||
// Prevent movement actions overriding current movement, we're probably dodging a slam
|
||||
if (isTank && bot->isMoving() && dynamic_cast<MovementAction*>(action))
|
||||
@@ -60,10 +51,7 @@ float IngvarThePlundererMultiplier::GetValue(Action* action)
|
||||
{
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", action->getName());
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
if (!spellInfo) { return 1.0f; }
|
||||
|
||||
uint32 castTime = spellInfo->CalcCastTime(bot);
|
||||
if (castTime != 0)
|
||||
@@ -73,10 +61,8 @@ float IngvarThePlundererMultiplier::GetValue(Action* action)
|
||||
}
|
||||
}
|
||||
// Done with non-tank logic
|
||||
if (!isTank)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
if (!isTank) { return 1.0f; }
|
||||
|
||||
// TANK ONLY
|
||||
if (boss->FindCurrentSpellBySpellId(SPELL_SMASH) ||
|
||||
boss->FindCurrentSpellBySpellId(SPELL_DARK_SMASH))
|
||||
|
||||
Reference in New Issue
Block a user