Пример #1
0
        /// <summary>
        /// Spawn the vob into the world
        /// </summary>
        /// <param name="world">the world name. Example: NewWorld\NewWorld.zen</param>
        /// <param name="position">The position of the vob in the world</param>
        /// <param name="direction">The direction of the vob.</param>
        public virtual void Spawn(String world, Vec3f position, Vec3f direction)
        {
            if (direction == null)
            {
                direction = new Vec3f();
            }
            GUC.WorldObjects.sWorld.getWorld(world).addVob(this.vob);
            //vob.IsSpawned = true;
            this.vob.Position  = position;
            this.vob.Direction = direction;



            SpawnVobMessage.Write(vob);
        }
        public void Read(RakNet.BitStream stream, RakNet.Packet packet, Server server)
        {
            int plId = 0;

            stream.Read(out plId);

            if (!sWorld.VobDict.ContainsKey(plId))
            {
                Log.Logger.log(Log.Logger.LOG_WARNING, "No Playerid found! " + plId);
                return;
            }

            Player pl = (Player)sWorld.VobDict[plId];

            pl.spawned();

            sWorld.getWorld(pl.Map).addVob(pl);

            SpawnVobMessage.Write(pl, packet.guid);
            Scripting.Objects.Character.Player.isOnPlayerSpawn((Scripting.Objects.Character.Player)pl.ScriptingNPC);
        }