public override void OnThink() { base.OnThink(); if (Combatant == null) { return; } if (_NextMastery < DateTime.UtcNow) { if (SkillMasterySpell.HasSpell(this, typeof(RampageSpell)) || Utility.RandomDouble() > 0.5) { SpecialMove.SetCurrentMove(this, SpellRegistry.GetSpecialMove(740)); } else { SkillMasterySpell spell = new RampageSpell(this, null); spell.Cast(); } _NextMastery = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(45, 70)); } if (_NextSpecial < DateTime.UtcNow) { DoSpecial(); _NextSpecial = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(45, 60)); } }
public override void OnThink() { base.OnThink(); if (Combatant == null) { return; } if (Core.TickCount - _NextMastery >= 0) { object spell = GetMasterySpell(); if (spell == null) { return; } if (spell is SkillMasterySpell && !SkillMasterySpell.HasSpell(this, ((SkillMasterySpell)spell).GetType())) { ((SkillMasterySpell)spell).Cast(); _NextMastery = Core.TickCount + (int)TimeSpan.FromSeconds(Utility.RandomMinMax(15, 30)).TotalMilliseconds; } else if (spell is SpecialMove) { SpecialMove.SetCurrentMove(this, (SpecialMove)spell); _NextMastery = Core.TickCount + (int)TimeSpan.FromSeconds(Utility.RandomMinMax(15, 30)).TotalMilliseconds; } } }
public static bool CheckHit(Mobile attacker, Mobile defender, WeaponAbility ability, Item weapon) { if (defender == null || (Core.EJ && (ability == WeaponAbility.Disarm || ability == WeaponAbility.InfectiousStrike || SkillMasterySpell.HasSpell(attacker, typeof(SkillMasterySpell))))) { return(false); } SplinteringWeaponContext context = PropertyEffect.GetContext <SplinteringWeaponContext>(attacker, defender, EffectsType.Splintering); if (context == null) { new SplinteringWeaponContext(attacker, defender, weapon); return(true); } return(false); }
public static bool CheckHit(Mobile attacker, Mobile defender, WeaponAbility ability, Item weapon) { if (defender == null || ability == WeaponAbility.Disarm || ability == WeaponAbility.InfectiousStrike || SkillMasterySpell.HasSpell(attacker, typeof(SkillMasterySpell)) || VictimIsUnderEffects <SplinteringWeaponContext>(defender)) { return(false); } SplinteringWeaponContext context = GetContext <SplinteringWeaponContext>(attacker, defender); if (context == null) { AddEffects(new SplinteringWeaponContext(attacker, defender, weapon)); return(true); } return(false); }