Esempio n. 1
0
        /// <summary>
        /// Sends the list of characters
        /// </summary>
        /// <param name="client"></param>
        /// <param name="charList"></param>
        public void CharacterList(Player client, LobbyCharacterInfo[] charList, ushort lastLoginIndex)
        {
            PacketStream stream = new PacketStream(0x07D4);

            stream.WriteUInt32(0); // currentSvTime
            stream.WriteUInt16(lastLoginIndex);
            stream.WriteUInt16((ushort)charList.Length);
            for (int i = 0; i < charList.Length; i++)
            {
                stream.WriteInt32(charList[i].ModelInfo.Sex);
                stream.WriteInt32(charList[i].ModelInfo.Race);
                for (int j = 0; j < 5; j++)
                    stream.WriteInt32(charList[i].ModelInfo.ModelId[j]);
                stream.WriteInt32(charList[i].ModelInfo.TextureId);
                for (int j = 0; j < 24; j++)
                    stream.WriteInt32(charList[i].ModelInfo.WearInfo[j]);
                stream.WriteInt32(charList[i].Level);
                stream.WriteInt32(charList[i].Job);
                stream.WriteInt32(charList[i].JobLevel);
                stream.WriteInt32(charList[i].ExpPercentage);
                stream.WriteInt32(charList[i].Hp);
                stream.WriteInt32(charList[i].Mp);
                stream.WriteInt32(charList[i].Permission);
                stream.WriteBool(charList[i].IsBanned);
                stream.WriteString(charList[i].Name, 19);
                stream.WriteUInt32(charList[i].SkinColor);
                stream.WriteString(charList[i].CreateTime, 30);
                stream.WriteString(charList[i].DeleteTime, 30);
                for (int j = 0; j < 24; j++)
                    stream.WriteInt32(charList[i].WearItemEnhanceInfo[j]);
                for (int j = 0; j < 24; j++)
                    stream.WriteInt32(charList[i].WearItemLevelInfo[j]);
                for (int j = 0; j < 24; j++)
                    stream.WriteByte(charList[i].WearItemElementalType[j]);
            }

            ClientManager.Instance.Send(client, stream, BroadcastArea.Self);
        }
Esempio n. 2
0
        /// <summary>
        /// Sets a property
        /// </summary>
        /// <param name="player">target player</param>
        /// <param name="name">property name</param>
        /// <param name="value">value</param>
        /// <param name="isInt">send as int?</param>
        internal void Property(Player player, string name, object value, bool isInt)
        {
            PacketStream stream = new PacketStream(0x01FB);

            stream.WriteUInt32(player.Handle);
            stream.WriteBool(isInt);
            stream.WriteString(name, 16);
            if (isInt)
            {
                stream.WriteInt64(Convert.ToInt64(value));
            }
            else
            {
                stream.WriteInt64(0);
                string val = (string)value;
                stream.WriteString(val, val.Length + 1);
            }

            ClientManager.Instance.Send(player, stream, BroadcastArea.Self);
        }
Esempio n. 3
0
        /// <summary>
        /// Updates game object stats and attributes
        /// </summary>
        /// <param name="player">the target</param>
        /// <param name="stat">stats</param>
        /// <param name="attribute">attributes</param>
        /// <param name="isBonus">are these bonus stats (green)</param>
        internal void StatInfo(Player player, CreatureStat stat, CreatureAttribute attribute, bool isBonus)
        {
            PacketStream stream = new PacketStream(0x03E8);

            stream.WriteUInt32(player.Handle);

            // Creature Stat
            stream.WriteInt16(stat.StatId);
            stream.WriteInt16(stat.STR);
            stream.WriteInt16(stat.VIT);
            stream.WriteInt16(stat.DEX);
            stream.WriteInt16(stat.AGI);
            stream.WriteInt16(stat.INT);
            stream.WriteInt16(stat.MEN);
            stream.WriteInt16(stat.LUK);

            // Creature Attributes
            stream.WriteInt16(attribute.Critical);
            stream.WriteInt16(attribute.CriticalPower);
            stream.WriteInt16(attribute.PAttackRight);
            stream.WriteInt16(attribute.PAttackLeft);
            stream.WriteInt16(attribute.Defense);
            stream.WriteInt16(attribute.BlockDefense);
            stream.WriteInt16(attribute.MAttack);
            stream.WriteInt16(attribute.MDefense);
            stream.WriteInt16(attribute.AccuracyRight);
            stream.WriteInt16(attribute.AccuracyLeft);
            stream.WriteInt16(attribute.MagicAccuracy);
            stream.WriteInt16(attribute.Evasion);
            stream.WriteInt16(attribute.MagicEvasion);
            stream.WriteInt16(attribute.BlockChance);
            stream.WriteInt16(attribute.MoveSpeed);
            stream.WriteInt16(attribute.AttackSpeed);
            stream.WriteInt16(attribute.AttackRange);
            stream.WriteInt16(attribute.MaxWeight);
            stream.WriteInt16(attribute.CastingSpeed);
            stream.WriteInt16(attribute.CoolTimeSpeed);
            stream.WriteInt16(attribute.ItemChance);
            stream.WriteInt16(attribute.HPRegenPercentage);
            stream.WriteInt16(attribute.HPRegenPoint);
            stream.WriteInt16(attribute.MPRegenPercentage);
            stream.WriteInt16(attribute.MPRegenPoint);

            stream.WriteBool(isBonus);

            ClientManager.Instance.Send(player, stream, BroadcastArea.Self);
        }
Esempio n. 4
0
        internal void EquipSummon(Player player, SummonData[] summon, bool openDialog)
        {
            PacketStream stream = new PacketStream(0x012F);

            stream.WriteBool(openDialog);
            for (int i = 0; i < 6; i++)
            {
                stream.WriteUInt32(summon[i].CardHandle);
            }

            ClientManager.Instance.Send(player, stream, BroadcastArea.Self);
        }