debuff trigger and action, allow multiple spell

This commit is contained in:
Yunfan Li
2023-06-02 19:57:08 +08:00
parent 25da0af70e
commit a44b310c0a
32 changed files with 113 additions and 85 deletions

View File

@@ -6,11 +6,6 @@
#include "Event.h"
#include "Playerbots.h"
bool CastSerpentStingAction::isUseful()
{
return AI_VALUE2(uint8, "health", "current target") > 50;
}
bool CastViperStingAction::isUseful()
{
return AI_VALUE2(uint8, "mana", "self target") < 50 && AI_VALUE2(uint8, "mana", "current target") >= 30;

View File

@@ -5,6 +5,7 @@
#ifndef _PLAYERBOT_HUNTERACTIONS_H
#define _PLAYERBOT_HUNTERACTIONS_H
#include "AiObject.h"
#include "GenericSpellActions.h"
class PlayerbotAI;
@@ -48,9 +49,7 @@ END_SPELL_ACTION()
BEGIN_RANGED_SPELL_ACTION(CastVolleyAction, "volley")
END_SPELL_ACTION()
BEGIN_RANGED_SPELL_ACTION(CastSerpentStingAction, "serpent sting")
bool isUseful() override;
END_SPELL_ACTION()
DEBUFF_CHECKISOWNER_ACTION(CastSerpentStingAction, "serpent sting");
BEGIN_RANGED_SPELL_ACTION(CastWyvernStingAction, "wyvern sting")
END_SPELL_ACTION()
@@ -156,7 +155,7 @@ class CastReadinessAction : public CastBuffSpellAction
class CastBlackArrow : public CastDebuffSpellAction
{
public:
CastBlackArrow(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "black arrow") { }
CastBlackArrow(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "black arrow", true) { }
};
class CastFreezingTrap : public CastDebuffSpellAction
@@ -187,7 +186,7 @@ class CastRaptorStrikeAction : public CastMeleeSpellAction
class CastSerpentStingOnAttackerAction : public CastDebuffSpellOnAttackerAction
{
public:
CastSerpentStingOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnAttackerAction(botAI, "serpent sting") { }
CastSerpentStingOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnAttackerAction(botAI, "serpent sting", true) { }
};
class FeedPetAction : public Action

View File

@@ -18,8 +18,10 @@ bool HunterAspectOfTheHawkTrigger::IsActive()
bool HunterNoStingsActiveTrigger::IsActive()
{
Unit* target = AI_VALUE(Unit*, "current target");
return target && AI_VALUE2(uint8, "health", "current target") > 40 && !botAI->HasAura("serpent sting", target) &&
!botAI->HasAura("scorpid sting", target) && !botAI->HasAura("viper sting", target);
return target && AI_VALUE2(uint8, "health", "current target") > 15 &&
!botAI->HasAura("serpent sting", target, false, true) &&
!botAI->HasAura("scorpid sting", target, false, true) &&
!botAI->HasAura("viper sting", target, false, true);
}
bool HuntersPetDeadTrigger::IsActive()

View File

@@ -6,11 +6,16 @@
#define _PLAYERBOT_HUNTERTRIGGERS_H
#include "GenericTriggers.h"
#include "Trigger.h"
class PlayerbotAI;
BEGIN_TRIGGER(HunterNoStingsActiveTrigger, Trigger)
END_TRIGGER()
class HunterNoStingsActiveTrigger : public Trigger
{
public:
HunterNoStingsActiveTrigger(PlayerbotAI* botAI): Trigger(botAI, "no stings") {}
bool IsActive() override;
};
class AutoShotTrigger : public Trigger
{
@@ -58,7 +63,7 @@ END_TRIGGER()
class BlackArrowTrigger : public DebuffTrigger
{
public:
BlackArrowTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "black arrow") { }
BlackArrowTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "black arrow", 1, true) { }
};
class HuntersMarkTrigger : public DebuffTrigger
@@ -88,7 +93,7 @@ class TrueshotAuraTrigger : public BuffTrigger
class SerpentStingOnAttackerTrigger : public DebuffOnAttackerTrigger
{
public:
SerpentStingOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "serpent sting") { }
SerpentStingOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "serpent sting", true) { }
};
BEGIN_TRIGGER(HunterPetNotHappy, Trigger)