Ulduar base files

Base files for ulduar. w/o any script
This commit is contained in:
Garashan
2024-03-11 13:07:41 +01:00
parent 879f9113da
commit 5ab57efd29
12 changed files with 250 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
// /*
// * 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_RAIDULDUARACTIONCONTEXT_H
#define _PLAYERBOT_RAIDULDUARACTIONCONTEXT_H
#include "Action.h"
#include "NamedObjectContext.h"
#include "RaidUlduarActions.h"
class RaidUlduarActionContext : public NamedObjectContext<Action>
{
public:
RaidUlduarActionContext() {
}
private:
};
#endif

View File

@@ -0,0 +1,24 @@
#include "ObjectGuid.h"
#include "PlayerbotAIConfig.h"
#include "Playerbots.h"
#include "RaidUlduarActions.h"
#include "RaidUlduarStrategy.h"
#include "ScriptedCreature.h"
#include "SharedDefines.h"
#include "RaidUlduarBossHelper.h"
uint32 RotateAroundTheCenterPointAction::FindNearestWaypoint()
{
float minDistance = 0;
int ret = -1;
for (int i = 0; i < intervals; i++) {
float w_x = waypoints[i].first, w_y = waypoints[i].second;
float dis = bot->GetDistance2d(w_x, w_y);
if (ret == -1 || dis < minDistance) {
ret = i;
minDistance = dis;
}
}
return ret;
}

View File

@@ -0,0 +1,23 @@
#ifndef _PLAYERBOT_RAIDULDUARACTIONS_H
#define _PLAYERBOT_RAIDULDUARACTIONS_H
#include "Action.h"
#include "MovementActions.h"
#include "AttackAction.h"
#include "GenericActions.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
#include "RaidUlduarScripts.h"
#include "RaidUlduarBossHelper.h"
// just for test
// class TryToGetBossAIAction : public Action
// {
// public:
// TryToGetBossAIAction(PlayerbotAI* ai) : Action(ai, "try to get boss ai") {}
// public:
// virtual bool Execute(Event event);
// };
#endif

View File

@@ -0,0 +1,71 @@
#ifndef _PLAYERBOT_RAIDULDUARBOSSHELPER_H
#define _PLAYERBOT_RAIDULDUARBOSSHELPER_H
#include "AiObject.h"
#include "AiObjectContext.h"
#include "EventMap.h"
#include "Log.h"
#include "ObjectGuid.h"
#include "Player.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
#include "ScriptedCreature.h"
#include "RaidUlduarScripts.h"
#include "SharedDefines.h"
#include <string>
const uint32 ULDUAR_MAP_ID = 603;
template<class BossAiType>
class GenericBossHelper : public AiObject {
public:
GenericBossHelper(PlayerbotAI* botAI, std::string name): AiObject(botAI), _name(name) {}
virtual bool UpdateBossAI() {
if (!bot->IsInCombat()) {
_unit = nullptr;
}
if(_unit && (!_unit->IsInWorld() || !_unit->IsAlive())) {
_unit = nullptr;
}
if (!_unit) {
_unit = AI_VALUE2(Unit*, "find target", _name);
if (!_unit) {
return false;
}
_target = _unit->ToCreature();
if (!_target) {
return false;
}
_ai = dynamic_cast<BossAiType *>(_target->GetAI());
if (!_ai) {
return false;
}
_event_map = &_ai->events;
if (!_event_map) {
return false;
}
}
if (!_event_map) {
return false;
}
_timer = _event_map->GetTimer();
return true;
}
virtual void Reset() {
_unit = nullptr;
_target = nullptr;
_ai = nullptr;
_event_map = nullptr;
_timer = 0;
}
protected:
std::string _name;
Unit* _unit = nullptr;
Creature* _target = nullptr;
BossAiType *_ai = nullptr;
EventMap* _event_map = nullptr;
uint32 _timer = 0;
};
#endif

View File

@@ -0,0 +1,21 @@
#include "RaidUlduarMultipliers.h"
#include "GenericActions.h"
#include "MovementActions.h"
#include "ScriptedCreature.h"
#include "RaidUlduarActions.h"
#include "GenericSpellActions.h"
#include "ChooseTargetActions.h"
#include "ReachTargetActions.h"
#include "UseMeetingStoneAction.h"
#include "FollowActions.h"
#include "ShamanActions.h"
#include "PriestActions.h"
#include "DKActions.h"
#include "HunterActions.h"
#include "MageActions.h"
#include "RogueActions.h"
#include "DruidActions.h"
#include "PaladinActions.h"
#include "WarriorActions.h"
#include "DruidBearActions.h"

View File

@@ -0,0 +1,8 @@
#ifndef _PLAYERRBOT_RAIDULDUARMULTIPLIERS_H_
#define _PLAYERRBOT_RAIDULDUARMULTIPLIERS_H_
#include "Multiplier.h"
#include "raids/ulduar/RaidUlduarBossHelper.h"
#endif

View File

@@ -0,0 +1,7 @@
#ifndef _PLAYERBOT_RAIDULDUARSCRIPTS_H
#define _PLAYERBOT_RAIDULDUARSCRIPTS_H
//There are no header files for bosses in Ulduar directory
//#include "../../../../src/server/scripts/Northrend/Ulduar/Ulduar/"
#endif

View File

@@ -0,0 +1,12 @@
#include "RaidUlduarStrategy.h"
#include "RaidUlduarMultipliers.h"
void RaidUlduarStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
{
}
void RaidUlduarStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers)
{
}

View File

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

View File

@@ -0,0 +1,23 @@
// /*
// * 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_RAIDULDUARTRIGGERCONTEXT_H
#define _PLAYERBOT_RAIDULDUARTRIGGERCONTEXT_H
#include "NamedObjectContext.h"
#include "AiObjectContext.h"
#include "RaidUlduarTriggers.h"
class RaidUlduarTriggerContext : public NamedObjectContext<Trigger>
{
public:
RaidUlduarTriggerContext()
{
}
private:
};
#endif

View File

@@ -0,0 +1,5 @@
#include "EventMap.h"
#include "Playerbots.h"
#include "RaidUlduarTriggers.h"
#include "ScriptedCreature.h"
#include "Trigger.h"

View File

@@ -0,0 +1,13 @@
#ifndef _PLAYERBOT_RAIDULDUARTRIGGERS_H
#define _PLAYERBOT_RAIDULDUARTRIGGERS_H
#include "EventMap.h"
#include "Trigger.h"
#include "PlayerbotAIConfig.h"
#include "GenericTriggers.h"
#include "RaidUlduarScripts.h"
#include "RaidUlduarBossHelper.h"
#endif