Skip to content

Commit

Permalink
-Random teleport change: Bots now won't travel for 10 minutes after g…
Browse files Browse the repository at this point in the history
…etting a random teleport to a rpg location.
  • Loading branch information
mostlikely4r committed Dec 15, 2023
1 parent 457b19a commit e3eb9d3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions playerbot/RandomPlayerbotMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3497,10 +3497,21 @@ void RandomPlayerbotMgr::ChangeStrategyOnce(Player* player)
void RandomPlayerbotMgr::RandomTeleportForRpg(Player* bot, bool activeOnly)
{
uint32 race = bot->getRace();
uint32 level = bot->GetLevel();
uint32 level = bot->GetLevel();
sLog.outDetail("Random teleporting bot %s for RPG (%zu locations available)", bot->GetName(), rpgLocsCacheLevel[race][level].size());
RandomTeleport(bot, rpgLocsCacheLevel[race][level], true, activeOnly);
Refresh(bot);
Refresh(bot);

//Travel cooldown for 10 minutes.
if (bot->GetPlayerbotAI())
{
AiObjectContext* context = bot->GetPlayerbotAI()->GetAiObjectContext();
TravelTarget* travelTarget = AI_VALUE(TravelTarget*, "travel target");

travelTarget->setTarget(sTravelMgr.nullTravelDestination, sTravelMgr.nullWorldPosition, true);
travelTarget->setStatus(TravelStatus::TRAVEL_STATUS_COOLDOWN);
travelTarget->setExpireIn(10 * MINUTE * IN_MILLISECONDS);
}
}

void RandomPlayerbotMgr::Remove(Player* bot)
Expand Down

0 comments on commit e3eb9d3

Please sign in to comment.