Exemple #1
0
 public virtual void UpdateAttributes(StatUpdateFlags flags)
 {
 }
Exemple #2
0
 public override void UpdateAttributes(StatUpdateFlags flags)
 {
     var x08 = new ServerPacket(0x08);
     x08.WriteByte((byte)flags);
     if (flags.HasFlag(StatUpdateFlags.Primary))
     {
         x08.Write(new byte[] { 1, 0, 0 });
         x08.WriteByte(Level);
         x08.WriteByte(Ability);
         x08.WriteUInt32(MaximumHp);
         x08.WriteUInt32(MaximumMp);
         x08.WriteByte(Str);
         x08.WriteByte(Int);
         x08.WriteByte(Wis);
         x08.WriteByte(Con);
         x08.WriteByte(Dex);
         if (LevelPoints > 0)
         {
             x08.WriteByte(1);
             x08.WriteByte((byte)LevelPoints);
         }
         else
         {
             x08.WriteByte(0);
             x08.WriteByte(0);
         }
         x08.WriteUInt16(MaximumWeight);
         x08.WriteUInt16(VisibleWeight);
         x08.WriteUInt32(uint.MinValue);
     }
     if (flags.HasFlag(StatUpdateFlags.Current))
     {
         x08.WriteUInt32(Hp);
         x08.WriteUInt32(Mp);
     }
     if (flags.HasFlag(StatUpdateFlags.Experience))
     {
         x08.WriteUInt32(Experience);
         x08.WriteUInt32(ExpToLevel);
         x08.WriteUInt32(AbilityExp);
         x08.WriteUInt32(0); // Next AB
         x08.WriteUInt32(0); // "GP"
         x08.WriteUInt32(Gold);
     }
     if (flags.HasFlag(StatUpdateFlags.Secondary))
     {
         x08.WriteUInt32(uint.MinValue);
         x08.WriteUInt16(ushort.MinValue);
         x08.WriteByte((byte)OffensiveElement);
         x08.WriteByte((byte)DefensiveElement);
         x08.WriteSByte(Mr);
         x08.WriteByte(0);
         x08.WriteSByte(Ac);
         x08.WriteByte(Dmg);
         x08.WriteByte(Hit);
     }
     Enqueue(x08);
 }
Exemple #3
0
        public void SendStatistics(StatUpdateFlags flags)
        {
            if (Player.CanWalkThroughWalls || Player.CanWalkThroughUnits)
            {
                flags |= StatUpdateFlags.GameMasterA;
            }
            else
            {
                flags |= StatUpdateFlags.Swimming;
            }

            var p = new ServerPacket(0x08);

            p.WriteByte((byte)flags);
            if ((flags & StatUpdateFlags.Primary) == StatUpdateFlags.Primary)
            {
                p.Write(new byte[] { 1, 0, 0 });
                p.WriteByte((byte)Player.Level);
                p.WriteByte(0x00);
                p.WriteByte((byte)Player.Ability);
                p.WriteUInt32(Player.MaximumHP);
                p.WriteUInt32(Player.MaximumMP);
                p.WriteUInt16(Player.Str);
                p.WriteUInt16(Player.Int);
                p.WriteUInt16(Player.Wis);
                p.WriteUInt16(Player.Con);
                p.WriteUInt16(Player.Dex);
                p.WriteByte(Player.AvailableStatPoints > 0);
                p.WriteByte((byte)Player.AvailableStatPoints);
                p.WriteUInt16((ushort)Player.MaximumWeight);
                p.WriteUInt16((ushort)Player.CurrentWeight);
                p.WriteUInt32(uint.MinValue);
            }
            if ((flags & StatUpdateFlags.Current) == StatUpdateFlags.Current)
            {
                p.WriteUInt32((uint)Player.CurrentHP);
                p.WriteUInt32((uint)Player.CurrentMP);
            }
            if ((flags & StatUpdateFlags.Experience) == StatUpdateFlags.Experience)
            {
                p.WriteUInt32((uint)Player.Experience);
                p.WriteUInt32((uint)(Player.ToNextLevel - Player.Experience));
                p.WriteUInt32((uint)(Player.ToNextLevel - Player.ToThisLevel));
                p.WriteUInt32((uint)Player.AbilityExp);
                p.WriteUInt32((uint)(Player.ToNextAbility - Player.AbilityExp));
                p.WriteUInt32((uint)(Player.ToNextAbility - Player.ToThisAbility));
                p.WriteUInt32((uint)Player.GamePoints);
                p.WriteUInt32((uint)Player.Gold);
            }
            if ((flags & StatUpdateFlags.Secondary) == StatUpdateFlags.Secondary)
            {
                p.WriteUInt32(uint.MinValue);
                p.WriteUInt16(ushort.MinValue);
                p.WriteByte((byte)Player.OffenseElement);
                p.WriteByte((byte)Player.DefenseElement);
                p.WriteByte((byte)(Player.MagicResistance / 10));
                p.WriteByte(byte.MinValue);
                p.WriteSByte(Player.ArmorClass);
                p.WriteSByte(Player.Dmg);
                p.WriteSByte(Player.Hit);
            }
            Enqueue(p);
        }
Exemple #4
0
 public virtual void UpdateStatistics(StatUpdateFlags flags = StatUpdateFlags.Full)
 {
 }
Exemple #5
0
 public virtual void UpdateAttributes(StatUpdateFlags flags)
 {
 }