コード例 #1
0
 public void Dispose()
 {
     handler.GetRoom().GetGameManager().OnScoreChanged -= scoreChangedDelegate;
     handler.GetRoom().GetGameManager().OnGameEnd      -= gameEndDeletgate;
     this.item    = null;
     this.handler = null;
 }
コード例 #2
0
        public void Handle(RoomUser user, Item TriggerItem)
        {
            if (this.NameBot == "" || this.Look == "")
            {
                return;
            }
            Room     room = handler.GetRoom();
            RoomUser Bot  = room.GetRoomUserManager().GetBotOrPetByName(this.NameBot);

            if (Bot == null)
            {
                return;
            }

            Bot.BotData.Look = this.Look;

            ServerPacket Message = new ServerPacket(ServerPacketHeader.UserChangeMessageComposer);

            Message.WriteInteger(Bot.VirtualId);
            Message.WriteString(Bot.BotData.Look);
            Message.WriteString(Bot.BotData.Gender);
            Message.WriteString(Bot.BotData.Motto);
            Message.WriteInteger(0);
            room.SendPacket(Message);
        }
コード例 #3
0
 public void Dispose()
 {
     handler.GetRoom().OnUserSays -= delegateFunction;
     item           = null;
     handler        = null;
     triggerMessage = null;
 }
コード例 #4
0
ファイル: BotMove.cs プロジェクト: EmuZoneDEV/HBBO-EMU
        public void Handle(RoomUser user, Item TriggerItem)
        {
            if (this.NameBot == "" || this.items.Count == 0)
            {
                return;
            }
            Room     room = handler.GetRoom();
            RoomUser Bot  = room.GetRoomUserManager().GetBotOrPetByName(this.NameBot);

            if (Bot == null)
            {
                return;
            }

            Item roomItem = this.items[0];

            if (roomItem == null)
            {
                return;
            }
            if (roomItem.Coordinate != Bot.Coordinate)
            {
                Bot.MoveTo(roomItem.GetX, roomItem.GetY, true);
            }
        }
コード例 #5
0
        public void Handle(RoomUser user, Item TriggerItem)
        {
            if (this.NomBot == "" || this.message == "")
            {
                return;
            }
            Room     room = handler.GetRoom();
            RoomUser Bot  = room.GetRoomUserManager().GetBotOrPetByName(this.NomBot);

            if (Bot == null)
            {
                return;
            }

            string TextMessage = this.message;

            if (user != null)
            {
                TextMessage = TextMessage.Replace("#username#", user.GetUsername());
                TextMessage = TextMessage.Replace("#point#", user.WiredPoints.ToString());
                TextMessage = TextMessage.Replace("#roomname#", this.handler.GetRoom().RoomData.Name.ToString());
            }

            Bot.OnChat(TextMessage, (Bot.IsPet) ? 0 : 2, this.IsCrier);
        }
コード例 #6
0
ファイル: BotFollowAvatar.cs プロジェクト: Stownizi/Wibbo
        public void Handle(RoomUser user, Item TriggerItem)
        {
            if (string.IsNullOrEmpty(this.NameBot))
            {
                return;
            }

            Room     room = handler.GetRoom();
            RoomUser Bot  = room.GetRoomUserManager().GetBotOrPetByName(this.NameBot);

            if (Bot == null)
            {
                return;
            }

            if (user != null && !user.IsBot && user.GetClient() != null)
            {
                if (this.IsFollow)
                {
                    if (Bot.BotData.FollowUser != user.VirtualId)
                    {
                        Bot.BotData.FollowUser = user.VirtualId;
                    }
                }
                else
                {
                    Bot.BotData.FollowUser = 0;
                }
            }
        }
コード例 #7
0
        public void Handle(RoomUser user, Item TriggerItem)
        {
            if (this.NameBot == "" || this.items.Count == 0)
            {
                return;
            }
            Room     room = handler.GetRoom();
            RoomUser Bot  = room.GetRoomUserManager().GetBotOrPetByName(this.NameBot);

            if (Bot == null)
            {
                return;
            }

            Item roomItem = this.items[ButterflyEnvironment.GetRandomNumber(0, this.items.Count - 1)];

            if (roomItem == null)
            {
                return;
            }
            if (roomItem.Coordinate != Bot.Coordinate)
            {
                this.gamemap.TeleportToItem(Bot, roomItem);
            }
        }
コード例 #8
0
        public void Handle(RoomUser user, Item TriggerItem)
        {
            if (this.NomBot == "" || this.message == "" || user == null || user.GetClient() == null)
            {
                return;
            }
            Room     room = handler.GetRoom();
            RoomUser Bot  = room.GetRoomUserManager().GetBotOrPetByName(this.NomBot);

            if (Bot == null)
            {
                return;
            }

            string TextMessage = this.message;

            if (user != null)
            {
                TextMessage = TextMessage.Replace("#username#", user.GetUsername());
                TextMessage = TextMessage.Replace("#point#", user.WiredPoints.ToString());
                TextMessage = TextMessage.Replace("#roomname#", this.handler.GetRoom().RoomData.Name.ToString());
            }

            if (IsMurmur)
            {
                ServerPacket Message = new ServerPacket(ServerPacketHeader.WhisperMessageComposer);
                Message.WriteInteger(Bot.VirtualId);
                Message.WriteString(TextMessage);
                Message.WriteInteger(0);
                Message.WriteInteger(2);
                Message.WriteInteger(0);
                Message.WriteInteger(-1);
                user.GetClient().SendPacket(Message);
            }
            else
            {
                ServerPacket Message = new ServerPacket(ServerPacketHeader.ChatMessageComposer);
                Message.WriteInteger(Bot.VirtualId);
                Message.WriteString(TextMessage);
                Message.WriteInteger(RoomUser.GetSpeechEmotion(this.message));
                Message.WriteInteger(2);
                Message.WriteInteger(0);
                Message.WriteInteger(-1);
                user.GetClient().SendPacket(Message);
            }
        }
コード例 #9
0
 public void Dispose()
 {
     handler.GetRoom().GetGameManager().OnGameEnd -= gameEndsDeletgate;
     item    = null;
     handler = null;
 }
コード例 #10
0
ファイル: GameStarts.cs プロジェクト: TheNaked/Firewind
 public void Dispose()
 {
     handler.GetRoom().GetGameManager().OnGameStart -= gameStartsDeletgate;
     this.item    = null;
     this.handler = null;
 }