Exemplo n.º 1
0
        public bool Cast()
        {
            if (IsDone)
            {
                return(false);
            }

            bool CanCast = true;

            if (Caster.AbtInterface.CanCast(Info, false) == GameData.AbilityResult.ABILITYRESULT_OK)
            {
                Caster.ActionPoints -= Info.Info.ApCost;

                if (Info.Info.ApSec == 0)
                {
                    DoneTime = TCPServer.GetTimeStampMS();
                }

                if (Handler != null)
                {
                    if (CanCast && Handler.CanCast(false) == GameData.AbilityResult.ABILITYRESULT_OK)
                    {
                        Caster.EvtInterface.Notify(EventName.ON_CAST, Caster, this);
                        Handler.Cast();
                    }
                    else
                    {
                        Handler.SendDone();
                    }
                }
                else
                {
                    SendAbilityDone(0);
                }

                WorldMgr.GeneralScripts.OnCastAbility(this);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
 public override void SendDone()
 {
     DamagesHandler.SendDone();
     HealHandler.SendDone();
 }