mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Integrate playerbots strategies, and actions for Onyxia (#737)
playerbots strategies for Onyxia40
This commit is contained in:
22
src/playerbots/InidivualProgressionPlayerbotsActionContext.h
Normal file
22
src/playerbots/InidivualProgressionPlayerbotsActionContext.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifdef MOD_PLAYERBOTS
|
||||||
|
#ifndef MOD_INDIVIDUAL_PROGRESSION_ACTIONCONTEXT_H
|
||||||
|
#define MOD_INDIVIDUAL_PROGRESSION_ACTIONCONTEXT_H
|
||||||
|
|
||||||
|
#include "ActionContext.h"
|
||||||
|
#include "IndividualProgressionOnyxiaActions.h"
|
||||||
|
#include "RaidOnyxiaActionContext.h"
|
||||||
|
|
||||||
|
class IPOnyxiaActionContext : public RaidOnyxiaActionContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IPOnyxiaActionContext : public RaidOnyxiaActionContext ()
|
||||||
|
{
|
||||||
|
creators["ony kill whelps"] = &IPOnyxiaActionContext::kill_whelps;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
static Action* kill_playerbots::ActionRegistry::RegisterAction("ony kill whelps", []() { return new IPOnyxiaKillWhelpsAction(ai); }
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#ifdef MOD_PLAYERBOTS
|
||||||
|
#include "Playerbots.h"
|
||||||
|
#include "IndividualProgressionOnyxiaActions.h"
|
||||||
|
|
||||||
|
bool IPOnyxiaKillWhelpsAction::Execute(Event event)
|
||||||
|
{
|
||||||
|
Unit* currentTarget = AI_VALUE(Unit*, "current target");
|
||||||
|
// If already attacking a whelp, don't swap targets
|
||||||
|
if (currentTarget
|
||||||
|
&& (currentTarget->GetEntry() == 11262 // Default AzerothCore Onyxian Whelp
|
||||||
|
|| currentTarget->GetEntry() == 301001)) // mod-individual-progression Onyxian Whelp
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
GuidVector targets = AI_VALUE(GuidVector, "possible targets");
|
||||||
|
for (ObjectGuid guid : targets)
|
||||||
|
{
|
||||||
|
Creature* unit = botAI->GetCreature(guid);
|
||||||
|
if (!unit || !unit->IsAlive() || !unit->IsInWorld())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (unit->GetEntry() == 11262 // Default AzerothCore Onyxian Whelp
|
||||||
|
|| unit->GetEntry() == 301001) // mod-individual-progression Onyxian Whelp
|
||||||
|
{
|
||||||
|
// bot->Yell("Attacking Whelps!", LANG_UNIVERSAL);
|
||||||
|
return Attack(unit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#ifdef MOD_PLAYERBOTS
|
||||||
|
#ifndef MOD_INDIVIDUAL_PROGRESSION_ONYXIAACTIONS_H
|
||||||
|
#define MOD_INDIVIDUAL_PROGRESSION_ONYXIAACTIONS_H
|
||||||
|
#include "RaidOnyxiaActions.h"
|
||||||
|
|
||||||
|
class IPOnyxiaKillWhelpsAction : public RaidOnyxiaKillWhelpsAction
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using RaidOnyxiaKillWhelpsAction::RaidOnyxiaKillWhelpsAction;
|
||||||
|
bool Execute(Event event) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user