Example #1
0
void BattlegroundIC::DoAction(uint32 action, uint64 const& var)
{
    if(action != ACTION_TELEPORT_PLAYER_TO_TRANSPORT)
        return;

    Player* pPlayer = sObjectMgr->GetPlayer(var);
    if(!pPlayer || !gunshipAlliance || !gunshipHorde)
        return;

    pPlayer->Achievement3854Check();
    pPlayer->CastSpell(pPlayer, SPELL_PARACHUTE, true); // this must be changed, there is a trigger in each transport that casts the spell.
    pPlayer->CastSpell(pPlayer, SPELL_SLOW_FALL, true);

    pPlayer->SetTransport(pPlayer->GetTeamId() == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde);

    pPlayer->m_movementInfo.t_pos.m_positionX = TransportMovementInfo.GetPositionX();
    pPlayer->m_movementInfo.t_pos.m_positionY = TransportMovementInfo.GetPositionY();
    pPlayer->m_movementInfo.t_pos.m_positionZ = TransportMovementInfo.GetPositionZ();
    pPlayer->m_movementInfo.t_guid = (pPlayer->GetTeamId() == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde)->GetGUID();

    pPlayer->TeleportTo(GetMapId(), TeleportToTransportPosition.GetPositionX(), TeleportToTransportPosition.GetPositionY(), TeleportToTransportPosition.GetPositionZ(), TeleportToTransportPosition.GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);
}