mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Ulduar base files
Base files for ulduar. w/o any script
This commit is contained in:
71
src/strategy/raids/ulduar/RaidUlduarBossHelper.h
Normal file
71
src/strategy/raids/ulduar/RaidUlduarBossHelper.h
Normal 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
|
||||
Reference in New Issue
Block a user