示例#1
0
        public static void RunSpeed(string[] args, WorldClass session)
        {
            ChatMessageValues chatMessage = new ChatMessageValues(0, "");

            if (args.Length == 1)
            {
                MoveHandler.HandleMoveSetRunSpeed(ref session);
            }
            else
            {
                var speed = CommandParser.Read <float>(args, 1);
                if (speed <= 50 && speed > 0)
                {
                    chatMessage.Message = "Run speed set to " + speed + "!";

                    MoveHandler.HandleMoveSetRunSpeed(ref session, speed);
                    ChatHandler.SendMessage(ref session, chatMessage);
                }
                else
                {
                    chatMessage.Message = "Please enter a value between 0.0 and 50.0!";

                    ChatHandler.SendMessage(ref session, chatMessage);
                }

                return;
            }

            chatMessage.Message = "Run speed set to default.";

            ChatHandler.SendMessage(ref session, chatMessage);
        }
示例#2
0
        public static void RunSpeed(string[] args)
        {
            var session = GetSession();

            if (args.Length == 1)
            {
                MoveHandler.HandleMoveSetRunSpeed(ref session);
            }
            else
            {
                var speed = CommandParser.Read <float>(args, 1);
                if (speed <= float.MaxValue && speed > 0)
                {
                    MoveHandler.HandleMoveSetRunSpeed(ref session, speed);
                    ChatHandler.SendMessageByType(ref session, 0, 0, "Run speed set to " + speed + "!");
                }
                else
                {
                    ChatHandler.SendMessageByType(ref session, 0, 0, "Please enter a value between 0.0 and 50.0!");
                }

                return;
            }

            ChatHandler.SendMessageByType(ref session, 0, 0, "Run speed set to default.");
        }
示例#3
0
        public static void HandleCastSpell(ref PacketReader packet, WorldClass2 session)
        {
            SmartGuid castId = packet.ReadGuid();

            packet.Read <int>();
            WorldClass session2;
            bool       flag;
            int        num2;

            while (true)
            {
IL_A5:
                uint arg_80_0 = 88971970u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_80_0 ^ 899281459u)) % 6u)
                    {
                    case 0u:
                        session2 = Manager.WorldMgr.GetSession(session.Character.Guid);
                        arg_80_0 = (num * 2285706345u ^ 946484535u);
                        continue;

                    case 2u:
                        flag     = false;
                        arg_80_0 = (num * 2596192904u ^ 1190916770u);
                        continue;

                    case 3u:
                        num2     = packet.Read <int>();
                        arg_80_0 = (num * 1794880723u ^ 3422198762u);
                        continue;

                    case 4u:
                        goto IL_A5;

                    case 5u:
                        packet.Read <int>();
                        arg_80_0 = (num * 1876448829u ^ 2032187839u);
                        continue;
                    }
                    goto Block_1;
                }
            }
Block_1:
            uint key = 0u;

            using (Dictionary <string, Tuple <uint, uint> > .Enumerator enumerator = Manager.WorldMgr.MountSpells.GetEnumerator())
            {
                while (true)
                {
IL_178:
                    uint arg_140_0 = enumerator.MoveNext() ? 1710289446u : 1398974958u;
                    while (true)
                    {
                        uint num;
                        switch ((num = (arg_140_0 ^ 899281459u)) % 7u)
                        {
                        case 0u:
                        {
                            KeyValuePair <string, Tuple <uint, uint> > current;
                            arg_140_0 = ((((ulong)current.Value.Item2 != (ulong)((long)num2)) ? 2858814123u : 2326435399u) ^ num * 1448571402u);
                            continue;
                        }

                        case 2u:
                            goto IL_178;

                        case 3u:
                        {
                            KeyValuePair <string, Tuple <uint, uint> > current = enumerator.Current;
                            arg_140_0 = 407543239u;
                            continue;
                        }

                        case 4u:
                        {
                            KeyValuePair <string, Tuple <uint, uint> > current;
                            key       = current.Value.Item1;
                            flag      = true;
                            arg_140_0 = (num * 3736795090u ^ 2499053439u);
                            continue;
                        }

                        case 5u:
                            arg_140_0 = 1710289446u;
                            continue;
                        }
                        goto Block_8;
                    }
                }
                Block_8 :;
            }
            if (flag)
            {
                goto IL_21A;
            }
            goto IL_2AA;
            uint arg_270_0;

            while (true)
            {
IL_26B:
                uint num;
                switch ((num = (arg_270_0 ^ 899281459u)) % 11u)
                {
                case 0u:
                    goto IL_2B9;

                case 1u:
                    SpellHandler.activeSpell = num2;
                    arg_270_0 = 1254900537u;
                    continue;

                case 2u:
                    ObjectHandler.HandleUpdateObjectValues(ref session2, false);
                    arg_270_0 = (num * 491903829u ^ 962464016u);
                    continue;

                case 3u:
                    session.Character.SetUpdateField <int>(107, 0, 0);
                    ObjectHandler.HandleUpdateObjectValues(ref session2, false);
                    arg_270_0 = (num * 848114486u ^ 2321693018u);
                    continue;

                case 4u:
                    goto IL_21A;

                case 5u:
                    session.Character.SetUpdateField <uint>(107, Manager.WorldMgr.MountDisplays[key], 0);
                    arg_270_0 = (num * 1207556804u ^ 358871447u);
                    continue;

                case 6u:
                    goto IL_2AA;

                case 7u:
                    goto IL_2C0;

                case 8u:
                    arg_270_0 = (((SpellHandler.activeSpell != 0) ? 3488354535u : 2713727219u) ^ num * 1240849208u);
                    continue;

                case 9u:
                    MoveHandler.HandleMoveSetRunSpeed(ref session, 7f);
                    arg_270_0 = (num * 4147973084u ^ 1878138665u);
                    continue;
                }
                break;
            }
            return;

IL_2B9:
            SpellHandler.activeSpell = 0;
            return;

IL_2C0:
            MoveHandler.HandleMoveSetRunSpeed(ref session, 14f);
            return;

IL_21A:
            arg_270_0 = 979607853u;
            goto IL_26B;
IL_2AA:
            SpellHandler.CastSpell(session2, num2, castId);
            arg_270_0 = 1740439945u;
            goto IL_26B;
        }