Exemplo n.º 1
0
 public RoomUser method_4(RoomBot Bot, Pet PetData)
 {
     int num = this.method_5();
     RoomUser user = new RoomUser(Convert.ToUInt32(num + 100000), this.RoomId, this.int_7++, true);
     user.CurrentFurniFX = num;
     this.UserList[num] = user;
     if (Bot.X > 0 && Bot.Y > 0 && Bot.X < this.Model.MapSizeX && Bot.Y < this.Model.MapSizeY)
     {
         user.SetPos(Bot.X, Bot.Y, Bot.Z);
         user.SetRot(Bot.Rot);
     }
     else
     {
         Bot.X = this.Model.DoorX;
         Bot.Y = this.Model.DoorY;
         user.SetPos(this.Model.DoorX, this.Model.DoorY, this.Model.DoorZ);
         user.SetRot(this.Model.DoorOrientation);
     }
     user.BotData = Bot;
     user.BotAI = Bot.GenerateBotAI(user.VirtualId);
     if (user.IsPet)
     {
         user.BotAI.Init((int)Bot.BotId, user.VirtualId, this.RoomId);
         user.PetData = PetData;
         user.PetData.VirtualId = user.VirtualId;
     }
     else
     {
         user.BotAI.Init(-1, user.VirtualId, this.RoomId);
     }
     this.UpdateUserStatus(user, true, true);
     user.UpdateNeeded = true;
     ServerMessage Message = new ServerMessage(28u);
     Message.AppendInt32(1);
     user.Serialize(Message);
     this.SendMessage(Message, null);
     user.BotAI.OnSelfEnterRoom();
     return user;
 }
Exemplo n.º 2
0
 public void method_46(GameClient Session, bool bool_13)
 {
     RoomUser @class = new RoomUser(Session.GetHabbo().Id, this.RoomId, this.int_7++, Session.GetHabbo().Visible);
     if (@class != null && @class.GetClient() != null && @class.GetClient().GetHabbo() != null)
     {
         if (bool_13 || [email protected])
         {
             @class.IsSpectator = true;
         }
         else
         {
             @class.SetPos(this.Model.DoorX, this.Model.DoorY, this.Model.DoorZ);
             @class.SetRot(this.Model.DoorOrientation);
             if (this.CheckRights(Session, true))
             {
                 @class.AddStatus("flatctrl", "useradmin");
             }
             else
             {
                 if (this.CheckRights(Session))
                 {
                     @class.AddStatus("flatctrl", "");
                 }
             }
             if ([email protected] && @class.GetClient().GetHabbo().IsTeleporting)
             {
                 RoomItem class2 = this.GetItem(@class.GetClient().GetHabbo().TeleporterId);
                 if (class2 != null)
                 {
                     @class.SetPos(class2.GetX, class2.GetY, class2.GetZ);
                     @class.SetRot(class2.Rot);
                     class2.InteractingUser2 = Session.GetHabbo().Id;
                     class2.ExtraData = "2";
                     class2.UpdateState(false, true);
                 }
             }
             @class.GetClient().GetHabbo().IsTeleporting = false;
             @class.GetClient().GetHabbo().TeleporterId = 0u;
             ServerMessage Message = new ServerMessage(28u);
             Message.AppendInt32(1);
             @class.Serialize(Message);
             this.SendMessage(Message, null);
         }
         int num = this.method_5();
         @class.CurrentFurniFX = num;
         this.UserList[num] = @class;
         if (!bool_13)
         {
             this.bool_10 = true;
         }
         Session.GetHabbo().CurrentRoomId = this.Id;
         Session.GetHabbo().GetMessenger().OnStatusChanged(false);
         Session.GetHabbo().RoomVisits++;
         int num2 = Session.GetHabbo().RoomVisits;
         if (num2 <= 500)
         {
             if (num2 <= 50)
             {
                 if (num2 != 5)
                 {
                     if (num2 == 50)
                     {
                         PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 2);
                     }
                 }
                 else
                 {
                     PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 1);
                 }
             }
             else
             {
                 if (num2 != 100)
                 {
                     if (num2 != 200)
                     {
                         if (num2 == 500)
                         {
                             PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 5);
                         }
                     }
                     else
                     {
                         PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 4);
                     }
                 }
                 else
                 {
                     PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 3);
                 }
             }
         }
         else
         {
             if (num2 <= 1500)
             {
                 if (num2 != 750)
                 {
                     if (num2 == 1500)
                     {
                         PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 7);
                     }
                 }
                 else
                 {
                     PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 6);
                 }
             }
             else
             {
                 if (num2 != 2500)
                 {
                     if (num2 != 4000)
                     {
                         if (num2 == 5000)
                         {
                             PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 10);
                         }
                     }
                     else
                     {
                         PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 9);
                     }
                 }
                 else
                 {
                     PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 8);
                 }
             }
         }
         Session.GetHabbo().OnEnterRoom(this.Id);
         if (Session.GetHabbo().GroupID > 0)
         {
             Phoenix.HabboHotel.Groups.Group class3 = GroupManager.GetGroup(Session.GetHabbo().GroupID);
             if (class3 != null && !this.list_17.Contains(class3))
             {
                 this.list_17.Add(class3);
                 ServerMessage Message2 = new ServerMessage(309u);
                 Message2.AppendInt32(this.list_17.Count);
                 foreach (Phoenix.HabboHotel.Groups.Group current in this.list_17)
                 {
                     Message2.AppendInt32(current.Id);
                     Message2.AppendStringWithBreak(current.Badge);
                 }
                 this.SendMessage(Message2, null);
             }
         }
         if (!bool_13)
         {
             this.method_51();
             for (int i = 0; i < this.UserList.Length; i++)
             {
                 RoomUser class4 = this.UserList[i];
                 if (class4 != null && class4.IsBot)
                 {
                     class4.BotAI.OnUserEnterRoom(@class);
                 }
             }
         }
     }
 }