mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-16 08:36:10 +00:00
naxx sapphiron strategy
This commit is contained in:
@@ -32,8 +32,8 @@ class RaidNaxxActionContext : public NamedObjectContext<Action>
|
|||||||
// creators["horseman attack in order"] = &RaidNaxxActionContext::horseman_attack_in_order;
|
// creators["horseman attack in order"] = &RaidNaxxActionContext::horseman_attack_in_order;
|
||||||
|
|
||||||
// creators["sapphiron ground main tank position"] = &RaidNaxxActionContext::sapphiron_ground_main_tank_position;
|
// creators["sapphiron ground main tank position"] = &RaidNaxxActionContext::sapphiron_ground_main_tank_position;
|
||||||
// creators["sapphiron ground position"] = &RaidNaxxActionContext::sapphiron_ground_position;
|
creators["sapphiron ground position"] = &RaidNaxxActionContext::sapphiron_ground_position;
|
||||||
// creators["sapphiron flight position"] = &RaidNaxxActionContext::sapphiron_flight_position;
|
creators["sapphiron flight position"] = &RaidNaxxActionContext::sapphiron_flight_position;
|
||||||
// creators["sapphiron avoid chill"] = &RaidNaxxActionContext::sapphiron_avoid_chill;
|
// creators["sapphiron avoid chill"] = &RaidNaxxActionContext::sapphiron_avoid_chill;
|
||||||
|
|
||||||
creators["kel'thuzad choose target"] = &RaidNaxxActionContext::kelthuzad_choose_target;
|
creators["kel'thuzad choose target"] = &RaidNaxxActionContext::kelthuzad_choose_target;
|
||||||
@@ -65,8 +65,8 @@ class RaidNaxxActionContext : public NamedObjectContext<Action>
|
|||||||
// static Action* horseman_attract_alternatively(PlayerbotAI* ai) { return new HorsemanAttractAlternativelyAction(ai); }
|
// static Action* horseman_attract_alternatively(PlayerbotAI* ai) { return new HorsemanAttractAlternativelyAction(ai); }
|
||||||
// static Action* horseman_attack_in_order(PlayerbotAI* ai) { return new HorsemanAttactInOrderAction(ai); }
|
// static Action* horseman_attack_in_order(PlayerbotAI* ai) { return new HorsemanAttactInOrderAction(ai); }
|
||||||
// static Action* sapphiron_ground_main_tank_position(PlayerbotAI* ai) { return new SapphironGroundMainTankPositionAction(ai); }
|
// static Action* sapphiron_ground_main_tank_position(PlayerbotAI* ai) { return new SapphironGroundMainTankPositionAction(ai); }
|
||||||
// static Action* sapphiron_ground_position(PlayerbotAI* ai) { return new SapphironGroundPositionAction(ai); }
|
static Action* sapphiron_ground_position(PlayerbotAI* ai) { return new SapphironGroundPositionAction(ai); }
|
||||||
// static Action* sapphiron_flight_position(PlayerbotAI* ai) { return new SapphironFlightPositionAction(ai); }
|
static Action* sapphiron_flight_position(PlayerbotAI* ai) { return new SapphironFlightPositionAction(ai); }
|
||||||
// static Action* sapphiron_avoid_chill(PlayerbotAI* ai) { return new SapphironAvoidChillAction(ai); }
|
// static Action* sapphiron_avoid_chill(PlayerbotAI* ai) { return new SapphironAvoidChillAction(ai); }
|
||||||
static Action* kelthuzad_choose_target(PlayerbotAI* ai) { return new KelthuzadChooseTargetAction(ai); }
|
static Action* kelthuzad_choose_target(PlayerbotAI* ai) { return new KelthuzadChooseTargetAction(ai); }
|
||||||
static Action* kelthuzad_position(PlayerbotAI* ai) { return new KelthuzadPositionAction(ai); }
|
static Action* kelthuzad_position(PlayerbotAI* ai) { return new KelthuzadPositionAction(ai); }
|
||||||
|
|||||||
@@ -526,120 +526,83 @@ bool RazuviousTargetAction::Execute(Event event)
|
|||||||
// // return MoveTo(533, 3498.58f, -5245.35f, 137.29f);
|
// // return MoveTo(533, 3498.58f, -5245.35f, 137.29f);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// bool SapphironGroundPositionAction::Execute(Event event)
|
bool SapphironGroundPositionAction::Execute(Event event)
|
||||||
// {
|
{
|
||||||
// Unit* boss = AI_VALUE2(Unit*, "find target", "sapphiron");
|
if (!helper.UpdateBossAI()) {
|
||||||
// if (!boss) {
|
return false;
|
||||||
// return false;
|
}
|
||||||
// }
|
if (botAI->IsMainTank(bot)) {
|
||||||
// BossAI* boss_ai = dynamic_cast<BossAI*>(boss->GetAI());
|
if (AI_VALUE2(bool, "has aggro", "current target")) {
|
||||||
// EventMap* eventMap = boss_botAI->GetEvents();
|
return MoveTo(NAXX_MAP_ID, helper.mainTankPos.first, helper.mainTankPos.second, helper.GENERIC_HEIGHT);
|
||||||
// const uint32 flight = eventMap->GetNextEventTime(6);
|
}
|
||||||
// const uint32 timer = eventMap->GetTimer();
|
return false;
|
||||||
// if (timer <= 2000 || (flight && flight != last_flight)) {
|
}
|
||||||
// reset = true;
|
if (helper.JustLanded()) {
|
||||||
// reset_timer = timer;
|
uint32 index = botAI->GetGroupSlotIndex(bot);
|
||||||
// }
|
float start_angle = 0.85 * M_PI;
|
||||||
// last_flight = flight;
|
float offset_angle = M_PI * 0.02 * index;
|
||||||
// if (reset) {
|
float angle = start_angle + offset_angle;
|
||||||
// // bot->Yell("Let\'s go!", LANG_UNIVERSAL);
|
float distance;
|
||||||
// std::pair<float, float> center = {3517.31f, -5253.74f};
|
if (botAI->IsRangedDps(bot)) {
|
||||||
// // std::pair<float, float> center = {3498.58f, -5245.35f};
|
distance = rand_norm() * 5 + 30.0f;
|
||||||
// // std::pair<float, float> center = {boss->GetPositionX(), boss->GetPositionY()};
|
} else if (botAI->IsHeal(bot)) {
|
||||||
// uint32 index = botAI->GetGroupSlotIndex(bot);
|
distance = rand_norm() * 5 + 20.0f;
|
||||||
// // float start_angle = 1.25 * M_PI;
|
} else {
|
||||||
// // float offset_angle = botAI->IsRanged(bot) ? -M_PI * 0.06 * index : -M_PI * 0.3;
|
distance = rand_norm() * 10;
|
||||||
// float start_angle = 0.85 * M_PI;
|
}
|
||||||
// float offset_angle = M_PI * 0.02 * index;
|
if (MoveTo(NAXX_MAP_ID, helper.center.first + cos(angle) * distance, helper.center.second + sin(angle) * distance, helper.GENERIC_HEIGHT)) {
|
||||||
// float angle = start_angle + offset_angle;
|
return true;
|
||||||
// float distance = 30.0f;
|
}
|
||||||
// if (botAI->IsRangedDps(bot)) {
|
} else {
|
||||||
// distance = rand_norm() * 5 + 40.0f;
|
std::vector<float> dest;
|
||||||
// } else if (botAI->IsHeal(bot)) {
|
if (helper.FindPosToAvoidChill(dest)) {
|
||||||
// distance = rand_norm() * 5 + 25.0f;
|
return MoveTo(NAXX_MAP_ID, dest[0], dest[1], dest[2]);
|
||||||
// } else {
|
}
|
||||||
// distance = rand_norm() * 10;
|
}
|
||||||
// }
|
return false;
|
||||||
// if (MoveTo(533, center.first + cos(angle) * distance, center.second + sin(angle) * distance, 137.29f)) {
|
}
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// if (timer - reset_timer >= 2000) {
|
|
||||||
// reset = false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// bool SapphironFlightPositionAction::Execute(Event event)
|
bool SapphironFlightPositionAction::Execute(Event event)
|
||||||
// {
|
{
|
||||||
// Unit* boss = AI_VALUE2(Unit*, "find target", "sapphiron");
|
if (!helper.UpdateBossAI()) {
|
||||||
// if (!boss) {
|
return false;
|
||||||
// return false;
|
}
|
||||||
// }
|
if (helper.WaitForExplosion()) {
|
||||||
// BossAI* boss_ai = dynamic_cast<BossAI*>(boss->GetAI());
|
return MoveToNearestIcebolt();
|
||||||
// EventMap* eventMap = boss_botAI->GetEvents();
|
} else {
|
||||||
// const uint32 explosion = eventMap->GetNextEventTime(10);
|
std::vector<float> dest;
|
||||||
// const uint32 land = eventMap->GetNextEventTime(11);
|
if (helper.FindPosToAvoidChill(dest)) {
|
||||||
// const uint32 timer = eventMap->GetTimer();
|
return MoveTo(NAXX_MAP_ID, dest[0], dest[1], dest[2]);
|
||||||
// if (explosion && explosion != last_explosion) {
|
}
|
||||||
// move_ice_bolt = true;
|
}
|
||||||
// }
|
return false;
|
||||||
// last_explosion = explosion;
|
}
|
||||||
// if (land && land > timer) {
|
|
||||||
// move_ice_bolt = false;
|
|
||||||
// }
|
|
||||||
// // bool newexplosion = explosion && explosion != last_explosion;
|
|
||||||
// if (move_ice_bolt) {
|
|
||||||
// return MoveToNearestIcebolt();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // before explosion
|
bool SapphironFlightPositionAction::MoveToNearestIcebolt()
|
||||||
// std::pair<float, float> center = {boss->GetPositionX(), boss->GetPositionY()};
|
{
|
||||||
// const uint32 icebolt = eventMap->GetNextEventTime(8);
|
Group* group = bot->GetGroup();
|
||||||
|
if (!group) {
|
||||||
// // uint32 runBeforeIcebolt = botAI->IsRanged(bot) ? 1000 : 3000;
|
return false;
|
||||||
// // if ((icebolt <= timer && timer - icebolt <= 7000) || (icebolt >= timer && icebolt - timer <= runBeforeIcebolt)) {
|
}
|
||||||
// // std::pair<float, float> center = {3517.31f, -5253.74f};
|
Group::MemberSlotList const& slots = group->GetMemberSlots();
|
||||||
// // uint32 index = botAI->GetGroupSlotIndex(bot);
|
Player* playerWithIcebolt = nullptr;
|
||||||
// // float start_angle = 0.9 * M_PI;
|
float minDistance;
|
||||||
// // float offset_angle = M_PI * 0.025 * index;
|
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) {
|
||||||
// // float angle = start_angle + offset_angle;
|
Player* member = ref->GetSource();
|
||||||
// // float distance = 45.0f;
|
if (botAI->HasAura("icebolt", member, false, false, -1, true)) {
|
||||||
// // if (MoveTo(533, center.first + cos(angle) * distance, center.second + sin(angle) * distance, 137.29f)) {
|
if (!playerWithIcebolt || minDistance > bot->GetDistance(member)) {
|
||||||
// // return true;
|
playerWithIcebolt = member;
|
||||||
// // }
|
minDistance = bot->GetDistance(member);
|
||||||
// // }
|
}
|
||||||
// return false;
|
}
|
||||||
// }
|
}
|
||||||
|
if (playerWithIcebolt) {
|
||||||
// bool SapphironFlightPositionAction::MoveToNearestIcebolt()
|
Unit* boss = AI_VALUE2(Unit*, "find target", "sapphiron");
|
||||||
// {
|
float angle = boss->GetAngle(playerWithIcebolt);
|
||||||
// Group* group = bot->GetGroup();
|
return MoveTo(NAXX_MAP_ID, playerWithIcebolt->GetPositionX() + cos(angle) * 3.0f, playerWithIcebolt->GetPositionY() + sin(angle) * 3.0f, helper.GENERIC_HEIGHT);
|
||||||
// if (!group) {
|
}
|
||||||
// return 0;
|
return false;
|
||||||
// }
|
}
|
||||||
// Group::MemberSlotList const& slots = group->GetMemberSlots();
|
|
||||||
// int counter = 0;
|
|
||||||
// Player* playerWithIcebolt = nullptr;
|
|
||||||
// float minDistance;
|
|
||||||
// for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) {
|
|
||||||
// Player* member = ref->GetSource();
|
|
||||||
// if (botAI->HasAuraWithDuration("icebolt", member)) {
|
|
||||||
// if (!playerWithIcebolt || minDistance > bot->GetDistance(member)) {
|
|
||||||
// playerWithIcebolt = member;
|
|
||||||
// minDistance = bot->GetDistance(member);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (playerWithIcebolt) {
|
|
||||||
// Unit* boss = AI_VALUE2(Unit*, "find target", "sapphiron");
|
|
||||||
// float angle = boss->GetAngle(playerWithIcebolt);
|
|
||||||
// // bot->Yell("Find icebolt and let\'s move!", LANG_UNIVERSAL);
|
|
||||||
// return MoveTo(533, playerWithIcebolt->GetPositionX() + cos(angle) * 3.0f, playerWithIcebolt->GetPositionY() + sin(angle) * 3.0f, 137.29f);
|
|
||||||
// }
|
|
||||||
// // bot->Yell("No icebolt!", LANG_UNIVERSAL);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// bool SapphironAvoidChillAction::Execute(Event event)
|
// bool SapphironAvoidChillAction::Execute(Event event)
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -171,33 +171,24 @@ class RazuviousTargetAction : public AttackAction
|
|||||||
// virtual bool Execute(Event event);
|
// virtual bool Execute(Event event);
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// class SapphironGroundPositionAction : public MovementAction
|
class SapphironGroundPositionAction : public MovementAction
|
||||||
// {
|
{
|
||||||
// public:
|
public:
|
||||||
// SapphironGroundPositionAction(PlayerbotAI* ai) : MovementAction(ai, "sapphiron ground position") {
|
SapphironGroundPositionAction(PlayerbotAI* ai) : MovementAction(ai, "sapphiron ground position"), helper(ai) {}
|
||||||
// this->reset = 1;
|
bool Execute(Event event) override;
|
||||||
// this->last_flight = 0;
|
protected:
|
||||||
// this->reset_timer = 0;
|
SapphironBossHelper helper;
|
||||||
// }
|
};
|
||||||
// virtual bool Execute(Event event);
|
|
||||||
// protected:
|
|
||||||
// bool reset;
|
|
||||||
// uint32 last_flight, reset_timer;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// class SapphironFlightPositionAction : public MovementAction
|
class SapphironFlightPositionAction : public MovementAction
|
||||||
// {
|
{
|
||||||
// public:
|
public:
|
||||||
// SapphironFlightPositionAction(PlayerbotAI* ai) : MovementAction(ai, "sapphiron flight position") {
|
SapphironFlightPositionAction(PlayerbotAI* ai) : MovementAction(ai, "sapphiron flight position"), helper(ai) {}
|
||||||
// this->last_explosion = 0;
|
bool Execute(Event event) override;
|
||||||
// this->move_ice_bolt = 0;
|
protected:
|
||||||
// }
|
SapphironBossHelper helper;
|
||||||
// virtual bool Execute(Event event);
|
bool MoveToNearestIcebolt();
|
||||||
// protected:
|
};
|
||||||
// uint32 last_explosion;
|
|
||||||
// bool move_ice_bolt;
|
|
||||||
// bool MoveToNearestIcebolt();
|
|
||||||
// };
|
|
||||||
|
|
||||||
// class SapphironAvoidChillAction : public MovementAction
|
// class SapphironAvoidChillAction : public MovementAction
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "AiObject.h"
|
#include "AiObject.h"
|
||||||
#include "AiObjectContext.h"
|
#include "AiObjectContext.h"
|
||||||
#include "EventMap.h"
|
#include "EventMap.h"
|
||||||
|
#include "Log.h"
|
||||||
#include "ObjectGuid.h"
|
#include "ObjectGuid.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "PlayerbotAI.h"
|
#include "PlayerbotAI.h"
|
||||||
@@ -20,12 +21,16 @@ template<class BossAiType>
|
|||||||
class GenericBossHelper : public AiObject {
|
class GenericBossHelper : public AiObject {
|
||||||
public:
|
public:
|
||||||
GenericBossHelper(PlayerbotAI* botAI, std::string name): AiObject(botAI), name_(name) {}
|
GenericBossHelper(PlayerbotAI* botAI, std::string name): AiObject(botAI), name_(name) {}
|
||||||
bool UpdateBossAI() {
|
virtual bool UpdateBossAI() {
|
||||||
Unit* target = AI_VALUE2(Unit*, "find target", name_);
|
Unit* unit = AI_VALUE2(Unit*, "find target", name_);
|
||||||
if (!target) {
|
if (!unit) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ai_ = dynamic_cast<BossAiType *>(target->GetAI());
|
target_ = unit->ToCreature();
|
||||||
|
if (!target_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ai_ = dynamic_cast<BossAiType *>(target_->GetAI());
|
||||||
if (!ai_) {
|
if (!ai_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -33,20 +38,23 @@ class GenericBossHelper : public AiObject {
|
|||||||
if (!event_map_) {
|
if (!event_map_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
timer_ = event_map_->GetTimer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
|
Creature* target_;
|
||||||
std::string name_;
|
std::string name_;
|
||||||
BossAiType *ai_;
|
BossAiType *ai_;
|
||||||
EventMap* event_map_;
|
EventMap* event_map_;
|
||||||
|
uint32 timer_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class KelthuzadBossHelper: public GenericBossHelper<boss_kelthuzad::boss_kelthuzadAI> {
|
class KelthuzadBossHelper: public GenericBossHelper<boss_kelthuzad::boss_kelthuzadAI> {
|
||||||
public:
|
public:
|
||||||
KelthuzadBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "kel'thuzad") {}
|
KelthuzadBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "kel'thuzad") {}
|
||||||
std::pair<float, float> center = {3716.19f, -5106.58f};
|
const std::pair<float, float> center = {3716.19f, -5106.58f};
|
||||||
std::pair<float, float> tank_pos = {3709.19f, -5104.86f};
|
const std::pair<float, float> tank_pos = {3709.19f, -5104.86f};
|
||||||
std::pair<float, float> assist_tank_pos = {3746.05f, -5112.74f};
|
const std::pair<float, float> assist_tank_pos = {3746.05f, -5112.74f};
|
||||||
bool IsPhaseOne() {
|
bool IsPhaseOne() {
|
||||||
return event_map_->GetNextEventTime(KELTHUZAD_EVENT_PHASE_2) != 0;
|
return event_map_->GetNextEventTime(KELTHUZAD_EVENT_PHASE_2) != 0;
|
||||||
}
|
}
|
||||||
@@ -74,4 +82,81 @@ class RazuviousBossHelper: public GenericBossHelper<boss_razuvious::boss_razuvio
|
|||||||
RazuviousBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "instructor razuvious") {}
|
RazuviousBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "instructor razuvious") {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SapphironBossHelper: public GenericBossHelper<boss_sapphiron::boss_sapphironAI> {
|
||||||
|
public:
|
||||||
|
const std::pair<float, float> mainTankPos = {3512.07f, -5274.06f};
|
||||||
|
const std::pair<float, float> center = {3517.31f, -5253.74f};
|
||||||
|
const float GENERIC_HEIGHT = 137.29f;
|
||||||
|
SapphironBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "sapphiron") {}
|
||||||
|
bool UpdateBossAI() override {
|
||||||
|
if (!GenericBossHelper::UpdateBossAI()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
uint32 nextEventGround = event_map_->GetNextEventTime(EVENT_GROUND);
|
||||||
|
if (nextEventGround && nextEventGround != lastEventGround)
|
||||||
|
lastEventGround = nextEventGround;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool IsPhaseGround() {
|
||||||
|
return target_->GetReactState() == REACT_AGGRESSIVE;
|
||||||
|
}
|
||||||
|
bool IsPhaseFlight() {
|
||||||
|
return !IsPhaseGround();
|
||||||
|
}
|
||||||
|
bool JustLanded() {
|
||||||
|
// if (event_map_->GetTimer() <= POSITION_TIME_AFTER_LANDED) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// LOG_DEBUG("playerbots", "JustLanded lastEventGround: {}", lastEventGround);
|
||||||
|
// return timer_ >= lastEventGround && timer_ - lastEventGround <= POSITION_TIME_AFTER_LANDED;
|
||||||
|
return (event_map_->GetNextEventTime(EVENT_FLIGHT_START) - timer_) >= EVENT_FLIGHT_INTERVAL - POSITION_TIME_AFTER_LANDED;
|
||||||
|
}
|
||||||
|
bool WaitForExplosion() {
|
||||||
|
return event_map_->GetNextEventTime(EVENT_FLIGHT_SPELL_EXPLOSION);
|
||||||
|
}
|
||||||
|
bool FindPosToAvoidChill(std::vector<float> &dest) {
|
||||||
|
Aura* aura = botAI->GetAura("chill", bot);
|
||||||
|
if (!aura) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
DynamicObject* dyn_obj = aura->GetDynobjOwner();
|
||||||
|
if (!dyn_obj) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Unit* currentTarget = AI_VALUE(Unit*, "current target");
|
||||||
|
float angle = 0;
|
||||||
|
uint32 index = botAI->GetGroupSlotIndex(bot);
|
||||||
|
if (currentTarget) {
|
||||||
|
if (botAI->IsRanged(bot)) {
|
||||||
|
if (bot->GetExactDist2d(currentTarget) <= 45.0f) {
|
||||||
|
angle = bot->GetAngle(dyn_obj) - M_PI + (rand_norm() - 0.5) * M_PI / 2;
|
||||||
|
} else {
|
||||||
|
if (index % 2 == 0) {
|
||||||
|
angle = bot->GetAngle(currentTarget) + M_PI / 2;
|
||||||
|
} else {
|
||||||
|
angle = bot->GetAngle(currentTarget) - M_PI / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (index % 3 == 0) {
|
||||||
|
angle = bot->GetAngle(currentTarget);
|
||||||
|
} else if (index % 3 == 1) {
|
||||||
|
angle = bot->GetAngle(currentTarget) + M_PI / 2;
|
||||||
|
} else {
|
||||||
|
angle = bot->GetAngle(currentTarget) - M_PI / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
angle = bot->GetAngle(dyn_obj) - M_PI + (rand_norm() - 0.5) * M_PI / 2;
|
||||||
|
}
|
||||||
|
dest = {bot->GetPositionX() + cos(angle) * 5.0f, bot->GetPositionY() + sin(angle) * 5.0f, bot->GetPositionZ()};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
const uint32 POSITION_TIME_AFTER_LANDED = 5000;
|
||||||
|
const uint32 EVENT_FLIGHT_INTERVAL = 45000;
|
||||||
|
uint32 lastEventGround = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -125,29 +125,17 @@ float HeiganDanceMultiplier::GetValue(Action* action)
|
|||||||
// return 1.0f;
|
// return 1.0f;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// float SapphironGenericMultiplier::GetValue(Action* action)
|
float SapphironGenericMultiplier::GetValue(Action* action)
|
||||||
// {
|
{
|
||||||
// Unit* boss = AI_VALUE2(Unit*, "find target", "sapphiron");
|
if (!helper.UpdateBossAI()) {
|
||||||
// if (!boss) {
|
return 1.0f;
|
||||||
// return 1.0f;
|
}
|
||||||
// }
|
if (dynamic_cast<FollowAction*>(action) ||
|
||||||
// if (dynamic_cast<FollowAction*>(action) ||
|
dynamic_cast<CastDeathGripAction*>(action)) {
|
||||||
// dynamic_cast<CastDeathGripAction*>(action)) {
|
return 0.0f;
|
||||||
// return 0.0f;
|
}
|
||||||
// }
|
return 1.0f;
|
||||||
// BossAI* boss_ai = dynamic_cast<BossAI*>(boss->GetAI());
|
}
|
||||||
// EventMap* eventMap = boss_botAI->GetEvents();
|
|
||||||
// uint32 curr_phase = eventMap->GetPhaseMask();
|
|
||||||
// uint32 timer = eventMap->GetTimer();
|
|
||||||
// uint32 explosion = eventMap->GetNextEventTime(10);
|
|
||||||
// if (curr_phase == 4 && explosion > timer &&
|
|
||||||
// (dynamic_cast<MovementAction*>(action) &&
|
|
||||||
// !dynamic_cast<SapphironFlightPositionAction*>(action) &&
|
|
||||||
// !dynamic_cast<SummonAction*>(action))) {
|
|
||||||
// return 0.0f;
|
|
||||||
// }
|
|
||||||
// return 1.0f;
|
|
||||||
// }
|
|
||||||
|
|
||||||
float InstructorRazuviousGenericMultiplier::GetValue(Action* action)
|
float InstructorRazuviousGenericMultiplier::GetValue(Action* action)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,14 +32,15 @@ public:
|
|||||||
// virtual float GetValue(Action* action);
|
// virtual float GetValue(Action* action);
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// class SapphironGenericMultiplier : public Multiplier
|
class SapphironGenericMultiplier : public Multiplier
|
||||||
// {
|
{
|
||||||
// public:
|
public:
|
||||||
// SapphironGenericMultiplier(PlayerbotAI* ai) : Multiplier(ai, "sapphiron generic") {}
|
SapphironGenericMultiplier(PlayerbotAI* ai) : Multiplier(ai, "sapphiron generic"), helper(ai) {}
|
||||||
|
|
||||||
// public:
|
virtual float GetValue(Action* action);
|
||||||
// virtual float GetValue(Action* action);
|
private:
|
||||||
// };
|
SapphironBossHelper helper;
|
||||||
|
};
|
||||||
|
|
||||||
class InstructorRazuviousGenericMultiplier : public Multiplier
|
class InstructorRazuviousGenericMultiplier : public Multiplier
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ void RaidNaxxStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
|||||||
triggers.push_back(new TriggerNode(
|
triggers.push_back(new TriggerNode(
|
||||||
"kel'thuzad",
|
"kel'thuzad",
|
||||||
NextAction::array(0,
|
NextAction::array(0,
|
||||||
|
new NextAction("kel'thuzad position", ACTION_RAID + 2),
|
||||||
new NextAction("kel'thuzad choose target", ACTION_RAID + 1),
|
new NextAction("kel'thuzad choose target", ACTION_RAID + 1),
|
||||||
new NextAction("kel'thuzad position", ACTION_RAID + 1),
|
|
||||||
NULL)));
|
NULL)));
|
||||||
|
|
||||||
// Anub'Rekhan
|
// Anub'Rekhan
|
||||||
@@ -85,18 +85,14 @@ void RaidNaxxStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
|||||||
// "horseman except attractors",
|
// "horseman except attractors",
|
||||||
// NextAction::array(0, new NextAction("horseman attack in order", ACTION_RAID + 1), NULL)));
|
// NextAction::array(0, new NextAction("horseman attack in order", ACTION_RAID + 1), NULL)));
|
||||||
|
|
||||||
// // sapphiron
|
// sapphiron
|
||||||
// triggers.push_back(new TriggerNode(
|
triggers.push_back(new TriggerNode(
|
||||||
// "sapphiron ground main tank",
|
"sapphiron ground",
|
||||||
// NextAction::array(0, new NextAction("sapphiron ground main tank position", ACTION_RAID + 1), NULL)));
|
NextAction::array(0, new NextAction("sapphiron ground position", ACTION_RAID + 1), NULL)));
|
||||||
|
|
||||||
// triggers.push_back(new TriggerNode(
|
triggers.push_back(new TriggerNode(
|
||||||
// "sapphiron ground except main tank",
|
"sapphiron flight",
|
||||||
// NextAction::array(0, new NextAction("sapphiron ground position", ACTION_RAID + 1), NULL)));
|
NextAction::array(0, new NextAction("sapphiron flight position", ACTION_RAID + 1), NULL)));
|
||||||
|
|
||||||
// triggers.push_back(new TriggerNode(
|
|
||||||
// "sapphiron flight",
|
|
||||||
// NextAction::array(0, new NextAction("sapphiron flight position", ACTION_RAID + 1), NULL)));
|
|
||||||
|
|
||||||
// triggers.push_back(new TriggerNode(
|
// triggers.push_back(new TriggerNode(
|
||||||
// "sapphiron chill",
|
// "sapphiron chill",
|
||||||
@@ -132,7 +128,7 @@ void RaidNaxxStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers)
|
|||||||
multipliers.push_back(new HeiganDanceMultiplier(botAI));
|
multipliers.push_back(new HeiganDanceMultiplier(botAI));
|
||||||
// multipliers.push_back(new LoathebGenericMultiplier(ai));
|
// multipliers.push_back(new LoathebGenericMultiplier(ai));
|
||||||
// multipliers.push_back(new ThaddiusGenericMultiplier(ai));
|
// multipliers.push_back(new ThaddiusGenericMultiplier(ai));
|
||||||
// multipliers.push_back(new SapphironGenericMultiplier(ai));
|
multipliers.push_back(new SapphironGenericMultiplier(botAI));
|
||||||
multipliers.push_back(new InstructorRazuviousGenericMultiplier(botAI));
|
multipliers.push_back(new InstructorRazuviousGenericMultiplier(botAI));
|
||||||
multipliers.push_back(new KelthuzadGenericMultiplier(botAI));
|
multipliers.push_back(new KelthuzadGenericMultiplier(botAI));
|
||||||
multipliers.push_back(new AnubrekhanGenericMultiplier(botAI));
|
multipliers.push_back(new AnubrekhanGenericMultiplier(botAI));
|
||||||
|
|||||||
@@ -31,10 +31,8 @@ class RaidNaxxTriggerContext : public NamedObjectContext<Trigger>
|
|||||||
// creators["horseman attractors"] = &RaidNaxxTriggerContext::horseman_attractors;
|
// creators["horseman attractors"] = &RaidNaxxTriggerContext::horseman_attractors;
|
||||||
// creators["horseman except attractors"] = &RaidNaxxTriggerContext::horseman_except_attractors;
|
// creators["horseman except attractors"] = &RaidNaxxTriggerContext::horseman_except_attractors;
|
||||||
|
|
||||||
// creators["sapphiron ground main tank"] = &RaidNaxxTriggerContext::sapphiron_ground_main_tank;
|
creators["sapphiron ground"] = &RaidNaxxTriggerContext::sapphiron_ground;
|
||||||
// creators["sapphiron ground except main tank"] = &RaidNaxxTriggerContext::sapphiron_ground_except_main_tank;
|
creators["sapphiron flight"] = &RaidNaxxTriggerContext::sapphiron_flight;
|
||||||
// creators["sapphiron flight"] = &RaidNaxxTriggerContext::sapphiron_flight;
|
|
||||||
// creators["sapphiron chill"] = &RaidNaxxTriggerContext::sapphiron_ground_chill;
|
|
||||||
|
|
||||||
creators["kel'thuzad"] = &RaidNaxxTriggerContext::kelthuzad;
|
creators["kel'thuzad"] = &RaidNaxxTriggerContext::kelthuzad;
|
||||||
// creators["kel'thuzad phase two"] = &RaidNaxxTriggerContext::kelthuzad_phase_two;
|
// creators["kel'thuzad phase two"] = &RaidNaxxTriggerContext::kelthuzad_phase_two;
|
||||||
@@ -61,9 +59,9 @@ class RaidNaxxTriggerContext : public NamedObjectContext<Trigger>
|
|||||||
|
|
||||||
// static Trigger* horseman_attractors(PlayerbotAI* ai) { return new HorsemanAttractorsTrigger(ai); }
|
// static Trigger* horseman_attractors(PlayerbotAI* ai) { return new HorsemanAttractorsTrigger(ai); }
|
||||||
// static Trigger* horseman_except_attractors(PlayerbotAI* ai) { return new HorsemanExceptAttractorsTrigger(ai); }
|
// static Trigger* horseman_except_attractors(PlayerbotAI* ai) { return new HorsemanExceptAttractorsTrigger(ai); }
|
||||||
// static Trigger* sapphiron_ground_main_tank(PlayerbotAI* ai) { return new SapphironGroundMainTankTrigger(ai); }
|
static Trigger* sapphiron_ground(PlayerbotAI* ai) { return new SapphironGroundTrigger(ai); }
|
||||||
|
static Trigger* sapphiron_flight(PlayerbotAI* ai) { return new SapphironFlightTrigger(ai); }
|
||||||
// static Trigger* sapphiron_ground_except_main_tank(PlayerbotAI* ai) { return new SapphironGroundExceptMainTankTrigger(ai); }
|
// static Trigger* sapphiron_ground_except_main_tank(PlayerbotAI* ai) { return new SapphironGroundExceptMainTankTrigger(ai); }
|
||||||
// static Trigger* sapphiron_flight(PlayerbotAI* ai) { return new SapphironFlightTrigger(ai); }
|
|
||||||
// static Trigger* sapphiron_ground_chill(PlayerbotAI* ai) { return new SapphironGroundChillTrigger(ai); }
|
// static Trigger* sapphiron_ground_chill(PlayerbotAI* ai) { return new SapphironGroundChillTrigger(ai); }
|
||||||
static Trigger* kelthuzad(PlayerbotAI* ai) { return new KelthuzadTrigger(ai); }
|
static Trigger* kelthuzad(PlayerbotAI* ai) { return new KelthuzadTrigger(ai); }
|
||||||
// static Trigger* kelthuzad_phase_two(PlayerbotAI* ai) { return new KelthuzadPhaseTwoTrigger(ai); }
|
// static Trigger* kelthuzad_phase_two(PlayerbotAI* ai) { return new KelthuzadPhaseTwoTrigger(ai); }
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "RaidNaxxTriggers.h"
|
#include "RaidNaxxTriggers.h"
|
||||||
#include "ScriptedCreature.h"
|
#include "ScriptedCreature.h"
|
||||||
|
#include "Trigger.h"
|
||||||
|
|
||||||
bool AuraRemovedTrigger::IsActive() {
|
bool AuraRemovedTrigger::IsActive() {
|
||||||
bool check = botAI->HasAura(name, bot, false, false, -1, true);
|
bool check = botAI->HasAura(name, bot, false, false, -1, true);
|
||||||
@@ -126,10 +127,21 @@ bool RazuviousNontankTrigger::IsActive()
|
|||||||
// botAI->IsHealAssistantOfIndex(bot, 1) || botAI->IsHealAssistantOfIndex(bot, 2));
|
// botAI->IsHealAssistantOfIndex(bot, 1) || botAI->IsHealAssistantOfIndex(bot, 2));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// bool SapphironGroundMainTankTrigger::IsActive()
|
bool SapphironGroundTrigger::IsActive()
|
||||||
// {
|
{
|
||||||
// return BossPhaseTrigger::IsActive() && botAI->IsMainTank(bot) && AI_VALUE2(bool, "has aggro", "boss target");
|
if (!helper.UpdateBossAI()) {
|
||||||
// }
|
return false;
|
||||||
|
}
|
||||||
|
return helper.IsPhaseGround();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SapphironFlightTrigger::IsActive()
|
||||||
|
{
|
||||||
|
if (!helper.UpdateBossAI()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return helper.IsPhaseFlight();
|
||||||
|
}
|
||||||
|
|
||||||
// bool SapphironGroundExceptMainTankTrigger::IsActive()
|
// bool SapphironGroundExceptMainTankTrigger::IsActive()
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -159,12 +159,14 @@ public:
|
|||||||
// virtual bool IsActive();
|
// virtual bool IsActive();
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// class SapphironGroundMainTankTrigger : public BossPhaseTrigger
|
class SapphironGroundTrigger : public Trigger
|
||||||
// {
|
{
|
||||||
// public:
|
public:
|
||||||
// SapphironGroundMainTankTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "sapphiron", (1 << (2 - 1)), "sapphiron ground main tank") {}
|
SapphironGroundTrigger(PlayerbotAI* ai) : Trigger(ai, "sapphiron ground"), helper(ai) {}
|
||||||
// virtual bool IsActive();
|
bool IsActive() override;
|
||||||
// };
|
private:
|
||||||
|
SapphironBossHelper helper;
|
||||||
|
};
|
||||||
|
|
||||||
// class SapphironGroundExceptMainTankTrigger : public BossPhaseTrigger
|
// class SapphironGroundExceptMainTankTrigger : public BossPhaseTrigger
|
||||||
// {
|
// {
|
||||||
@@ -173,12 +175,14 @@ public:
|
|||||||
// virtual bool IsActive();
|
// virtual bool IsActive();
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// class SapphironFlightTrigger : public BossPhaseTrigger
|
class SapphironFlightTrigger : public Trigger
|
||||||
// {
|
{
|
||||||
// public:
|
public:
|
||||||
// SapphironFlightTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "sapphiron", (1 << (3 - 1)), "sapphiron flight") {}
|
SapphironFlightTrigger(PlayerbotAI* ai) : Trigger(ai, "sapphiron flight"), helper(ai) {}
|
||||||
// virtual bool IsActive();
|
bool IsActive() override;
|
||||||
// };
|
private:
|
||||||
|
SapphironBossHelper helper;
|
||||||
|
};
|
||||||
|
|
||||||
// class SapphironGroundChillTrigger : public BossPhaseTrigger
|
// class SapphironGroundChillTrigger : public BossPhaseTrigger
|
||||||
// {
|
// {
|
||||||
|
|||||||
Reference in New Issue
Block a user