Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text;
- using System.Collections.Generic;
- using Plus.HabboHotel.Rooms;
- using Plus.Communication.Packets.Outgoing;
- using Plus.Communication.Packets.Outgoing.Nux;
- using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
- namespace Plus.Communication.Packets.Incoming.Rooms.Engine
- {
- class MoveAvatarEvent : IPacketEvent
- {
- public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
- {
- if (Session == null || Session.GetHabbo() == null)
- return;
- if (!Session.GetHabbo().InRoom)
- return;
- Room Room = Session.GetHabbo().CurrentRoom;
- if (Room == null)
- return;
- RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
- if (User == null || !User.CanWalk)
- return;
- int MoveX = Packet.PopInt();
- int MoveY = Packet.PopInt();
- if (MoveX == User.X && MoveY == User.Y)
- {
- if(!User.IsWalking)
- return;
- else
- User.SeatCount++;
- if (User.SeatCount == 5)
- return;
- }
- if (User.RidingHorse)
- {
- RoomUser Horse = Room.GetRoomUserManager().GetRoomUserByVirtualId(User.HorseID);
- if (Horse != null)
- Horse.MoveTo(MoveX, MoveY);
- }
- User.MoveTo(MoveX, MoveY);
- if (Session.GetHabbo().NewUser)
- {
- var nuxStatus = new ServerPacket(ServerPacketHeader.NuxUserStatus);
- nuxStatus.WriteInteger(2);
- Session.SendPacket(nuxStatus);
- Session.SendPacket(new NuxAlertComposer("nux/lobbyoffer/hide"));
- Session.SendPacket(new NuxAlertComposer("helpBubble/add/HC_JOIN_BUTTON/" + PlusEnvironment.GetGame().GetLanguageLocale().TryGetValue("phrase_7_end") +""));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment