mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-19 11:45:42 +00:00
Improve class spell and use trinket
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "ShamanActions.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "Totem.h"
|
||||
|
||||
bool CastTotemAction::isUseful()
|
||||
{
|
||||
@@ -41,7 +42,24 @@ bool CastSearingTotemAction::isUseful()
|
||||
return CastTotemAction::isUseful() && !AI_VALUE2(bool, "has totem", "flametongue totem");
|
||||
}
|
||||
|
||||
bool CastMagmaTotemAction::isUseful() { return CastTotemAction::isUseful() && !AI_VALUE2(bool, "has totem", name); }
|
||||
bool CastMagmaTotemAction::isUseful() {
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
if (!target || !bot->IsWithinMeleeRange(target))
|
||||
return false;
|
||||
|
||||
return CastTotemAction::isUseful() && !AI_VALUE2(bool, "has totem", name);
|
||||
}
|
||||
|
||||
bool CastFireNovaAction::isUseful() {
|
||||
Creature* fireTotem = bot->GetMap()->GetCreature(bot->m_SummonSlot[1]);
|
||||
if (!fireTotem)
|
||||
return false;
|
||||
|
||||
if (bot->GetDistance(fireTotem) > 8.0f)
|
||||
return false;
|
||||
|
||||
return CastMeleeSpellAction::isUseful();
|
||||
}
|
||||
|
||||
bool CastCleansingTotemAction::isUseful()
|
||||
{
|
||||
|
||||
@@ -231,10 +231,11 @@ public:
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastFireNovaAction : public CastSpellAction
|
||||
class CastFireNovaAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastFireNovaAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "fire nova") {}
|
||||
CastFireNovaAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "fire nova") {}
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastWindShearAction : public CastSpellAction
|
||||
|
||||
Reference in New Issue
Block a user