Ejemplo n.º 1
0
        private void TeleportHandler(WoWReader wr)
        {
            float x, y, z, orient;
            byte  mask = wr.ReadByte();

            WoWGuid guid = new WoWGuid(mask, wr.ReadBytes(WoWGuid.BitCount8(mask)));

            wr.ReadUInt32(); // flags

            wr.ReadUInt32(); // time?
            wr.ReadByte();   // unk 2.3.0

            wr.ReadSingle(); // unk2
            x      = wr.ReadSingle();
            y      = wr.ReadSingle();
            z      = wr.ReadSingle();
            orient = wr.ReadSingle();
            wr.ReadUInt16(); // unk3
            wr.ReadByte();   // unk4
            BoogieCore.Log(LogType.SystemDebug, "Got teleport to: {0} {1} {2} {3}", x, y, z, orient);

            BoogieCore.world.getPlayerObject().SetCoordinates(new Coordinate(x, y, z, orient));

            WoWWriter ww = new WoWWriter(OpCode.MSG_MOVE_TELEPORT_ACK);

            ww.Write(BoogieCore.world.getPlayerObject().GUID.GetOldGuid());
            Send(ww.ToArray());
            SendMoveHeartBeat(BoogieCore.world.getPlayerObject().GetCoordinates());
        }
Ejemplo n.º 2
0
        private void Handle_CreatureQuery(WoWReader wr)
        {
            Entry entry = new Entry();

            entry.entry   = wr.ReadUInt32();
            entry.name    = wr.ReadString();
            entry.blarg   = wr.ReadBytes(3);
            entry.subname = wr.ReadString();
            entry.flags   = wr.ReadUInt32();
            entry.subtype = wr.ReadUInt32();
            entry.family  = wr.ReadUInt32();
            entry.rank    = wr.ReadUInt32();

            BoogieCore.Log(LogType.NeworkComms, "Got CreatureQuery Response - Entry: {0} - Name: {1} - SubName {2}", entry.entry, entry.name, entry.subname);
            if (EntryList.ContainsKey(entry.entry) == false)
            {
                EntryList.Add(entry.entry, entry);
            }

            if (EntryQueue.ContainsKey(entry.entry))
            {
                EntryQueue.Remove(entry.entry);
            }

            foreach (Object obj in BoogieCore.world.getObjectList())
            {
                if (obj.Fields != null)
                {
                    if (obj.Fields[(int)UpdateFields.OBJECT_FIELD_ENTRY] == entry.entry)
                    {
                        if (entry.name.Contains("Auctioneer") && SentHello == false)
                        {
                            WoWWriter ww = new WoWWriter(OpCode.MSG_AUCTION_HELLO);
                            ww.Write(obj.GUID.GetOldGuid());
                            Send(ww.ToArray());
                            BoogieCore.Log(LogType.SystemDebug, "Sent AH Hello!");
                            SentHello = true;
                        }

                        obj.Name    = entry.name;
                        obj.SubName = entry.subname;
                        obj.SubType = entry.subtype;
                        obj.Family  = entry.family;
                        obj.Rank    = entry.rank;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void MovementHandler(WoWReader wr)
        {
            WoWGuid guid;
            byte    mask = wr.ReadByte();

            if (mask == 0x00)
            {
                return;
            }

            guid = new WoWGuid(mask, wr.ReadBytes(WoWGuid.BitCount8(mask)));

            MovementInfo mi = new MovementInfo(wr);

            if (BoogieCore.world.getObject(guid) != null)
            {
                //BoogieCore.Log(LogType.Error, "Updating coordinates for object {0}, x={1} y={2} z={3}", BoogieCore.world.getObject(guid).Name, mi.x, mi.y, mi.z);
                BoogieCore.world.getObject(guid).SetCoordinates(mi.GetCoordinates());
            }
        }