mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-16 08:36:10 +00:00
grobbulus fixed
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "EventMap.h"
|
||||
#include "Playerbots.h"
|
||||
#include "RaidNaxxTrigger.h"
|
||||
#include "ScriptedCreature.h"
|
||||
@@ -21,12 +22,15 @@ bool MutatingInjectionRemovedTrigger::IsActive()
|
||||
return HasNoAuraTrigger::IsActive() && botAI->GetState() == BOT_STATE_COMBAT && botAI->IsRanged(bot);
|
||||
}
|
||||
|
||||
bool BossEventTrigger::IsActive()
|
||||
template<class T>
|
||||
bool BossEventTrigger<T>::IsActive()
|
||||
{
|
||||
Unit* boss = AI_VALUE(Unit*, "boss target");
|
||||
if (!boss || boss->GetEntry() != boss_entry) {
|
||||
return false;
|
||||
}
|
||||
T* ai = dynamic_cast<T*>(boss->GetAI());
|
||||
EventMap *eventMap = &ai->events;
|
||||
if (!eventMap) {
|
||||
return false;
|
||||
}
|
||||
@@ -54,18 +58,18 @@ bool BossEventTrigger::IsActive()
|
||||
// return phase_mask == this->phase_mask;
|
||||
// }
|
||||
|
||||
// bool GrobbulusCloudTrigger::IsActive()
|
||||
// {
|
||||
// Unit* boss = AI_VALUE(Unit*, "boss target");
|
||||
// if (!boss || boss->GetEntry() != boss_entry) {
|
||||
// return false;
|
||||
// }
|
||||
// if (!botAI->IsMainTank(bot)) {
|
||||
// return false;
|
||||
// }
|
||||
// // bot->Yell("has aggro on " + boss->GetName() + " : " + to_string(AI_VALUE2(bool, "has aggro", "boss target")), LANG_UNIVERSAL);
|
||||
// return AI_VALUE2(bool, "has aggro", "boss target");
|
||||
// }
|
||||
bool GrobbulusCloudTrigger::IsActive()
|
||||
{
|
||||
Unit* boss = AI_VALUE(Unit*, "boss target");
|
||||
if (!boss || boss->GetEntry() != boss_entry) {
|
||||
return false;
|
||||
}
|
||||
if (!botAI->IsMainTank(bot)) {
|
||||
return false;
|
||||
}
|
||||
// bot->Yell("has aggro on " + boss->GetName() + " : " + to_string(AI_VALUE2(bool, "has aggro", "boss target")), LANG_UNIVERSAL);
|
||||
return AI_VALUE2(bool, "has aggro", "boss target");
|
||||
}
|
||||
|
||||
bool HeiganMeleeTrigger::IsActive()
|
||||
{
|
||||
@@ -159,4 +163,6 @@ bool HeiganRangedTrigger::IsActive()
|
||||
// }
|
||||
// // bot->Yell("Time to taunt!", LANG_UNIVERSAL);
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
|
||||
template bool BossEventTrigger<boss_grobbulus::boss_grobbulusAI>::IsActive();
|
||||
@@ -34,6 +34,7 @@ public:
|
||||
virtual bool IsActive();
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class BossEventTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
@@ -45,7 +46,6 @@ public:
|
||||
virtual bool IsActive();
|
||||
protected:
|
||||
uint32 boss_entry, event_id, last_event_time;
|
||||
EventMap *eventMap;
|
||||
};
|
||||
|
||||
class BossPhaseTrigger : public Trigger
|
||||
@@ -61,12 +61,10 @@ protected:
|
||||
uint32 phase_mask;
|
||||
};
|
||||
|
||||
class GrobbulusCloudTrigger : public BossEventTrigger
|
||||
class GrobbulusCloudTrigger : public BossEventTrigger<boss_grobbulus::boss_grobbulusAI>
|
||||
{
|
||||
public:
|
||||
GrobbulusCloudTrigger(PlayerbotAI* ai): BossEventTrigger(ai, 15931, 2, "grobbulus cloud event") {
|
||||
this->eventMap = boss_grobbulus::boss_grobbulusAI
|
||||
}
|
||||
GrobbulusCloudTrigger(PlayerbotAI* ai): BossEventTrigger(ai, 15931, 2, "grobbulus cloud event") { }
|
||||
virtual bool IsActive();
|
||||
};
|
||||
|
||||
@@ -205,4 +203,6 @@ public:
|
||||
// LoathebTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "loatheb", 0, "loatheb trigger") {}
|
||||
// };
|
||||
|
||||
|
||||
// template BossEventTrigger<class boss_grobbulus::boss_grobbulusAI>;
|
||||
#endif
|
||||
@@ -195,8 +195,8 @@ class TriggerContext : public NamedObjectContext<Trigger>
|
||||
creators["rpg duel"] = &TriggerContext::rpg_duel;
|
||||
|
||||
creators["mutating injection"] = &TriggerContext::mutating_injection;
|
||||
// creators["mutating injection removed"] = &TriggerContext::mutating_injection_removed;
|
||||
// creators["grobbulus cloud"] = &TriggerContext::grobbulus_cloud;
|
||||
creators["mutating injection removed"] = &TriggerContext::mutating_injection_removed;
|
||||
creators["grobbulus cloud"] = &TriggerContext::grobbulus_cloud;
|
||||
creators["heigan melee"] = &TriggerContext::heigan_melee;
|
||||
creators["heigan ranged"] = &TriggerContext::heigan_ranged;
|
||||
|
||||
@@ -367,8 +367,8 @@ class TriggerContext : public NamedObjectContext<Trigger>
|
||||
static Trigger* rpg_duel(PlayerbotAI* botAI) { return new RpgDuelTrigger(botAI); }
|
||||
|
||||
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* 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); }
|
||||
static Trigger* heigan_ranged(PlayerbotAI* ai) { return new HeiganRangedTrigger(ai); }
|
||||
// static Trigger* thaddius_phase_pet(PlayerbotAI* ai) { return new ThaddiusPhasePetTrigger(ai); }
|
||||
|
||||
Reference in New Issue
Block a user