mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fixes on naxxramas heigan and thaddius (#994)
* Fix naxx thaddius * Fix naxx heigan strats
This commit is contained in:
@@ -28,7 +28,8 @@ public:
|
|||||||
ActionThreatType getThreatType() override { return ActionThreatType::Single; }
|
ActionThreatType getThreatType() override { return ActionThreatType::Single; }
|
||||||
|
|
||||||
NextAction** getPrerequisites() override;
|
NextAction** getPrerequisites() override;
|
||||||
|
std::string const getSpell() { return spell; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string spell;
|
std::string spell;
|
||||||
float range;
|
float range;
|
||||||
|
|||||||
@@ -13,15 +13,13 @@ float CastTimeMultiplier::GetValue(Action* action)
|
|||||||
if (action == nullptr)
|
if (action == nullptr)
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
|
|
||||||
// uint8 targetHealth = AI_VALUE2(uint8, "health", "current target");
|
|
||||||
std::string const name = action->getName();
|
|
||||||
|
|
||||||
if (!action->GetTarget() || action->GetTarget() != AI_VALUE(Unit*, "current target"))
|
if (!action->GetTarget() || action->GetTarget() != AI_VALUE(Unit*, "current target"))
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
|
|
||||||
if (/*targetHealth < sPlayerbotAIConfig->criticalHealth && */ dynamic_cast<CastSpellAction*>(action))
|
if (/*targetHealth < sPlayerbotAIConfig->criticalHealth && */ dynamic_cast<CastSpellAction*>(action))
|
||||||
{
|
{
|
||||||
uint32 spellId = AI_VALUE2(uint32, "spell id", name);
|
CastSpellAction* spellAction = dynamic_cast<CastSpellAction*>(action);
|
||||||
|
uint32 spellId = AI_VALUE2(uint32, "spell id", spellAction->getSpell());
|
||||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
@@ -35,7 +33,7 @@ float CastTimeMultiplier::GetValue(Action* action)
|
|||||||
if (spellInfo->IsChanneled())
|
if (spellInfo->IsChanneled())
|
||||||
{
|
{
|
||||||
int32 duration = spellInfo->GetDuration();
|
int32 duration = spellInfo->GetDuration();
|
||||||
bot->ApplySpellMod(spellInfo->Id, SPELLMOD_DURATION, duration);
|
// bot->ApplySpellMod(spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||||
duration = std::min(duration, 3000);
|
duration = std::min(duration, 3000);
|
||||||
if (duration > 0)
|
if (duration > 0)
|
||||||
castTime += duration;
|
castTime += duration;
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ FrostMageStrategy::FrostMageStrategy(PlayerbotAI* botAI) : GenericMageStrategy(b
|
|||||||
|
|
||||||
NextAction** FrostMageStrategy::getDefaultActions()
|
NextAction** FrostMageStrategy::getDefaultActions()
|
||||||
{
|
{
|
||||||
return NextAction::array(0, new NextAction("frostbolt", ACTION_DEFAULT + 0.2f),
|
return NextAction::array(0, new NextAction("frostbolt", ACTION_DEFAULT + 0.3f),
|
||||||
|
new NextAction("fire blast", ACTION_DEFAULT + 0.2f), // cast during movement
|
||||||
new NextAction("shoot", ACTION_DEFAULT + 0.1f),
|
new NextAction("shoot", ACTION_DEFAULT + 0.1f),
|
||||||
new NextAction("fireball", ACTION_DEFAULT), nullptr);
|
new NextAction("fireball", ACTION_DEFAULT), nullptr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
this->prev_erupt = 0;
|
this->prev_erupt = 0;
|
||||||
this->prev_timer = 0;
|
this->prev_timer = 0;
|
||||||
ResetSafe();
|
ResetSafe();
|
||||||
waypoints.push_back(std::make_pair(2793.58f, -3665.93f));
|
waypoints.push_back(std::make_pair(2794.88f, -3668.12f));
|
||||||
waypoints.push_back(std::make_pair(2775.49f, -3674.43f));
|
waypoints.push_back(std::make_pair(2775.49f, -3674.43f));
|
||||||
waypoints.push_back(std::make_pair(2762.30f, -3684.59f));
|
waypoints.push_back(std::make_pair(2762.30f, -3684.59f));
|
||||||
waypoints.push_back(std::make_pair(2755.99f, -3703.96f));
|
waypoints.push_back(std::make_pair(2755.99f, -3703.96f));
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ float HeiganDanceMultiplier::GetValue(Action* action)
|
|||||||
uint32 curr_dance = eventMap->GetNextEventTime(4);
|
uint32 curr_dance = eventMap->GetNextEventTime(4);
|
||||||
uint32 curr_timer = eventMap->GetTimer();
|
uint32 curr_timer = eventMap->GetTimer();
|
||||||
uint32 curr_erupt = eventMap->GetNextEventTime(3);
|
uint32 curr_erupt = eventMap->GetNextEventTime(3);
|
||||||
if (dynamic_cast<CombatFormationMoveAction*>(action))
|
if (dynamic_cast<CombatFormationMoveAction*>(action) ||
|
||||||
|
dynamic_cast<CastDisengageAction*>(action) ||
|
||||||
|
dynamic_cast<CastBlinkBackAction*>(action) )
|
||||||
{
|
{
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
@@ -62,7 +64,8 @@ float HeiganDanceMultiplier::GetValue(Action* action)
|
|||||||
}
|
}
|
||||||
if (dynamic_cast<CastSpellAction*>(action) && !dynamic_cast<CastMeleeSpellAction*>(action))
|
if (dynamic_cast<CastSpellAction*>(action) && !dynamic_cast<CastMeleeSpellAction*>(action))
|
||||||
{
|
{
|
||||||
uint32 spellId = AI_VALUE2(uint32, "spell id", action->getName());
|
CastSpellAction* spellAction = dynamic_cast<CastSpellAction*>(action);
|
||||||
|
uint32 spellId = AI_VALUE2(uint32, "spell id", spellAction->getSpell());
|
||||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
{
|
{
|
||||||
@@ -110,12 +113,13 @@ float ThaddiusGenericMultiplier::GetValue(Action* action)
|
|||||||
{
|
{
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
if (dynamic_cast<CombatFormationMoveAction*>(action))
|
||||||
|
return 0.0f;
|
||||||
// pet phase
|
// pet phase
|
||||||
if (helper.IsPhasePet() &&
|
if (helper.IsPhasePet() &&
|
||||||
(dynamic_cast<DpsAssistAction*>(action) || dynamic_cast<TankAssistAction*>(action) ||
|
(dynamic_cast<DpsAssistAction*>(action) || dynamic_cast<TankAssistAction*>(action) ||
|
||||||
dynamic_cast<CastDebuffSpellOnAttackerAction*>(action) ||
|
dynamic_cast<CastDebuffSpellOnAttackerAction*>(action) ||
|
||||||
dynamic_cast<ReachPartyMemberToHealAction*>(action) || dynamic_cast<BuffOnMainTankAction*>(action) ||
|
dynamic_cast<ReachPartyMemberToHealAction*>(action) || dynamic_cast<BuffOnMainTankAction*>(action)))
|
||||||
dynamic_cast<CombatFormationMoveAction*>(action)))
|
|
||||||
{
|
{
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user