Exemple #1
0
 public override void OnTimerTick()
 {
     if (this.int_2 <= 0)
     {
         if (base.GetRoomBot() != null && base.GetRoomBot().list_0.Count > 0)
         {
             RandomSpeech @class = base.GetRoomBot().GetRandomSpeech();
             base.GetRoomUser().HandleSpeech(null, @class.Message, @class.Shout);
         }
         this.int_2 = Essential.smethod_5(0, 150);
     }
     else
     {
         this.int_2--;
     }
     if (this.int_3 <= 0)
     {
         int int_  = Essential.smethod_5(0, base.GetRoom().RoomModel.int_4);
         int int_2 = Essential.smethod_5(0, base.GetRoom().RoomModel.int_5);
         base.GetRoomUser().MoveTo(int_, int_2);
         this.int_3 = Essential.smethod_5(0, 30);
     }
     else
     {
         this.int_3--;
     }
 }
Exemple #2
0
        private int method_4()
        {
            RoomUser @class = base.GetRoomUser();
            int      result = 5;

            if (@class.PetData.Level >= 1)
            {
                result = Essential.smethod_5(1, 8);
            }
            else
            {
                if (@class.PetData.Level >= 5)
                {
                    result = Essential.smethod_5(1, 7);
                }
                else
                {
                    if (@class.PetData.Level >= 10)
                    {
                        result = Essential.smethod_5(1, 6);
                    }
                }
            }
            return(result);
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Dictionary <Room, int> dictionary = Essential.GetGame().GetRoomManager().method_21();
            Room @class = null;
            IEnumerable <Room> arg_35_0 = dictionary.Keys;

            if (FindNewFriendsMessageEvent.func_0 == null)
            {
                FindNewFriendsMessageEvent.func_0 = new Func <Room, int>(FindNewFriendsMessageEvent.smethod_0);
            }
            IOrderedEnumerable <Room> orderedEnumerable = arg_35_0.OrderByDescending(FindNewFriendsMessageEvent.func_0);
            int num = 0;

            foreach (Room current in orderedEnumerable)
            {
                num++;
                string a = Essential.smethod_5(1, 5).ToString();
                if (a == "2")
                {
                    goto IL_83;
                }
                if (num == orderedEnumerable.Count <Room>())
                {
                    goto IL_83;
                }
                bool arg_A2_0 = true;
IL_A2:
                if (arg_A2_0)
                {
                    continue;
                }
                @class = current;
                break;
IL_83:
                arg_A2_0 = (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentRoom == null || Session.GetHabbo().CurrentRoom == current);
                goto IL_A2;
            }
            if (@class == null)
            {
                ServerMessage Message = new ServerMessage(Outgoing.SearchFriendsMessage); // Updated
                Message.AppendBoolean(false);
                Session.SendMessage(Message);
            }
            else
            {
                ServerMessage Message2 = new ServerMessage(Outgoing.RoomForward); // Updated
                Message2.AppendBoolean(@class.IsPublic);
                Message2.AppendUInt(@class.Id);
                Session.SendMessage(Message2);
                ServerMessage Message3 = new ServerMessage(Outgoing.SearchFriendsMessage);
                Message3.AppendBoolean(true);
                Session.SendMessage(Message3);
            }
        }
Exemple #4
0
        private void method_5(int int_4, int int_5, bool bool_0)
        {
            RoomUser @class = base.GetRoomUser();

            if (bool_0)
            {
                int int_6 = Essential.smethod_5(0, base.GetRoom().RoomModel.int_4);
                int int_7 = Essential.smethod_5(0, base.GetRoom().RoomModel.int_5);
                @class.MoveTo(int_6, int_7);
            }
            else
            {
                if (int_4 < base.GetRoom().RoomModel.int_4&& int_5 < base.GetRoom().RoomModel.int_5&& int_4 >= 0 && int_5 >= 0)
                {
                    @class.MoveTo(int_4, int_5);
                }
            }
        }
Exemple #5
0
 public override void OnTimerTick()
 {
     try
     {
         if (this.SpeechTimer <= 0)
         {
             if (this.randomSpeeches.Count > 0)
             {
                 if (canSpeak)
                 {
                     RandomSpeech randomSpeech = this.GetRandomSpeech();
                     base.GetRoomUser().HandleSpeech(null, randomSpeech.Message, randomSpeech.Shout, 0);
                 }
             }
             this.SpeechTimer = speechDelta;
         }
         else
         {
             this.SpeechTimer--;
         }
         if (this.int_3 <= 0 && (this.uBot.walkmode == "freeroam" || this.uBot.walkmode == "specified_range") && !base.FollowsUser)
         {
             if (this.uBot.walkmode == "freeroam")
             {
                 int int_  = Essential.smethod_5(0, base.GetRoom().RoomModel.int_4);
                 int int_2 = Essential.smethod_5(0, base.GetRoom().RoomModel.int_5);
                 base.GetRoomUser().MoveTo(int_, int_2);
                 this.int_3 = Essential.smethod_5(0, 30);
             }
             else
             {
                 int int_  = Essential.smethod_5(this.uBot.minX, this.uBot.maxX);
                 int int_2 = Essential.smethod_5(this.uBot.minY, this.uBot.maxY);
                 base.GetRoomUser().MoveTo(int_, int_2);
                 this.int_3 = Essential.smethod_5(0, 30);
             }
         }
         else
         {
             this.int_3--;
         }
     }
     catch { }
 }
Exemple #6
0
 public override void OnTimerTick()
 {
     if (this.int_2 <= 0)
     {
         if (base.GetRoomBot().list_0.Count > 0)
         {
             RandomSpeech @class = base.GetRoomBot().GetRandomSpeech();
             base.GetRoomUser().HandleSpeech(null, @class.Message, @class.Shout);
         }
         this.int_2 = Essential.smethod_5(10, 300);
     }
     else
     {
         this.int_2--;
     }
     if (this.int_3 <= 0)
     {
         string text = base.GetRoomBot().WalkMode.ToLower();
         if (text != null && !(text == "stand"))
         {
             if (!(text == "freeroam"))
             {
                 if (text == "specified_range")
                 {
                     int int_  = Essential.smethod_5(base.GetRoomBot().min_x, base.GetRoomBot().max_x);
                     int int_2 = Essential.smethod_5(base.GetRoomBot().min_y, base.GetRoomBot().max_y);
                     base.GetRoomUser().MoveTo(int_, int_2);
                 }
             }
             else
             {
                 int int_  = Essential.smethod_5(0, base.GetRoom().RoomModel.int_4);
                 int int_2 = Essential.smethod_5(0, base.GetRoom().RoomModel.int_5);
                 base.GetRoomUser().MoveTo(int_, int_2);
             }
         }
         this.int_3 = Essential.smethod_5(1, 30);
     }
     else
     {
         this.int_3--;
     }
 }
Exemple #7
0
 public RandomSpeech GetRandomSpeech()
 {
     return(this.list_0[Essential.smethod_5(0, this.list_0.Count - 1)]);
 }
Exemple #8
0
        public override void OnTimerTick()
        {
            if (this.SpeechTimer <= 0)
            {
                RoomUser @class = base.GetRoomUser();
                string[] array  = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_dog1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dog2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dog3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dog4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dog5")
                };
                string[] array2 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_cat1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_cat2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_cat3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_cat4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_cat5")
                };
                string[] array3 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_croc1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_croc2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_croc3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_croc4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_croc5")
                };
                string[] array4 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_dog1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dog2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dog3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dog4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dog5")
                };
                string[] array5 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_bear1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_bear2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_bear3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_bear4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_bear5")
                };
                string[] array6 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_pig1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_pig2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_pig3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_pig4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_pig5")
                };
                string[] array7 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_lion1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_lion2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_lion3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_lion4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_lion5")
                };
                string[] array8 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_rhino1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_rhino2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_rhino3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_rhino4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_rhino5")
                };
                string[] array9 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_spider1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_spider2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_spider3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_spider4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_spider5")
                };
                string[] array10 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_turtle1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_turtle2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_turtle3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_turtle4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_turtle5")
                };
                string[] array11 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_chic1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_chic2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_chic3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_chic4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_chic5")
                };
                string[] array12 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_frog1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_frog2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_frog3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_frog4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_frog5")
                };
                string[] array13 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_dragon1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dragon2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dragon3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dragon4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_dragon5")
                };
                string[] array14 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_horse1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_horse2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_horse3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_horse4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_horse5")
                };
                string[] array15 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_monkey1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_monkey2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_monkey3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_monkey4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_monkey5")
                };
                string[] array16 = new string[]
                {
                    EssentialEnvironment.GetExternalText("pet_chatter_generic1"),
                    EssentialEnvironment.GetExternalText("pet_chatter_generic2"),
                    EssentialEnvironment.GetExternalText("pet_chatter_generic3"),
                    EssentialEnvironment.GetExternalText("pet_chatter_generic4"),
                    EssentialEnvironment.GetExternalText("pet_chatter_generic5")
                };
                string[] array17 = new string[]
                {
                    "sit",
                    "lay",
                    "snf",
                    "ded",
                    "jmp",
                    "snf",
                    "sit",
                    "snf"
                };
                string[] array18 = new string[]
                {
                    "sit",
                    "lay"
                };
                string[] array19 = new string[]
                {
                    "wng",
                    "grn",
                    "flm",
                    "std",
                    "swg",
                    "sit",
                    "lay",
                    "snf",
                    "plf",
                    "jmp",
                    "flm",
                    "crk",
                    "rlx",
                    "flm"
                };
                if (@class != null)
                {
                    Random random = new Random();
                    int    num    = Essential.smethod_5(1, 4);
                    if (num == 2)
                    {
                        @class.Statusses.Clear();
                        if (base.GetRoomUser().RoomBot.RoomUser_0 == null)
                        {
                            if (@class.PetData.Type == 13u)
                            {
                                @class.Statusses.Add(array18[random.Next(0, array18.Length - 1)], @class.double_0.ToString());
                            }
                            else
                            {
                                if (@class.PetData.Type != 12u)
                                {
                                    @class.Statusses.Add(array17[random.Next(0, array17.Length - 1)], @class.double_0.ToString());
                                }
                                else
                                {
                                    @class.Statusses.Add(array19[random.Next(0, array19.Length - 1)], @class.double_0.ToString());
                                }
                            }
                        }
                    }
                    switch (@class.PetData.Type)
                    {
                    case 0u:
                        @class.HandleSpeech(null, array[random.Next(0, array.Length - 1)], false);
                        break;

                    case 1u:
                        @class.HandleSpeech(null, array2[random.Next(0, array2.Length - 1)], false);
                        break;

                    case 2u:
                        @class.HandleSpeech(null, array3[random.Next(0, array3.Length - 1)], false);
                        break;

                    case 3u:
                        @class.HandleSpeech(null, array4[random.Next(0, array4.Length - 1)], false);
                        break;

                    case 4u:
                        @class.HandleSpeech(null, array5[random.Next(0, array5.Length - 1)], false);
                        break;

                    case 5u:
                        @class.HandleSpeech(null, array6[random.Next(0, array6.Length - 1)], false);
                        break;

                    case 6u:
                        @class.HandleSpeech(null, array7[random.Next(0, array7.Length - 1)], false);
                        break;

                    case 7u:
                        @class.HandleSpeech(null, array8[random.Next(0, array8.Length - 1)], false);
                        break;

                    case 8u:
                        @class.HandleSpeech(null, array9[random.Next(0, array9.Length - 1)], false);
                        break;

                    case 9u:
                        @class.HandleSpeech(null, array10[random.Next(0, array10.Length - 1)], false);
                        break;

                    case 10u:
                        @class.HandleSpeech(null, array11[random.Next(0, array11.Length - 1)], false);
                        break;

                    case 11u:
                        @class.HandleSpeech(null, array12[random.Next(0, array12.Length - 1)], false);
                        break;

                    case 12u:
                        @class.HandleSpeech(null, array13[random.Next(0, array13.Length - 1)], false);
                        break;

                    case 13u:
                        @class.HandleSpeech(null, array14[random.Next(0, array14.Length - 1)], false);
                        break;

                    case 14u:
                        @class.HandleSpeech(null, array15[random.Next(0, array15.Length - 1)], false);
                        break;

                    default:
                        @class.HandleSpeech(null, array16[random.Next(0, array16.Length - 1)], false);
                        break;
                    }
                }
                this.SpeechTimer = Essential.smethod_5(30, 120);
            }
            else
            {
                this.SpeechTimer--;
            }
            if (this.ActionTimer <= 0)
            {
                base.GetRoomUser().PetData.PetEnergy(10);
                if (base.GetRoomUser().RoomBot.RoomUser_0 == null)
                {
                    this.method_5(0, 0, true);
                }
                this.ActionTimer = 30;
                this.FollowType  = FollowType.None;
                this.FollowUser  = null;
            }
            else
            {
                this.ActionTimer--;

                if (this.FollowType != FollowType.None && this.FollowUser != null)
                {
                    this.PetFollowUser(this.FollowUser, base.GetRoomUser(), this.FollowType);
                }
            }
        }