Ejemplo n.º 1
0
 public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
 {
     if (!GuessEventManager.Started)
     {
         trigger.Reply("Guess word event is not started.");
         return;
     }
     GuessEventManager.Stop();
     trigger.Reply("Guess word event stoped.");
 }
Ejemplo n.º 2
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                var word = trigger.Text.NextWord();

                if (word.Length < 3)
                {
                    trigger.Reply("Minimum length of secret word is 3");
                    return;
                }
                if (GuessEventManager.Started)
                {
                    trigger.Reply("Guess word event is already started.");
                    return;
                }
                var percision = trigger.Text.NextInt(100);

                GuessEventManager.Start(word, percision, trigger.Args.Character.Name);
                trigger.Reply("Ok, guess word event started. Word is {0}, percision is {1}.", word, percision);
            }
Ejemplo n.º 3
0
        [PacketHandler(RealmServerOpCode.GlobalChatWithItem)] //6560
        public static void GlobalChatWithItemRequest(IRealmClient client, RealmPacketIn packet)
        {
            packet.Position -= 24;
            var success = client.ActiveCharacter.Asda2Inventory.UseGlobalChatItem();

            if (!success)
            {
                return;
            }
            //var accId = packet.ReadInt32();//default : 0Len : 4
            packet.Position += 1;                            //nk1 default : 0Len : 1
            var msg = packet.ReadAsciiString(client.Locale); //default : Len : 0

            if (msg.Length < 1 ||
                RealmCommandHandler.HandleCommand(client.ActiveCharacter, msg,
                                                  client.ActiveCharacter.Target as Character))
            {
                return;
            }
            if (msg.Length > 200)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Global chat message more than 200 symbols.", 80);
                return;
            }
            if (client.ActiveCharacter.ChatBanned)
            {
                client.ActiveCharacter.SendInfoMsg("Your chat is banned.");
                return;
            }
            if (GuessEventManager.Started)
            {
                GuessEventManager.TryGuess(msg, client.ActiveCharacter);
            }
            var locale = Asda2EncodingHelper.MinimumAvailableLocale(client.Locale, msg);

            SendGlobalChatWithItemResponseResponse(CreateSenderName(client.ActiveCharacter), msg, client.ActiveCharacter.ChatColor, locale);
        }