public static bool BladeWeaving(Mobile attacker, out WeaponAbility a) { BladeWeaveRedirect bwr; bool success = m_NewAttack.TryGetValue(attacker, out bwr); if (success) a = bwr.NewAbility; else a = null; return success; }
private static void InternalCallback( Mobile attacker, Mobile defender, int damage, WeaponAbility a ) { if ( !defender.CanBeginAction( typeof( ClericSacrificeSpell ) ) ) { PSys.Party p = PSys.Party.Get( defender ); if ( p != null ) { foreach( PSys.PartyMemberInfo info in p.Members ) { Mobile m = info.Mobile; if ( m != defender && m != attacker && !m.Poisoned ) { m.Heal( damage / 2 ); m.PlaySound( 0x202 ); m.FixedParticles( 0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist ); m.FixedParticles( 0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist ); } } } } }
public static bool SetCurrentAbility(Mobile m, WeaponAbility a) { if (!Core.AOS) { ClearCurrentAbility(m); return false; } if (!IsWeaponAbility(m, a)) { ClearCurrentAbility(m); return false; } if (a != null && !a.Validate(m)) { ClearCurrentAbility(m); return false; } if (a == null) { m_Table.Remove(m); } else { SpecialMove.ClearCurrentMove(m); m_Table[m] = a; } return true; }
public static bool IsWeaponAbility(Mobile m, WeaponAbility a) { if (a == null) return true; if (!m.Player) return true; BaseWeapon weapon = m.Weapon as BaseWeapon; return (weapon != null && (weapon.PrimaryAbility == a || weapon.SecondaryAbility == a)); }
public static bool SetCurrentAbility( Mobile m, WeaponAbility a ) { if ( !IsWeaponAbility( m, a ) ) { ClearCurrentAbility( m ); return false; } if ( m.Spell != null ) { m.SendLocalizedMessage( 1063024 ); // You cannot perform this special move right now. ClearCurrentAbility( m ); return false; } if ( a != null && !a.Validate( m ) ) { ClearCurrentAbility( m ); return false; } if ( a == null ) { m_Table.Remove( m ); } else { SpecialMove.ClearCurrentMove( m ); m_Table[m] = a; } return true; }
public static void InvokeHitByWeapon( Mobile attacker, Mobile defender, int damage, WeaponAbility a ) { if ( HitByWeapon != null ) HitByWeapon( attacker, defender, damage, a ); }
private static void InternalCallback( Mobile attacker, Mobile defender, int damage, WeaponAbility a ) { if ( !defender.CanBeginAction( typeof( ClericTrialByFireSpell ) ) && Utility.RandomBool() ) { defender.DoHarmful( attacker ); double scale = 1.0; scale += defender.Skills[SkillName.Inscribe].Value * 0.001; if ( defender.Player ) { scale += defender.Int * 0.001; scale += AosAttributes.GetValue( defender, AosAttribute.SpellDamage ) * 0.01; } int baseDamage = 6 + (int)(defender.Skills[SkillName.EvalInt].Value / 5.0); double firedmg = Utility.RandomMinMax( baseDamage, baseDamage + 3 ); firedmg *= scale; SpellHelper.Damage( TimeSpan.Zero, attacker, defender, firedmg, 0, 100, 0, 0, 0 ); attacker.FixedParticles( 0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot ); attacker.PlaySound( 0x208 ); } }
public static bool SetCurrentAbility( Mobile m, WeaponAbility a ) { ClearCurrentAbility( m ); return false; }
public BladeWeaveRedirect(WeaponAbility ability, int cliloc) { NewAbility = ability; ClilocEntry = cliloc; }
public override TimeSpan OnSwing(Mobile attacker, Mobile defender) { WeaponAbility a = WeaponAbility.GetCurrentAbility(attacker); // Make sure we've been standing still for .25/.5/1 second depending on Era if (DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds(Core.SE ? 0.25 : (Core.AOS ? 0.5 : 1.0))) || (Core.AOS && WeaponAbility.GetCurrentAbility(attacker) is MovingShot)) { bool canSwing = true; if (Core.AOS) { canSwing = (!attacker.Paralyzed && !attacker.Frozen); if (canSwing) { Spell sp = attacker.Spell as Spell; canSwing = (sp == null || !sp.IsCasting || !sp.BlocksMovement); } } if (canSwing && attacker.HarmfulCheck(defender)) { attacker.DisruptiveAction(); attacker.Send(new Swing(0, attacker, defender)); if (OnFired(attacker, defender)) { if (CheckHit(attacker, defender)) { OnHit(attacker, defender); } else { OnMiss(attacker, defender); } } } attacker.RevealingAction(); return(GetDelay(attacker)); } else { attacker.RevealingAction(); return(TimeSpan.FromSeconds(0.25)); } }
public override TimeSpan OnSwing(Mobile attacker, Mobile defender) { WeaponAbility a = WeaponAbility.GetCurrentAbility(attacker); //attacker.SendMessage(this.SwingState.ToString()); /*if (DateTime.Now <= (attacker.LastMoveTime + TimeSpan.FromSeconds(0.25))) * { * * return TimeSpan.Zero; * }*/ // Make sure we've been standing still for .25/.5/1 second depending on Era /*if (DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds(Core.SE ? 0.25 : (Core.AOS ? 0.5 : 1.0))) || (Core.AOS && WeaponAbility.GetCurrentAbility(attacker) is MovingShot)) * {*/ bool canSwing = true; int OldSwingState = attacker.SwingState; int NewSwingState = this.AdvanceSwingState(attacker); if (OldSwingState == NewSwingState) { return(TimeSpan.Zero); } if (NewSwingState < 2) { return(TimeSpan.Zero); } if (NewSwingState == 2) { if (!OnFired(attacker, defender)) { this.ResetSwingState(1); return(TimeSpan.Zero); } PlaySwingAnimation(attacker); //attacker.PlaySound(GetMissAttackSound(attacker, defender)); attacker.DisruptiveAction(); attacker.Send(new Swing(0, attacker, defender)); if (CheckHit(attacker, defender)) { OnHit(attacker, defender); } else { OnMiss(attacker, defender); } } if (NewSwingState == 3 && attacker.HarmfulCheck(defender)) { /*if (OnFired(attacker, defender)) * {*/ //} } attacker.RevealingAction(); return(GetDelay(attacker)); /*} * else * { * attacker.RevealingAction(); * * return TimeSpan.FromSeconds(0.25); * }*/ }
public override TimeSpan OnSwing(Mobile attacker, Mobile defender) { WeaponAbility a = WeaponAbility.GetCurrentAbility(attacker); if (this.Parent is Player) { Marksman mm = Perk.GetByType <Marksman>((Player)this.Parent); if (mm != null && mm.RunAndGun()) { bool canSwing = true; if (Core.AOS) { canSwing = (!attacker.Paralyzed && !attacker.Frozen); if (canSwing) { Spell sp = attacker.Spell as Spell; canSwing = (sp == null || !sp.IsCasting || !sp.BlocksMovement); } } if (canSwing && attacker.HarmfulCheck(defender)) { attacker.DisruptiveAction(); attacker.Send(new Swing(0, attacker, defender)); Item weapon = this as BaseRanged; if (weapon != null) { if (((Player)this.Parent).Stam < (int)(((weapon.Weight + 2) / 2) + 3)) { canSwing = false; ((Player)this.Parent).SendMessage("You do not have the stamina to draw your bow."); } else { ((Player)this.Parent).Stam -= (int)(((weapon.Weight + 2) / 2) + 3); } } if (OnFired(attacker, defender)) { if (CheckHit(attacker, defender)) { OnHit(attacker, defender); } else { OnMiss(attacker, defender); } } } attacker.RevealingAction(); return(GetDelay(attacker)); } } // Make sure we've been standing still for .25/.5/1 second depending on Era if (DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds(Core.SE ? 0.25 : (Core.AOS ? 0.5 : 1.0))) || (Core.AOS && WeaponAbility.GetCurrentAbility(attacker) is MovingShot)) { bool canSwing = true; if (Core.AOS) { canSwing = (!attacker.Paralyzed && !attacker.Frozen); if (canSwing) { Spell sp = attacker.Spell as Spell; canSwing = (sp == null || !sp.IsCasting || !sp.BlocksMovement); } } if (canSwing && attacker.HarmfulCheck(defender)) { attacker.DisruptiveAction(); attacker.Send(new Swing(0, attacker, defender)); Item weapon = this as BaseRanged; if (Parent is Player) { if (weapon != null) { if (((Player)this.Parent).Stam < (int)(((weapon.Weight + 2) / 2) + 3)) { canSwing = false; ((Player)this.Parent).SendMessage("You do not have the stamina to draw your bow."); } else { ((Player)this.Parent).Stam -= (int)(((weapon.Weight + 2) / 2) + 3); } } } if (OnFired(attacker, defender)) { if (CheckHit(attacker, defender)) { OnHit(attacker, defender); } else { OnMiss(attacker, defender); } } } attacker.RevealingAction(); return(GetDelay(attacker)); } else { attacker.RevealingAction(); return(TimeSpan.FromSeconds(0.25)); } }
//public override void OnDoubleClick( Mobile from ) //{ // base.OnDoubleClick( from ); //} public override TimeSpan OnSwing(Mobile attacker, Mobile defender) { // Make sure we've been standing still for one second if (Core.TickCount > attacker.LastMoveTime + (Core.AOS ? 500 : 1000) || (Core.AOS && WeaponAbility.GetCurrentAbility(attacker) is MovingShot)) { bool canSwing = true; if (Core.AOS) { canSwing = (!attacker.Paralyzed && !attacker.Frozen); if (canSwing) { Spell sp = attacker.Spell as Spell; canSwing = (sp == null || !sp.IsCasting || !sp.BlocksMovement); } } if (canSwing && attacker.HarmfulCheck(defender)) { attacker.DisruptiveAction(); attacker.Send(new Swing(0, attacker, defender)); if (OnFired(attacker, defender)) { if (CheckHit(attacker, defender)) { OnHit(attacker, defender); } else { OnMiss(attacker, defender); } } } return(GetDelay(attacker)); } else { return(TimeSpan.FromSeconds(0.25)); } }