mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-21 20:46:22 +00:00
Spell casting
This commit is contained in:
@@ -51,7 +51,7 @@ void DpsHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
triggers.push_back(new TriggerNode("hunter's mark", NextAction::array(0, new NextAction("hunter's mark", 31.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("concussive shot on snare target", NextAction::array(0, new NextAction("concussive shot", 20.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("call pet", 21.0f), NULL)));
|
||||
triggers.push_back(new TriggerNode("hunters pet low health", NextAction::array(0, new NextAction("mend pet", 21.0f), NULL)));
|
||||
// triggers.push_back(new TriggerNode("hunters pet low health", NextAction::array(0, new NextAction("mend pet", 21.0f), NULL)));
|
||||
triggers.push_back(new TriggerNode("has aggro", NextAction::array(0, new NextAction("concussive shot", 20.0f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,6 @@ void HunterPetStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("call pet", 60.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("has pet", NextAction::array(0, new NextAction("toggle pet spell", 60.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("pet not happy", NextAction::array(0, new NextAction("feed pet", 60.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunters pet low health", NextAction::array(0, new NextAction("mend pet", 60.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunters pet medium health", NextAction::array(0, new NextAction("mend pet", 60.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunters pet dead", NextAction::array(0, new NextAction("revive pet", 60.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ void GenericHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
new NextAction("mongoose bite", ACTION_HIGH),
|
||||
nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("feign death", 35.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunters pet low health", NextAction::array(0, new NextAction("mend pet", ACTION_HIGH + 2), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunters pet medium health", NextAction::array(0, new NextAction("mend pet", ACTION_HIGH + 2), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("no ammo", NextAction::array(0, new NextAction("switch to melee", ACTION_HIGH + 1), new NextAction("say::no ammo", ACTION_HIGH), nullptr)));
|
||||
triggers.push_back(new TriggerNode("aspect of the viper", NextAction::array(0, new NextAction("aspect of the viper", ACTION_HIGH), NULL)));
|
||||
triggers.push_back(new TriggerNode("enemy too close for shoot", NextAction::array(0, new NextAction("flee", ACTION_MOVE + 9), nullptr)));
|
||||
|
||||
@@ -63,6 +63,7 @@ class HunterTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
creators["no stings"] = &HunterTriggerFactoryInternal::NoStings;
|
||||
creators["hunters pet dead"] = &HunterTriggerFactoryInternal::hunters_pet_dead;
|
||||
creators["hunters pet low health"] = &HunterTriggerFactoryInternal::hunters_pet_low_health;
|
||||
creators["hunters pet medium health"] = &HunterTriggerFactoryInternal::hunters_pet_medium_health;
|
||||
creators["hunter's mark"] = &HunterTriggerFactoryInternal::hunters_mark;
|
||||
creators["freezing trap"] = &HunterTriggerFactoryInternal::freezing_trap;
|
||||
creators["aspect of the pack"] = &HunterTriggerFactoryInternal::aspect_of_the_pack;
|
||||
@@ -97,6 +98,7 @@ class HunterTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
static Trigger* NoStings(PlayerbotAI* botAI) { return new HunterNoStingsActiveTrigger(botAI); }
|
||||
static Trigger* hunters_pet_dead(PlayerbotAI* botAI) { return new HuntersPetDeadTrigger(botAI); }
|
||||
static Trigger* hunters_pet_low_health(PlayerbotAI* botAI) { return new HuntersPetLowHealthTrigger(botAI); }
|
||||
static Trigger* hunters_pet_medium_health(PlayerbotAI* botAI) { return new HuntersPetMediumHealthTrigger(botAI); }
|
||||
static Trigger* hunters_mark(PlayerbotAI* botAI) { return new HuntersMarkTrigger(botAI); }
|
||||
static Trigger* freezing_trap(PlayerbotAI* botAI) { return new FreezingTrapTrigger(botAI); }
|
||||
static Trigger* aspect_of_the_pack(PlayerbotAI* botAI) { return new HunterAspectOfThePackTrigger(botAI); }
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "HunterTriggers.h"
|
||||
#include "GenericTriggers.h"
|
||||
#include "HunterActions.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "SharedDefines.h"
|
||||
@@ -39,6 +40,12 @@ bool HuntersPetLowHealthTrigger::IsActive()
|
||||
return pet && AI_VALUE2(uint8, "health", "pet target") < 40 && !AI_VALUE2(bool, "dead", "pet target") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
}
|
||||
|
||||
bool HuntersPetMediumHealthTrigger::IsActive()
|
||||
{
|
||||
Unit* pet = AI_VALUE(Unit*, "pet target");
|
||||
return pet && AI_VALUE2(uint8, "health", "pet target") < sPlayerbotAIConfig->mediumHealth && !AI_VALUE2(bool, "dead", "pet target") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
}
|
||||
|
||||
bool HunterPetNotHappy::IsActive()
|
||||
{
|
||||
return !AI_VALUE(bool, "pet happy") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
|
||||
@@ -67,6 +67,9 @@ END_TRIGGER()
|
||||
BEGIN_TRIGGER(HuntersPetLowHealthTrigger, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
BEGIN_TRIGGER(HuntersPetMediumHealthTrigger, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
class BlackArrowTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user