public override void InitAbility(Ability Ab) { this.Ab = Ab; if (Ab.Caster.IsUnit()) { Target = Ab.Caster.GetUnit().CbtInterface.GetTarget( GameData.TargetTypes.TARGETTYPES_TARGET_ENEMY ); } if (Ab.Info.Entry == 1667) // Follo me CustomValue = GetAbilityDamage(); if (Ab.Info.Entry == 1682) // Right in da jib CustomValue = GetAbilityDamage(); if (Ab.Info.Entry == 1677) // Savin me hide CustomValue = GetAbilityDamage(); if (Ab.Info.Entry == 1683) // Shut Yer Face CustomValue = GetAbilityDamage(); if (Ab.Info.Entry == 1676) // Skull Thumper CustomValue = GetAbilityDamage(); if (Ab.Info.Entry == 1670) // Trip Em Up CustomValue = GetAbilityDamage(); if (Ab.Info.Entry == 1669) // Trip Em Up CustomValue = GetAbilityDamage(); if (Ab.Info.Entry == 1666) // Wot Armor CustomValue = GetAbilityDamage(); }
public Ability(AbilityInterface Interface, Ability Parent, Ability_Stats Info, Unit Caster, bool IsBuff, ushort Px, ushort Py, ushort Pz, ushort ZoneId, string OverrideHandler = "") : this(Interface, Parent, Info, Caster, IsBuff, OverrideHandler) { this.Px = Px; this.Py = Py; this.Pz = Pz; this.ZoneId = ZoneId; }
public override void InitAbility(Ability Ab) { this.Ab = Ab; Target = Ab.Caster.CbtInterface.GetTarget(GameData.TargetTypes.TARGETTYPES_TARGET_ALLY); if (Target == null) Target = Ab.Caster; }
public override void InitAbility(Ability Ab) { this.Ab = Ab; if (Ab.Info.RadiusAroundTarget) TargetHandler = new DealDamagesHandler(); if (TargetHandler != null) TargetHandler.InitAbility(Ab); }
public override void Start(Ability Ab) { this.Ab = Ab; if (Ab.Caster.IsUnit()) Target = Ab.Caster.GetUnit().CbtInterface.GetTarget(); Log.Info("DealDamage", "Target = " + Target); }
public override void InitAbility(Ability Ab) { this.Ab = Ab; if (Ab.Caster.IsUnit()) { Target = Ab.Caster.GetUnit().CbtInterface.GetTarget(GameData.TargetTypes.TARGETTYPES_TARGET_ENEMY); } }
public override void OnReceiveDamages(Unit Attacker, Ability Spell, ref uint Damages) { if (IsValid) { if (CombatInterface.CanAttack(Ab.Caster, Attacker)) { IsValid = false; Ab.Caster.DealDamages(Attacker, Ab, GetAbilityDamage()); } } }
public override void InitAbility(Ability Ab) { this.Ab = Ab; if (Ab.Caster.IsUnit()) { Target = Ab.Caster.GetUnit().CbtInterface.GetTarget(GameData.TargetTypes.TARGETTYPES_TARGET_ALLY); /*if (Target != null && !Target.IsPlayer()) Target = null;*/ } }
public override void Start(Ability Ab) { if(TargetHandler == null) InvisibleObject = Ab.Caster.Region.CreateGameObject(23, Ab.ZoneId, Ab.Px, Ab.Py, Ab.Pz); else InvisibleObject = Ab.Caster.Region.CreateGameObject(23, TargetHandler.Target.Zone.ZoneId, (ushort)TargetHandler.Target.X, (ushort)TargetHandler.Target.Y, (ushort)TargetHandler.Target.Z); InvisibleObject.Load(); if (TargetHandler != null) TargetHandler.Start(Ab); }
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; }
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); }
public override void OnReceiveDamages(Unit Attacker, Ability Spell, ref uint Damages) { if (Damages >= AbsorbCount) { Damages -= AbsorbCount; AbsorbCount = 0; //Attacker.SendCastEffect(Ab.Caster, (ushort)(Spell != null ? Spell.Info.Entry : 0), GameData.CombatEvent.COMBATEVENT_ABSORB, 100); /*PacketOut Out = new PacketOut((byte)Opcodes.F_HIT_PLAYER); Out.WriteUInt16(Attacker.Oid); Out.WriteUInt16(Ab.Caster.Oid); Out.WriteHexStringBytes("000008C21D000000"); Ab.Caster.GetPlayer().SendPacket(Out);*/ } else { AbsorbCount -= Damages; Damages = 0; //Attacker.SendCastEffect(Ab.Caster, (ushort)(Spell != null ? Spell.Info.Entry : 0), GameData.CombatEvent.COMBATEVENT_ABSORB, 100); } }
public abstract void Start(Ability Ab);
public override void Start(Ability Ab) { if (Target == null) return; }
/// <summary> /// Deal Heal, check abilities buff (heal bonus , etc ) /// </summary> public virtual void DealHeal(Unit Target, Ability Ab, uint Heal) { AbtInterface.OnDealHeals(Target, Ab, ref Heal); Target.AbtInterface.OnReceiveHeal(this, Ab, ref Heal); if (Ab != null) { Ab.SendSpellDamage(Target, Heal, true); Ab.SendSpellEffect(this, Target, (ushort)Heal, (ushort)Heal, Ab.Info); } DealHeal(Target, (uint)Heal); }
public override void InitAbility(Ability Ab) { this.Ab = Ab; this.OriginalCount = GetAbilityDamage(); }
public override void Start(Ability Ab) { }
public override void Start(Ability Ab) { if (!CombatInterface.CanAttack(Ab.Caster, Target)) Stop(); }
public override void InitAbility(Ability Ab) { this.Ab = Ab; }
/// <summary> /// Deal Damages but check abilities buff reductions (absorb, invinsibility, etc) /// </summary> public virtual void DealDamages(Unit Target, Ability Ab, uint Damages) { AbtInterface.OnDealDamages(Target, Ab, ref Damages); Target.AbtInterface.OnReceiveDamages(this, Ab, ref Damages); if (Ab != null) // Ability Damage { Ab.SendSpellDamage(Target, Damages, false); Ab.SendSpellEffect(this, Target, (ushort)Damages, (ushort)Damages, Ab.Info); } else // Weapon { SendCastEffect(Target, 0, GameData.CombatEvent.COMBATEVENT_HIT, Damages); } DealDamages(Target, (uint)Damages); }
public void OnReceiveHeal(Unit Attacker, Ability Spell, ref uint Damages) { if (CurrentAbility != null && CurrentAbility.Handler != null) CurrentAbility.Handler.OnReceiveHeal(Attacker, Spell, ref Damages); foreach (Ability Ab in ActiveBuff) if (Ab != null && Ab.Handler != null) Ab.Handler.OnReceiveHeal(Attacker, Spell, ref Damages); }
public void Cancel(bool Force) { if (CurrentAbility != null) { Ability Ab = CurrentAbility; CurrentAbility = null; Ab.Cancel(); } }
public override void Update(long Tick) { if (CurrentAbility != null) { if (CurrentAbility.IsStarted) CurrentAbility.Update(Tick); } base.Update(Tick); if (CurrentAbility != null && CurrentAbility.IsDone) { CurrentAbility = null; } UpdateBuff(Tick); }
public override void InitAbility(Ability Ab) { this.Ab = Ab; IsValid = true; }
public void Cast(Ability_Stats Info, ushort Px, ushort Py,ushort Pz, ushort ZoneId) { GameData.AbilityResult Result = CanCast(Info, true); if (Result == GameData.AbilityResult.ABILITYRESULT_OK) { Ability NewAbility = new Ability(this, null, Info, _Owner.GetUnit(),false, Px, Py, Pz, ZoneId); if (NewAbility.Handler != null) Result = NewAbility.Handler.CanCast(true); if (NewAbility.Handler == null || Result == GameData.AbilityResult.ABILITYRESULT_OK) { //Log.Info("Cast", Info.Entry.ToString() + ":" + Info.Description + " : " + Info.Damages1); SetCooldown(0, GlobalMSCoolDown); CurrentAbility = NewAbility; CurrentAbility.Start(); SetCooldown(Info.Entry, Info.Info.Cooldown * 1000); } else Cancel(false); } else Cancel(false); }
public void OnCastAbility(Ability Ab) { for (int i = 0; i < Scripts.Count; ++i) Scripts[i].OnCastAbility(Ab); }
public IAbilityTypeHandler AddBuff(Ability Parent, string NewHandler) { Ability Current = GetBuff(Parent.Info.Entry); if (Current != null && Current.Info.Level == Parent.Info.Level) { Current.Reset(); return Current.Handler; } else if (Current != null && Current.Info.Level > Parent.Info.Level) return null; else { if (Current != null && Current.Info.Level < Parent.Info.Level) Current.Stop(); byte Id = (byte)GetBuffId(); Ability Ab = new Ability(this, Parent, Parent.Info, Parent.Caster, true, NewHandler); Ab.BuffId = (byte)(Id + 1); Ab.Start(); Ab.Reset(); if (Id >= ActiveBuff.Count) ActiveBuff.Add(Ab); else ActiveBuff[Id] = Ab; Log.Info("AddBuff", _Owner.Name + "," + Ab.Handler); return Ab.Handler; } }
public override void InitAbility(Ability Ab) { this.Ab = Ab; this.Target = Ab.Parent.Handler.GetTarget(); }
public void OnDealHeals(Unit Victim, Ability Spell, ref uint Damages) { if (CurrentAbility != null && CurrentAbility.Handler != null) CurrentAbility.Handler.OnDealHeals(Victim, Spell, ref Damages); foreach (Ability Ab in ActiveBuff) if (Ab != null && Ab.Handler != null) Ab.Handler.OnDealHeals(Victim, Spell, ref Damages); }
public override void Start(Ability Ab) { if (!CombatInterface.IsFriend(Ab.Caster, Target)) Stop(); }