コード例 #1
0
ファイル: Room.cs プロジェクト: RootkitR/Essential-5.1
        public RoomUser method_4(RoomBot Bot, Pet PetData, uint x = 0)
        {
            int num;
            if (x == 0)
                num = this.method_5();
            else
                num = (int)x;
            RoomUser user = new RoomUser(Convert.ToUInt32(num + 1000), this.Id, this.int_7++, true, x);

            user.int_20 = num;

            this.RoomUsers[num] = user;
            if (Bot.x > 0 && Bot.y > 0 && Bot.x < this.RoomModel.int_4 && Bot.y < this.RoomModel.int_5)
            {
                user.method_7(Bot.x, Bot.y, Bot.z);
                user.method_9(Bot.Rotation);
            }
            else
            {
                Bot.x = this.RoomModel.DoorX;
                Bot.y = this.RoomModel.DoorY;
                user.method_7(this.RoomModel.DoorX, this.RoomModel.DoorY, this.RoomModel.double_0);
                user.method_9(this.RoomModel.int_2);
            }

            user.RoomBot = Bot;
            user.BotAI = Bot.GetBotAI(user.VirtualId);

            if (user.IsPet)
            {
                user.BotAI.Init((int)Bot.Id, user.VirtualId, this.Id);
                user.PetData = PetData;
                user.PetData.VirtualId = user.VirtualId;
            }
            else
            {
                user.BotAI.Init(-1, user.VirtualId, this.Id);
            }
            this.method_87(user, true, true);
            user.UpdateNeeded = true;
            ServerMessage Message = new ServerMessage(Outgoing.SetRoomUser); // P
            Message.AppendInt32(1);
            user.method_14(Message);
            this.SendMessage(Message, null);
            user.BotAI.OnSelfEnterRoom();
            return user;
        }
コード例 #2
0
		public void AddPet(Pet pet)
		{
            try
            {
                if (pet != null)
                {
                    pet.PlacedInRoom = false;

                    if (!Pets.ContainsKey(pet.PetId))
                        Pets.Add(pet.PetId, pet);

                    this.GetClient().SendMessage(ComposePetInventoryListMessage());
                }
            }
            catch { }
		}