Ejemplo n.º 1
0
        public void SendFlagInfo(Player plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_INFO);

            Out.WriteUInt32((uint)ObjectiveID);
            Out.WriteByte(0);
            Out.WriteByte((byte)OwningRealm);
            Out.WriteByte(1);
            Out.WriteUInt16(0);
            Out.WritePascalString(ObjectiveName);
            Out.WriteByte(2);
            Out.WriteUInt32(0x0000348F);
            Out.WriteUInt32(0x0000FF00);

            if (OwningRealm == 0)
            {
                Out.WritePascalString("Capturing");
            }
            else if ((int)plr.Realm == OwningRealm)
            {
                Out.WritePascalString("Defend");
            }
            else
            {
                Out.WritePascalString("Attack");
            }

            Out.WriteByte(0);
            Out.WritePascalString(""); // Tooltip text
            Out.Fill(0, 12);
            Out.WriteUInt16(0x3101);
            Out.Fill(0, 3);
            plr.SendPacket(Out);
        }
Ejemplo n.º 2
0
Archivo: Player.cs Proyecto: uvbs/DoR
        public void SendInited()
        {
            PacketOut Out = new PacketOut((byte)Opcodes.S_PLAYER_INITTED);

            Out.WriteUInt16(_ObjectId);
            Out.WriteUInt16(0);
            Out.WriteUInt32((uint)_Info.CharacterId);
            Out.WriteUInt16((ushort)_Value.WorldZ);
            Out.WriteUInt16(0);
            Out.WriteUInt32((uint)_Value.WorldX);
            Out.WriteUInt32((uint)_Value.WorldY);
            Out.WriteUInt16((ushort)_Value.WorldO);
            Out.WriteByte(0);
            Out.WriteByte((byte)Realm);

            Out.WriteUInt16(0); //(ushort)(Zone.Region.RegionId < 18 ? 0 : 1));
            Out.WriteUInt16(0); //(ushort)(Zone.Region.RegionId < 18 ? 0 : 57)); // some kind of bitwise flag?


            Out.WriteUInt16((ushort)Zone.Info.Region); // 01 04
            Out.WriteUInt16((ushort)1);                // instance id // 1D 57
            Out.WriteByte(0);
            Out.WriteByte(_Info.Career);
            Out.Fill(0, 6);
            Out.WritePascalString(Program.Rm.Name);
            Out.Fill(0, 3);
            SendPacket(Out);
        }
Ejemplo n.º 3
0
        private void WritePostRolls(PacketOut Out)
        {
            int maxCount = Math.Min(24, _postRoll.Count);

            for (int i = 0; i < maxCount; i++)
            {
                ContributionInfo curRoll = _postRoll[i].Value;

                Out.WriteStringBytes(curRoll.PlayerName);
                Out.Fill(0, 24 - curRoll.PlayerName.Length);
                Out.Fill(0, 2);
                Out.WriteUInt16R((ushort)curRoll.RandomBonus);
                Out.WriteUInt16R((ushort)curRoll.ContributionBonus);
                Out.WriteUInt16R((ushort)curRoll.PersistenceBonus);
                Out.WriteByte(1);              // ???
                Out.WriteByte(curRoll.BagWon); // bag won
            }

            if (maxCount < 24)
            {
                for (int i = maxCount; i < 24; i++)
                {
                    Out.Fill(0, 34);  // i just send empty once here
                }
            }
        }
Ejemplo n.º 4
0
        public void SendInited()
        {
            PacketOut Out = new PacketOut((byte)Opcodes.S_PLAYER_INITTED);

            Out.WriteUInt16(_ObjectId);
            Out.WriteUInt16(0);
            Out.WriteUInt32((uint)_Info.CharacterId);
            Out.WriteUInt16((ushort)_Value.WorldZ);
            Out.WriteUInt16(0);
            Out.WriteUInt32((uint)_Value.WorldX);
            Out.WriteUInt32((uint)_Value.WorldY);
            Out.WriteUInt16((ushort)_Value.WorldO);
            Out.WriteByte(0);
            Out.WriteByte((byte)Realm);
            Out.Fill(0, 5); // ??
            Out.WriteByte((byte)Zone.Info.Region);
            Out.WriteUInt16(1);
            Out.WriteByte(0);
            Out.WriteByte(_Info.Career);
            Out.Fill(0, 6);
            Out.WritePascalString(Program.Rm.Name);
            Out.Fill(0, 3);
            SendPacket(Out);


            /*  PacketOut Out = new PacketOut((byte)Opcodes.S_PLAYER_INITTED);
             * Out.WriteHexStringBytes("00CA00000028D5BF1D7F0000000CF824000CAFC7051700020000000000080001001A000000000000084261646C616E6473000000");
             * SendPacket(Out);
             */
        }
        public void DispatchUpdateState(byte stateID, ushort val1)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(stateID);
            Out.Fill(0, 3);
            Out.WriteUInt16(val1);
            Out.Fill(0, 2);
            DispatchPacket(Out, true);
        }
Ejemplo n.º 6
0
        public void SendFlagState(Player plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_STATE, 16);

            Out.WriteUInt32((uint)ObjectiveID);
            Out.Fill(0xFF, 6);
            Out.WriteUInt16(0);
            Out.WriteByte((byte)OwningRealm);
            Out.Fill(0, 3); // 2nd byte can be meaningful!
            plr.SendPacket(Out);
        }
Ejemplo n.º 7
0
        public void SendSwitchRegion(UInt16 ZoneID)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_SWITCH_REGION);

            Out.WriteUInt16(ZoneID);
            Out.Fill(0, 5);
            Out.WriteByte(1);
            Out.WriteByte(1);
            Out.Fill(0, 11);
            SendPacket(Out);
        }
Ejemplo n.º 8
0
        public void CancelPendingCast()
        {
            // Failed attempt to break a channel
            if (AbInfo != null)
            {
                return;
            }

            if (_pendingInfo.ConstantInfo.ChannelID != 0)
            {
                PacketOut Out = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER, 12);
                Out.WriteUInt16(_pendingInfo.Entry);
                Out.Fill(0, 4);
                Out.WriteUInt16(0);
                Out.Fill(0, 4);
                if (_caster is Pet)
                {
                    ((Pet)_caster).Owner.SendPacket(Out);
                }
                else if (_caster is Player)
                {
                    ((Player)_caster).SendPacket(Out);
                }
            }

            if (_pendingInfo.SpecialCost < 0)
            {
                Player plr = _caster as Player;

                if (plr != null)
                {
                    PacketOut Out = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER, 12);
                    Out.WriteUInt16(0);
                    Out.WriteUInt16(0x200); // Morale timer
                    Out.WriteUInt32(0);     // cooldown
                    Out.WriteUInt32(0);
                    plr.SendPacket(Out);
                }
            }

            AbInfo        = _pendingInfo;
            _castSequence = _pendingCastSequence;

            CancelCast(0);

            AbInfo        = null;
            _castSequence = 0;

            _pendingInfo = null;
            _pendingItemCooldownGroup = 0;
            _pendingCastSequence      = 0;
        }
Ejemplo n.º 9
0
        public void SendObjectiveState(Player plr, bool announce = false)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_STATE);

            Out.WriteUInt32(ObjectiveID);
            Out.Fill(0xFF, 6);
            Out.WriteUInt16(0);
            Out.WriteByte((byte)OwningRealm);
            Out.Fill(0, 2);
            Out.WriteByte(0);

            plr.SendPacket(Out);
        }
Ejemplo n.º 10
0
 public override void SendObjectiveStates(Player plr)
 {
     foreach (ProximityFlag flag in Flags)
     {
         PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_STATE, 16);
         Out.WriteUInt32((uint)flag.ObjectiveID);
         Out.Fill(0xFF, 6);
         Out.WriteUInt16(0);
         Out.WriteByte((byte)flag.OwningRealm);
         Out.Fill(0, 3);
         plr.SendPacket(Out);
     }
 }
Ejemplo n.º 11
0
        public void Update()
        {
            Log.Debug("Group", "Updating Group");

            if (Leader == null || Members.Count < 1 || (Members.Count == 1 && Leader == Members.First()))
            {
                Delete();
                return;
            }

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

            Out.WriteUInt16(0x0602); // Group info
            Out.WriteUInt16(0xB536); // Group id
            Out.WriteByte((byte)Members.Count);
            foreach (Player Plr in Members)
            {
                Out.WriteUInt32(0xA8BF3B0C);
                Out.WriteByte((byte)Plr._Info.ModelId);
                Out.WriteByte((byte)Plr._Info.Race);
                Out.WriteByte((byte)Plr.Level);
                Out.WriteUInt16((ushort)Plr._Info.CareerLine);
                Out.WriteByte(1);
                Out.WriteByte(0); // Will be 1 for at least one member. Perhaps Leader?
                Out.WriteByte(0);
                Out.WriteByte(1); // Online = 1, Offline = 0
                Out.WriteByte((byte)Plr.Name.Length);
                Out.Fill(0, 3);
                Out.WriteStringBytes(Plr.Name);
                Out.WriteByte(0); // Name length. Pet? Target?
                Out.Fill(0, 3);
                //Out.WriteStringBytes(Pet name? Target?);

                Out.WriteByte(0x8B);
                Out.WriteUInt16R((ushort)650); // X ?
                Out.WriteByte(0xD3);
                Out.WriteUInt16R((ushort)650); // y ?
                byte[] data = { 0xC8, 0x50, 0x27, 0x25, 0x05, 0x40, 0x01, 0x02 };
                Out.Write(data);

                Out.WriteByte((byte)(Plr._Value.ZoneId * 2));
                Out.WriteByte(1);
                Out.WriteByte(1);

                Out.WriteByte((byte)Plr.PctHealth);
                Out.WriteByte((byte)Plr.PctAp); // action points
                Out.WriteByte(0);
            }

            SendToGroup(Out);
        }
        public void SendFlagInfo(Player plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_INFO);

            Out.WriteUInt32((uint)ObjectiveID);
            Out.WriteByte(0);
            Out.WriteByte((byte)Owner);
            Out.WriteByte(1);
            Out.WriteUInt16(0);
            Out.WritePascalString(ObjectiveName);
            Out.WriteByte(2);
            Out.WriteUInt32(0x0000348F);
            Out.WriteUInt32(0x0000FF00);

            if ((int)plr.Realm == HoldOwner)
            {
                Out.WritePascalString("Maintain control of " + ObjectiveName);
            }
            else
            {
                Out.WritePascalString("Interact with the flag to capture " + ObjectiveName + "!");
            }

            Out.WriteByte(0);

            if ((int)plr.Realm == HoldOwner)
            {
                Out.WritePascalString("Your realm controls " + ObjectiveName + ".");
            }
            else
            {
                Out.WritePascalString("Fight for control of " + ObjectiveName + "!");
            }

            if (HoldStartTime > 0)
            {
                Out.WriteUInt32(60); //total
                var remaining = 60 - ((TCPManager.GetTimeStampMS() - HoldStartTime) / 1000);
                Out.WriteUInt32((byte)remaining);
            }
            else
            {
                Out.WriteUInt32(0);
                Out.WriteUInt32(0);
            }

            Out.Fill(0, 4);
            Out.WriteUInt16(0x3101);
            Out.Fill(0, 3);
            plr.SendPacket(Out);
        }
        public void SendPlotInfo()
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_GET_CULTIVATION_INFO);

            Out.WriteByte(_index);
            Out.WriteByte((byte)_ownerInterface.GetPlotCount());
            Out.WriteByte(_stage);
            Out.WriteByte(0);
            Out.WriteUInt32(_currentStageTime);
            Out.WriteUInt32((uint)(_stage3Time + _stage2Time + _currentStageTime));

            if (_seedItemID == 0)
            {
                Out.WriteByte(0);
            }
            else
            {
                Item.BuildItem(ref Out, null, ItemService.GetItem_Info(_seedItemID), null, 0, 0);
            }

            if (_soilItemID == 0)
            {
                Out.Fill(0, 5);
            }
            else
            {
                Item.BuildItem(ref Out, null, ItemService.GetItem_Info(_soilItemID), null, 0, 0);
            }

            if (_waterItemID == 0)
            {
                Out.Fill(0, 5);
            }
            else
            {
                Item.BuildItem(ref Out, null, ItemService.GetItem_Info(_waterItemID), null, 0, 0);
            }

            if (_nutrientItemID == 0)
            {
                Out.Fill(0, 5);
            }
            else
            {
                Item.BuildItem(ref Out, null, ItemService.GetItem_Info(_nutrientItemID), null, 0, 0);
            }

            Out.Fill(0, 7);

            _ownerInterface.GetPlayer().SendPacket(Out);
        }
Ejemplo n.º 14
0
Archivo: Player.cs Proyecto: uvbs/DoR
        public override void SendMeTo(Player Plr)
        {
            if (Plr == null || Plr.IsDisposed || Plr.Client == null)
            {
                return;
            }

            if (IsDisposed || Client == null)
            {
                return;
            }

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

            Out.WriteUInt16((UInt16)_Client.Id);
            Out.WriteUInt16(Oid);
            Out.WriteUInt16(_Info.ModelId);
            Out.WriteUInt16(_Info.CareerLine);
            Out.WriteUInt16((UInt16)Z);
            Out.WriteUInt16(Zone.ZoneId);

            Out.WriteUInt16((UInt16)X);
            Out.WriteUInt16((UInt16)Y);
            Out.WriteUInt16(Heading);

            Out.WriteByte(0);            // Level
            Out.WriteByte(_Value.Level); // Level

            Out.WriteByte(0x2B);
            Out.WriteByte((byte)(Faction + (IsDead ? 1 : 0))); // Faction
            Out.WriteByte(0);
            Out.WriteByte(0);                                  // ?

            Out.Write(_Info.bTraits, 0, _Info.bTraits.Length);
            Out.Fill(0, 12);

            Out.WriteByte(_Info.Race);
            Out.WriteByte(0); //sometimes 1
            Out.WriteByte(0); // health/ap?
            Out.WriteByte(PctHealth);
            Out.Fill(0, 8);

            Out.WritePascalString(_Info.Name);
            Out.WritePascalString(""); // suffix. title?
            Out.WritePascalString(""); // guild name
            Out.Fill(0, 4);

            Plr.SendPacket(Out);
            base.SendMeTo(Plr);
        }
Ejemplo n.º 15
0
        protected override void SendCreateMonster(Player plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_MONSTER);

            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(0);    // Speed Z
            // 18
            Out.WriteUInt16(1578); //1578    1583???

            Out.WriteByte(50);
            Out.WriteByte(Owner.GldInterface.Guild.Info.Level);
            if (RealmStandard == Realms.REALMS_REALM_DESTRUCTION)
            {
                Out.WriteByte(128);
            }
            else
            {
                Out.WriteByte(64);
            }
            Out.Fill(0, 6);
            Out.WriteUInt16(9);
            Out.Fill(0, 13);

            Out.WriteByte(0x02);
            Out.WriteByte(0x17);
            Out.WriteByte(0x19);
            Out.WriteByte(0x01);

            Owner.GldInterface.Guild.BuildHeraldry(Out);
            Log.Info("", "" + Owner.GldInterface.Guild.GetBannerPost(Bannertyp));
            Out.WriteByte(Owner.GldInterface.Guild.GetBannerPost(Bannertyp));
            //Out.WriteByte(0x01);
            Out.WriteByte(0x02);


            Out.WriteStringBytes(Name);

            Out.WriteHexStringBytes("000000100303010A0000001205002905CAA286BB2910640005040000100343002905000000");


            plr.SendPacket(Out);
        }
Ejemplo n.º 16
0
        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.Proto.GetUnk(0));
            Out.WriteUInt16(Spawn.Proto.GetUnk(1));
            Out.WriteUInt16(Spawn.Proto.GetUnk(2));
            Out.WriteByte(0);
            Out.WriteUInt16(Spawn.Proto.GetUnk(3));
            Out.Fill(0, 5);
            Out.WriteUInt16(Spawn.Proto.GetUnk(4));
            Out.WriteUInt16(Spawn.Proto.GetUnk(5));

            Out.WriteUInt32(0);

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

            Plr.SendPacket(Out);

            base.SendMeTo(Plr);
        }
        private void SalvageDroppedOff(Player plr, Part part)
        {
            for (int i = 0; i < 2; ++i)
            {
                foreach (Player player in Players[i])
                {
                    PacketOut Out = new PacketOut((byte)Opcodes.F_LOCALIZED_STRING, 64);

                    Out.WriteUInt16((ushort)256);

                    Out.WriteUInt16(0);
                    Out.WriteUInt16((ushort)Localized_text.TEXT_FLAG_CAPTURE);
                    Out.WriteUInt16(0);
                    Out.WriteUInt16(0x0003);
                    Out.WriteUInt16(0x0100);


                    byte[] bytes = Encoding.GetEncoding("iso-8859-1").GetBytes(plr.Name);
                    Out.WriteByte((byte)(bytes.Length + 1));
                    Out.Write(bytes, 0, bytes.Length);


                    Out.Fill(0, 5);
                    if (plr.Realm == Realms.REALMS_REALM_DESTRUCTION)
                    {
                        Out.WriteByte(0x9C);
                    }
                    else
                    {
                        Out.WriteByte(0x9B);
                    }

                    Out.WriteUInt32(0);
                    Out.WriteUInt16(0x0100);

                    bytes = Encoding.GetEncoding("iso-8859-1").GetBytes("Salvage Part");
                    Out.WriteByte((byte)(bytes.Length + 1));
                    Out.Write(bytes, 0, bytes.Length);


                    Out.WriteByte(0);

                    player.SendPacket(Out);

                    SendObjectiveStates(player);
                }
            }
            ResetPart();
            GivePoints((plr.Realm == Realms.REALMS_REALM_ORDER ? 1 : 2), 75);
            //rewarding the player turning in the salvage so it gets more focused on objectives
            plr.AddRenown(70, true);
            if (plr.Realm == Realms.REALMS_REALM_ORDER)
            {
                _orderCart.PlayEffect(1136, new Point3D(_orderCart.Spawn.WorldX, _orderCart.Spawn.WorldY, _orderCart.Spawn.WorldZ + 50));
            }
            else
            {
                _destroCart.PlayEffect(1136, new Point3D(_destroCart.Spawn.WorldX, _destroCart.Spawn.WorldY, _destroCart.Spawn.WorldZ + 50));
            }
        }
Ejemplo n.º 18
0
        public void SendStartCasting(ushort TargetOID)
        {
            PacketOut Out1 = new PacketOut((byte)Opcodes.F_UPDATE_STATE);

            Out1.WriteUInt16(TargetOID);
            Out1.WriteByte(0x1A);
            Out1.Fill(0, 7);
            Caster.DispatchPacket(Out1, true);

            if (Info.CastTime == 0)
            {
                return;
            }

            PacketOut Out2 = new PacketOut((byte)Opcodes.F_USE_ABILITY);

            Out2.WriteUInt16(0);
            Out2.WriteUInt16(Info.Entry);
            Out2.WriteUInt16(Caster.Oid);
            Out2.WriteByte(0x06);
            Out2.WriteByte(0x10);
            Out2.WriteUInt16(0x2273);
            Out2.WriteUInt32(0x1010000);
            Out2.WriteUInt16((ushort)this.Info.CastTime);
            Out2.WriteByte(1);
            Out2.Fill(0, 3);
            Caster.GetPlayer().DispatchPacket(Out2, true);
        }
Ejemplo n.º 19
0
        public void SendAbilityDone(ushort TargetOID)
        {
            Log.Success("Ability", "Send Done :" + Info.Entry);

            Player    player = this.Caster.GetPlayer();
            PacketOut Out1   = new PacketOut((byte)Opcodes.F_USE_ABILITY);

            Out1.WriteUInt16(0);
            Out1.WriteUInt16(Info.Entry);
            Out1.WriteUInt16(Caster.Oid);
            Out1.WriteHexStringBytes("061022730601000001E601000000");
            player.DispatchPacket(Out1, true);

            PacketOut Out2 = new PacketOut((byte)Opcodes.F_USE_ABILITY);

            Out2.WriteUInt16(0);
            Out2.WriteUInt16(Info.Entry);
            Out2.WriteUInt16(Caster.Oid);
            Out2.WriteHexStringBytes("0610227302010000000001000000");
            player.DispatchPacket(Out2, true);

            PacketOut Out3 = new PacketOut((byte)Opcodes.F_SWITCH_ATTACK_MODE);

            Out3.WriteByte(1);
            Out3.Fill(0, 3);
            player.SendPacket(Out3);

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

            Out4.WriteUInt16(Info.Entry);
            Out4.Fill(0, 10);
            player.SendPacket(Out4);
        }
Ejemplo n.º 20
0
        public void SendKeepStatus(Player plr, BattleFrontKeep keep)
        {
            if (keep.Region == null)
            {
                return;
            }

            //var doors = keep.Doors.FindAll(x =>
            //    x.Info.Number != (int) KeepDoorType.None && x.Info.GameObjectId == 100 && x.GameObject.PctHealth > 0);

            var doors = keep.Doors.FindAll(x => x.Info.GameObjectId == 100);

            var innerDoor = keep.Doors.SingleOrDefault(x => x.Info.Number == (int)KeepDoorType.InnerMain);

            var Out = new PacketOut((byte)Opcodes.F_KEEP_STATUS, 26);

            Out.WriteByte(keep.Info.KeepId);
            {
                Out.WriteByte(keep.KeepStatus == KeepStatus.KEEPSTATUS_LOCKED ? (byte)1 : (byte)keep.KeepStatus);
                Out.WriteByte(0); // ?
                Out.WriteByte((byte)keep.Realm);
                Out.WriteByte((byte)doors.Count);
                Out.WriteByte(keep.Rank); // Rank
                if (doors.Count > 0)
                {
                    if (innerDoor != null)
                    {
                        Out.WriteByte((byte)((innerDoor.GameObject.PctHealth))); // Door health
                    }
                    else
                    {
                        Out.WriteByte(0);
                    }
                }
                else
                {
                    Out.WriteByte(0);
                }
                Out.WriteByte(0); // Next rank %
            }

            Out.Fill(0, 18);

            if (plr != null)
            {
                plr.SendPacket(Out);
            }
            else
            {
                lock (Player._Players)
                {
                    foreach (var player in Player._Players)
                    {
                        player.SendCopy(Out);
                    }
                }
            }

            _logger.Trace($"F_KEEP_STATUS {keep.Info.Name} Status : {keep.KeepStatus} ");
        }
Ejemplo n.º 21
0
        public void SendMessage(UInt16 Oid, string NameSender, string Text, SystemData.ChatLogFilters Filter)
        {
            if (Text.IndexOf("<LINK") >= 0 && Text.IndexOf("ITEM:") > 0)
            {
                int       Pos     = Text.IndexOf("ITEM:") + 5;
                int       LastPos = Text.IndexOf(" ", Pos) - 1;
                string    Value   = Text.Substring(Pos, LastPos - Pos);
                uint      ItemId  = uint.Parse(Value);
                Item_Info Info    = WorldMgr.GetItem_Info(ItemId);
                if (Info != null)
                {
                }
            }

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

            Out.WriteUInt16(Oid);
            Out.WriteByte((byte)Filter);
            Out.Fill(0, 4);
            Out.WritePascalString(NameSender);
            Out.WriteByte(0);
            Out.WritePascalString(Text);
            Out.WriteByte(0);
            SendPacket(Out);
        }
Ejemplo n.º 22
0
Archivo: Mount.cs Proyecto: uvbs/DoR
        public void SendMount(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_MOUNT_UPDATE);

            Out.WriteUInt16(Owner.Oid);

            if (CurrentMountInfo == null)
            {
                Out.WriteUInt32(0);
            }
            else
            {
                Out.WriteUInt32(CurrentMountInfo.Entry);
            }

            Out.Fill(0, 14);

            if (Plr == null)
            {
                Owner.DispatchPacket(Out, true);
            }
            else
            {
                Plr.SendPacket(Out);
            }
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Temporarily changes players name until server restart.
        /// </summary>
        /// <param name="plr">Player that initiated the command</param>
        /// <param name="values">List of command arguments (after command name)</param>
        /// <returns>True if command was correctly handled, false if operation was canceled</returns>
        public static bool ModifyPlayerNameTemp(Player plr, ref List <string> values)
        {
            string name = null;

            if (values.Count > 0)
            {
                foreach (var t in values)
                {
                    name += t + " ";
                }
            }
            if (name != null)
            {
                name = name.Trim();
            }

            if (plr.CbtInterface.GetCurrentTarget() is Player)
            {
                var player = plr.CbtInterface.GetCurrentTarget().GetPlayer();
                player.Info.TempFirstName = name;

                var Out = new PacketOut((byte)Opcodes.F_REMOVE_PLAYER); //F_PLAYER_INVENTORY
                Out.WriteUInt16(player.Oid);
                Out.WriteUInt16((ushort)plr.CbtInterface.GetCurrentTarget().Oid);
                Out.Fill(0, 18);
                player.DispatchPacket(Out, true);

                foreach (Player p in player.PlayersInRange)
                {
                    player.SendMeTo(p);
                }
            }
            return(true);
        }
Ejemplo n.º 24
0
        static public void F_DUMP_ARENAS_LARGE(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            if (!cclient.HasAccount())
            {
                cclient.Disconnect();
                return;
            }

            byte      CharacterSlot = packet.GetUint8();
            Character Char          = CharMgr.GetAccountChar(cclient._Account.AccountId).GetCharacterBySlot(CharacterSlot);

            if (Char == null)
            {
                Log.Error("F_DUMP_ARENAS_LARGE", "Can not find character on slot : " + CharacterSlot);
                cclient.Disconnect();
                return;
            }

            if (cclient.Plr == null)
            {
                cclient.Plr = Player.CreatePlayer(cclient, Char);
            }

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

            Out.WriteUInt16(0x0608); // TODO
            Out.Fill(0, 20);
            Out.WriteString("38699", 5);
            Out.WriteString("38700", 5);
            Out.WriteString("0.0.0.0", 20);
            cclient.SendTCP(Out);
        }
Ejemplo n.º 25
0
        public void SendAllToks()
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_TOK_ENTRY_UPDATE, 1509);

            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(1500);
            Out.WriteByte(0);
            Out.WriteByte(0);

            byte flags = 0;

            if (Program.Config.DiscoverAll)
            {
                Out.Fill(0xFF, 1500);
            }
            else
            {
                for (ushort i = 0; i < 1500 * 8; i++)
                {
                    if (_tokUnlocks.ContainsKey(i))
                    {
                        flags |= (byte)(1 << ((byte)(i % 8)));
                    }

                    if (i % 8 == 7)
                    {
                        Out.WriteByte(flags);
                        flags = 0;
                    }
                }
            }
            GetPlayer().SendPacket(Out);
        }
Ejemplo n.º 26
0
Archivo: Player.cs Proyecto: uvbs/DoR
        public void SetPVPFlag(bool State)
        {
            if (State == false)
            {
                Faction = (byte)(Realm == GameData.Realms.REALMS_REALM_DESTRUCTION ? 8 : 6);
            }
            else
            {
                Faction = (byte)(Realm == GameData.Realms.REALMS_REALM_DESTRUCTION ? 72 : 68);
            }

            if (_IsActive && IsInWorld() && _Loaded)
            {
                // sends countdown + rvr red icon
                PacketOut Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
                Out.WriteUInt16(_ObjectId); // 0F 0C
                Out.WriteByte(4);           // 04  08
                Out.WriteByte((byte)2);     // 01= white txt 2 = red text
                Out.Fill(0, 7);
                DispatchPacket(Out, true);



                foreach (Player Plr in _PlayerRanged)
                {
                    if (Plr.HasInRange(this))
                    {
                        SendMeTo(Plr);
                    }
                }
            }
        }
        public void CHAR_ITEM_SET_SLOT_MODEL(Client client, ApiPacket packet)
        {
            var charId    = packet.ReadUInt32();
            var slotIndex = packet.ReadUInt16();
            var modelID   = packet.ReadUInt16();

            Player player = null;

            lock (Player._Players)
                player = Player._Players.Where(e => e.CharacterId == charId).FirstOrDefault();
            if (player != null)
            {
                var Out  = new PacketOut(0xAA);
                var item = player.ItmInterface.GetItemInSlot(slotIndex);
                if (item != null)
                {
                    Out.WriteByte(1);
                    Out.Fill(0, 3);
                    Item.BuildItem(ref Out, item, null, null, slotIndex, 0, player);
                    var pos = Out.Position;
                    Out.Position = 14;
                    Out.WriteUInt16(modelID);
                    Out.Position = pos;
                    player.SendPacket(Out);

                    Out = new PacketOut(0xBD); //F_PLAYER_INVENTORY
                    Out.WriteUInt16(player.Oid);
                    Out.WriteUInt16(1);
                    Out.WriteUInt16(slotIndex);
                    Out.WriteUInt16(modelID);
                    Out.WriteByte(0);
                    player.DispatchPacket(Out, false);
                }
            }
        }
Ejemplo n.º 28
0
        public override void NotifyInteractionComplete(NewBuff b)
        {
            if (CapturingPlayer == null || HeldState == EHeldState.Inactive)
            {
                return;
            }

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(0);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            SetHeldState(EHeldState.Carried);

            Holder          = CapturingPlayer;
            CapturingPlayer = null;

            BuffInfo buffInfo = AbilityMgr.GetBuffInfo(BuffId);

            Holder.BuffInterface.QueueBuff(new BuffQueueInfo(Holder, 1, buffInfo, HoldObjectBuff.GetNew, HoldObjectCallback));

            OnPickupAction?.Invoke(this, Holder);
        }
Ejemplo n.º 29
0
        protected virtual void SendWarbandStatus()
        {
            // Leader
            PacketOut Out = new PacketOut((byte)Opcodes.F_GROUP_STATUS, 18);

            Out.Fill(0, 4);
            Out.WriteByte(0x13);
            Out.WriteByte(1);
            Out.WriteVarUInt(Leader.CharacterId);
            Out.WriteByte(0);
            SendToWarband(Out);

            // Group options
            Out = new PacketOut((byte)Opcodes.F_GROUP_STATUS, 20);
            Out.WriteUInt16(Groups[0].GroupId);
            Out.WriteByte(0x01);                             //1
            Out.WriteByte(0x00);                             // Setting FF hides the status of members.
            Out.WriteByte(LootOption);                       // round robin = 0 free for all = 1 master loot = 2
            Out.WriteByte(LootThreshold);                    //1   loottresh
            Out.WriteUInt32(MasterLooter?.CharacterId ?? 0); // Master Looter
            Out.WriteByte(NeedOnUse ? (byte)1 : (byte)0);    // need on use
            Out.WriteByte(RvRAutoLoot ? (byte)1 : (byte)0);  //2  rvr autoloot
            Out.WriteUInt32(MainAssist.CharacterId);
            Out.WriteUInt32(Leader.CharacterId);
            SendToWarband(Out);
        }
Ejemplo n.º 30
0
        public virtual void SendState(Player Plr)
        {
            if (IsPlayer())
            {
                return;
            }

            if (!IsInWorld())
            {
                return;
            }

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

            Out.WriteUInt16(Oid);
            Out.WriteUInt16((ushort)X);
            Out.WriteUInt16((ushort)Y);
            Out.WriteUInt16((ushort)Z);
            Out.WriteByte(PctHealth);
            Out.WriteUInt16(Zone.ZoneId);
            Out.Fill(0, 5);
            Out.WriteUInt16R(Heading);
            if (Plr == null)
            {
                DispatchPacket(Out, false);
            }
            else
            {
                Plr.SendPacket(Out);
            }
        }