Skip to content

Commit

Permalink
Merge pull request liyunfan1223#642 from Bobblybook/master
Browse files Browse the repository at this point in the history
Oculus implementation
  • Loading branch information
noisiver authored Oct 27, 2024
2 parents 4219c39 + 9f27379 commit e82eb3a
Show file tree
Hide file tree
Showing 17 changed files with 949 additions and 26 deletions.
2 changes: 2 additions & 0 deletions src/strategy/AiObjectContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ AiObjectContext::AiObjectContext(PlayerbotAI* botAI) : PlayerbotAIAware(botAI)
actionContexts.Add(new WotlkDungeonGDActionContext());
actionContexts.Add(new WotlkDungeonHoSActionContext());
actionContexts.Add(new WotlkDungeonHoLActionContext());
actionContexts.Add(new WotlkDungeonOccActionContext());
actionContexts.Add(new WotlkDungeonUPActionContext());
actionContexts.Add(new WotlkDungeonCoSActionContext());

Expand All @@ -80,6 +81,7 @@ AiObjectContext::AiObjectContext(PlayerbotAI* botAI) : PlayerbotAIAware(botAI)
triggerContexts.Add(new WotlkDungeonGDTriggerContext());
triggerContexts.Add(new WotlkDungeonHoSTriggerContext());
triggerContexts.Add(new WotlkDungeonHoLTriggerContext());
triggerContexts.Add(new WotlkDungeonOccTriggerContext());
triggerContexts.Add(new WotlkDungeonUPTriggerContext());
triggerContexts.Add(new WotlkDungeonCoSTriggerContext());

Expand Down
10 changes: 4 additions & 6 deletions src/strategy/dungeons/DungeonStrategyContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
#include "wotlk/gundrak/GundrakStrategy.h"
#include "wotlk/hallsofstone/HallsOfStoneStrategy.h"
#include "wotlk/hallsoflightning/HallsOfLightningStrategy.h"
#include "wotlk/oculus/OculusStrategy.h"
#include "wotlk/utgardepinnacle/UtgardePinnacleStrategy.h"
#include "wotlk/cullingofstratholme/CullingOfStratholmeStrategy.h"

/*
Full list/TODO:
The Oculus - Occ
Drakos the Interrogator, Varos Cloudstrider, Mage-Lord Urom, Ley-Guardian Eregos
Trial of the Champion - ToC
Alliance Champions: Deathstalker Visceri, Eressea Dawnsinger, Mokra the Skullcrusher, Runok Wildmane, Zul'tore
Horde Champions: Ambrose Boltspark, Colosos, Jacob Alerius, Jaelyne Evensong, Lana Stouthammer
Expand Down Expand Up @@ -74,12 +73,11 @@ class DungeonStrategyContext : public NamedObjectContext<Strategy>
static Strategy* wotlk_gd(PlayerbotAI* botAI) { return new WotlkDungeonGDStrategy(botAI); }
static Strategy* wotlk_hos(PlayerbotAI* botAI) { return new WotlkDungeonHoSStrategy(botAI); }
static Strategy* wotlk_hol(PlayerbotAI* botAI) { return new WotlkDungeonHoLStrategy(botAI); }
// static Strategy* wotlk_occ(PlayerbotAI* botAI) { return new WotlkDungeonOccStrategy(botAI); }
static Strategy* wotlk_occ(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); }
static Strategy* wotlk_occ(PlayerbotAI* botAI) { return new WotlkDungeonOccStrategy(botAI); }
static Strategy* wotlk_up(PlayerbotAI* botAI) { return new WotlkDungeonUPStrategy(botAI); }
static Strategy* wotlk_cos(PlayerbotAI* botAI) { return new WotlkDungeonCoSStrategy(botAI); }

static Strategy* wotlk_toc(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); } // NYI from here down
// NYI from here down
static Strategy* wotlk_toc(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); }
static Strategy* wotlk_hor(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); }
static Strategy* wotlk_pos(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); }
static Strategy* wotlk_fos(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); }
Expand Down
2 changes: 1 addition & 1 deletion src/strategy/dungeons/wotlk/WotlkDungeonActionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "gundrak/GundrakActionContext.h"
#include "hallsofstone/HallsOfStoneActionContext.h"
#include "hallsoflightning/HallsOfLightningActionContext.h"
// #include "oculus/OculusActionContext.h"
#include "oculus/OculusActionContext.h"
#include "utgardepinnacle/UtgardePinnacleActionContext.h"
#include "cullingofstratholme/CullingOfStratholmeActionContext.h"
// #include "trialofthechampion/TrialOfTheChampionActionContext.h"
Expand Down
2 changes: 1 addition & 1 deletion src/strategy/dungeons/wotlk/WotlkDungeonTriggerContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "gundrak/GundrakTriggerContext.h"
#include "hallsofstone/HallsOfStoneTriggerContext.h"
#include "hallsoflightning/HallsOfLightningTriggerContext.h"
// #include "oculus/OculusTriggerContext.h"
#include "oculus/OculusTriggerContext.h"
#include "utgardepinnacle/UtgardePinnacleTriggerContext.h"
#include "cullingofstratholme/CullingOfStratholmeTriggerContext.h"
// #include "trialofthechampion/TrialOfTheChampionTriggerContext.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
bool ShatterSpreadAction::Execute(Event event)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "krystallus");
float radius = 40.0f;
if (!boss) { return false; }

float radius = 40.0f;
Unit* closestMember = nullptr;

GuidVector members = AI_VALUE(GuidVector, "group members");
for (auto& member : members)
{
Expand Down
30 changes: 30 additions & 0 deletions src/strategy/dungeons/wotlk/oculus/OculusActionContext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef _PLAYERBOT_WOTLKDUNGEONOCCACTIONCONTEXT_H
#define _PLAYERBOT_WOTLKDUNGEONOCCACTIONCONTEXT_H

#include "Action.h"
#include "NamedObjectContext.h"
#include "OculusActions.h"

class WotlkDungeonOccActionContext : public NamedObjectContext<Action>
{
public:
WotlkDungeonOccActionContext() {
creators["avoid unstable sphere"] = &WotlkDungeonOccActionContext::avoid_unstable_sphere;
creators["mount drake"] = &WotlkDungeonOccActionContext::mount_drake;
creators["dismount drake"] = &WotlkDungeonOccActionContext::dismount_drake;
creators["fly drake"] = &WotlkDungeonOccActionContext::fly_drake;
creators["drake attack"] = &WotlkDungeonOccActionContext::drake_attack;
creators["avoid arcane explosion"] = &WotlkDungeonOccActionContext::avoid_arcane_explosion;
creators["time bomb spread"] = &WotlkDungeonOccActionContext::time_bomb_spread;
}
private:
static Action* avoid_unstable_sphere(PlayerbotAI* ai) { return new AvoidUnstableSphereAction(ai); }
static Action* mount_drake(PlayerbotAI* ai) { return new MountDrakeAction(ai); }
static Action* dismount_drake(PlayerbotAI* ai) { return new DismountDrakeAction(ai); }
static Action* fly_drake(PlayerbotAI* ai) { return new FlyDrakeAction(ai); }
static Action* drake_attack(PlayerbotAI* ai) { return new DrakeAttackAction(ai); }
static Action* avoid_arcane_explosion(PlayerbotAI* ai) { return new AvoidArcaneExplosionAction(ai); }
static Action* time_bomb_spread(PlayerbotAI* ai) { return new TimeBombSpreadAction(ai); }
};

#endif
Loading

0 comments on commit e82eb3a

Please sign in to comment.