Ejemplo n.º 1
0
        private void UpdateUserEffect(RoomUser User, int x, int y)
        {
            if (User.IsBot)
            {
                return;
            }
            byte NewCurrentUserItemEffect = room.GetGameMap().EffectMap[x, y];

            if (NewCurrentUserItemEffect > 0)
            {
                ItemEffectType Type = ByteToItemEffectEnum.Parse(NewCurrentUserItemEffect);
                if (Type != User.CurrentItemEffect)
                {
                    switch (Type)
                    {
                    case ItemEffectType.Iceskates:
                    {
                        if (User.GetClient().GetHabbo().Gender == "M")
                        {
                            User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(38);
                        }
                        else
                        {
                            User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(39);
                        }
                        User.CurrentItemEffect = ItemEffectType.Iceskates;
                        break;
                    }

                    case ItemEffectType.Normalskates:
                    {
                        if (User.GetClient().GetHabbo().Gender == "M")
                        {
                            User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(55);
                        }
                        else
                        {
                            User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(56);
                        }
                        //56=girls
                        //55=
                        User.CurrentItemEffect = Type;
                        break;
                    }

                    case ItemEffectType.Swim:
                    {
                        User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(29);
                        User.CurrentItemEffect = Type;
                        break;
                    }

                    case ItemEffectType.SwimLow:
                    {
                        User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(30);
                        User.CurrentItemEffect = Type;
                        break;
                    }

                    case ItemEffectType.SwimHalloween:
                    {
                        User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(37);
                        User.CurrentItemEffect = Type;
                        break;
                    }

                    case ItemEffectType.None:
                    {
                        User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(-1);
                        User.CurrentItemEffect = Type;
                        break;
                    }

                    case ItemEffectType.PublicPool:
                    {
                        User.AddStatus("swim", string.Empty);
                        User.CurrentItemEffect = Type;
                        break;
                    }
                    }
                }
            }
            else if (User.CurrentItemEffect != ItemEffectType.None && NewCurrentUserItemEffect == 0)
            {
                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1);
                User.CurrentItemEffect = ItemEffectType.None;
                User.RemoveStatus("swim");
            }
        }
Ejemplo n.º 2
0
        internal void MoveTo(int pX, int pY)
        {
            // Comando developer activado?
            if (DeveloperCommand.CheckDeveloper(this, pX, pY, GetRoom()))
            {
                return;
            }

            bool    guildGateUser = false;
            Gamemap roomGameMap   = GetRoom().GetGameMap();

            Point square = new Point(pX, pY);

            if (roomGameMap.guildGates.ContainsKey(square))
            {
                uint     GuildId = 0;
                string[] strArr  = roomGameMap.guildGates[square].GroupData.Split(';');
                if (strArr.Length < 2)
                {
                    return;
                }

                uint.TryParse(strArr[1], out GuildId);

                if (GuildId > 0)
                {
                    if (!IsBot)
                    {
                        if (GetClient().GetHabbo().MyGroups.Contains(GuildId))
                        {
                            guildGateUser = true;
                        }
                    }
                }
            }

            // Si hay un usuario o un item, evitamos crear un nuevo path.
            if (!GetRoom().GetGameMap().tileIsWalkable(pX, pY, true, false, guildGateUser) && !AllowOverride && walkingToPet == null)
            {
                return;
            }

            if (ByteToItemEffectEnum.Parse(GetRoom().GetGameMap().EffectMap[pX, pY]) == ItemEffectType.HorseJump)
            {
                return;
            }

            if (isKicking)
            {
                return;
            }

            Unidle();

            if (TeleportEnabled)
            {
                if (IsWalking)
                {
                    GetRoom().GetGameMap().RemoveUserFromMap(this, new Point(SetX, SetY));
                    ClearMovement(true);
                }

                GetRoom().SendMessage(GetRoom().GetRoomItemHandler().UpdateUserOnRoller(this, new Point(pX, pY), 0));
                GetRoom().GetRoomUserManager().UpdateUserStatus(this, false);
                return;
            }

            IsWalking        = true;
            GoalX            = pX;
            GoalY            = pY;
            PathRecalcNeeded = true;
            throwBallAtGoal  = false;
            // GetRoom().GetRoomUserManager().UpdateUsersPath = true;
        }