Ejemplo n.º 1
0
        private static void ParseCreatureSpeak(InputMessage input)
        {
            //input.getU32();
            input.getString();

            byte type = input.getByte();

            switch (type)
            {
            case 1:
            case 2:
            case 3:
            case 0x10:
            case 0x11:
                input.getLocation();
                break;

            case 5:
            case 0xA:
            case 0xE:
            case 0xC:
                input.getU16();
                break;

            case 6:
                input.getU16();
                break;

            default:
                break;
            }

            input.getString();
        }
Ejemplo n.º 2
0
 private static void ParseTextWindow(InputMessage input)
 {
     input.getU32();
     input.getU16();
     input.getU16();
     input.getString();
 }
Ejemplo n.º 3
0
        private static void ParseTradeItemRequest(InputMessage input)
        {
            input.getString();
            byte tradeItemsSize = input.getByte();

            for (int index = 0; index < tradeItemsSize; index++)
            {
                GetThing(input);
            }
        }
Ejemplo n.º 4
0
        private static void ParseChannelsDialog(InputMessage input)
        {
            byte channelsSize = input.getByte();

            for (int index = 0; index < channelsSize; index++)
            {
                input.getU16();
                input.getString();
            }
        }
Ejemplo n.º 5
0
        private static void ParseContainer(InputMessage input)
        {
            input.getByte();
            input.getU16();
            input.getString();
            input.getByte();
            input.getByte();
            byte containerSize = input.getByte();

            for (int index = 0; index < containerSize; index++)
            {
                GetThing(input);
            }
        }
Ejemplo n.º 6
0
        private static Thing GetThing(InputMessage message)
        {
            //get thing type
            var thingId = message.getU16();

            if (thingId == 0x0061 || thingId == 0x0062)
            {
                //Console.WriteLine("Creature baby.");
                //creatures
                Creature creature = null;
                if (thingId == 0x0062)
                {
                    uint creatureId = message.getU32();
                    creature = new Creature(creatureId);
                    if (creature == null)
                    {
                        throw new Exception("[GetThing] (0x0062) Can't find the creature.");
                    }

                    byte creatureHealth = message.getByte();
                    //Console.WriteLine("Creature with id: " + creatureId + " Life: " + creatureHealth);
                }
                else if (thingId == 0x0061)     //creature is not known
                {
                    uint creatureId = message.getU32();
                    //Console.WriteLine("Removing creature: " + creatureId);
                    uint creatureIdNew = message.getU32();
                    creature        = new Creature(creatureIdNew);
                    creature.Name   = message.getString();
                    creature.Health = message.getByte();
                }

                var direction = (Direction)message.getByte();
                creature.LookDirection = direction;
                creature.TurnDirection = direction;

                creature.Outfit     = message.getOutfit();
                creature.LightLevel = message.getByte();
                creature.LightColor = message.getByte();
                creature.Speed      = message.getU16();
                creature.Skull      = message.getByte();
                creature.Shield     = message.getByte();

                return(creature);
            }
            else if (thingId == 0x0063)
            {
                uint     creatureId = message.getU32();
                Creature creature   = new Creature(creatureId);
                if (creature == null)
                {
                    throw new Exception("[GetThing] (0x0063)  Can't find the creature in the battle list.");
                }

                creature.TurnDirection = (Direction)message.getByte();

                return(creature);
            }
            else
            {
                return(GetItem(message, thingId));
            }
        }
Ejemplo n.º 7
0
 private static void ParseVIP(InputMessage input)
 {
     input.getU32();
     input.getString();
     input.getByte();
 }
Ejemplo n.º 8
0
 private static void ParseTextMessage(InputMessage input)
 {
     input.getByte();
     input.getString();
 }
Ejemplo n.º 9
0
 private static void ParseAnimatedText(InputMessage input)
 {
     input.getLocation();
     input.getByte();
     input.getString();
 }
Ejemplo n.º 10
0
 private static void ParseOpenPrivateChannel(InputMessage input)
 {
     input.getString();
 }
Ejemplo n.º 11
0
 private static void ParseChannel(InputMessage input)
 {
     input.getU16();
     input.getString();
 }
Ejemplo n.º 12
0
 private static void ParseHouseWindow(InputMessage input)
 {
     input.getByte();
     input.getU32();
     input.getString();
 }
Ejemplo n.º 13
0
 private static void ParsesRuleViolationCancel(InputMessage input)
 {
     input.getString();
 }
Ejemplo n.º 14
0
 private static void ParseRemoveReport(InputMessage input)
 {
     input.getString();
 }
Ejemplo n.º 15
0
 private static void ParseWaitList(InputMessage input)
 {
     input.getString();
     input.getByte();
 }
Ejemplo n.º 16
0
 private static void ParseDisconnectClient(InputMessage input)
 {
     input.getString();
 }