[New Rpg] New rpg start up (add GO_GRIND and NEAR_RANDOM status)

This commit is contained in:
Yunfan Li
2024-11-30 23:48:29 +08:00
parent 3e449fff73
commit 0fd894176b
27 changed files with 625 additions and 65 deletions

View File

@@ -24,6 +24,7 @@ public:
creators["reputation"] = &ChatTriggerContext::reputation;
creators["log"] = &ChatTriggerContext::log;
creators["los"] = &ChatTriggerContext::los;
creators["rpg status"] = &ChatTriggerContext::rpg_status;
creators["aura"] = &ChatTriggerContext::aura;
creators["drop"] = &ChatTriggerContext::drop;
creators["share"] = &ChatTriggerContext::share;
@@ -211,6 +212,7 @@ private:
static Trigger* reputation(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "reputation"); }
static Trigger* log(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "log"); }
static Trigger* los(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "los"); }
static Trigger* rpg_status(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "rpg status"); }
static Trigger* aura(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "aura"); }
static Trigger* loot_all(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "add all loot"); }
static Trigger* release(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "release"); }

View File

@@ -0,0 +1,4 @@
#include "NewRpgTriggers.h"
#include "PlayerbotAI.h"
bool NewRpgStatusTrigger::IsActive() { return status == botAI->rpgInfo.status; }

View File

@@ -0,0 +1,20 @@
#ifndef _PLAYERBOT_NEWRPGTRIGGERS_H
#define _PLAYERBOT_NEWRPGTRIGGERS_H
#include "NewRpgStrategy.h"
#include "Trigger.h"
class NewRpgStatusTrigger : public Trigger
{
public:
NewRpgStatusTrigger(PlayerbotAI* botAI, NewRpgStatus status = NewRpgStatus::IDLE)
: Trigger(botAI, "new rpg status"), status(status)
{
}
bool IsActive() override;
protected:
NewRpgStatus status;
};
#endif

View File

@@ -12,6 +12,8 @@
#include "LfgTriggers.h"
#include "LootTriggers.h"
#include "NamedObjectContext.h"
#include "NewRpgStrategy.h"
#include "NewRpgTriggers.h"
#include "PvpTriggers.h"
#include "RaidNaxxTriggers.h"
#include "RpgTriggers.h"
@@ -213,6 +215,8 @@ public:
creators["rpg craft"] = &TriggerContext::rpg_craft;
creators["rpg trade useful"] = &TriggerContext::rpg_trade_useful;
creators["rpg duel"] = &TriggerContext::rpg_duel;
creators["go grind status"] = &TriggerContext::go_grind_status;
creators["near random status"] = &TriggerContext::near_random_status;
}
private:
@@ -402,6 +406,8 @@ private:
static Trigger* rpg_craft(PlayerbotAI* botAI) { return new RpgCraftTrigger(botAI); }
static Trigger* rpg_trade_useful(PlayerbotAI* botAI) { return new RpgTradeUsefulTrigger(botAI); }
static Trigger* rpg_duel(PlayerbotAI* botAI) { return new RpgDuelTrigger(botAI); }
static Trigger* go_grind_status(PlayerbotAI* botAI) { return new NewRpgStatusTrigger(botAI, NewRpgStatus::GO_GRIND); }
static Trigger* near_random_status(PlayerbotAI* botAI) { return new NewRpgStatusTrigger(botAI, NewRpgStatus::NEAR_RANDOM); }
};
#endif