refactor raid naxx related

This commit is contained in:
Yunfan Li
2023-07-14 23:13:46 +08:00
parent 86f7a6e9d1
commit d183d285b6
18 changed files with 389 additions and 298 deletions

View File

@@ -13,6 +13,9 @@
#include "WorldPacketTriggerContext.h"
#include "ValueContext.h"
#include "Playerbots.h"
#include "RaidStrategyContext.h"
#include "RaidNaxxActionContext.h"
#include "RaidNaxxTriggerContext.h"
AiObjectContext::AiObjectContext(PlayerbotAI* botAI) : PlayerbotAIAware(botAI)
{
@@ -25,10 +28,12 @@ AiObjectContext::AiObjectContext(PlayerbotAI* botAI) : PlayerbotAIAware(botAI)
actionContexts.Add(new ActionContext());
actionContexts.Add(new ChatActionContext());
actionContexts.Add(new WorldPacketActionContext());
actionContexts.Add(new RaidNaxxActionContext());
triggerContexts.Add(new TriggerContext());
triggerContexts.Add(new ChatTriggerContext());
triggerContexts.Add(new WorldPacketTriggerContext());
triggerContexts.Add(new RaidNaxxTriggerContext());
valueContexts.Add(new ValueContext());

View File

@@ -47,7 +47,7 @@
#include "UseFoodStrategy.h"
#include "UsePotionsStrategy.h"
#include "WorldPacketHandlerStrategy.h"
#include "RaidStrategy.h"
#include "RaidNaxxStrategy.h"
class StrategyContext : public NamedObjectContext<Strategy>
{
@@ -221,15 +221,6 @@ class QuestStrategyContext : public NamedObjectContext<Strategy>
static Strategy* accept_all_quests(PlayerbotAI* botAI) { return new AcceptAllQuestsStrategy(botAI); }
};
class RaidStrategyContext : public NamedObjectContext<Strategy>
{
public:
RaidStrategyContext() : NamedObjectContext<Strategy>(false, true)
{
creators["naxx"] = &RaidStrategyContext::naxx;
}
private:
static Strategy* naxx(PlayerbotAI* botAI) { return new RaidNaxxGenericStrategy(botAI); }
};
#endif

View File

@@ -57,7 +57,7 @@
#include "XpGainAction.h"
#include "VehicleActions.h"
#include "WorldBuffAction.h"
#include "RaidNaxxAction.h"
#include "RaidNaxxActions.h"
class PlayerbotAI;
@@ -223,42 +223,7 @@ class ActionContext : public NamedObjectContext<Action>
creators["toggle pet spell"] = &ActionContext::toggle_pet_spell;
creators["grobbulus go behind the boss"] = &ActionContext::go_behind_the_boss;
creators["rotate grobbulus"] = &ActionContext::rotate_grobbulus;
creators["grobbulus move center"] = &ActionContext::grobbulus_move_center;
creators["heigan dance melee"] = &ActionContext::heigan_dance_melee;
creators["heigan dance ranged"] = &ActionContext::heigan_dance_ranged;
// creators["thaddius attack nearest pet"] = &ActionContext::thaddius_attack_nearest_pet;
// creators["thaddius melee to place"] = &ActionContext::thaddius_tank_to_place;
// creators["thaddius ranged to place"] = &ActionContext::thaddius_ranged_to_place;
// creators["thaddius move to platform"] = &ActionContext::thaddius_move_to_platform;
// creators["thaddius move polarity"] = &ActionContext::thaddius_move_polarity;
// creators["razuvious use obedience crystal"] = &ActionContext::razuvious_use_obedience_crystal;
// creators["razuvious target"] = &ActionContext::razuvious_target;
// creators["horseman attract alternatively"] = &ActionContext::horseman_attract_alternatively;
// creators["horseman attack in order"] = &ActionContext::horseman_attack_in_order;
// creators["sapphiron ground main tank position"] = &ActionContext::sapphiron_ground_main_tank_position;
// creators["sapphiron ground position"] = &ActionContext::sapphiron_ground_position;
// creators["sapphiron flight position"] = &ActionContext::sapphiron_flight_position;
// creators["sapphiron avoid chill"] = &ActionContext::sapphiron_avoid_chill;
// creators["kel'thuzad choose target"] = &ActionContext::kelthuzad_choose_target;
// creators["kel'thuzad position"] = &ActionContext::kelthuzad_position;
creators["anub'rekhan choose target"] = &ActionContext::anubrekhan_choose_target;
creators["anub'rekhan position"] = &ActionContext::anubrekhan_position;
// creators["gluth choose target"] = &ActionContext::gluth_choose_target;
// creators["gluth position"] = &ActionContext::gluth_position;
// creators["gluth slowdown"] = &ActionContext::gluth_slowdown;
// creators["loatheb position"] = &ActionContext::loatheb_position;
// creators["loatheb choose target"] = &ActionContext::loatheb_choose_target;
}
private:
@@ -421,33 +386,7 @@ class ActionContext : public NamedObjectContext<Action>
static Action* toggle_pet_spell(PlayerbotAI* ai) { return new TogglePetSpellAutoCastAction(ai); }
static Action* go_behind_the_boss(PlayerbotAI* ai) { return new GoBehindTheBossAction(ai); }
static Action* rotate_grobbulus(PlayerbotAI* ai) { return new RotateGrobbulusAction(ai); }
static Action* grobbulus_move_center(PlayerbotAI* ai) { return new GrobblulusMoveCenterAction(ai); }
static Action* heigan_dance_melee(PlayerbotAI* ai) { return new HeiganDanceMeleeAction(ai); }
static Action* heigan_dance_ranged(PlayerbotAI* ai) { return new HeiganDanceRangedAction(ai); }
// static Action* thaddius_attack_nearest_pet(PlayerbotAI* ai) { return new ThaddiusAttackNearestPetAction(ai); }
// static Action* thaddius_tank_to_place(PlayerbotAI* ai) { return new ThaddiusMeleeToPlaceAction(ai); }
// static Action* thaddius_ranged_to_place(PlayerbotAI* ai) { return new ThaddiusRangedToPlaceAction(ai); }
// static Action* thaddius_move_to_platform(PlayerbotAI* ai) { return new ThaddiusMoveToPlatformAction(ai); }
// static Action* thaddius_move_polarity(PlayerbotAI* ai) { return new ThaddiusMovePolarityAction(ai); }
// static Action* razuvious_target(PlayerbotAI* ai) { return new RazuviousTargetAction(ai); }
// static Action* razuvious_use_obedience_crystal(PlayerbotAI* ai) { return new RazuviousUseObedienceCrystalAction(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* 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_flight_position(PlayerbotAI* ai) { return new SapphironFlightPositionAction(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_position(PlayerbotAI* ai) { return new KelthuzadPositionAction(ai); }
static Action* anubrekhan_choose_target(PlayerbotAI* ai) { return new AnubrekhanChooseTargetAction(ai); }
static Action* anubrekhan_position(PlayerbotAI* ai) { return new AnubrekhanPositionAction(ai); }
// static Action* gluth_choose_target(PlayerbotAI* ai) { return new GluthChooseTargetAction(ai); }
// static Action* gluth_position(PlayerbotAI* ai) { return new GluthPositionAction(ai); }
// static Action* gluth_slowdown(PlayerbotAI* ai) { return new GluthSlowdownAction(ai); }
// static Action* loatheb_position(PlayerbotAI* ai) { return new LoathebPositionAction(ai); }
// static Action* loatheb_choose_target(PlayerbotAI* ai) { return new LoathebChooseTargetAction(ai); }
};
#endif

View File

@@ -0,0 +1,21 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_RAIDACTIONCONTEXTACTION_H
#define _PLAYERBOT_RAIDACTIONCONTEXTACTION_H
#include "Action.h"
#include "NamedObjectContext.h"
class RaidActionContext : public NamedObjectContext<Action>
{
public:
RaidActionContext()
{
}
private:
};
#endif

View File

@@ -0,0 +1,18 @@
#ifndef _PLAYERBOT_RAIDSTRATEGYCONTEXT_H_
#define _PLAYERBOT_RAIDSTRATEGYCONTEXT_H_
#include "Strategy.h"
#include "RaidNaxxStrategy.h"
class RaidStrategyContext : public NamedObjectContext<Strategy>
{
public:
RaidStrategyContext() : NamedObjectContext<Strategy>(false, true)
{
creators["naxx"] = &RaidStrategyContext::naxx;
}
private:
static Strategy* naxx(PlayerbotAI* botAI) { return new RaidNaxxStrategy(botAI); }
};
#endif

View File

View File

@@ -0,0 +1,82 @@
// /*
// * Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
// */
#ifndef _PLAYERBOT_RAIDNAXXACTIONCONTEXT_H
#define _PLAYERBOT_RAIDNAXXACTIONCONTEXT_H
#include "Action.h"
#include "NamedObjectContext.h"
#include "RaidNaxxActions.h"
class RaidNaxxActionContext : public NamedObjectContext<Action>
{
public:
RaidNaxxActionContext() {
creators["grobbulus go behind the boss"] = &RaidNaxxActionContext::go_behind_the_boss;
creators["rotate grobbulus"] = &RaidNaxxActionContext::rotate_grobbulus;
creators["grobbulus move center"] = &RaidNaxxActionContext::grobbulus_move_center;
creators["heigan dance melee"] = &RaidNaxxActionContext::heigan_dance_melee;
creators["heigan dance ranged"] = &RaidNaxxActionContext::heigan_dance_ranged;
// creators["thaddius attack nearest pet"] = &RaidNaxxActionContext::thaddius_attack_nearest_pet;
// creators["thaddius melee to place"] = &RaidNaxxActionContext::thaddius_tank_to_place;
// creators["thaddius ranged to place"] = &RaidNaxxActionContext::thaddius_ranged_to_place;
// creators["thaddius move to platform"] = &RaidNaxxActionContext::thaddius_move_to_platform;
// creators["thaddius move polarity"] = &RaidNaxxActionContext::thaddius_move_polarity;
// creators["razuvious use obedience crystal"] = &RaidNaxxActionContext::razuvious_use_obedience_crystal;
// creators["razuvious target"] = &RaidNaxxActionContext::razuvious_target;
// creators["horseman attract alternatively"] = &RaidNaxxActionContext::horseman_attract_alternatively;
// 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 position"] = &RaidNaxxActionContext::sapphiron_ground_position;
// creators["sapphiron flight position"] = &RaidNaxxActionContext::sapphiron_flight_position;
// creators["sapphiron avoid chill"] = &RaidNaxxActionContext::sapphiron_avoid_chill;
// creators["kel'thuzad choose target"] = &RaidNaxxActionContext::kelthuzad_choose_target;
// creators["kel'thuzad position"] = &RaidNaxxActionContext::kelthuzad_position;
creators["anub'rekhan choose target"] = &RaidNaxxActionContext::anubrekhan_choose_target;
creators["anub'rekhan position"] = &RaidNaxxActionContext::anubrekhan_position;
// creators["gluth choose target"] = &RaidNaxxActionContext::gluth_choose_target;
// creators["gluth position"] = &RaidNaxxActionContext::gluth_position;
// creators["gluth slowdown"] = &RaidNaxxActionContext::gluth_slowdown;
// creators["loatheb position"] = &RaidNaxxActionContext::loatheb_position;
// creators["loatheb choose target"] = &RaidNaxxActionContext::loatheb_choose_target;
}
private:
static Action* go_behind_the_boss(PlayerbotAI* ai) { return new GoBehindTheBossAction(ai); }
static Action* rotate_grobbulus(PlayerbotAI* ai) { return new RotateGrobbulusAction(ai); }
static Action* grobbulus_move_center(PlayerbotAI* ai) { return new GrobblulusMoveCenterAction(ai); }
static Action* heigan_dance_melee(PlayerbotAI* ai) { return new HeiganDanceMeleeAction(ai); }
static Action* heigan_dance_ranged(PlayerbotAI* ai) { return new HeiganDanceRangedAction(ai); }
// static Action* thaddius_attack_nearest_pet(PlayerbotAI* ai) { return new ThaddiusAttackNearestPetAction(ai); }
// static Action* thaddius_tank_to_place(PlayerbotAI* ai) { return new ThaddiusMeleeToPlaceAction(ai); }
// static Action* thaddius_ranged_to_place(PlayerbotAI* ai) { return new ThaddiusRangedToPlaceAction(ai); }
// static Action* thaddius_move_to_platform(PlayerbotAI* ai) { return new ThaddiusMoveToPlatformAction(ai); }
// static Action* thaddius_move_polarity(PlayerbotAI* ai) { return new ThaddiusMovePolarityAction(ai); }
// static Action* razuvious_target(PlayerbotAI* ai) { return new RazuviousTargetAction(ai); }
// static Action* razuvious_use_obedience_crystal(PlayerbotAI* ai) { return new RazuviousUseObedienceCrystalAction(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* 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_flight_position(PlayerbotAI* ai) { return new SapphironFlightPositionAction(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_position(PlayerbotAI* ai) { return new KelthuzadPositionAction(ai); }
static Action* anubrekhan_choose_target(PlayerbotAI* ai) { return new AnubrekhanChooseTargetAction(ai); }
static Action* anubrekhan_position(PlayerbotAI* ai) { return new AnubrekhanPositionAction(ai); }
// static Action* gluth_choose_target(PlayerbotAI* ai) { return new GluthChooseTargetAction(ai); }
// static Action* gluth_position(PlayerbotAI* ai) { return new GluthPositionAction(ai); }
// static Action* gluth_slowdown(PlayerbotAI* ai) { return new GluthSlowdownAction(ai); }
// static Action* loatheb_position(PlayerbotAI* ai) { return new LoathebPositionAction(ai); }
// static Action* loatheb_choose_target(PlayerbotAI* ai) { return new LoathebChooseTargetAction(ai); }
};
#endif

View File

@@ -1,11 +1,9 @@
#include "Playerbots.h"
#include "RaidNaxxAction.h"
#include "RaidStrategy.h"
#include "RaidNaxxActions.h"
#include "RaidNaxxStrategy.h"
#include "ScriptedCreature.h"
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_heigan.h"
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_grobbulus.h"
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.h"
using namespace std;

View File

@@ -1,5 +1,5 @@
#ifndef _PLAYERBOT_RAIDNAXXACTION_H
#define _PLAYERBOT_RAIDNAXXACTION_H
#ifndef _PLAYERBOT_RAIDNAXXACTIONS_H
#define _PLAYERBOT_RAIDNAXXACTIONS_H
#include "Action.h"
#include "MovementActions.h"
@@ -7,6 +7,7 @@
#include "GenericActions.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
#include "RaidNaxxScripts.h"
// just for test
// class TryToGetBossAIAction : public Action

View File

@@ -1,7 +1,7 @@
#include "RaidStrategy.h"
#include "RaidNaxxMultipliers.h"
#include "MovementActions.h"
#include "ScriptedCreature.h"
#include "RaidNaxxAction.h"
#include "RaidNaxxActions.h"
#include "GenericSpellActions.h"
#include "ChooseTargetActions.h"
#include "ReachTargetActions.h"
@@ -16,9 +16,6 @@
#include "DruidActions.h"
#include "PaladinActions.h"
#include "WarriorActions.h"
#include <string>
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_heigan.h"
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.h"
float HeiganDanceMultiplier::GetValue(Action* action)
{
@@ -292,139 +289,3 @@ float AnubrekhanGenericMultiplier::GetValue(Action* action)
// }
// return 1.0f;
// }
void RaidNaxxGenericStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
{
// triggers.push_back(new TriggerNode(
// "often",
// NextAction::array(0, new NextAction("try to get boss ai", ACTION_RAID), NULL)));
// Grobbulus
triggers.push_back(new TriggerNode(
"mutating injection",
NextAction::array(0, new NextAction("grobbulus go behind the boss", ACTION_RAID + 2), NULL)));
triggers.push_back(new TriggerNode(
"mutating injection removed",
NextAction::array(0, new NextAction("grobbulus move center", ACTION_RAID + 1), NULL)));
triggers.push_back(new TriggerNode(
"grobbulus cloud",
NextAction::array(0, new NextAction("rotate grobbulus", ACTION_RAID + 1), NULL)));
// Heigan the Unclean
triggers.push_back(new TriggerNode(
"heigan melee",
NextAction::array(0, new NextAction("heigan dance melee", ACTION_RAID + 1), NULL)));
triggers.push_back(new TriggerNode(
"heigan ranged",
NextAction::array(0, new NextAction("heigan dance ranged", ACTION_RAID + 1), NULL)));
// Thaddius
// triggers.push_back(new TriggerNode(
// "thaddius phase pet",
// NextAction::array(0,
// new NextAction("thaddius attack nearest pet", ACTION_RAID + 1),
// new NextAction("thaddius melee to place", ACTION_RAID),
// new NextAction("thaddius ranged to place", ACTION_RAID),
// NULL)));
// triggers.push_back(new TriggerNode(
// "thaddius phase pet lose aggro",
// NextAction::array(0, new NextAction("taunt spell", ACTION_RAID + 2), NULL)));
// triggers.push_back(new TriggerNode(
// "thaddius phase transition",
// NextAction::array(0, new NextAction("thaddius move to platform", ACTION_RAID + 1), NULL)));
// triggers.push_back(new TriggerNode(
// "thaddius phase thaddius",
// NextAction::array(0, new NextAction("thaddius move polarity", ACTION_RAID + 1), NULL)));
// // Instructor Razuvious
// triggers.push_back(new TriggerNode(
// "razuvious tank",
// NextAction::array(0, new NextAction("razuvious use obedience crystal", ACTION_RAID + 1), NULL)));
// triggers.push_back(new TriggerNode(
// "razuvious nontank",
// NextAction::array(0, new NextAction("razuvious target", ACTION_RAID + 1), NULL)));
// // four horseman
// triggers.push_back(new TriggerNode(
// "horseman attractors",
// NextAction::array(0, new NextAction("horseman attract alternatively", ACTION_RAID + 1), NULL)));
// triggers.push_back(new TriggerNode(
// "horseman except attractors",
// NextAction::array(0, new NextAction("horseman attack in order", ACTION_RAID + 1), NULL)));
// // sapphiron
// triggers.push_back(new TriggerNode(
// "sapphiron ground main tank",
// NextAction::array(0, new NextAction("sapphiron ground main tank position", ACTION_RAID + 1), NULL)));
// triggers.push_back(new TriggerNode(
// "sapphiron ground except main tank",
// NextAction::array(0, new NextAction("sapphiron ground 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(
// "sapphiron chill",
// NextAction::array(0, new NextAction("sapphiron avoid chill", ACTION_RAID + 1), NULL)));
// // Kel'Thuzad
// triggers.push_back(new TriggerNode(
// "kel'thuzad",
// NextAction::array(0,
// new NextAction("kel'thuzad choose target", ACTION_RAID + 1),
// new NextAction("kel'thuzad position", ACTION_RAID + 1),
// NULL)));
// Anub'Rekhan
triggers.push_back(new TriggerNode(
"anub'rekhan",
NextAction::array(0,
// new NextAction("anub'rekhan choose target", ACTION_RAID + 1),
new NextAction("anub'rekhan position", ACTION_RAID + 1),
NULL)));
// // Gluth
// triggers.push_back(new TriggerNode(
// "gluth",
// NextAction::array(0,
// new NextAction("gluth choose target", ACTION_RAID + 1),
// new NextAction("gluth position", ACTION_RAID + 1),
// new NextAction("gluth slowdown", ACTION_RAID),
// NULL)));
// triggers.push_back(new TriggerNode(
// "gluth main tank mortal wound",
// NextAction::array(0,
// new NextAction("taunt spell", ACTION_RAID + 1), NULL)));
// // Loatheb
// triggers.push_back(new TriggerNode(
// "loatheb",
// NextAction::array(0,
// new NextAction("loatheb position", ACTION_RAID + 1),
// new NextAction("loatheb choose target", ACTION_RAID + 1),
// NULL)));
}
void RaidNaxxGenericStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers)
{
multipliers.push_back(new HeiganDanceMultiplier(botAI));
// multipliers.push_back(new LoathebGenericMultiplier(ai));
// multipliers.push_back(new ThaddiusGenericMultiplier(ai));
// multipliers.push_back(new SapphironGenericMultiplier(ai));
// multipliers.push_back(new InstructorRazuviousGenericMultiplier(ai));
// multipliers.push_back(new KelthuzadGenericMultiplier(ai));
multipliers.push_back(new AnubrekhanGenericMultiplier(botAI));
// multipliers.push_back(new FourhorsemanGenericMultiplier(ai));
// multipliers.push_back(new GothikGenericMultiplier(ai));
// multipliers.push_back(new GluthGenericMultiplier(ai));
}

View File

@@ -1,9 +1,8 @@
#ifndef _PLAYERBOT_RAIDSTRATEGY_H
#define _PLAYERBOT_RAIDSTRATEGY_H
#ifndef _PLAYERRBOT_RAIDNAXXMULTIPLIERS_H_
#define _PLAYERRBOT_RAIDNAXXMULTIPLIERS_H_
#include "Multiplier.h"
#include "Strategy.h"
class HeiganDanceMultiplier : public Multiplier
{
@@ -95,14 +94,4 @@ public:
// virtual float GetValue(Action* action);
// };
class RaidNaxxGenericStrategy : public Strategy
{
public:
RaidNaxxGenericStrategy(PlayerbotAI* ai) : Strategy(ai) {}
virtual std::string const getName() override { return "naxx"; }
virtual void InitTriggers(std::vector<TriggerNode*> &triggers) override;
virtual void InitMultipliers(std::vector<Multiplier*> &multipliers) override;
};
#endif

View File

@@ -0,0 +1,8 @@
#ifndef _PLAYERBOT_RAIDNAXXSCRIPTS_H
#define _PLAYERBOT_RAIDNAXXSCRIPTS_H
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_heigan.h"
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.h"
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_grobbulus.h"
#endif

View File

@@ -0,0 +1,139 @@
#include "RaidNaxxStrategy.h"
#include "RaidNaxxMultipliers.h"
void RaidNaxxStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
{
// triggers.push_back(new TriggerNode(
// "often",
// NextAction::array(0, new NextAction("try to get boss ai", ACTION_RAID), NULL)));
// Grobbulus
triggers.push_back(new TriggerNode(
"mutating injection",
NextAction::array(0, new NextAction("grobbulus go behind the boss", ACTION_RAID + 2), NULL)));
triggers.push_back(new TriggerNode(
"mutating injection removed",
NextAction::array(0, new NextAction("grobbulus move center", ACTION_RAID + 1), NULL)));
triggers.push_back(new TriggerNode(
"grobbulus cloud",
NextAction::array(0, new NextAction("rotate grobbulus", ACTION_RAID + 1), NULL)));
// Heigan the Unclean
triggers.push_back(new TriggerNode(
"heigan melee",
NextAction::array(0, new NextAction("heigan dance melee", ACTION_RAID + 1), NULL)));
triggers.push_back(new TriggerNode(
"heigan ranged",
NextAction::array(0, new NextAction("heigan dance ranged", ACTION_RAID + 1), NULL)));
// Thaddius
// triggers.push_back(new TriggerNode(
// "thaddius phase pet",
// NextAction::array(0,
// new NextAction("thaddius attack nearest pet", ACTION_RAID + 1),
// new NextAction("thaddius melee to place", ACTION_RAID),
// new NextAction("thaddius ranged to place", ACTION_RAID),
// NULL)));
// triggers.push_back(new TriggerNode(
// "thaddius phase pet lose aggro",
// NextAction::array(0, new NextAction("taunt spell", ACTION_RAID + 2), NULL)));
// triggers.push_back(new TriggerNode(
// "thaddius phase transition",
// NextAction::array(0, new NextAction("thaddius move to platform", ACTION_RAID + 1), NULL)));
// triggers.push_back(new TriggerNode(
// "thaddius phase thaddius",
// NextAction::array(0, new NextAction("thaddius move polarity", ACTION_RAID + 1), NULL)));
// // Instructor Razuvious
// triggers.push_back(new TriggerNode(
// "razuvious tank",
// NextAction::array(0, new NextAction("razuvious use obedience crystal", ACTION_RAID + 1), NULL)));
// triggers.push_back(new TriggerNode(
// "razuvious nontank",
// NextAction::array(0, new NextAction("razuvious target", ACTION_RAID + 1), NULL)));
// // four horseman
// triggers.push_back(new TriggerNode(
// "horseman attractors",
// NextAction::array(0, new NextAction("horseman attract alternatively", ACTION_RAID + 1), NULL)));
// triggers.push_back(new TriggerNode(
// "horseman except attractors",
// NextAction::array(0, new NextAction("horseman attack in order", ACTION_RAID + 1), NULL)));
// // sapphiron
// triggers.push_back(new TriggerNode(
// "sapphiron ground main tank",
// NextAction::array(0, new NextAction("sapphiron ground main tank position", ACTION_RAID + 1), NULL)));
// triggers.push_back(new TriggerNode(
// "sapphiron ground except main tank",
// NextAction::array(0, new NextAction("sapphiron ground 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(
// "sapphiron chill",
// NextAction::array(0, new NextAction("sapphiron avoid chill", ACTION_RAID + 1), NULL)));
// // Kel'Thuzad
// triggers.push_back(new TriggerNode(
// "kel'thuzad",
// NextAction::array(0,
// new NextAction("kel'thuzad choose target", ACTION_RAID + 1),
// new NextAction("kel'thuzad position", ACTION_RAID + 1),
// NULL)));
// Anub'Rekhan
triggers.push_back(new TriggerNode(
"anub'rekhan",
NextAction::array(0,
// new NextAction("anub'rekhan choose target", ACTION_RAID + 1),
new NextAction("anub'rekhan position", ACTION_RAID + 1),
NULL)));
// // Gluth
// triggers.push_back(new TriggerNode(
// "gluth",
// NextAction::array(0,
// new NextAction("gluth choose target", ACTION_RAID + 1),
// new NextAction("gluth position", ACTION_RAID + 1),
// new NextAction("gluth slowdown", ACTION_RAID),
// NULL)));
// triggers.push_back(new TriggerNode(
// "gluth main tank mortal wound",
// NextAction::array(0,
// new NextAction("taunt spell", ACTION_RAID + 1), NULL)));
// // Loatheb
// triggers.push_back(new TriggerNode(
// "loatheb",
// NextAction::array(0,
// new NextAction("loatheb position", ACTION_RAID + 1),
// new NextAction("loatheb choose target", ACTION_RAID + 1),
// NULL)));
}
void RaidNaxxStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers)
{
multipliers.push_back(new HeiganDanceMultiplier(botAI));
// multipliers.push_back(new LoathebGenericMultiplier(ai));
// multipliers.push_back(new ThaddiusGenericMultiplier(ai));
// multipliers.push_back(new SapphironGenericMultiplier(ai));
// multipliers.push_back(new InstructorRazuviousGenericMultiplier(ai));
// multipliers.push_back(new KelthuzadGenericMultiplier(ai));
multipliers.push_back(new AnubrekhanGenericMultiplier(botAI));
// multipliers.push_back(new FourhorsemanGenericMultiplier(ai));
// multipliers.push_back(new GothikGenericMultiplier(ai));
// multipliers.push_back(new GluthGenericMultiplier(ai));
}

View File

@@ -0,0 +1,21 @@
#ifndef _PLAYERBOT_RAIDNAXXSTRATEGY_H
#define _PLAYERBOT_RAIDNAXXSTRATEGY_H
#include "Multiplier.h"
#include "AiObjectContext.h"
#include "Strategy.h"
#include "RaidNaxxScripts.h"
class RaidNaxxStrategy : public Strategy
{
public:
RaidNaxxStrategy(PlayerbotAI* ai) : Strategy(ai) {}
virtual std::string const getName() override { return "naxx"; }
virtual void InitTriggers(std::vector<TriggerNode*> &triggers) override;
virtual void InitMultipliers(std::vector<Multiplier*> &multipliers) override;
};
#endif

View File

@@ -0,0 +1,76 @@
// /*
// * Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
// */
#ifndef _PLAYERBOT_RAIDNAXXTRIGGERCONTEXT_H
#define _PLAYERBOT_RAIDNAXXTRIGGERCONTEXT_H
#include "NamedObjectContext.h"
#include "AiObjectContext.h"
#include "RaidNaxxTriggers.h"
class RaidNaxxTriggerContext : public NamedObjectContext<Trigger>
{
public:
RaidNaxxTriggerContext()
{
creators["mutating injection"] = &RaidNaxxTriggerContext::mutating_injection;
creators["mutating injection removed"] = &RaidNaxxTriggerContext::mutating_injection_removed;
creators["grobbulus cloud"] = &RaidNaxxTriggerContext::grobbulus_cloud;
creators["heigan melee"] = &RaidNaxxTriggerContext::heigan_melee;
creators["heigan ranged"] = &RaidNaxxTriggerContext::heigan_ranged;
// creators["thaddius phase pet"] = &RaidNaxxTriggerContext::thaddius_phase_pet;
// creators["thaddius phase pet lose aggro"] = &RaidNaxxTriggerContext::thaddius_phase_pet_lose_aggro;
// creators["thaddius phase transition"] = &RaidNaxxTriggerContext::thaddius_phase_transition;
// creators["thaddius phase thaddius"] = &RaidNaxxTriggerContext::thaddius_phase_thaddius;
// creators["razuvious tank"] = &RaidNaxxTriggerContext::razuvious_tank;
// creators["razuvious nontank"] = &RaidNaxxTriggerContext::razuvious_nontank;
// creators["horseman attractors"] = &RaidNaxxTriggerContext::horseman_attractors;
// creators["horseman except attractors"] = &RaidNaxxTriggerContext::horseman_except_attractors;
// creators["sapphiron ground main tank"] = &RaidNaxxTriggerContext::sapphiron_ground_main_tank;
// creators["sapphiron ground except main tank"] = &RaidNaxxTriggerContext::sapphiron_ground_except_main_tank;
// creators["sapphiron flight"] = &RaidNaxxTriggerContext::sapphiron_flight;
// creators["sapphiron chill"] = &RaidNaxxTriggerContext::sapphiron_ground_chill;
// creators["kel'thuzad"] = &RaidNaxxTriggerContext::kelthuzad;
// creators["kel'thuzad phase two"] = &RaidNaxxTriggerContext::kelthuzad_phase_two;
creators["anub'rekhan"] = &RaidNaxxTriggerContext::anubrekhan;
// creators["gluth"] = &RaidNaxxTriggerContext::gluth;
// creators["gluth main tank mortal wound"] = &RaidNaxxTriggerContext::gluth_main_tank_mortal_wound;
// creators["loatheb"] = &RaidNaxxTriggerContext::loatheb;
}
private:
static Trigger* mutating_injection(PlayerbotAI* ai) { return new MutatingInjectionTrigger(ai); }
static Trigger* mutating_injection_removed(PlayerbotAI* ai) { return new MutatingInjectionRemovedTrigger(ai); }
static Trigger* grobbulus_cloud(PlayerbotAI* ai) { return new GrobbulusCloudTrigger(ai); }
static Trigger* heigan_melee(PlayerbotAI* ai) { return new HeiganMeleeTrigger(ai); }
static Trigger* heigan_ranged(PlayerbotAI* ai) { return new HeiganRangedTrigger(ai); }
// static Trigger* thaddius_phase_pet(PlayerbotAI* ai) { return new ThaddiusPhasePetTrigger(ai); }
// static Trigger* thaddius_phase_pet_lose_aggro(PlayerbotAI* ai) { return new ThaddiusPhasePetLoseAggroTrigger(ai); }
// static Trigger* thaddius_phase_transition(PlayerbotAI* ai) { return new ThaddiusPhaseTransitionTrigger(ai); }
// static Trigger* thaddius_phase_thaddius(PlayerbotAI* ai) { return new ThaddiusPhaseThaddiusTrigger(ai); }
// static Trigger* razuvious_tank(PlayerbotAI* ai) { return new RazuviousTankTrigger(ai); }
// static Trigger* razuvious_nontank(PlayerbotAI* ai) { return new RazuviousNontankTrigger(ai); }
// static Trigger* horseman_attractors(PlayerbotAI* ai) { return new HorsemanAttractorsTrigger(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_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* kelthuzad(PlayerbotAI* ai) { return new KelthuzadTrigger(ai); }
// static Trigger* kelthuzad_phase_two(PlayerbotAI* ai) { return new KelthuzadPhaseTwoTrigger(ai); }
static Trigger* anubrekhan(PlayerbotAI* ai) { return new AnubrekhanTrigger(ai); }
// static Trigger* gluth(PlayerbotAI* ai) { return new GluthTrigger(ai); }
// static Trigger* gluth_main_tank_mortal_wound(PlayerbotAI* ai) { return new GluthMainTankMortalWoundTrigger(ai); }
// static Trigger* loatheb(PlayerbotAI* ai) { return new LoathebTrigger(ai); }
};
#endif

View File

@@ -1,6 +1,6 @@
#include "EventMap.h"
#include "Playerbots.h"
#include "RaidNaxxTrigger.h"
#include "RaidNaxxTriggers.h"
#include "ScriptedCreature.h"
bool AuraRemovedTrigger::IsActive() {

View File

@@ -1,13 +1,12 @@
#ifndef _PLAYERBOT_RAIDNAXXTRIGGER_H
#define _PLAYERBOT_RAIDNAXXTRIGGER_H
#ifndef _PLAYERBOT_RAIDNAXXTRIGGERS_H
#define _PLAYERBOT_RAIDNAXXTRIGGERS_H
#include "EventMap.h"
#include "Trigger.h"
#include "PlayerbotAIConfig.h"
#include "GenericTriggers.h"
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_grobbulus.h"
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.h"
#include "RaidNaxxScripts.h"
using namespace std;

View File

@@ -16,7 +16,7 @@
#include "StuckTriggers.h"
#include "TravelTriggers.h"
#include "NamedObjectContext.h"
#include "RaidNaxxTrigger.h"
#include "RaidNaxxTriggers.h"
class PlayerbotAI;
@@ -194,38 +194,6 @@ class TriggerContext : public NamedObjectContext<Trigger>
creators["rpg craft"] = &TriggerContext::rpg_craft;
creators["rpg trade useful"] = &TriggerContext::rpg_trade_useful;
creators["rpg duel"] = &TriggerContext::rpg_duel;
creators["mutating injection"] = &TriggerContext::mutating_injection;
creators["mutating injection removed"] = &TriggerContext::mutating_injection_removed;
creators["grobbulus cloud"] = &TriggerContext::grobbulus_cloud;
creators["heigan melee"] = &TriggerContext::heigan_melee;
creators["heigan ranged"] = &TriggerContext::heigan_ranged;
// creators["thaddius phase pet"] = &TriggerContext::thaddius_phase_pet;
// creators["thaddius phase pet lose aggro"] = &TriggerContext::thaddius_phase_pet_lose_aggro;
// creators["thaddius phase transition"] = &TriggerContext::thaddius_phase_transition;
// creators["thaddius phase thaddius"] = &TriggerContext::thaddius_phase_thaddius;
// creators["razuvious tank"] = &TriggerContext::razuvious_tank;
// creators["razuvious nontank"] = &TriggerContext::razuvious_nontank;
// creators["horseman attractors"] = &TriggerContext::horseman_attractors;
// creators["horseman except attractors"] = &TriggerContext::horseman_except_attractors;
// creators["sapphiron ground main tank"] = &TriggerContext::sapphiron_ground_main_tank;
// creators["sapphiron ground except main tank"] = &TriggerContext::sapphiron_ground_except_main_tank;
// creators["sapphiron flight"] = &TriggerContext::sapphiron_flight;
// creators["sapphiron chill"] = &TriggerContext::sapphiron_ground_chill;
// creators["kel'thuzad"] = &TriggerContext::kelthuzad;
// creators["kel'thuzad phase two"] = &TriggerContext::kelthuzad_phase_two;
creators["anub'rekhan"] = &TriggerContext::anubrekhan;
// creators["gluth"] = &TriggerContext::gluth;
// creators["gluth main tank mortal wound"] = &TriggerContext::gluth_main_tank_mortal_wound;
// creators["loatheb"] = &TriggerContext::loatheb;
}
private:
@@ -367,31 +335,6 @@ class TriggerContext : public NamedObjectContext<Trigger>
static Trigger* rpg_craft(PlayerbotAI* botAI) { return new RpgCraftTrigger(botAI); }
static Trigger* rpg_trade_useful(PlayerbotAI* botAI) { return new RpgTradeUsefulTrigger(botAI); }
static Trigger* rpg_duel(PlayerbotAI* botAI) { return new RpgDuelTrigger(botAI); }
static Trigger* mutating_injection(PlayerbotAI* ai) { return new MutatingInjectionTrigger(ai); }
static Trigger* mutating_injection_removed(PlayerbotAI* ai) { return new MutatingInjectionRemovedTrigger(ai); }
static Trigger* grobbulus_cloud(PlayerbotAI* ai) { return new GrobbulusCloudTrigger(ai); }
static Trigger* heigan_melee(PlayerbotAI* ai) { return new HeiganMeleeTrigger(ai); }
static Trigger* heigan_ranged(PlayerbotAI* ai) { return new HeiganRangedTrigger(ai); }
// static Trigger* thaddius_phase_pet(PlayerbotAI* ai) { return new ThaddiusPhasePetTrigger(ai); }
// static Trigger* thaddius_phase_pet_lose_aggro(PlayerbotAI* ai) { return new ThaddiusPhasePetLoseAggroTrigger(ai); }
// static Trigger* thaddius_phase_transition(PlayerbotAI* ai) { return new ThaddiusPhaseTransitionTrigger(ai); }
// static Trigger* thaddius_phase_thaddius(PlayerbotAI* ai) { return new ThaddiusPhaseThaddiusTrigger(ai); }
// static Trigger* razuvious_tank(PlayerbotAI* ai) { return new RazuviousTankTrigger(ai); }
// static Trigger* razuvious_nontank(PlayerbotAI* ai) { return new RazuviousNontankTrigger(ai); }
// static Trigger* horseman_attractors(PlayerbotAI* ai) { return new HorsemanAttractorsTrigger(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_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* kelthuzad(PlayerbotAI* ai) { return new KelthuzadTrigger(ai); }
// static Trigger* kelthuzad_phase_two(PlayerbotAI* ai) { return new KelthuzadPhaseTwoTrigger(ai); }
static Trigger* anubrekhan(PlayerbotAI* ai) { return new AnubrekhanTrigger(ai); }
// static Trigger* gluth(PlayerbotAI* ai) { return new GluthTrigger(ai); }
// static Trigger* gluth_main_tank_mortal_wound(PlayerbotAI* ai) { return new GluthMainTankMortalWoundTrigger(ai); }
// static Trigger* loatheb(PlayerbotAI* ai) { return new LoathebTrigger(ai); }
};
#endif