mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-22 04:56:22 +00:00
[New Rpg] Implement GO_INNKEEPER and NEAR_NPC status
This commit is contained in:
@@ -18,9 +18,15 @@ void NewRpgStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("go grind status", NextAction::array(0, new NextAction("new rpg go grind", 1.0f), nullptr)));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("go innkeeper status", NextAction::array(0, new NextAction("new rpg go innkeeper", 1.0f), nullptr)));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("near random status", NextAction::array(0, new NextAction("new rpg move random", 1.0f), nullptr)));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("near npc status", NextAction::array(0, new NextAction("new rpg move npc", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
void NewRpgStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
|
||||
@@ -20,16 +20,30 @@ enum class NewRpgStatus
|
||||
// Exploring nearby
|
||||
NEAR_RANDOM,
|
||||
NEAR_NPC,
|
||||
// Idling
|
||||
// Taking a break
|
||||
REST,
|
||||
// Initial status
|
||||
IDLE
|
||||
};
|
||||
|
||||
struct NewRpgInfo
|
||||
{
|
||||
NewRpgStatus status{NewRpgStatus::IDLE};
|
||||
// NewRpgStatus::GO_GRIND
|
||||
WorldPosition grindPos{};
|
||||
uint32 lastGrind{0};
|
||||
uint32 lastGoGrind{0};
|
||||
// NewRpgStatus::GO_INNKEEPER
|
||||
WorldPosition innKeeperPos{};
|
||||
uint32 lastGoInnKeeper{0};
|
||||
// NewRpgStatus::NEAR_NPC
|
||||
GuidPosition npcPos{};
|
||||
uint32 lastNearNpc{0};
|
||||
uint32 lastReachNpc{0};
|
||||
// NewRpgStatus::NEAR_RANDOM
|
||||
uint32 lastNearRandom{0};
|
||||
// NewRpgStatus::REST
|
||||
uint32 lastRest{0};
|
||||
|
||||
std::string ToString()
|
||||
{
|
||||
std::stringstream out;
|
||||
@@ -51,9 +65,14 @@ struct NewRpgInfo
|
||||
case NewRpgStatus::IDLE:
|
||||
out << "IDLE";
|
||||
break;
|
||||
case NewRpgStatus::REST:
|
||||
out << "REST";
|
||||
break;
|
||||
default:
|
||||
out << "UNKNOWN";
|
||||
}
|
||||
out << "\nGrindPos: " << grindPos.GetMapId() << " " << grindPos.GetPositionX() << " " << grindPos.GetPositionY() << " " << grindPos.GetPositionZ();
|
||||
out << "\nLastGrind: " << lastGrind;
|
||||
out << "\nlastGoGrind: " << lastGoGrind;
|
||||
return out.str();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user