/// <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); }
/// <summary> /// Informs about changes in what target is wearing /// </summary> /// <param name="itemHandle"></param> /// <param name="position"></param> /// <param name="targetHandle"></param> /// <param name="enhance"></param> /// <param name="elementalEffectType"></param> internal void ItemWearInfo(Player player, uint itemHandle, short position, uint targetHandle, int enhance, short elementalEffectType) { PacketStream stream = new PacketStream(0x011f); stream.WriteUInt32(itemHandle); stream.WriteInt16(position); stream.WriteUInt32(targetHandle); stream.WriteInt32(enhance); stream.WriteByte((byte)elementalEffectType); ClientManager.Instance.Send(player, stream, BroadcastArea.Self); }
internal void LoginResult(Player player) { PacketStream stream = new PacketStream(0x0004); stream.WriteByte(1); stream.WriteUInt32(player.Handle); stream.WriteSingle(168344f);//player.Position.X); stream.WriteSingle(55400f);//player.Position.Y); stream.WriteSingle(player.Position.Z); stream.WriteByte(1);//player.Position.Layer); stream.WriteSingle(0f); // TODO : face_direction stream.WriteInt32(Globals.RegionSize); stream.WriteInt32(100);//player.Hp); stream.WriteInt16(100);//player.Mp); stream.WriteInt32(100);//player.MaxHp); stream.WriteInt16(100);// player.MaxMp); stream.WriteInt32(player.Havoc); stream.WriteInt32(Globals.MaxHavoc); // TODO : Is this constant? stream.WriteInt32(player.Sex); stream.WriteInt32(player.Race); stream.WriteUInt32(player.SkinColor); stream.WriteInt32(player.FaceId); stream.WriteInt32(player.HairId); stream.WriteString(player.Name, 19); stream.WriteInt32(Globals.CellSize); stream.WriteInt32(player.GuildId); ClientManager.Instance.Send(player, stream, BroadcastArea.Self); }
internal void InventoryList(Player player, List<uint> inventory) { PacketStream stream = new PacketStream(0x00CF); stream.WriteUInt16((ushort)inventory.Count); for (int i = 0; i < inventory.Count; i++) { Item item = (Item) GObjectManager.Instance.Get(ObjectType.Item, inventory[i]); // TS_ITEM_BASE_INFO stream.WriteUInt32(item.Handle); stream.WriteInt32(item.Code); stream.WriteInt64(item.UId); stream.WriteInt64(item.Count); stream.WriteInt32(item.Durability); stream.WriteUInt32(item.Endurance); stream.WriteByte((byte)item.Enhance); stream.WriteByte((byte)item.Level); stream.WriteInt32(item.Flag); stream.WriteInt32(item.Socket[0]); stream.WriteInt32(item.Socket[1]); stream.WriteInt32(item.Socket[2]); stream.WriteInt32(item.Socket[3]); stream.WriteInt32(item.RemainTime); stream.WriteByte((byte)item.ElementalEffectType); stream.WriteInt32(0); // TODO : elemental_effect_remain_time stream.WriteInt32(item.ElementalEffectAttackPoint); stream.WriteInt32(item.ElementalEffectMagicPoint); // TS_ITEM_INFO stream.WriteInt16((short)item.WearInfo); stream.WriteUInt32(0); // TODO : own_summon_handle stream.WriteInt32(i); // TODO : index } ClientManager.Instance.Send(player, stream, BroadcastArea.Self); }