Halls of Lightning implementation

Halls of Lightning implementation
This commit is contained in:
Bobblybook
2024-10-18 20:42:36 +11:00
parent 70c9bdbd9d
commit f6987a80a5
16 changed files with 699 additions and 15 deletions

View File

@@ -0,0 +1,88 @@
#include "HallsOfLightningMultipliers.h"
#include "HallsOfLightningActions.h"
#include "GenericSpellActions.h"
#include "ChooseTargetActions.h"
#include "MovementActions.h"
#include "HallsOfLightningTriggers.h"
#include "Action.h"
float BjarngrimMultiplier::GetValue(Action* action)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "general bjarngrim");
if (!boss || botAI->IsHeal(bot)) { return 1.0f; }
if (boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_WHIRLWIND_BJARNGRIM))
{
if (dynamic_cast<MovementAction*>(action) && !dynamic_cast<AvoidWhirlwindAction*>(action))
{
return 0.0f;
}
}
Unit* boss_add = AI_VALUE2(Unit*, "find target", "stormforged lieutenant");
if (!boss_add || botAI->IsTank(bot)) { return 1.0f; }
if (dynamic_cast<DpsAssistAction*>(action))
{
return 0.0f;
}
if (action->getThreatType() == Action::ActionThreatType::Aoe)
{
return 0.0f;
}
return 1.0f;
}
float VolkhanMultiplier::GetValue(Action* action)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "volkhan");
if (!boss || botAI->IsTank(bot) || botAI->IsHeal(bot)) { return 1.0f; }
if (dynamic_cast<DpsAssistAction*>(action))
{
return 0.0f;
}
if (action->getThreatType() == Action::ActionThreatType::Aoe)
{
return 0.0f;
}
return 1.0f;
}
float IonarMultiplier::GetValue(Action* action)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "ionar");
if (!boss) { return 1.0f; }
if(!bot->CanSeeOrDetect(boss))
{
if (dynamic_cast<MovementAction*>(action)
&& !dynamic_cast<DispersePositionAction*>(action)
&& !dynamic_cast<StaticOverloadSpreadAction*>(action))
{
return 0.0f;
}
}
return 1.0f;
}
float LokenMultiplier::GetValue(Action* action)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "loken");
if (!boss) { return 1.0f; }
if (dynamic_cast<FleeAction*>(action)) { return 0.0f; }
if (boss->FindCurrentSpellBySpellId(SPELL_LIGHTNING_NOVA)
&& dynamic_cast<MovementAction*>(action)
&& !dynamic_cast<AvoidLightningNovaAction*>(action))
{
return 0.0f;
}
return 1.0f;
}