27 lines
1.0 KiB
C++
27 lines
1.0 KiB
C++
#ifndef VCORE_CLIENTLESS_MOUNT_PREPARATION_H
|
|
#define VCORE_CLIENTLESS_MOUNT_PREPARATION_H
|
|
|
|
#include "Player.h"
|
|
|
|
namespace ClientlessMountPreparation
|
|
{
|
|
// Cancel the aura category, not individual spell IDs: covers every druid
|
|
// form and its ranks, including travel, aquatic, flight and talent forms.
|
|
inline bool LeaveDruidForm(Player* player)
|
|
{
|
|
if (player->getClass() != CLASS_DRUID || !player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
|
|
return true;
|
|
|
|
// Never drop a flying/swimming druid out of a form in mid-transition.
|
|
// The normal landing/transport owner must finish before mounting.
|
|
if (!player->IsAlive() || player->IsInCombat() || player->IsFlying() || player->IsFalling() ||
|
|
player->IsInWater() || player->IsInFlight() || player->GetTransport() || player->GetVehicle() ||
|
|
player->IsBeingTeleported())
|
|
return false;
|
|
|
|
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
|
return !player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT);
|
|
}
|
|
}
|
|
#endif
|