Esempio n. 1
0
        public static float GetSpellHitTime(this Spell spell, Vector2 pos)
        {
            switch (spell.SpellType)
            {
            case SpellType.Line:
                if (spell.Info.ProjectileSpeed >= float.MaxValue)
                {
                    return(Math.Max(0, spell.EndTime - Environment.TickCount - ObjectCache.GamePing));
                }

                var spellPos = spell.GetCurrentSpellPosition(true, ObjectCache.GamePing);
                return(1000 * spellPos.Distance(pos) / spell.Info.ProjectileSpeed);

            case SpellType.Cone:
            case SpellType.Circular: return(Math.Max(0, spell.EndTime - Environment.TickCount - ObjectCache.GamePing));
            }

            return(float.MaxValue);
        }
Esempio n. 2
0
 public static void UpdateSpellInfo(this Spell spell)
 {
     spell.CurrentSpellPosition    = spell.GetCurrentSpellPosition();
     spell.CurrentNegativePosition = spell.GetCurrentSpellPosition(true);
     spell.Dangerlevel             = spell.GetSpellDangerLevel();
 }