示例#1
0
        public override void OnStartCasting(Vector2 position, Vector2 endPosition, AttackableUnit target)
        {
            this.Casted = true;

            var script = Owner.SpellManager.GetSpell("BlindMonkQOne").GetScript <BlindMonkQOne>();

            AIUnit dashTarget = script.GetTarget();

            SetAnimation("Run", "Spell1b");

            Action onDashEnd = () =>
            {
                Owner.PathManager.DestroyPendingPoint();
                SetAnimation("Run", "Run");
                DestroyFX("blindMonk_W_self_mis.troy");
                DestroyFX(dashTarget, "blindMonk_Q_tar.troy");
                DestroyFX(dashTarget, "blindMonk_Q_tar_indicator.troy");
                dashTarget.InflictDamages(new World.Spells.Damages(Owner, target, 200, false, DamageType.DAMAGE_TYPE_PHYSICAL, false));
                script.DestroyTarget();
                Owner.TryBasicAttack(dashTarget);
            };

            if (Owner != null)
            {
                Owner.Dash(dashTarget.Position, 1800f, false, onDashEnd);

                SwapSpell("BlindMonkQOne", 0);
            }
        }