public void serialize(Utils.Objects.Packet sender)
 {
     sender.WriteShort((short)Base);
     sender.WriteShort((short)ObjectsAndMountBonus);
     sender.WriteShort((short)AlignGiftBonus);
     sender.WriteShort((short)ContextModif);
 }
 public static void serialize(Utils.Objects.Packet sender, int accountId)
 {
     sender.WriteInt(accountId);
     sender.WriteBool(false); // tutorial available
     sender.WriteShort(8191); // breeds visible
     sender.WriteShort(2047); // breeds available
 }
Example #3
0
 public static void serialize(Utils.Objects.Packet sender, List<int> path, Global.Character actor)
 {
     sender.WriteShort( (short)path.Count );
     foreach (int cell in path)
         sender.WriteShort((short)cell);
     sender.WriteInt(actor.Guid);
 }
Example #4
0
 public static void serialize(Utils.Objects.Packet sender, Global.FriendList friends)
 {
     sender.WriteShort((short)friends.Count);
     foreach (Types.context.FriendInformations friend in friends.ToList())
     {
             sender.WriteShort((short)friend.ProtocolID);
             friend.serialize(sender);
     }
 }
Example #5
0
 public static void serialize(Utils.Objects.Packet sender, List<Types.game.friend.FriendInformations> friends)
 {
     sender.WriteShort((short)friends.Count);
     foreach (Types.game.friend.FriendInformations friend in friends)
     {
         sender.WriteShort((short)friend.ProtocolID);
         friend.serialize(sender);
     }
 }
Example #6
0
        public static void serialize(Utils.Objects.Packet sender, List<Channel> enabled, List<Channel> disabled)
        {
            sender.WriteShort( (short)enabled.Count );
            foreach (Channel chan in enabled)
                sender.WriteByte( (byte)chan );

            sender.WriteShort( (short)disabled.Count );
            foreach (Channel chan in disabled)
                sender.WriteByte( (byte)chan );
        }
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteInt(_target.Guid);

            ////// ENTITY LOOK //////

            sender.WriteShort(1); // bones ID

            sender.WriteShort(1); // nSkins
            sender.WriteShort( (short)( (int)_target.Classe * 10 + (int)_target.Sexe) );

            sender.WriteShort((short)5);
            for (int i = 0; i < 5; ++i)
                sender.WriteInt(_target.Colors[i] | (i + 1) * 0x1000000);

            sender.WriteShort(1); // nScales
            sender.WriteShort( (short)140 );

            sender.WriteShort(0); // nSubEntities

            ////// ENTITY DISPOSITION

            sender.WriteShort(60); // EntityDisposition id

            sender.WriteShort(_target.CurCell);
            sender.WriteByte( (byte)_target.Direction );
        }
        public void serialize(Utils.Objects.Packet sender)
        {
            // MINIMAL INFO
            sender.WriteInt(Member.Guid);
            sender.WriteByte((byte)Member.Level);
            sender.WriteUTF(Member.Name);

            // LOOK
            sender.WriteShort(1); // bones ID

            sender.WriteShort(1); // nSkins
            sender.WriteShort((short)((int)Member.Classe * 10 + (int)Member.Sexe));

            sender.WriteShort((short)5);
            for (int i = 0; i < 5; ++i)
                sender.WriteInt(Member.Colors[i] | (i + 1) * 0x1000000);

            sender.WriteShort(1); // nScales
            sender.WriteShort((short)140);

            sender.WriteShort(0); // nSubEntities

            // PARTY
            sender.WriteInt(Member.Characteristics.lifePoints);
            sender.WriteInt(Member.Characteristics.maxLifePoints);
            sender.WriteShort((short)Member.Characteristics.prospecting.Total);
            sender.WriteByte(0); // regenRate
            sender.WriteShort((short)Member.Characteristics.initiative.Total);
            sender.WriteBool(false); // pvp enabled
            sender.WriteByte(0); // alignment side
        }
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteByte((byte)alignmentSide);
            sender.WriteByte((byte)alignmentValue);
            sender.WriteByte((byte)alignmentGrade);
            sender.WriteShort((short)dishonor);
            sender.WriteInt(characterPower);

            sender.WriteShort((short)honor);
            sender.WriteShort((short)honorGradeFloor);
            sender.WriteShort((short)honorNextGradeFloor);
            sender.WriteBool(pvpEnabled);
        }
Example #10
0
        public static void serialize(Utils.Objects.Packet sender, Enums.TextInformationType type, int msgId, string message)
        {
            sender.WriteByte((byte)type);
            sender.WriteShort((byte)msgId);

            if (message != string.Empty)
            {
                sender.WriteShort(1); // nMessages
                sender.WriteUTF(message);
            }
            else
                sender.WriteShort(0); // nMessages
        }
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteInt(_target.Guid);

            ////// ENTITY LOOK //////

            sender.WriteShort(1); // bones ID

            sender.WriteShort(1); // nSkins
            sender.WriteShort( (short)( (int)_target.Classe * 10 + (int)_target.Sexe) );

            sender.WriteShort((short)5);
            for (int i = 0; i < 5; ++i)
                sender.WriteInt(_target.Colors[i] | (i + 1) * 0x1000000);

            sender.WriteShort(1); // nScales
            sender.WriteShort( (short)140 );

            sender.WriteShort(0); // nSubEntities

            ////// ENTITY DISPOSITION

            sender.WriteShort((short)Types.game.context.EntityDispositionInformations.ProtocolID);
            _target.Disposition.serialize(sender);
        }
Example #12
0
        public static void serialize(Utils.Objects.Packet sender, List<Global.Character> characters)
        {
            // On classe la liste dans l'ordre décroissant de la dernière utilisation
            characters = characters.OrderByDescending(x => x.LastUse).ToList();

            sender.WriteBool(false); // hasStartupActions
            sender.WriteShort( (short)characters.Count );

            foreach (Global.Character each in characters)
            {
                sender.WriteShort((short)Types.game.character.CharacterBaseInformations.ProtocolID);
                new Types.game.character.CharacterBaseInformations(each).serialize(sender);
            }
        }
Example #13
0
 public static void serialize(Utils.Objects.Packet sender)
 {
     int nFlags = 0;
     sender.WriteShort((short)nFlags);
     for (int i = 0; i < nFlags; ++i)
         sender.WriteInt(0);
 }
 public static void serialize(Utils.Objects.Packet sender, List<int> path, int targetMap)
 {
     sender.WriteShort( (short)path.Count );
     foreach (int cell in path)
         sender.WriteCell(cell);
     sender.WriteInt(targetMap);
 }
 public static void serialize(Utils.Objects.Packet sender, string ticket, string senderIp)
 {
     sender.WriteShort( (short)GlobalConfig.Network.Game.Guid );
     sender.WriteUTF(senderIp == "127.0.0.1" ? "127.0.0.1" : GlobalConfig.Network.IP);
     sender.WriteUShort( (ushort)GlobalConfig.Network.Game.Port );
     sender.WriteBool(true); // can create characters
     sender.WriteUTF(ticket);
 }
        public void serialize(Utils.Objects.Packet sender)
        {
            // --------------- //
            // --- MINIMAL --- //
            // --------------- //

            sender.WriteInt(_character.Guid);
            sender.WriteByte( (byte)_character.Level );
            sender.WriteUTF(_character.Name);

            // ------------ //
            // --- LOOK --- //
            // ------------ //

            sender.WriteShort(1); // bones ID

            sender.WriteShort(1); // nSkins
            sender.WriteShort( (short)( (int)_character.Classe * 10 + (int)_character.Sexe) );

            sender.WriteShort((short)5);
            for (int i = 0; i < 5; ++i)
                sender.WriteInt(_character.Colors[i] | (i + 1) * 0x1000000);

            sender.WriteShort(1); // nScales
            sender.WriteShort( (short)140 );

            sender.WriteShort(0); // nSubEntities

            // ------------ //
            // --- BASE --- //
            // ------------ //

            sender.WriteByte( (byte)_character.Classe );
            sender.WriteByte( (byte)_character.Sexe );
        }
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteInt(_target.Id);

            _target.Look.serialize(sender);

            sender.WriteShort((short)EntityDispositionInformations.ProtocolID);
            _target.Disposition.serialize(sender);
        }
Example #18
0
        public void serialize(Utils.Objects.Packet sender)
        {
            // MINIMAL INFO
            sender.WriteInt((int)Member.Id);
            sender.WriteByte((byte)Member.Level);
            sender.WriteUTF(Member.Name);

            Member.Look.serialize(sender);

            // PARTY
            sender.WriteInt(Member.Characteristics.lifePoints);
            sender.WriteInt(Member.Characteristics.maxLifePoints);
            sender.WriteShort((short)Member.Characteristics.prospecting.Total);
            sender.WriteByte(0); // regenRate
            sender.WriteShort((short)Member.Characteristics.initiative.Total);
            sender.WriteBool(false); // pvp enabled
            sender.WriteByte(0); // alignment side
        }
Example #19
0
        public static void serialize(Utils.Objects.Packet sender, Global.Account acc)
        {
            sender.WriteShort(1); // nGameServers

            sender.WriteUShort((ushort)GlobalConfig.Network.Game.Guid);
            sender.WriteByte((byte)ServerState.ONLINE);
            sender.WriteByte(0); // completion
            sender.WriteBool(true); // selectable
            sender.WriteByte( (byte)acc.Characters.Count );
        }
Example #20
0
        public static void serialize(Utils.Objects.Packet sender, Global.Party party)
        {
            sender.WriteInt(party.Leader.Guid);

            sender.WriteShort((short)party.Members.Count);
            foreach (Global.Character member in party.Members)
                new Types.game.context.PartyMemberInformations(member).serialize(sender);

            sender.WriteBool(false); // restricted ??
        }
Example #21
0
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteShort(1); // bones ID

            sender.WriteShort(1); // nSkins
            sender.WriteShort((short)((int)Target.Breed * 10 + (int)Target.Gender));

            sender.WriteShort((short)5);
            for (int i = 0; i < 5; ++i)
                sender.WriteInt(Colors[i] | (i + 1) * 0x1000000);

            sender.WriteShort(1); // nScales
            sender.WriteShort((short)140);

            sender.WriteShort(0); // nSubEntities
        }
Example #22
0
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteUTF(Friend.Nickname);
            sender.WriteByte(Friend.CurrentCharacter != null ? (byte)Friend.CurrentCharacter.State : (byte)Enums.PlayerStateEnum.NOT_CONNECTED);
            sender.WriteInt(0);

            if (Friend.CurrentCharacter != null && Friend.CurrentCharacter.IsConnected)
            {
                sender.WriteUTF(Friend.CurrentCharacter.Name);
                sender.WriteShort((short)Friend.CurrentCharacter.Level);
                sender.WriteByte(0); // alignmentSide
                sender.WriteByte((byte)Friend.CurrentCharacter.Classe);
                sender.WriteByte((byte)Friend.CurrentCharacter.Sexe);

                sender.WriteInt(0); // guild guid
                sender.WriteUTF(""); // guild name

                sender.WriteByte(0xff); // mood smiley id
            }
        }
        public static void serialize(Utils.Objects.Packet sender, Global.Map map)
        {
            sender.WriteShort( (short)map.SubAreaID );
            sender.WriteInt( map.ID );
            sender.WriteByte(0); // subareaAlignmentSide

            sender.WriteShort(0); // nHouses

            sender.WriteShort( (short)map.Actors.Count );
            foreach (Global.Character actor in map.Actors)
            {
                sender.WriteShort((short)Types.game.context.GameRolePlayActorInformations.ProtocolID);
                new Types.game.context.GameRolePlayActorInformations(actor).serialize(sender);
            }

            sender.WriteShort(0); // nInteractiveElements

            sender.WriteShort(0); // nStatedElements

            sender.WriteShort(0); // nObstacles

            sender.WriteShort(0); // nFights
        }
Example #24
0
 public static void serialize(Utils.Objects.Packet sender)
 {
     sender.WriteBool(true);
     sender.WriteShort(0);
 }
Example #25
0
 public static void serialize(Utils.Objects.Packet sender)
 {
     sender.WriteShort(0); // nFinished
     sender.WriteShort(0); // nActive
 }
 public void serialize(Utils.Objects.Packet sender)
 {
     sender.WriteShort((short)Cell);
     sender.WriteByte((byte)Direction);
 }
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteDouble(experience);
            sender.WriteDouble(experienceLevelFloor);
            sender.WriteDouble(experienceNextLevelFloor);
            sender.WriteInt(kamas);
            sender.WriteInt(statsPoints);
            sender.WriteInt(spellsPoints);
            alignmentInfos.serialize(sender);
            sender.WriteInt(lifePoints);
            sender.WriteInt(maxLifePoints);
            sender.WriteShort((short)energyPoints);
            sender.WriteShort((short)maxEnergyPoints);
            sender.WriteShort((short)actionPointsCurrent);
            sender.WriteShort((short)movementPointsCurrent);
            initiative.serialize(sender);
            prospecting.serialize(sender);
            actionPoints.serialize(sender);
            movementPoints.serialize(sender);
            strength.serialize(sender);
            vitality.serialize(sender);
            wisdom.serialize(sender);
            chance.serialize(sender);
            agility.serialize(sender);
            intelligence.serialize(sender);
            range.serialize(sender);
            summonableCreaturesBoost.serialize(sender);
            reflect.serialize(sender);
            criticalHit.serialize(sender);
            sender.WriteShort((short)criticalHitWeapon);
            criticalMiss.serialize(sender);
            healBonus.serialize(sender);
            allDamagesBonus.serialize(sender);
            weaponDamagesBonusPercent.serialize(sender);
            damagesBonusPercent.serialize(sender);
            trapBonus.serialize(sender);
            trapBonusPercent.serialize(sender);
            permanentDamagePercent.serialize(sender);
            tackleBlock.serialize(sender);
            tackleEvade.serialize(sender);
            PAAttack.serialize(sender);
            PMAttack.serialize(sender);
            pushDamageBonus.serialize(sender);
            criticalDamageBonus.serialize(sender);
            neutralDamageBonus.serialize(sender);
            earthDamageBonus.serialize(sender);
            waterDamageBonus.serialize(sender);
            airDamageBonus.serialize(sender);
            fireDamageBonus.serialize(sender);
            dodgePALostProbability.serialize(sender);
            dodgePMLostProbability.serialize(sender);
            neutralElementResistPercent.serialize(sender);
            earthElementResistPercent.serialize(sender);
            waterElementResistPercent.serialize(sender);
            airElementResistPercent.serialize(sender);
            fireElementResistPercent.serialize(sender);
            neutralElementReduction.serialize(sender);
            earthElementReduction.serialize(sender);
            waterElementReduction.serialize(sender);
            airElementReduction.serialize(sender);
            fireElementReduction.serialize(sender);
            pushDamageReduction.serialize(sender);
            criticalDamageReduction.serialize(sender);
            pvpNeutralElementResistPercent.serialize(sender);
            pvpEarthElementResistPercent.serialize(sender);
            pvpWaterElementResistPercent.serialize(sender);
            pvpAirElementResistPercent.serialize(sender);
            pvpFireElementResistPercent.serialize(sender);
            pvpNeutralElementReduction.serialize(sender);
            pvpEarthElementReduction.serialize(sender);
            pvpWaterElementReduction.serialize(sender);
            pvpAirElementReduction.serialize(sender);
            pvpFireElementReduction.serialize(sender);

            sender.WriteShort(0); // nSpellModifications
        }
Example #28
0
 public static void serialize(Utils.Objects.Packet sender, Global.Character perso)
 {
     sender.WriteShort(0); // nItems
     sender.WriteInt(perso.Characteristics.kamas);
 }
Example #29
0
 public static void serialize(Utils.Objects.Packet sender, Types.context.FriendInformations friend)
 {
     sender.WriteShort((short)friend.ProtocolID);
     friend.serialize(sender);
 }
Example #30
0
 public static void serialize(Utils.Objects.Packet sender)
 {
     sender.WriteInt( (int)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds ); // timestamp
     sender.WriteShort(3600); // timezoneOffset
 }