Exemplo 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);
        }
Exemplo n.º 2
0
        public override void SendInteract(Player Plr, InteractMenu Menu)
        {
            if (IsDead && Loots != null)
            {
                Loots.SendInteract(Plr, Menu);
                if (!Loots.IsLootable())
                {
                    SetLootable(false, Plr);
                }
            }

            base.SendInteract(Plr, Menu);
        }
Exemplo n.º 3
0
        // For quests which require you to loot GameObjects this will update any objects
        // around you and make them lootable if they have items you need for a quest.
        // Notes: We could minimise the amount of SendMeTo's by checking if object are already
        // flagged and unflag them or unflagged and need flagging. However it isnt possible
        // to see if its already been flagged at the moment.
        public void updateObjects()
        {
            GameObject GameObject;

            foreach (Object Obj in _Owner._ObjectRanged)
            {
                if (Obj.IsGameObject())
                {
                    GameObject = Obj.GetGameObject();
                    Loot Loots = LootsMgr.GenerateLoot(GameObject, _Owner.GetPlayer());
                    if (Loots != null && Loots.IsLootable())
                    {
                        GameObject.SendMeTo(_Owner.GetPlayer());
                    }
                }
            }
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public override void SendInteract(Player Plr, InteractMenu Menu)
        {
            Tok_Info Info = WorldMgr.GetTok(Spawn.Proto.TokUnlock);

            if (!IsDead)
            {
                Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_USE_GO, Spawn.Entry, 1);
            }

            if (Spawn.Proto.TokUnlock != 0)
            {
                Plr.TokInterface.AddTok(Info);
            }

            Loot Loots = LootsMgr.GenerateLoot(this, Plr);

            if (Loots != null)
            {
                Loots.SendInteract(Plr, Menu);
                // If object has been looted, make it unlootable
                // and then Reset its lootable staus in XX seconds
                if (!Loots.IsLootable())
                {
                    Looted = true;
                    foreach (Object Obj in this._ObjectRanged)
                    {
                        if (Obj.IsPlayer())
                        {
                            this.SendMeTo(Obj.GetPlayer());
                        }
                    }
                    EvtInterface.AddEvent(ResetLoot, RELOOTABLE_TIME, 1);
                }
            }

            base.SendInteract(Plr, Menu);
        }
Exemplo n.º 6
0
        public override void SendInteract(Player Plr, InteractMenu Menu)

        {
            Log.Success("SendInteract", "" + Name + " -> " + Plr.Name + ",Type=" + InteractType);


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

            Out.WriteByte(0);                    // 00
            Out.WriteByte(1);                    // 01
            Out.WriteByte(1);                    // 01
            Out.WriteByte(5);                    // 05
            Out.WriteUInt16(0);                  //00 00
            Out.WriteUInt16(Spawn.GameObjTimer); // 13 88 =5000
            Out.WriteUInt16(Oid);
            Out.WriteUInt16(0);
            Plr.SendPacket(Out);


            if (Spawn.GameObjTimer == 0)

            {
                Out = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER);
                Out.WriteByte(0);   // 00
                Out.WriteByte(1);   // 01
                Out.WriteByte(1);   // 01
                Out.WriteUInt16(0); //00 00
                Out.WriteUInt16(0); // 13 88
                Out.WriteUInt16(0);
                Out.WriteUInt16(0);
                Out.WriteByte(0);

                Plr.SendPacket(Out);
            }


            Out = new PacketOut((byte)Opcodes.F_PLAY_EFFECT);
            Out.WriteUInt16((UInt16)0x0144);
            Out.WriteByte(0);// 00
            Out.WriteUInt16((UInt16)Spawn.WorldZ);
            Out.WriteUInt32((UInt32)Spawn.WorldX);
            Out.WriteUInt32((UInt32)Spawn.WorldY);
            Out.WriteUInt16(0x0017);// 00 17
            Out.Fill(0, 5);
            Plr.SendPacket(Out);



            Tok_Info Info = WorldMgr.GetTok(Spawn.Proto.TokUnlock);

            if (!IsDead)
            {
                Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_USE_GO, Spawn.Entry, 1);
            }

            if (Spawn.Proto.TokUnlock != 0)
            {
                Plr.TokInterface.AddTok(Info);
            }

            Loot Loots = LootsMgr.GenerateLoot(this, Plr);

            if (Loots != null)
            {
                Loots.SendInteract(Plr, Menu);
                // If object has been looted, make it unlootable
                // and then Reset its lootable staus in XX seconds
                if (!Loots.IsLootable())
                {
                    Looted = true;
                    foreach (Object Obj in this._ObjectRanged)
                    {
                        if (Obj.IsPlayer())
                        {
                            this.SendMeTo(Obj.GetPlayer());
                        }
                    }
                    EvtInterface.AddEvent(ResetLoot, RELOOTABLE_TIME, 1);
                }
            }



            if (Spawn.DoorId != 0)
            {
                if (DoorOpen)
                {
                    CloseDoor();
                }
                else
                {
                    OpenDoor();
                }
            }



            base.SendInteract(Plr, Menu);
        }