Enable Vashjir bot travel and fix walkable adventure outings
This commit is contained in:
1 parent
30d606cb92
commit
bc621c1d74
44 files changed
+2450
-33
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#include "AdventureVashjir.h"
|
||||
#include "AdventureProfessionPolicy.h"
|
||||
#include "ClientlessLuaEngine.h"
|
||||
#include "ClientlessMountPreparation.h"
|
||||
@@ -639,11 +640,28 @@ void ClientlessLuaEngine::UpdateWorldPresence(Player* player, std::string const&
|
||||
TC_LOG_INFO("server.adventurebot","WORGEN_FORM guid=%u intent='%s' desired=%u arrived=%u",guid,intent.c_str(),wanted->second,arrived);
|
||||
}
|
||||
|
||||
bool ClientlessLuaEngine::PrepareAquaticMount(Player* player)
|
||||
{
|
||||
if (!player || !GetAdventureProfile(player->GetGUID().GetCounter()) || !AdventureVashjir::Contains(player))return false;
|
||||
// Boarding policy only: do not strip an existing mount or interrupt flight.
|
||||
if (player->IsMounted())return player->HasAura(AdventureVashjir::Seahorse);
|
||||
if (player->getLevel()<80 || !player->HasSpell(AdventureVashjir::Seahorse) || !player->IsInWater() ||
|
||||
!player->IsAlive() || player->IsInCombat() || player->IsBeingTeleported() || player->IsInFlight() ||
|
||||
player->IsFlying() || player->IsFalling() || player->GetTransport() || player->GetVehicle() ||
|
||||
player->HasUnitState(UNIT_STATE_CASTING) || !player->GetMountCapability(232))return false;
|
||||
if (!ClientlessMountPreparation::LeaveDruidForm(player,true))return false;
|
||||
// Native mount spell/capability supplies the model and swimming speed.
|
||||
player->CastSpell(player,AdventureVashjir::Seahorse,true);
|
||||
return player->HasAura(AdventureVashjir::Seahorse) && player->IsMounted();
|
||||
}
|
||||
|
||||
bool ClientlessLuaEngine::PrepareGroundMount(Player* player, float travelDistance, char const* context)
|
||||
{
|
||||
if (!player || !player->IsInWorld())
|
||||
return false;
|
||||
|
||||
if (AdventureVashjir::Contains(player))return PrepareAquaticMount(player);
|
||||
|
||||
ClientlessAdventureProfile const* profile = GetAdventureProfile(player->GetGUID().GetCounter());
|
||||
if (!profile || !profile->CanGroundMount || (profile->GroundMounts.empty() && player->getRace()!=RACE_WORGEN))
|
||||
return false;
|
||||
@@ -687,6 +705,7 @@ void ClientlessLuaEngine::DismountGroundMount(Player* player, char const* reason
|
||||
return;
|
||||
|
||||
uint32 const oldDisplay = player->GetMountID();
|
||||
player->RemoveAurasDueToSpell(AdventureVashjir::Seahorse);
|
||||
player->RemoveAurasDueToSpell(87840);
|
||||
player->Dismount();
|
||||
player->UpdateSpeed(MOVE_RUN);
|
||||
|
||||
Reference in new issue
Block a user