Example #1
0
        public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message)
        {
            Logger.Debug("(OnTargeted) Portal has been activated ");

            var world     = this.World.Game.GetWorld(this.Destination.WorldSNO);
            var now_world = player.World;

            if (world == null)
            {
                Logger.Warn("Portal's destination world does not exist (WorldSNO = {0})", this.Destination.WorldSNO);
                return;
            }

            var startingPoint = world.GetStartingPointById(this.Destination.StartingPointActorTag);

            if (startingPoint != null)
            {
                player.ChangeWorld(world, startingPoint);
            }
            else if (this.Destination.StartingPointActorTag == -606)
            {
                player.ChangeWorld(world, new Common.Types.Math.Vector3D(2233.019f, 1801.747f, 5.950454f));
            }
            else if (this.Destination.StartingPointActorTag == -636)
            {
                player.ChangeWorld(world, new Common.Types.Math.Vector3D(2037.89f, 1775.57f, 0f));
            }
            else if (this.Destination.StartingPointActorTag == -637)
            {
                player.ChangeWorld(world, new Common.Types.Math.Vector3D(2177f, 1946f, -4.968689f));
            }
            else if (this.Destination.StartingPointActorTag == -471)
            {
                player.ChangeWorld(world, new Common.Types.Math.Vector3D(2201.044f, 2531.148f, -27.36831f));
            }
            else
            {
                Logger.Warn("Portal's tagged starting point does not exist (Tag = {0})", this.Destination.StartingPointActorTag);
            }

            #region Тестовая функция: переход наёмника
            if (player.ActiveHireling != null)
            {
                player.ActiveHireling.ChangeWorld(world, startingPoint);

                player.InGameClient.SendMessage(new PetMessage()
                {
                    Field0 = 0,
                    Field1 = 0,
                    PetId  = player.ActiveHireling.DynamicID,
                    Field3 = 0,
                });
            }
            #endregion
            //base.OnTargeted(player, message);
        }