Ejemplo n.º 1
0
        public override void SendMeTo(Player Plr)
        {
            //    Log.Info("GO", "go = " + Name + "  Oid = " + Oid + "  X= " + Spawn.WorldX + "  Y= " + Spawn.WorldY + "  Z= " + Spawn.WorldZ + " DoorId= " + Spawn.DoorId);


            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);

            Out.WriteUInt16(Oid);
            Out.WriteUInt16((byte)(DoorOpen ? 1 : Spawn.DoorOpen));

            Out.WriteUInt16((UInt16)Spawn.WorldO);
            Out.WriteUInt16((UInt16)Spawn.WorldZ);
            Out.WriteUInt32((UInt32)Spawn.WorldX);
            Out.WriteUInt32((UInt32)Spawn.WorldY);
            Out.WriteUInt16((ushort)Spawn.DisplayID);

            Out.WriteUInt16(Spawn.GetUnk(0));
            Out.WriteUInt16(Spawn.GetUnk(1));
            Out.WriteUInt16(Spawn.GetUnk(2));
            Out.WriteByte(Spawn.Unk1);

            int  flags = Spawn.GetUnk(3);
            Loot Loots = LootsMgr.GenerateLoot(this, Plr);

            if ((Loots != null && Loots.IsLootable()) || (Plr.QtsInterface.GetPublicQuest() != null) || Plr.QtsInterface.GameObjectNeeded(Spawn.Entry) || Spawn.DoorId != 0)

            {
                flags = flags | 4;
            }

            Out.WriteUInt16((ushort)flags);
            Out.WriteByte(Spawn.Unk2);
            Out.WriteUInt32(Spawn.Unk3);
            Out.WriteUInt16(Spawn.GetUnk(4));
            Out.WriteUInt16(Spawn.GetUnk(5));
            Out.WriteUInt32(Spawn.Unk4);

            Out.WritePascalString(Name);

            if (Spawn.DoorId != 0)
            {
                Out.WriteByte(0x04);
                Out.WriteUInt32((uint)(Spawn.DoorId));
            }
            else
            {
                Out.WriteByte(0x00);
            }


            Plr.SendPacket(Out);

            base.SendMeTo(Plr);
        }
        public override void SendMeTo(Player plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC, 128);

            Out.WriteUInt16(Oid);
            Out.WriteUInt16(0);

            Out.WriteUInt16(Heading);
            Out.WriteUInt16((ushort)WorldPosition.Z);
            Out.WriteUInt32((uint)WorldPosition.X);
            Out.WriteUInt32((uint)WorldPosition.Y);
            Out.WriteUInt16((ushort)_spawn.DisplayID);

            Out.WriteByte((byte)(_spawn.GetUnk(0) >> 8));

            Out.WriteByte((byte)Realm);

            Out.WriteUInt16(_spawn.GetUnk(1));
            Out.WriteUInt16(_spawn.GetUnk(2));
            Out.WriteByte(_spawn.Unk1);

            int flags = _spawn.GetUnk(3);

            Out.WriteUInt16((ushort)flags);
            Out.WriteByte(_spawn.Unk2);
            Out.WriteUInt32(_spawn.Unk3);
            Out.WriteUInt16(_spawn.GetUnk(4));
            Out.WriteUInt16(_spawn.GetUnk(5));
            Out.WriteUInt32(_spawn.Unk4);

            Out.WritePascalString(Name);

            if (_spawn.DoorId != 0)
            {
                Out.WriteByte(0x04);
                Out.WriteUInt32(_spawn.DoorId);
            }
            else
            {
                Out.WriteByte(0x00);
            }

            plr.SendPacket(Out);

            base.SendMeTo(plr);
        }
Ejemplo n.º 3
0
        /*
         * |00 3D 71
         * 06 90
         * 00 00
         * 00 00
         * 1F E3
         * 00 0C E3 29
         * 00 0E 59 90
         * FF FF
         * 1E 00 00 00 35 F3 00 03 04 00 00
         |00 00 64 8B 76 09 CD 00 00 00 00 0F 45 6D 70 69 |..d.v.......Empi|
         |72 65 20 42 61 72 20 44 6F 6F 72 04 06 AB DD 00 |re Bar Door.....|
         * -------------------------------------------------------------------
         * */

        public override void SendMeTo(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);

            Out.WriteUInt16(Oid);
            Out.WriteUInt16(0);

            Out.WriteUInt16((UInt16)Spawn.WorldO);
            Out.WriteUInt16((UInt16)Spawn.WorldZ);
            Out.WriteUInt32((UInt32)Spawn.WorldX);
            Out.WriteUInt32((UInt32)Spawn.WorldY);
            Out.WriteUInt16((ushort)Spawn.DisplayID);

            Out.WriteUInt16(Spawn.GetUnk(0));
            Out.WriteUInt16(Spawn.GetUnk(1));
            Out.WriteUInt16(Spawn.GetUnk(2));
            Out.WriteByte(Spawn.Unk1);

            int  flags = Spawn.GetUnk(3);
            Loot Loots = LootsMgr.GenerateLoot(this, Plr);

            if (Loots != null && Loots.IsLootable())
            {
                flags = flags | 4;
            }

            Out.WriteUInt16((ushort)flags);
            Out.WriteByte(Spawn.Unk2);
            Out.WriteUInt32(Spawn.Unk3);
            Out.WriteUInt16(Spawn.GetUnk(4));
            Out.WriteUInt16(Spawn.GetUnk(5));
            Out.WriteUInt32(Spawn.Unk4);

            Out.WritePascalString(Name);
            Out.WriteByte(0);

            Plr.SendPacket(Out);

            base.SendMeTo(Plr);
        }
        public override void SendMeTo(Player plr)
        {
            // Log.Info("STATIC", "Creating static oid=" + Oid + " name=" + Name + " x=" + Spawn.WorldX + " y=" + Spawn.WorldY + " z=" + Spawn.WorldZ + " doorID=" + Spawn.DoorId);
            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC, 46 + (Name?.Length ?? 0));

            Out.WriteUInt16(Oid);
            Out.WriteUInt16(VfxState); //ie: red glow, open door, lever pushed, etc

            Out.WriteUInt16((ushort)Spawn.WorldO);
            Out.WriteUInt16((ushort)Spawn.WorldZ);
            Out.WriteUInt32((uint)Spawn.WorldX);
            Out.WriteUInt32((uint)Spawn.WorldY);
            Out.WriteUInt16((ushort)Spawn.DisplayID);

            Out.WriteByte((byte)(Spawn.GetUnk(0) >> 8));

            // Get the database if the value hasnt been changed (currently only used for keep doors)
            if (Realm == GameData.Realms.REALMS_REALM_NEUTRAL)
            {
                Out.WriteByte((byte)(Spawn.GetUnk(0) & 0xFF));
            }
            else
            {
                Out.WriteByte((byte)Realm);
            }

            Out.WriteUInt16(Spawn.GetUnk(1));
            Out.WriteUInt16(Spawn.GetUnk(2));
            Out.WriteByte(Spawn.Unk1);

            int flags = Spawn.GetUnk(3);

            if (Realm != GameData.Realms.REALMS_REALM_NEUTRAL && !IsInvulnerable)
            {
                flags |= 8; // Attackable (stops invalid target errors)
            }
            LootContainer lootsContainer = LootsMgr.GenerateLoot(this, plr, 1);

            if ((lootsContainer != null && lootsContainer.IsLootable()) || ((plr.QtsInterface.PublicQuest != null) && Interactable) || (plr.QtsInterface.GameObjectNeeded(Spawn.Entry) && Interactable) || Spawn.Entry == 188 || Spawn.DoorId != 0)
            {
                flags |= 4; // Interactable
            }

            if (Flags.HasValue)
            {
                Out.WriteUInt16(Flags.Value);
            }
            else
            {
                Out.WriteUInt16((ushort)flags);
            }

            Out.WriteByte(Spawn.Unk2);
            Out.WriteUInt32(Spawn.Unk3);
            Out.WriteUInt16(Spawn.GetUnk(4));
            Out.WriteUInt16(Spawn.GetUnk(5));
            Out.WriteUInt32(Spawn.Unk4);

            Out.WritePascalString(Name);

            if (Spawn.DoorId != 0)
            {
                Out.WriteByte(0x04);

                Out.WriteUInt32(Spawn.DoorId);
            }
            else
            {
                Out.WriteByte(0x00);
            }

            plr.SendPacket(Out);

            base.SendMeTo(plr);
        }