Beispiel #1
0
 public void CallOnCast(IAbilityTypeHandler Handler, uint Count)
 {
     if (OnCastEvents != null)
     {
         OnCastEvents(Handler, Count);
     }
 }
Beispiel #2
0
        public override IAbilityTypeHandler Cast()
        {
            IAbilityTypeHandler NewHandler = DamagesHandler.Cast();

            if (NewHandler != null)
            {
                NewHandler.OnCastEvents += OnDealDamageTarget;
            }
            return(null);
        }
Beispiel #3
0
        static public IAbilityTypeHandler GetAbilityHandler(UInt16 AbilityType)
        {
            IAbilityTypeHandler Handler = null;

            if (_AbilityTypes.TryGetValue(AbilityType, out Handler))
            {
                return(Activator.CreateInstance(Handler.GetType()) as IAbilityTypeHandler);
            }

            return(null);
        }
        public override void InitAbility(Ability Ab)
        {
            this.Ab = Ab;
            this.DamagesHandler = new DealDamagesHandler();

            if (Ab.Info.Info.GroupMates)
                this.HealHandler = new SimpleHealGroupHandler();
            else
                this.HealHandler = new SimpleHealHandler();
            HealHandler.InitAbility(Ab);
            DamagesHandler.InitAbility(Ab);
            DamagesHandler.OnCastEvents += OnDealDamageTarget;
        }
Beispiel #5
0
        public Ability(AbilityInterface Interface, Ability Parent, Ability_Stats Info, Unit Caster, bool IsBuff, string OverrideHandler = "")
        {
            this.Parent = Parent;
            this.Info = Info;
            this.Caster = Caster;
            this.Interface = Interface;
            if (OverrideHandler == "")
                this.Handler = AbilityMgr.GetAbilityHandler(Info.Entry, Info.Info.HandlerName);
            else
                this.Handler = AbilityMgr.GetAbilityHandler(0, OverrideHandler);

            this.IsBuff = IsBuff;

            if (Handler != null)
                Handler.InitAbility(this);
        }
Beispiel #6
0
        public void Stop()
        {
            IsDone = true;

            if (Handler != null)
            {
                Handler.Stop();
                Handler = null;
            }

            SendStop();
            if (Info.Info.ApSec != 0)
            {
                SendAbilityDone(0);
            }
        }
Beispiel #7
0
        public override void InitAbility(Ability Ab)
        {
            this.Ab             = Ab;
            this.DamagesHandler = new DealDamagesHandler();

            if (Ab.Info.Info.GroupMates)
            {
                this.HealHandler = new SimpleHealGroupHandler();
            }
            else
            {
                this.HealHandler = new SimpleHealHandler();
            }
            HealHandler.InitAbility(Ab);
            DamagesHandler.InitAbility(Ab);
            DamagesHandler.OnCastEvents += OnDealDamageTarget;
        }
Beispiel #8
0
        public Ability(AbilityInterface Interface, Ability Parent, Ability_Stats Info, Unit Caster, bool IsBuff, string OverrideHandler = "")
        {
            this.Parent    = Parent;
            this.Info      = Info;
            this.Caster    = Caster;
            this.Interface = Interface;
            if (OverrideHandler == "")
            {
                this.Handler = AbilityMgr.GetAbilityHandler(Info.Entry, Info.Info.HandlerName);
            }
            else
            {
                this.Handler = AbilityMgr.GetAbilityHandler(0, OverrideHandler);
            }

            this.IsBuff = IsBuff;

            if (Handler != null)
            {
                Handler.InitAbility(this);
            }
        }
Beispiel #9
0
 public Ability(Ability_Info Info, Object Caster)
 {
     this.Info   = Info;
     this.Caster = Caster;
     Handler     = AbilityMgr.GetAbilityHandler(Info.AbilityType);
 }
Beispiel #10
0
 public Ability(Ability_Info Info, Object Caster)
 {
     this.Info = Info;
     this.Caster = Caster;
     Handler = AbilityMgr.GetAbilityHandler(Info.AbilityType);
 }
Beispiel #11
0
 public void CallOnCast(IAbilityTypeHandler Handler, uint Count)
 {
     if (OnCastEvents != null)
         OnCastEvents(Handler, Count);
 }
 public void OnDealDamageTarget(IAbilityTypeHandler Handler, uint Damage)
 {
     HealHandler.CustomValue = (uint)(((float)Damage * (float)Ab.Info.GetPercent(0)) / 100f) + Ab.Info.GetHeal(0);
     HealHandler.Cast();
 }
Beispiel #13
0
        public void Stop()
        {
            IsDone = true;

            if (Handler != null)
            {
                Handler.Stop();
                Handler = null;
            }

            SendStop();
            if (Info.Info.ApSec != 0)
                SendAbilityDone(0);
        }
Beispiel #14
0
 public void OnDealDamageTarget(IAbilityTypeHandler Handler, uint Damage)
 {
     HealHandler.CustomValue = (uint)(((float)Damage * (float)Ab.Info.GetPercent(0)) / 100f) + Ab.Info.GetHeal(0);
     HealHandler.Cast();
 }