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,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