mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-24 22:16:23 +00:00
naxx raid grobbulus
This commit is contained in:
@@ -2,30 +2,41 @@
|
||||
#include "RaidNaxxTrigger.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
// bool MutatingInjectionRemovedTrigger::IsActive()
|
||||
// {
|
||||
// Unit* boss = AI_VALUE2(Unit*, "find target", "grobbulus");
|
||||
// if (!boss) {
|
||||
// return false;
|
||||
// }
|
||||
// return HasNotAuraTrigger::IsActive() && botAI->GetCurrentState() == BOT_STATE_COMBAT && botAI->IsRanged(bot);
|
||||
// }
|
||||
bool AuraRemovedTrigger::IsActive() {
|
||||
bool check = botAI->HasAura(name, bot, false, false, -1, true);
|
||||
bool ret = false;
|
||||
if (prev_check && !check) {
|
||||
ret = true;
|
||||
}
|
||||
prev_check = check;
|
||||
return ret;
|
||||
}
|
||||
|
||||
// bool BossEventTrigger::IsActive()
|
||||
// {
|
||||
// Unit* boss = AI_VALUE(Unit*, "boss target");
|
||||
// if (!boss || boss->GetEntry() != boss_entry) {
|
||||
// return false;
|
||||
// }
|
||||
// BossAI* boss_ai = dynamic_cast<BossAI*>(boss->GetAI());
|
||||
// EventMap* eventMap = boss_botAI->GetEvents();
|
||||
// const uint32 event_time = eventMap->GetNextEventTime(event_id);
|
||||
// if (event_time != last_event_time) {
|
||||
// last_event_time = event_time;
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
bool MutatingInjectionRemovedTrigger::IsActive()
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "grobbulus");
|
||||
if (!boss) {
|
||||
return false;
|
||||
}
|
||||
return HasNoAuraTrigger::IsActive() && botAI->GetState() == BOT_STATE_COMBAT && botAI->IsRanged(bot);
|
||||
}
|
||||
|
||||
bool BossEventTrigger::IsActive()
|
||||
{
|
||||
Unit* boss = AI_VALUE(Unit*, "boss target");
|
||||
if (!boss || boss->GetEntry() != boss_entry) {
|
||||
return false;
|
||||
}
|
||||
if (!eventMap) {
|
||||
return false;
|
||||
}
|
||||
const uint32 event_time = eventMap->GetNextEventTime(event_id);
|
||||
if (event_time != last_event_time) {
|
||||
last_event_time = event_time;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// bool BossPhaseTrigger::IsActive()
|
||||
// {
|
||||
|
||||
@@ -2,44 +2,37 @@
|
||||
#ifndef _PLAYERBOT_RAIDNAXXTRIGGER_H
|
||||
#define _PLAYERBOT_RAIDNAXXTRIGGER_H
|
||||
|
||||
#include "EventMap.h"
|
||||
#include "Trigger.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "GenericTriggers.h"
|
||||
#include "../../../../src/server/scripts/Northrend/Naxxramas/boss_grobbulus.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
// class MutatingInjectionTrigger : public HasAuraTrigger
|
||||
// {
|
||||
// public:
|
||||
// MutatingInjectionTrigger(PlayerbotAI* ai): HasAuraTrigger(ai, "mutating injection", 1) {}
|
||||
// };
|
||||
class MutatingInjectionTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
MutatingInjectionTrigger(PlayerbotAI* ai): HasAuraTrigger(ai, "mutating injection", 1) {}
|
||||
};
|
||||
|
||||
// class AuraRemovedTrigger : public Trigger
|
||||
// {
|
||||
// public:
|
||||
// AuraRemovedTrigger(PlayerbotAI* ai, string name): Trigger(ai, name, 1) {
|
||||
// this->prev_check = false;
|
||||
// }
|
||||
// virtual bool IsActive() {
|
||||
// bool check = ai->HasAuraWithDuration(name, bot);
|
||||
// bool ret = false;
|
||||
// // bot->Yell(to_string(prev_check) + to_string(check), LANG_UNIVERSAL);
|
||||
// if (prev_check && !check) {
|
||||
// ret = true;
|
||||
// }
|
||||
// prev_check = check;
|
||||
// return ret;
|
||||
// }
|
||||
// protected:
|
||||
// bool prev_check;
|
||||
// };
|
||||
class AuraRemovedTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
AuraRemovedTrigger(PlayerbotAI* botAI, string name): Trigger(botAI, name, 1) {
|
||||
this->prev_check = false;
|
||||
}
|
||||
virtual bool IsActive() override;
|
||||
protected:
|
||||
bool prev_check;
|
||||
};
|
||||
|
||||
// class MutatingInjectionRemovedTrigger : public HasNotAuraTrigger
|
||||
// {
|
||||
// public:
|
||||
// MutatingInjectionRemovedTrigger(PlayerbotAI* ai): HasNotAuraTrigger(ai, "mutating injection", 1) {}
|
||||
// virtual bool IsActive();
|
||||
// };
|
||||
class MutatingInjectionRemovedTrigger : public HasNoAuraTrigger
|
||||
{
|
||||
public:
|
||||
MutatingInjectionRemovedTrigger(PlayerbotAI* ai): HasNoAuraTrigger(ai, "mutating injection") {}
|
||||
virtual bool IsActive();
|
||||
};
|
||||
|
||||
class BossEventTrigger : public Trigger
|
||||
{
|
||||
@@ -52,6 +45,7 @@ public:
|
||||
virtual bool IsActive();
|
||||
protected:
|
||||
uint32 boss_entry, event_id, last_event_time;
|
||||
EventMap *eventMap;
|
||||
};
|
||||
|
||||
class BossPhaseTrigger : public Trigger
|
||||
@@ -67,12 +61,14 @@ protected:
|
||||
uint32 phase_mask;
|
||||
};
|
||||
|
||||
// class GrobbulusCloudTrigger : public BossEventTrigger
|
||||
// {
|
||||
// public:
|
||||
// GrobbulusCloudTrigger(PlayerbotAI* ai): BossEventTrigger(ai, 15931, 2, "grobbulus cloud event") {}
|
||||
// virtual bool IsActive();
|
||||
// };
|
||||
class GrobbulusCloudTrigger : public BossEventTrigger
|
||||
{
|
||||
public:
|
||||
GrobbulusCloudTrigger(PlayerbotAI* ai): BossEventTrigger(ai, 15931, 2, "grobbulus cloud event") {
|
||||
this->eventMap = boss_grobbulus::boss_grobbulusAI
|
||||
}
|
||||
virtual bool IsActive();
|
||||
};
|
||||
|
||||
class HeiganMeleeTrigger : public Trigger
|
||||
{
|
||||
|
||||
@@ -194,7 +194,7 @@ class TriggerContext : public NamedObjectContext<Trigger>
|
||||
creators["rpg trade useful"] = &TriggerContext::rpg_trade_useful;
|
||||
creators["rpg duel"] = &TriggerContext::rpg_duel;
|
||||
|
||||
// creators["mutating injection"] = &TriggerContext::mutating_injection;
|
||||
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;
|
||||
@@ -366,7 +366,7 @@ class TriggerContext : public NamedObjectContext<Trigger>
|
||||
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(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); }
|
||||
|
||||
Reference in New Issue
Block a user