public string guild;                    //var_89;

        public TowerInitMessage(Reader reader)
        {
            this._version = reader.ReadShort();
            this._version = 65535 & ((65535 & this._version) >> 3 | (65535 & this._version) << 13);
            this._version = this._version > 32767 ? (int)(this._version - 65536) : (int)(this._version);
            reader.ReadShort();
            this.targetAction = new EntityTargetAction(reader);
            this.position     = new PositionStub(0, 0);
            this.position.X   = reader.ReadShort();
            this.position.X   = 65535 & ((65535 & this.position.X) >> 3 | (65535 & this.position.X) << 13);
            this.position.X   = this.position.X > 32767 ? (int)(this.position.X - 65536) : (int)(this.position.X);
            this.position.Y   = reader.ReadShort();
            this.position.Y   = 65535 & ((65535 & this.position.Y) << 8 | (65535 & this.position.Y) >> 8);
            this.position.Y   = this.position.Y > 32767 ? (int)(this.position.Y - 65536) : (int)(this.position.Y);
            reader.ReadShort();
            this.pointsMax            = new ShipPointsStub(reader);
            this.entityInfo           = new EntityInfo(0, 0);
            this.entityInfo.projectId = reader.ReadShort();
            this.entityInfo.projectId = 65535 & ((65535 & this.entityInfo.projectId) >> 12 | (65535 & this.entityInfo.projectId) << 4);
            this.entityInfo.projectId = this.entityInfo.projectId > 32767 ? (int)(this.entityInfo.projectId - 65536) : (int)(this.entityInfo.projectId);
            this.entityInfo.entityId  = reader.ReadDouble();
            this.designID             = reader.ReadShort();
            this.designID             = 65535 & ((65535 & this.designID) >> 15 | (65535 & this.designID) << 1);
            this.designID             = this.designID > 32767 ? (int)(this.designID - 65536) : (int)(this.designID);
            reader.ReadShort();
            this.pointsCurrent = new ShipPointsStub(reader);
            this.name_28       = reader.ReadInt();
            this.name_28       = this.name_28 >> 15 | this.name_28 << 27;
            this.guild         = reader.ReadString();
            this.towerId       = reader.ReadByte();
            this.towerId       = 255 & ((255 & this.towerId) << 2 | (255 & this.towerId) >> 6);
            this.towerId       = this.towerId > 127 ? (int)(this.towerId - 256) : (int)(this.towerId);
        }
 public PlayerInitMessage(double entityId, int projectId, string username, string guild, PositionStub position, List <PositionStub> route)
 {
     this.entityInfo = new EntityInfo(entityId, projectId);
     this.username   = username;
     this.guild      = guild;
     this.position   = position;
     this.route      = route;
 }
 public MonsterInitMessage(double entityId, int projectId, int nameId, int hp, int maxHp, PositionStub position)
 {
     this.entityInfo = new EntityInfo(entityId, projectId);
     this.nameId     = nameId;
     if (Bot.Monsters.ContainsKey(nameId))
     {
         this.name = Bot.Monsters[nameId];
     }
     this.hitpoints    = hp;
     this.maxHitpoints = maxHp;
     this.position     = position;
 }
        public PlayerInitMessage(Reader reader)
        {
            this._version = reader.ReadShort();
            this._version = (65535 & ((65535 & this._version) << 10 | (int)((uint)(65535 & this._version) >> 6)));
            this._version = ((this._version > 32767) ? (this._version - 65536) : this._version);
            this.route    = new List <PositionStub>();
            var i   = 0;
            var num = reader.ReadShort();

            while (i < num)
            {
                reader.ReadShort();
                this.route.Add(new PositionStub(reader));
                i++;
            }
            this.username = reader.ReadString();
            reader.ReadShort();             //ID
            this.targetAction         = new EntityTargetAction(reader);
            this.var_25               = reader.ReadByte();
            this.var_25               = (255 & ((255 & this.var_25) << 4 | (int)((uint)(255 & this.var_25) >> 4)));
            this.var_25               = ((this.var_25 > 127) ? (this.var_25 - 256) : this.var_25);
            this.var_53               = reader.ReadByte();
            this.var_53               = (int)(255u & ((uint)(255 & this.var_53) >> 0 | (uint)((uint)(255 & this.var_53) << 8)));
            this.var_53               = ((this.var_53 > 127) ? (this.var_53 - 256) : this.var_53);
            this.guild                = reader.ReadString();
            this.entityInfo           = new EntityInfo(0, 0);
            this.entityInfo.projectId = reader.ReadShort();
            this.entityInfo.projectId = (int)(65535u & ((uint)(65535 & this.entityInfo.projectId) >> 12 | (uint)((uint)(65535 & this.entityInfo.projectId) << 4)));
            this.entityInfo.projectId = ((this.entityInfo.projectId > 32767) ? (this.entityInfo.projectId - 65536) : this.entityInfo.projectId);
            this.entityInfo.entityId  = reader.ReadDouble();
            this.designId             = reader.ReadShort();
            this.designId             = (int)(65535u & ((uint)(65535 & this.designId) << 9 | (uint)((uint)(65535 & this.designId) >> 7)));
            this.designId             = ((this.designId > 32767) ? (this.designId - 65536) : this.designId);
            this.var_30               = reader.ReadByte();
            this.var_30               = (255 & ((255 & this.var_30) << 6 | (int)((uint)(255 & this.var_30) >> 2)));
            this.var_30               = ((this.var_30 > 127) ? (this.var_30 - 256) : this.var_30);
            this.position             = new PositionStub(0, 0);
            this.position.X           = reader.ReadShort();
            this.position.X           = (65535 & ((65535 & this.position.X) << 4 | (65535 & this.position.X) >> 12));
            this.position.X           = ((this.position.X > 32767) ? (this.position.X - 65536) : this.position.X);
            this.position.Y           = reader.ReadShort();
            this.position.Y           = (65535 & ((65535 & this.position.Y) << 3 | (int)((uint)(65535 & this.position.Y) >> 13)));
            this.position.Y           = ((this.position.Y > 32767) ? (this.position.Y - 65536) : this.position.Y);
            this.list_1               = new List <int>();
            i   = 0;
            num = reader.ReadByte();
            while (i < num)
            {
                list_1.Add(reader.ReadShort());
                i++;
            }
        }
Esempio n. 5
0
 public ShipInitMessage(double entityId, int projectId, int nameId, int hp, int maxHp, PositionStub position, List <PositionStub> route)
 {
     this.entityInfo = new EntityInfo(entityId, projectId);
     this.nameId     = nameId;
     if (Bot.NPCs.ContainsKey(nameId))
     {
         this.name = Bot.NPCs[nameId];
     }
     this.pointsCurrent = new ShipPointsStub(hp, 0);
     this.pointsMax     = new ShipPointsStub(maxHp, 0);
     this.position      = position;
     this.route         = route;
 }
 public UserInitMessage(Reader reader)
 {
     this._version             = reader.ReadShort();
     this._version             = (int)(65535u & ((uint)(65535 & this._version) >> 7 | (uint)((uint)(65535 & this._version) << 9)));
     this._version             = ((this._version > 32767) ? (this._version - 65536) : this._version);
     this.var_53               = reader.ReadByte();
     this.var_53               = (int)(255u & ((uint)(255 & this.var_53) >> 0 | (uint)((uint)(255 & this.var_53) << 8)));
     this.var_53               = ((this.var_53 > 127) ? (this.var_53 - 256) : this.var_53);
     this.entityInfo           = new EntityInfo(0, 0);
     this.entityInfo.projectId = reader.ReadShort();
     this.entityInfo.projectId = (65535 & ((65535 & this.entityInfo.projectId) << 7 | (int)((uint)(65535 & this.entityInfo.projectId) >> 9)));
     this.entityInfo.projectId = ((this.entityInfo.projectId > 32767) ? (this.entityInfo.projectId - 65536) : this.entityInfo.projectId);
     this.entityInfo.entityId  = reader.ReadDouble();
     this.bp                = reader.ReadInt();
     this.bp                = (int)((uint)this.bp << 3 | (uint)((uint)this.bp >> 29));
     this.position          = new PositionStub(0, 0);
     this.position.X        = reader.ReadShort();
     this.position.X        = (65535 & ((65535 & this.position.X) << 13 | (int)((uint)(65535 & this.position.X) >> 3)));
     this.position.X        = ((this.position.X > 32767) ? (this.position.X - 65536) : this.position.X);
     this.position.Y        = reader.ReadShort();
     this.position.Y        = (int)(65535u & ((uint)(65535 & this.position.Y) >> 9 | (uint)((uint)(65535 & this.position.Y) << 7)));
     this.position.Y        = ((this.position.Y > 32767) ? (this.position.Y - 65536) : this.position.Y);
     this.level             = reader.ReadByte();
     this.level             = (255 & ((255 & this.level) << 0 | (int)((uint)(255 & this.level) >> 8)));
     this.level             = ((this.level > 127) ? (this.level - 256) : this.level);
     this.designId          = reader.ReadShort();
     this.designId          = (int)(65535u & ((uint)(65535 & this.designId) << 11 | (uint)((uint)(65535 & this.designId) >> 5)));
     this.designId          = ((this.designId > 32767) ? (this.designId - 65536) : this.designId);
     this.carpenterType     = reader.ReadByte();
     this.carpenterType     = (255 & ((255 & this.carpenterType) << 5 | (int)((uint)(255 & this.carpenterType) >> 3)));
     this.carpenterType     = ((this.carpenterType > 127) ? (this.carpenterType - 256) : this.carpenterType);
     this.xp                = reader.ReadDouble();
     this.hasTreasureHunter = reader.ReadBool();
     reader.ReadShort();
     this.currentHealth = new ShipPointsStub(reader);
     this.guild         = reader.ReadString();
     this.username      = reader.ReadString();
     this.maxXp         = reader.ReadDouble();
     this.maxBp         = reader.ReadInt();
     this.maxBp         = (int)((uint)this.maxBp << 14 | (uint)((uint)this.maxBp >> 18));
     this.hasPremium    = reader.ReadBool();
     this.medallionId   = reader.ReadByte();
     this.medallionId   = (255 & ((255 & this.medallionId) >> 6 | (int)((uint)(255 & this.medallionId) << 2)));
     this.medallionId   = ((this.medallionId > 127) ? (this.medallionId - 256) : this.medallionId);
     reader.ReadShort();             //ID
     this.targetAction = new EntityTargetAction(reader);
     this.var_30       = reader.ReadByte();
     this.var_30       = (255 & ((255 & this.var_30) >> 2 | (int)((uint)(255 & this.var_30) << 6)));
     this.var_30       = ((this.var_30 > 127) ? (this.var_30 - 256) : this.var_30);
     this.isRepairing  = reader.ReadBool();
 }
Esempio n. 7
0
 public BoxInitMessage(double entityId, int projectId, int type, PositionStub position, bool visible)
 {
     this.entityId  = entityId;
     this.projectId = projectId;
     this.type      = type;
     if (position == null)
     {
         this.position = new PositionStub(0, 0);
     }
     else
     {
         this.position = position;
     }
     this.visible = visible;
 }
Esempio n. 8
0
 public MapTileStub(Reader reader)
 {
     this._version   = reader.ReadShort();
     this._version   = 65535 & ((65535 & this._version) >> 5 | (65535 & this._version) << 11);
     this._version   = this._version > 32767 ? (this._version - 65536) : (this._version);
     this.position   = new PositionStub(0, 0);
     this.position.Y = reader.ReadByte();
     this.position.Y = 255 & ((255 & this.position.Y) >> 4 | (255 & this.position.Y) << 4);
     this.position.Y = this.position.Y > 127 ? (this.position.Y - 256) : (this.position.Y);
     this.position.X = reader.ReadByte();
     this.position.X = 255 & ((255 & this.position.X) >> 1 | (255 & this.position.X) << 7);
     this.position.X = this.position.X > 127 ? (this.position.X - 256) : (this.position.X);
     this.tileId     = reader.ReadShort();
     this.tileId     = 65535 & ((65535 & this.tileId) << 10 | (65535 & this.tileId) >> 6);
     this.tileId     = this.tileId > 32767 ? (this.tileId - 65536) : (this.tileId);
 }
Esempio n. 9
0
 public MapChangeMessage(Reader reader)
 {
     this._version = reader.ReadShort();
     this._version = (65535 & ((65535 & this._version) << 3 | (int)((uint)(65535 & this._version) >> 13)));
     this._version = ((this._version > 32767) ? (this._version - 65536) : this._version);
     reader.ReadShort(); //ID
     this.mapInfo     = new MapStub(reader);
     this.animationID = reader.ReadShort();
     this.animationID = 65535 & ((65535 & this.animationID) << 15 | (65535 & this.animationID) << 10);
     this.animationID = this.animationID > 32767 ? (int)(this.animationID - 65536) : (int)(this.animationID);
     this.position    = new PositionStub(0, 0);
     this.position.X  = reader.ReadShort();
     this.position.X  = 65535 & ((65535 & this.position.X) << 10 | (65535 & this.position.X) >> 6);
     this.position.X  = this.position.X > 32767 ? (int)(this.position.X - 65536) : (int)(this.position.X);
     this.position.Y  = reader.ReadShort();
     this.position.Y  = 65535 & ((65535 & this.position.Y) >> 3 | (65535 & this.position.Y) << 13);
     this.position.Y  = this.position.Y > 32767 ? (int)(this.position.Y - 65536) : (int)(this.position.Y);
 }
Esempio n. 10
0
 public BoxInitMessage(Reader reader)
 {
     this._version   = reader.ReadShort();
     this._version   = (int)(65535u & ((uint)(65535 & this._version) >> 6 | (uint)((uint)(65535 & this._version) << 10)));
     this._version   = ((this._version > 32767) ? (this._version - 65536) : this._version);
     this.type       = reader.ReadShort();
     this.position   = new PositionStub(0, 0);
     this.position.X = reader.ReadShort();
     this.position.X = 65535 & ((65535 & this.position.X) >> 12 | (65535 & this.position.X) << 4);
     this.position.X = this.position.X > 32767 ? (int)(this.position.X - 65536) : (int)(this.position.X);
     this.position.Y = reader.ReadShort();
     this.position.Y = 65535 & ((65535 & this.position.Y) << 12 | (65535 & this.position.Y) >> 4);
     this.position.Y = this.position.Y > 32767 ? (int)(this.position.Y - 65536) : (int)(this.position.Y);
     this.projectId  = reader.ReadShort();
     this.projectId  = (65535 & ((65535 & this.projectId) >> 9 | (65535 & this.projectId) << 7));
     this.projectId  = this.projectId > 32767 ? (int)(this.projectId - 65536) : (int)(this.projectId);
     this.entityId   = reader.ReadDouble();
     this.visible    = reader.ReadBool();
 }
Esempio n. 11
0
 public StopMessage(Reader reader)
 {
     this._version   = reader.ReadShort();
     this._version   = (65535 & ((65535 & this._version) << 13 | (int)((uint)(65535 & this._version) >> 3)));
     this._version   = ((this._version > 32767) ? (this._version - 65536) : this._version);
     this.position   = new PositionStub(0, 0);
     this.position.X = reader.ReadShort();
     this.position.X = (65535 & ((65535 & this.position.X) >> 0 | (int)((uint)(65535 & this.position.X) << 16)));
     this.position.X = ((this.position.X > 32767) ? (this.position.X - 65536) : this.position.X);
     this.position.Y = reader.ReadShort();
     this.position.Y = (int)(65535u & ((uint)(65535 & this.position.Y) >> 14 | (uint)((uint)(65535 & this.position.Y) << 2)));
     this.position.Y = ((this.position.Y > 32767) ? (this.position.Y - 65536) : this.position.Y);
     this.distance   = reader.ReadByte();
     this.distance   = (int)(255u & ((uint)(255 & this.distance) << 4 | (uint)((uint)(255 & this.distance) >> 4)));
     this.distance   = ((this.distance > 127) ? (this.distance - 256) : this.distance);
     this.projectId  = reader.ReadShort();
     this.projectId  = (65535 & ((65535 & this.projectId) >> 3 | (int)((uint)(65535 & this.projectId) << 13)));
     this.projectId  = ((this.projectId > 32767) ? (this.projectId - 65536) : this.projectId);
     this.entityId   = reader.ReadDouble();
 }
 public MonsterInitMessage(Reader reader)
 {
     this._version                = reader.ReadShort();
     this._version                = (65535 & ((65535 & this._version) << 10 | (int)((uint)(65535 & this._version) >> 6)));
     this._version                = ((this._version > 32767) ? (this._version - 65536) : this._version);
     this.taggingEntity           = new EntityInfo(0, 0);
     this.taggingEntity.projectId = reader.ReadShort();
     this.taggingEntity.projectId = (65535 & ((65535 & this.taggingEntity.projectId) >> 5 | (int)((uint)(65535 & this.taggingEntity.projectId) << 11)));
     this.taggingEntity.projectId = ((this.taggingEntity.projectId > 32767) ? (this.taggingEntity.projectId - 65536) : this.taggingEntity.projectId);
     this.taggingEntity.entityId  = reader.ReadDouble();
     this.entityInfo              = new EntityInfo(0, 0);
     this.entityInfo.projectId    = reader.ReadShort();
     this.entityInfo.projectId    = (65535 & ((65535 & this.entityInfo.projectId) >> 5 | (int)((uint)(65535 & this.entityInfo.projectId) << 11)));
     this.entityInfo.projectId    = ((this.entityInfo.projectId > 32767) ? (this.entityInfo.projectId - 65536) : this.entityInfo.projectId);
     this.entityInfo.entityId     = reader.ReadDouble();
     this.var_30       = reader.ReadByte();
     this.var_30       = (int)(255u & ((uint)(255 & this.var_30) >> 5 | (uint)((uint)(255 & this.var_30) << 3)));
     this.var_30       = ((this.var_30 > 127) ? (this.var_30 - 256) : this.var_30);
     this.nameId       = reader.ReadByte();
     this.nameId       = (int)(255u & ((uint)(255 & this.nameId) << 7 | (uint)((uint)(255 & this.nameId) >> 1)));
     this.nameId       = ((this.nameId > 127) ? (this.nameId - 256) : this.nameId);
     this.type         = reader.ReadShort();
     this.hitpoints    = reader.ReadInt();
     this.hitpoints    = (int)((uint)this.hitpoints << 13 | (uint)((uint)this.hitpoints >> 19));
     this.maxHitpoints = reader.ReadInt();
     this.maxHitpoints = (int)((uint)this.maxHitpoints << 9 | (uint)((uint)this.maxHitpoints >> 23));
     this.position     = new PositionStub(0, 0);
     this.position.X   = reader.ReadShort();
     this.position.X   = (65535 & ((65535 & this.position.X) >> 8 | (65535 & this.position.X) << 8));
     this.position.X   = ((this.position.X > 32767) ? (this.position.X - 65536) : this.position.X);
     this.position.Y   = reader.ReadShort();
     this.position.Y   = (int)(65535u & ((uint)(65535 & this.position.Y) >> 1 | (uint)((uint)(65535 & this.position.Y) << 15)));
     this.position.Y   = ((this.position.Y > 32767) ? (this.position.Y - 65536) : this.position.Y);
     this.var_452      = reader.ReadByte();
     this.var_452      = (255 & ((255 & this.var_452) >> 4 | (int)((uint)(255 & this.var_452) << 4)));
     this.var_452      = ((this.var_452 > 127) ? (this.var_452 - 256) : this.var_452);
 }
Esempio n. 13
0
        public ShipInitMessage(Reader reader)
        {
            this._version = reader.ReadShort();
            this._version = (int)(65535u & ((uint)(65535 & this._version) >> 4 | (uint)((uint)(65535 & this._version) << 12)));
            this._version = ((this._version > 32767) ? (this._version - 65536) : this._version);
            this.var_167  = new List <int>();
            var i   = 0;
            var num = reader.ReadByte();

            while (i < num)
            {
                var_167.Add(reader.ReadShort());
                i++;
            }
            this.name_28 = reader.ReadByte();
            this.name_28 = (int)(255u & ((uint)(255 & this.name_28) << 1 | (uint)((uint)(255 & this.name_28) >> 7)));
            this.name_28 = ((this.name_28 > 127) ? (this.name_28 - 256) : this.name_28);
            this.var_53  = reader.ReadShort();
            this.route   = new List <PositionStub>();
            i            = 0;
            num          = reader.ReadShort();
            while (i < num)
            {
                reader.ReadShort();
                route.Add(new PositionStub(reader));
                i++;
            }
            this.var_737    = reader.ReadShort();
            this.position   = new PositionStub(0, 0);
            this.position.X = reader.ReadShort();
            this.position.X = (int)(65535u & ((uint)(65535 & this.position.X) << 11 | (uint)((uint)(65535 & this.position.X) >> 5)));
            this.position.X = ((this.position.X > 32767) ? (this.position.X - 65536) : this.position.X);
            this.position.Y = reader.ReadShort();
            this.position.Y = (65535 & ((65535 & this.position.Y) << 15 | (int)((uint)(65535 & this.position.Y) >> 1)));
            this.position.Y = ((this.position.Y > 32767) ? (this.position.Y - 65536) : this.position.Y);
            reader.ReadShort();             //ID
            this.pointsCurrent           = new ShipPointsStub(reader);
            this.usePlates               = reader.ReadBool();
            this.entityInfo              = new EntityInfo(0, 0);
            this.entityInfo.projectId    = reader.ReadShort();
            this.entityInfo.projectId    = (65535 & ((65535 & this.entityInfo.projectId) >> 15 | (int)((uint)(65535 & this.entityInfo.projectId) << 1)));
            this.entityInfo.projectId    = ((this.entityInfo.projectId > 32767) ? (this.entityInfo.projectId - 65536) : this.entityInfo.projectId);
            this.entityInfo.entityId     = reader.ReadDouble();
            this.taggingEntity           = new EntityInfo(0, 0);
            this.taggingEntity.projectId = reader.ReadShort();
            this.taggingEntity.projectId = (65535 & ((65535 & this.taggingEntity.projectId) >> 15 | (int)((uint)(65535 & this.taggingEntity.projectId) << 1)));
            this.taggingEntity.projectId = ((this.taggingEntity.projectId > 32767) ? (this.taggingEntity.projectId - 65536) : this.taggingEntity.projectId);
            this.taggingEntity.entityId  = reader.ReadDouble();
            this.usePowder               = reader.ReadBool();
            this.designId = reader.ReadShort();
            this.designId = (65535 & ((65535 & this.designId) >> 11 | (int)((uint)(65535 & this.designId) << 5)));
            this.designId = ((this.designId > 32767) ? (this.designId - 65536) : this.designId);
            this.var_865  = reader.ReadShort();
            this.var_906  = reader.ReadShort();
            this.name_32  = new List <ShipEntityInfoType>();
            i             = 0;
            num           = reader.ReadByte();
            while (i < num)
            {
                reader.ReadShort();
                name_32.Add(new ShipEntityInfoType(reader));
                i++;
            }
            this.name = reader.ReadString();
            reader.ReadShort();             //ID
            this.pointsMax = new ShipPointsStub(reader);
            this.nameId    = reader.ReadShort();
            this.nameId    = (int)(65535u & ((uint)(65535 & this.nameId) << 4 | (uint)((uint)(65535 & this.nameId) >> 12)));
            this.nameId    = ((this.nameId > 32767) ? (this.nameId - 65536) : this.nameId);
            this.useBoard  = reader.ReadBool();
            this.var_30    = reader.ReadByte();
            this.var_30    = (int)(255u & ((uint)(255 & this.var_30) >> 3 | (uint)((uint)(255 & this.var_30) << 5)));
            this.var_30    = ((this.var_30 > 127) ? (this.var_30 - 256) : this.var_30);
            this.var_496   = reader.ReadShort();
            this.var_496   = (int)(65535u & ((uint)(65535 & this.var_496) << 0 | (uint)((uint)(65535 & this.var_496) >> 16)));
            this.var_496   = ((this.var_496 > 32767) ? (this.var_496 - 65536) : this.var_496);
            this.var_184   = reader.ReadShort();
        }