示例#1
0
 public Hardpoint(SiegeType type, int x, int y, int z, int heading)
 {
     SiegeType = type;
     X         = x;
     Y         = y;
     Z         = z;
     Heading   = (ushort)heading;
 }
示例#2
0
 public Siege(Creature_spawn spawn, Player owner, SiegeType type, BattleFrontKeep keep = null) : base(spawn)
 {
     _type                    = type;
     SiegeInterface           = AddInterface <SiegeInterface>();
     SiegeInterface.Creator   = owner;
     AssignedKeep             = keep; // Only need to assign keep for oil
     SiegeInterface.DeathTime = TCPManager.GetTimeStampMS() + SiegeLifeSpan;
 }
        public Siege(Creature_spawn spawn, Player owner, Keep k, SiegeType type) : base(spawn)
        {
            Keep = k;

            _type                    = type;
            SiegeInterface           = AddInterface <SiegeInterface>();
            SiegeInterface.Creator   = owner;
            SiegeInterface.DeathTime = TCPManager.GetTimeStampMS() + 300 * 1000;
        }
示例#4
0
        public int GetNumberByType(SiegeType siegeType, Realms realm)
        {
            var tracking = SiegeTracking.SingleOrDefault(x => x.Type == siegeType && x.Realm == realm);

            if (tracking != null)
            {
                return(tracking.CurrentNumberSiege);
            }
            else
            {
                return(0);
            }
        }
示例#5
0
        /// <summary>
        /// Determine whether the counts mean we can deploy this siege.
        /// </summary>
        /// <param name="typeToDeploy"></param>
        /// <returns></returns>
        private bool SiegeTypeCanDeploy(SiegeType typeToDeploy, Realms realm)
        {
            var okToDeploy = SiegeTracking.SingleOrDefault(x => x.Type == typeToDeploy && x.Realm == realm);

            if (okToDeploy != null)
            {
                return(okToDeploy.CanDeploy());
            }
            else
            {
                return(false);
            }
        }
 public EnemyKeepLocationComparitor(SiegeType siegeTypeValue)
 {
     SiegeTypeValue = siegeTypeValue;
 }
示例#7
0
        public void SendSiegeResponse(Player player, SiegeType type, SiegeControlType controlType, byte maxPlayers = 0, string siegeName = null)
        {
            if (type == SiegeType.RAM)
            {
                maxPlayers = 4;
            }

            PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);

            Out.WriteByte(0x18);              //siege
            Out.WriteByte((byte)controlType); //control type LEADER, HELPER, RELEASE
            Out.WriteByte(0);

            if (controlType != SiegeControlType.Release)
            {
                Out.WriteByte(0x46); //some sort of ID
                Out.WritePascalString(siegeName);
                Out.WriteByte(1);
                Out.WriteByte(0x28);
                Out.WriteByte(0);
                Out.WriteByte(0);

                if (type == SiegeType.OIL)
                {
                    Out.WriteByte(0x18);
                    Out.WriteByte(0x6A);
                }
                else if (type == SiegeType.GTAOE)
                {
                    Out.WriteByte(0x18);
                    Out.WriteByte(0x6A);
                }
                else if (type == SiegeType.RAM)
                {
                    Out.WriteByte(0x5B);
                    Out.WriteByte(0x60);
                }
                else if (type == SiegeType.SNIPER)
                {
                    Out.WriteByte(0x18);
                    Out.WriteByte(0x6A);
                }

                Out.WriteUInt16(_abilityId);

                Out.WriteByte(0);
                Out.WriteByte(04);
                Out.WriteByte(0);
                Out.WriteByte(maxPlayers); //player count
                Out.WriteByte(0x1E);
                Out.WriteByte(0);
                Out.WriteByte(0);
                Out.WriteByte(0);
                Out.WriteByte(0x10);
                Out.WriteByte((byte)type); //aim type
                Out.WriteByte(0);          //time?
                Out.WriteByte(0);
                Out.WriteByte(0x27);
                Out.WriteByte(0x0);
            }

            player.SendPacket(Out);
        }
示例#8
0
 /// <summary>
 /// Determine whether we can deploy the given siege type.
 /// </summary>
 /// <param name="caster"></param>
 /// <param name="comparitor"></param>
 /// <param name="typeToDeploy"></param>
 /// <returns></returns>
 public DeploymentReason CanDeploySiege(Player caster, ILocationComparitor comparitor, SiegeType typeToDeploy)
 {
     if (comparitor.InRange(caster))
     {
         if (SiegeTypeCanDeploy(typeToDeploy, caster.Realm))
         {
             return(DeploymentReason.Success);
         }
         else
         {
             return(DeploymentReason.MaximumCount);
         }
     }
     return(DeploymentReason.Range);
 }