예제 #1
0
파일: Ability.cs 프로젝트: wardev1/WarEmu-1
        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);
            }
        }
예제 #2
0
 public override void SendDone()
 {
     DamagesHandler.SendDone();
     HealHandler.SendDone();
 }