コード例 #1
0
ファイル: houseface.cs プロジェクト: JVirant/DOLSharp
        public void OnCommand(GameClient client, string[] args)
        {
            int housenumber = 0;

            if (args.Length > 1)
            {
                try
                {
                    housenumber = int.Parse(args[1]);
                }
                catch
                {
                    DisplaySyntax(client);
                    return;
                }
            }
            else
            {
                HouseMgr.GetHouseNumberByPlayer(client.Player);
            }

            if (housenumber == 0)
            {
                DisplayMessage(client, "No house found.");
                return;
            }

            House house = HouseMgr.GetHouse(housenumber);

            ushort direction = client.Player.GetHeading(house.Position);

            client.Player.Heading = direction;
            client.Out.SendPlayerJump(true);
            DisplayMessage(client, "You face house " + housenumber);
        }
コード例 #2
0
        public override void SendUpdatePlayer()
        {
            GamePlayer player = m_gameClient.Player;

            if (player == null)
            {
                return;
            }

            using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.VariousUpdate)))
            {
                pak.WriteByte(0x03);                 //subcode
                pak.WriteByte(0x0e);                 //number of entry
                pak.WriteByte(0x00);                 //subtype
                pak.WriteByte(0x00);                 //unk
                //entry :

                pak.WriteByte(player.GetDisplayLevel(m_gameClient.Player));                 //level
                pak.WritePascalString(player.Name);

                pak.WriteByte((byte)(player.MaxHealth >> 8));                        // maxhealth high byte ?
                pak.WritePascalString(player.CharacterClass.Name);                   // class name
                pak.WriteByte((byte)(player.MaxHealth & 0xFF));                      // maxhealth low byte ?

                pak.WritePascalString(/*"The "+*/ player.CharacterClass.Profession); // Profession

                pak.WriteByte(0x00);                                                 //unk

                pak.WritePascalString(player.CharacterClass.GetTitle(player, player.Level));

                //todo make function to calcule realm rank
                //client.Player.RealmPoints
                //todo i think it s realmpoint percent not realrank
                pak.WriteByte((byte)player.RealmLevel);                                //urealm rank
                pak.WritePascalString(player.RealmRankTitle(player.Client.Account.Language));
                pak.WriteByte((byte)player.RealmSpecialtyPoints);                      // realm skill points

                pak.WritePascalString(player.CharacterClass.BaseName);                 // base class

                pak.WriteByte((byte)(HouseMgr.GetHouseNumberByPlayer(player) >> 8));   // personal house high byte
                pak.WritePascalString(player.GuildName);
                pak.WriteByte((byte)(HouseMgr.GetHouseNumberByPlayer(player) & 0xFF)); // personal house low byte

                pak.WritePascalString(player.LastName);

                pak.WriteByte(0x0);                 // ML Level
                pak.WritePascalString(player.RaceName);

                pak.WriteByte(0x0);
                if (player.GuildRank != null)
                {
                    pak.WritePascalString(player.GuildRank.Title);
                }
                else
                {
                    pak.WritePascalString("");
                }
                pak.WriteByte(0x0);

                AbstractCraftingSkill skill = CraftingMgr.getSkillbyEnum(player.CraftingPrimarySkill);
                if (skill != null)
                {
                    pak.WritePascalString(skill.Name);                     //crafter guilde: alchemist
                }
                else
                {
                    pak.WritePascalString("None");                     //no craft skill at start
                }
                pak.WriteByte(0x0);
                pak.WritePascalString(player.CraftTitle);                 //crafter title: legendary alchemist

                pak.WriteByte(0x0);
                pak.WritePascalString("None");                 //ML title

                // new in 1.75
                pak.WriteByte(0x0);
                string title = "None";
                if (player.CurrentTitle != PlayerTitleMgr.ClearTitle)
                {
                    title = GameServer.ServerRules.GetPlayerTitle(player, player);
                }
                pak.WritePascalString(title);                 // new in 1.74
                SendTCP(pak);
            }
        }