Пример #1
0
        public CastInformations GetCastInformations(Vector3 position, Vector3 endPosition, string spellName, uint missileNetId = 0, AttackableUnit[] targets = null)
        {
            if (missileNetId == 0)
            {
                missileNetId = Owner.Game.NetIdProvider.PopNextNetId();
            }
            var infos = new CastInformations()
            {
                AmmoRechargeTime        = 1f,
                AmmoUsed                = 1,                  // ??
                AttackSpeedModifier     = 1f,
                Cooldown                = GetTotalCooldown(), // fonctionne avec le slot
                CasterNetID             = Owner.NetId,
                IsAutoAttack            = false,
                IsSecondAutoAttack      = false,
                DesignerCastTime        = Record.GetCastTime(),
                DesignerTotalTime       = Record.GetCastTime(),
                ExtraCastTime           = 0f,
                IsClickCasted           = false,
                IsForceCastingOrChannel = false,
                IsOverrideCastPosition  = false,
                ManaCost                = 0f,
                MissileNetID            = missileNetId,
                PackageHash             = (uint)Owner.GetHash(),
                SpellCastLaunchPosition = new Vector3(Owner.Position.X, Owner.Position.Y, 100),// Owner.GetPositionVector3(),
                SpellChainOwnerNetID    = Owner.NetId,
                SpellHash               = spellName.HashString(),
                SpellLevel              = Level,
                SpellNetID              = Owner.Game.NetIdProvider.PopNextNetId(),
                SpellSlot               = Slot, // 3 = R
                StartCastTime           = 0,    // animation current, ou en est?
                TargetPosition          = position,
                TargetPositionEnd       = endPosition,
                Targets = new List <Tuple <uint, HitResultEnum> >()
            };

            if (targets != null)
            {
                foreach (var target in targets)
                {
                    infos.Targets.Add(new Tuple <uint, HitResultEnum>(target.NetId, HitResultEnum.Normal));
                }
            }
            return(infos);
        }
Пример #2
0
 public SpawnProjectileMessage(uint netId, Vector3 position, Vector3 casterPosition, Vector3 direction,
                               Vector3 velocity, Vector3 startPoint, Vector3 endPoint, Vector3 unitPosition, float timeFromCreation,
                               float speed, float lifePercentage, float timedSpeedDelta, float timedSpeedDeltaTime, bool bounced, CastInformations castInfo) : base(netId)
 {
     this.netId               = netId;
     this.position            = position;
     this.casterPosition      = casterPosition;
     this.direction           = direction;
     this.velocity            = velocity;
     this.startPoint          = startPoint;
     this.endPoint            = endPoint;
     this.unitPosition        = unitPosition;
     this.timeFromCreation    = timeFromCreation;
     this.speed               = speed;
     this.lifePercentage      = lifePercentage;
     this.timedSpeedDelta     = timedSpeedDelta;
     this.timedSpeedDeltaTime = timedSpeedDeltaTime;
     this.bounced             = bounced;
     this.castInfo            = castInfo;
 }
Пример #3
0
 public CastSpellAnswerMessage(uint netId, int casterPositionSyncId, bool unknown1, CastInformations castInfo) : base(netId)
 {
     this.casterPositionSyncId = casterPositionSyncId;
     this.unknown1             = unknown1;
     this.castInfo             = castInfo;
 }