public override void OnDoubleClick(Mobile from) //testing to make sure it works. { if (from.InRange(this, 3) && from is PlayerMobile) { from.PlaySound(from.Female ? 791 : 1063); from.Say("*slipped on " + Name + "*"); if (!from.Mounted) { from.Freeze(TimeSpan.FromSeconds(4.0)); from.Animate(22, 5, 1, true, false, 0); from.Freeze(TimeSpan.FromSeconds(4.0)); } } }
public override void OnMovement(Mobile from, Point3D oldLocation) { if (from.InRange(this, 3) && from is PlayerMobile) //chooses the area around the bannana { from.PlaySound(from.Female ? 791 : 1063); //sound from.Say("*slipped on " + Name + "*"); //message if (!from.Mounted) //if not on a horse do the following... { from.Freeze(TimeSpan.FromSeconds(4.0)); //stops player from running from.Animate(22, 5, 1, true, false, 0); //show the player falling from.Freeze(TimeSpan.FromSeconds(4.0)); //stops the player just a bit longer. } } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (defender.Frozen == false) { defender.Freeze( TimeSpan.FromSeconds( 6.0 ) ); defender.SendMessage( "You are stuck to the spot!" ); } }
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus ) { if (defender.Player && defender.Region.Name == "The Paintball Field" ) { Item paintrobe = defender.FindItemOnLayer(Layer.OuterTorso ); defender.SendMessage( "You feel wet paint on you" ); if ( paintrobe == null) { defender.SendMessage( "Cheating is not allowed!!!" ); defender.SendMessage( "You are Eliminated" ); defender.X = 6094; defender.Y = 1216; defender.Z = 0; defender.Map = Map.Felucca; } else if ( paintrobe.Hue == 6) paintrobe.Hue = 11; else if ( paintrobe.Hue == 11) paintrobe.Hue = 21; else if ( paintrobe.Hue == 21) paintrobe.Hue = 31; else if ( paintrobe.Hue == 31) paintrobe.Hue = 38; else if ( paintrobe.Hue == 38) { paintrobe.Hue = 6; defender.X = 6094; defender.Y = 1216; defender.Z = 0; defender.Map = Map.Felucca; defender.SendMessage( "You were Eliminated" ); this.Name = this.Name + "/"; } else { paintrobe.Hue = 6; defender.X = 6094; defender.Y = 1216; defender.Z = 0; defender.Map = Map.Felucca; defender.SendMessage( "You were Eliminated for an improper robe" ); } } else if ( defender.Region.Name == "The Paintball Field" ) { attacker.SendMessage( "You stunned the bot for a moment" ); defender.Freeze( TimeSpan.FromSeconds( 10.0 ) ); } damageBonus = -10; base.OnHit( attacker, defender, damageBonus ); }
public override void OnHit( Mobile attacker, Mobile defender, int damage ) { if ( !Validate( attacker ) || !CheckMana( attacker, true ) ) return; ClearCurrentAbility( attacker ); attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow! defender.SendLocalizedMessage( 1060164 ); // The attack has temporarily paralyzed you! defender.Freeze( defender.Player ? PlayerFreezeDuration : NPCFreezeDuration ); defender.FixedEffect( 0x376A, 9, 32 ); defender.PlaySound( 0x204 ); }
public override void OnTrigger( Mobile from ) { if ( from.AccessLevel > AccessLevel.Player ) return; Effects.SendLocationEffect( this.Location, this.Map, 14186, 32, 20, 300, 0 ); Effects.PlaySound( Location, Map, 0x204 ); if ( from.Alive && CheckRange( from.Location, 0 ) && from.CanBeDamaged() ) { from.Freeze( TimeSpan.FromSeconds( m_Duration ) ); from.SendMessage( "You have been paralyzed!" ); } }
public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message) { if (!dismounted.Mounted && !Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted) && !dismounted.Flying) { return; } if (dismounted is ChaosDragoonElite) { dismounter.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount. } IMount mount = dismounted.Mount; if (mount != null) { mount.Rider = null; if (message) { dismounted.SendLocalizedMessage(1040023); // You have been knocked off of your mount! } } else if (Core.ML && Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted)) { Spells.Ninjitsu.AnimalForm.RemoveContext(dismounted, true); } else if (dismounted.Flying) { if (!OnFlightPath(dismounted)) { dismounted.Flying = false; dismounted.Freeze(TimeSpan.FromSeconds(1)); dismounted.Animate(AnimationType.Land, 0); BuffInfo.RemoveBuff(dismounted, BuffIcon.Fly); } } else { return; } if (delay != TimeSpan.MinValue) { SetMountPrevention(dismounted, mount as Mobile, blockmounttype, delay); } }
public override void OnThink() { if (DateTime.Now >= m_NextPull) { Mobile combatant = this.Combatant; if (combatant != null && combatant.Map == this.Map && !combatant.InRange(this, 4)) { m_NextPull = DateTime.Now + TimeSpan.FromSeconds(20.0); combatant.MoveToWorld(this.Location, this.Map); combatant.Poison = Poison.Lethal; combatant.Freeze(TimeSpan.FromSeconds(5.0)); combatant.SendMessage("A hidden vine pulls you to the tree!"); } } }
// No longer active in pub21: /*public override bool CheckSkills( Mobile from ) * { * if ( !base.CheckSkills( from ) ) * return false; * * if ( !(from.Weapon is Fists) ) * return true; * * Skill skill = from.Skills[SkillName.Anatomy]; * * if ( skill != null && skill.Base >= 80.0 ) * return true; * * from.SendLocalizedMessage( 1061811 ); // You lack the required anatomy skill to perform that attack! * * return false; * }*/ public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker) || !CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); attacker.SendLocalizedMessage(1060163); // You deliver a paralyzing blow! defender.SendLocalizedMessage(1060164); // The attack has temporarily paralyzed you! defender.Freeze(defender.Player ? PlayerFreezeDuration : NPCFreezeDuration); defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x204); }
public override void OnTrigger(Mobile from) { if (from.AccessLevel > AccessLevel.Player) { return; } Effects.SendLocationEffect(this.Location, this.Map, 14186, 32, 20, 300, 0); Effects.PlaySound(Location, Map, 0x204); if (from.Alive && CheckRange(from.Location, 0) && from.CanBeDamaged()) { from.Freeze(TimeSpan.FromSeconds(m_Duration)); from.SendMessage("You have been paralyzed!"); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (0.1 > Utility.RandomDouble()) { defender.FixedParticles(0x374A, 1, 17, 0x15B6, 0, 0, EffectLayer.Waist); defender.PlaySound(0x233); defender.Damage(10, this); switch (Utility.Random(3)) { case 0: { defender.SendLocalizedMessage(1112391); // The creature's tail smashes into you! break; } case 1: { defender.Freeze(TimeSpan.FromSeconds(3.0)); defender.SendLocalizedMessage(1112554); // You're stunned as the creature's tail knocks the wind out of you. break; } case 2: { defender.SendLocalizedMessage(1112555); // You're left confused as the creature's tail catches you right in the face! defender.PublicOverheadMessage(MessageType.Regular, 946, 502039); // *looks confused* defender.AddStatMod(new StatMod(StatType.Dex, "Boura Dex Malus", -20, TimeSpan.FromSeconds(5.0))); defender.AddStatMod(new StatMod(StatType.Int, "Boura Int Malus", -20, TimeSpan.FromSeconds(5.0))); defender.FixedParticles(0x37B9, 1, 10, 0x232A, 5, 0, EffectLayer.Head); defender.PlaySound(0xF9); break; } } } }
public void Entangle(Mobile m) { Point3D p = Location; if (SpellHelper.FindValidSpawnLocation(Map, ref p, true)) { TimeSpan delay = TimeSpan.FromSeconds(Utility.RandomMinMax(3, 6)); m.MoveToWorld(p, Map); m.Freeze(delay); m.SendLocalizedMessage(1042555); // You become entangled in the spider web. SpiderWeb web = new SpiderWeb(delay); p.Z += 2; web.MoveToWorld(p, Map); Combatant = m; } }
public override void OnCast() { if (CheckSequence()) { ArrayList targets = new ArrayList(); Map map = Caster.Map; if (map != null) { double tile = SpellHelper.AdjustValue(Caster, 1 + (int)(Caster.Skills[CastSkill].Value / 33.0), true); if (tile > 5) { tile = 5; } foreach (Mobile m in Caster.GetMobilesInRange((int)tile)) { if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && !(Caster.Party == m.Party)) { targets.Add(m); } } } Caster.PlaySound(503); Effects.SendTargetParticles(Caster, 14154, 10, 15, 5013, 1108, 0, EffectLayer.CenterFeet); //ID, speed, dura, effect, hue, render, layer TimeSpan duration = TimeSpan.FromSeconds(0); for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; Effects.SendTargetParticles(m, 14154, 10, 15, 5013, 1108, 0, EffectLayer.CenterFeet); //ID, speed, dura, effect, hue, render, layer Disturb(m); m.Freeze(duration); } } FinishSequence(); }
private void ExplodeHorn( Mobile target ) { target.SendMessage("One of the eryon's horns seems to glow, erupting violently in a flash!"); this.FixedEffect(0x36B0, 10, 1); target.BoltEffect(0); target.BoltEffect(0); target.Freeze(TimeSpan.FromSeconds(5)); this.Direction = this.GetDirectionTo(target.Location); this.DoHarmful(target, true); target.Damage(Utility.RandomMinMax(15, 45), this); Item hornShard = new Item(0x9D1); //grape bunch itemID hornShard.Hue = 1109; hornShard.Name = "a piece of eryon horn"; hornShard.MoveToWorld(target.Location, target.Map); }
public override void OnGaveMeleeAttack(Mobile defender) { if (DoElementalChamp && Utility.Random(2) < 1) { Map map = this.Map; if (map != null) { // try 10 times to find a teleport spot for (int i = 0; i < 10; ++i) { int x = X + (Utility.RandomMinMax(-10, 15)); int y = Y + (Utility.RandomMinMax(-10, 15)); int z = Z; if (!map.CanFit(x, y, z, 16, false, false)) { continue; } Point3D from = defender.Location; Point3D to = new Point3D(x, y, z); if (!InLOS(to)) { continue; } defender.Location = to; defender.ProcessDelta(); defender.Combatant = null; defender.Freeze(TimeSpan.FromSeconds(5.0)); Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023); Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); Effects.PlaySound(to, map, 0x1FE); DoECTeleport(this); } } } base.OnGaveMeleeAttack(defender); }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker) || !CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); bool cantpara = Server.Items.ParalyzingBlow.IsImmune(defender); if (cantpara) { attacker.SendLocalizedMessage(1070804); // Your target resists paralysis. defender.SendLocalizedMessage(1070813); // You resist paralysis. } else { attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike! defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike! } attacker.PlaySound(0x204); defender.FixedEffect(0x376A, 9, 32); defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist); if (Core.ML) { AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + Utility.Random(10)), true, 100, 0, 0, 0, 0); //0-25 if (!cantpara && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble()) { defender.Paralyze(TimeSpan.FromSeconds(2.0)); Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration); } } else if (!cantpara) { AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0); //10-25 defender.Freeze(TimeSpan.FromSeconds(2.0)); Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration); } }
private void ExplodeHorn(Mobile target) { target.SendMessage("One of the eryon's horns seems to glow, erupting violently in a flash!"); this.FixedEffect(0x36B0, 10, 1); target.BoltEffect(0); target.BoltEffect(0); target.Freeze(TimeSpan.FromSeconds(5)); this.Direction = this.GetDirectionTo(target.Location); this.DoHarmful(target, true); target.Damage(Utility.RandomMinMax(15, 45), this); Item hornShard = new Item(0x9D1); //grape bunch itemID hornShard.Hue = 1109; hornShard.Name = "a piece of eryon horn"; hornShard.MoveToWorld(target.Location, target.Map); }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); BaseCreature c = defender as BaseCreature; if (c != null && c.SummonMaster != null) { c.ControlTarget = c.SummonMaster; c.ControlOrder = OrderType.Attack; c.Combatant = c.SummonMaster; this.Combatant = c.SummonMaster; } if (defender.Player) { defender.Freeze(TimeSpan.FromSeconds(5.0)); defender.SendMessage("You are frozen in sheer terror!"); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (0.2 < Utility.RandomDouble()) { return; } switch (Utility.Random(2)) { case 0: { defender.SendMessage("The Torax Has Bitten You!"); defender.PlaySound(0x597); AOS.Damage(defender, this, Utility.Random(95, 65), 100, 0, 0, 0, 0); break; } case 1: { defender.SendAsciiMessage("The Torax Is Using Its Head As A Battering Ram And Slams Into You!"); defender.PlaySound(0x599); defender.Freeze(TimeSpan.FromSeconds(3.0)); IMount mount = defender.Mount; if (mount != null) { mount.Rider = null; } if (defender.Mounted) { return; } AOS.Damage(defender, this, Utility.Random(45, 40), 100, 0, 0, 0, 0); break; } } }
public override void OnGotMeleeAttack(Mobile attacker) { base.OnGaveMeleeAttack(attacker); if (Utility.Random(4) < 1) { Map map = this.Map; if (map != null) { for (int i = 0; i < 10; ++i) { int x = X + (Utility.RandomMinMax(-10, 15)); int y = Y + (Utility.RandomMinMax(-10, 15)); int z = Z; if (!map.CanFit(x, y, z, 16, false, false)) { continue; } Point3D from = attacker.Location; Point3D to = new Point3D(x, y, z); if (!InLOS(to)) { continue; } attacker.Location = to; attacker.ProcessDelta(); attacker.Combatant = null; attacker.Freeze(TimeSpan.FromSeconds(10.0)); Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023); Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); Effects.PlaySound(to, map, 0x1FE); } } } }
public override void OnHit( Mobile attacker, Mobile defender, int damage ) { if( !Validate( attacker ) || !CheckMana( attacker, true ) ) return; ClearCurrentAbility( attacker ); bool cantpara = Server.Items.ParalyzingBlow.IsImmune(defender); if ( cantpara ) { attacker.SendLocalizedMessage(1070804); // Your target resists paralysis. defender.SendLocalizedMessage(1070813); // You resist paralysis. } else { attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike! defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike! } attacker.PlaySound(0x204); defender.FixedEffect(0x376A, 9, 32); defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist); if ( Core.ML ) { AOS.Damage( defender, attacker, (int)( 15.0 * ( attacker.Skills[SkillName.Bushido].Value - 50.0 ) / 70.0 + Utility.Random( 10 ) ), true, 100, 0, 0, 0, 0 ); //0-25 if (!cantpara && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble()) { defender.Paralyze( TimeSpan.FromSeconds( 2.0 ) ); Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration ); } } else if( !cantpara ) { AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0 ); //10-25 defender.Freeze(TimeSpan.FromSeconds(2.0)); Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration); } }
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus ) { base.OnHit( attacker, defender, damageBonus ); if ( Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() ) { defender.SendMessage( "You receive a paralyzing blow!" ); // Is this not localized? defender.Freeze( TimeSpan.FromSeconds( 2.0 ) ); attacker.SendMessage( "You deliver a paralyzing blow!" ); // Is this not localized? attacker.PlaySound( 0x11C ); } if ( Poison != null && PoisonCharges > 0 ) { --PoisonCharges; if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison defender.ApplyPoison( attacker, Poison ); } }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { base.OnHit(attacker, defender, damageBonus); if (!Core.AOS && this.Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility(attacker, "Paralyzing Blow", false)) { defender.SendMessage("You receive a paralyzing blow!"); // Is this not localized? defender.Freeze(TimeSpan.FromSeconds(2.0)); attacker.SendMessage("You deliver a paralyzing blow!"); // Is this not localized? attacker.PlaySound(0x11C); } if (!Core.AOS && this.Poison != null && this.PoisonCharges > 0) { --this.PoisonCharges; if (Utility.RandomDouble() >= 0.5) // 50% chance to poison defender.ApplyPoison(attacker, this.Poison); } }
public static bool BeginSpiritSpeak(Mobile m) { if (_Table == null || !_Table.ContainsKey(m)) { m.Freeze(TimeSpan.FromSeconds(1)); m.Animate(AnimationType.Spell, 1); m.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1062074, "", false); // Anh Mi Sah Ko m.PlaySound(0x24A); if (_Table == null) { _Table = new Dictionary <Mobile, Timer>(); } _Table[m] = new SpiritSpeakTimerNew(m); return(true); } return(false); }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (defender.Frozen || UnderEffect(defender)) { attacker.SendLocalizedMessage(1061923); // The target is already frozen. return; } if (!IsBladeweaveAttack) { if (!Validate(attacker)) { return; } if (!CheckMana(attacker, true)) { return; } } ClearCurrentAbility(attacker); if (!IsInmune(defender)) { attacker.SendLocalizedMessage(1060163); // You deliver a paralyzing blow! defender.SendLocalizedMessage(1072221); // You have been hit by a paralyzing blow! defender.Freeze(defender.IsPlayer ? PlayerFreezeDuration : NPCFreezeDuration); BeginInmunity(defender); } else { attacker.SendLocalizedMessage(1063346); // Your attack was blocked! defender.SendLocalizedMessage(1070813); // You resist paralysis. } defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x204); }
private void Damage(Mobile to) { if (to != null) { // send the effects Effects.SendPacket(to, to.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, to.Location, to.Location, 20, 10, true, false)); to.PlaySound(0x307); // deal the damage SpellHelper.Damage(this, to, GetNewAosDamage(40, 1, 5, to), 100, 0, 0, 0, 0); // stun the target double stunChance = (GetBaseSkill(Caster) + GetBoostSkill(Caster)) / 2000.0; stunChance -= GetResistSkill(to) / 1000.0; if (Utility.RandomDouble() < stunChance && !ParalyzingBlow.IsInmune(to)) { to.Freeze(TimeSpan.FromSeconds(2.0)); ParalyzingBlow.BeginInmunity(to, TimeSpan.FromSeconds(10.0)); } } }
public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message) { if (!dismounted.Mounted) { return; } if (dismounted is ChaosDragoonElite) { dismounter.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount. } IMount mount = dismounted.Mount; if (mount != null) { mount.Rider = null; BaseMount.SetMountPrevention(dismounted, blockmounttype, delay); if (message) { dismounted.SendLocalizedMessage(1040023); // You have been knocked off of your mount! } BuffInfo.AddBuff(dismounted, new BuffInfo(BuffIcon.DismountPrevention, 1075635, 1075636, delay, dismounted)); } else if (dismounted.Flying) { if (!OnFlightPath(dismounted)) { dismounted.Flying = false; dismounted.Freeze(TimeSpan.FromSeconds(1)); dismounted.Animate(61, 10, 1, true, false, 0); } } else if (Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted)) { Spells.Ninjitsu.AnimalForm.RemoveContext(dismounted, true); } }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m.Blessed) { Caster.SendMessage("Vous ne pouvez pas cibler une créature invulnérable !"); } else if (CheckSequence()) { SpellHelper.Turn(Caster, m); if (m != Caster && m.BeginAction(typeof(ChampDeStaseSpell)) && m.AccessLevel <= Caster.AccessLevel) { double dur = durationMax * Spell.GetSpellScaling(Caster, Info.skillForCasting); TimeSpan duration = TimeSpan.FromSeconds(dur); m.Freeze(duration); m.Hidden = true; m.Blessed = true; Timer t = new InternalTimer(m, duration); m_Timers[m] = t; t.Start(); } else { Caster.SendMessage("Vous ne pouvez pas vous cibler vous-même !"); } } FinishSequence(); }
public void Teleport(Mobile caster) // Taken from questboss.cs and values changed (note this.Combatant = caster; was added and i have emailed you this change to questboss.cs too { Map map = this.Map; if (map != null) { for (int i = 0; i < 12; ++i) { int x = X + (Utility.RandomMinMax(-1, 1)); int y = Y + (Utility.RandomMinMax(-1, 1)); int z = Z; if (!map.CanFit(x, y, z, 16, false, false)) { continue; } Point3D from = caster.Location; Point3D to = new Point3D(x, y, z); if (!InLOS(to)) { continue; } caster.Location = to; caster.ProcessDelta(); caster.Combatant = null; this.Combatant = caster; caster.Freeze(TimeSpan.FromSeconds(1.5)); Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023); Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); Effects.PlaySound(to, map, 0x1FE); } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Bandage.Deleted) { return; } if (targeted is Mobile) { if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range)) { if (BandageContext.BeginHeal(from, (Mobile)targeted) != null) { from.PublicOverheadMessage(MessageType.Regular, 0x22, true, "** Begins healing with bandages! **"); from.Freeze(TimeSpan.FromSeconds(1.5)); if (!Engines.ConPVP.DuelContext.IsFreeConsume(from)) { m_Bandage.Consume(); } } } else { from.SendLocalizedMessage(500295); // You are too far away to do that. } } else if (targeted is PlagueBeastInnard) { if (((PlagueBeastInnard)targeted).OnBandage(from)) { m_Bandage.Consume(); } } else { from.SendLocalizedMessage(500970); // Bandages can not be used on that. } }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker) || !CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); defender.Damage((int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + Utility.RandomMinMax(1, 10)), attacker); double chance = (double)(((4 * attacker.Skills[SkillName.Bushido].Value) + 150) / 700); if (chance < Utility.RandomDouble()) { attacker.SendLocalizedMessage(1070804); // Your target resists paralysis. return; } if (Server.Items.ParalyzingBlow.IsInmune(defender)) { attacker.SendLocalizedMessage(1070804); // Your target resists paralysis. defender.SendLocalizedMessage(1070813); // You resist paralysis. return; } attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike! defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike! attacker.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist); defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x204); defender.Freeze(TimeSpan.FromSeconds(2.0)); Server.Items.ParalyzingBlow.BeginInmunity(defender, TimeSpan.FromSeconds(10.0)); }
public void Teleport(Mobile caster) { Map map = this.Map; if (map != null) { for (int i = 0; i < 10; ++i) { int x = X + (Utility.RandomMinMax(-1, 1)); int y = Y + (Utility.RandomMinMax(-1, 1)); int z = Z; if (!map.CanFit(x, y, z, 16, false, false)) { continue; } Point3D from = caster.Location; Point3D to = new Point3D(x, y, z); if (!InLOS(to)) { continue; } caster.Location = to; caster.ProcessDelta(); caster.Combatant = null; this.Combatant = caster; caster.Freeze(TimeSpan.FromSeconds(2.0)); Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023); Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); Effects.PlaySound(to, map, 0x1FE); } } }
public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message) { if (!dismounted.Mounted) { return; } if (dismounted is ChaosDragoonElite) { dismounter.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount. } IMount mount = dismounted.Mount; if (mount != null) { mount.Rider = null; BaseMount.SetMountPrevention(dismounted, blockmounttype, delay); if (message) { dismounted.SendLocalizedMessage(1040023); // You have been knocked off of your mount! } } else if (dismounted.Flying) { if (!OnFlightPath(dismounted)) { dismounted.Flying = false; dismounted.Freeze(TimeSpan.FromSeconds(1)); dismounted.Animate(61, 10, 1, true, false, 0); } else { // ... } } }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { base.OnHit(attacker, defender, damageBonus); if ((attacker.Skills[SkillName.Anatomy].Value / 1000.0) >= Utility.RandomDouble()) // 10% chance to paralyze at 100 anatomy. { defender.SendMessage("You receive a paralyzing blow!"); defender.Freeze(TimeSpan.FromSeconds(2.0)); attacker.SendMessage("You deliver a paralyzing blow!"); attacker.PlaySound(0x11C); } if (Core.AOS && Poison != null && PoisonCharges > 0) { --PoisonCharges; if (Utility.RandomDouble() >= 0.5) // 50% chance to poison { defender.ApplyPoison(attacker, Poison); } } }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { base.OnHit(attacker, defender, damageBonus); if (!Core.AOS && this.Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility(attacker, "Paralyzing Blow", false)) { defender.SendMessage("You receive a paralyzing blow!"); // Is this not localized? defender.Freeze(TimeSpan.FromSeconds(2.0)); attacker.SendMessage("You deliver a paralyzing blow!"); // Is this not localized? attacker.PlaySound(0x11C); } if (!Core.AOS && this.Poison != null && this.PoisonCharges > 0) { --this.PoisonCharges; if (Utility.RandomDouble() >= 0.5) // 50% chance to poison { defender.ApplyPoison(attacker, this.Poison); } } }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { base.OnHit(attacker, defender, damageBonus); if (!Core.AOS && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 500.0) >= Utility.RandomDouble()) { defender.SendLocalizedMessage(1060164); // The attack has temporarily paralyzed you! defender.Freeze(TimeSpan.FromSeconds(3.0)); attacker.SendLocalizedMessage(1060163); // You deliver a paralyzing blow! attacker.PlaySound(0x11C); } if (!Core.AOS && Poison != null && PoisonCharges > 0) { --PoisonCharges; if (Utility.RandomDouble() >= 0.5) // 50% chance to poison { defender.ApplyPoison(attacker, Poison); } } }
public override void OnHit(Mobile attacker, Mobile defender) { base.OnHit(attacker, defender); if (!Core.AOS && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble()) { defender.SendMessage("You receive a paralyzing blow!"); // Is this not localized? defender.Freeze(TimeSpan.FromSeconds(2.0)); attacker.SendMessage("You deliver a paralyzing blow!"); // Is this not localized? attacker.PlaySound(0x11C); } if (!Core.AOS && Poison != null && PoisonCharges > 0) { --PoisonCharges; if (Utility.RandomDouble() >= 0.5) // 50% chance to poison { defender.ApplyPoison(attacker, Poison); } } }
// // carry out the combo defenses // // If you add a new combo, you must add the code here to define what it actually does when it is activated // public void DoComboDefense(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboDefense combo) { if (attacker == null || defender == null || weapon == null || combo == null) { return; } defender.SendMessage("You unleash the combo defense {0}!", combo.Name); // apply the combo defense switch (combo.DefenseID) { case ComboDefenses.ColdWind: { // 5 sec paralyze attacker.FixedEffect(0x376A, 9, 32); attacker.PlaySound(0x204); attacker.Freeze(TimeSpan.FromSeconds(5)); // 7x stam drain attacker.Stam -= weapon.MaxDamage * 7; break; } } }
public override void OnGaveMeleeAttack( Mobile defender ) { base.OnGaveMeleeAttack( defender ); if ( 0.2 < Utility.RandomDouble() ) return; switch ( Utility.Random( 3 ) ) { case 0: { defender.SendLocalizedMessage( 1004014 ); // You have been stunned! defender.Freeze( TimeSpan.FromSeconds( 4.0 ) ); break; } case 1: { defender.SendAsciiMessage( "You have been hit by a paralyzing blow!" ); defender.Freeze( TimeSpan.FromSeconds( 3.0 ) ); break; } case 2: { AOS.Damage( defender, this, Utility.Random( 10, 5 ), 100, 0, 0, 0, 0 ); defender.SendAsciiMessage( "You have been hit by a critical strike!" ); break; } } }
private void Damage( Mobile to ) { if ( to != null ) { // send the effects Effects.SendPacket( to, to.Map, new GraphicalEffect( EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, to.Location, to.Location, 20, 10, true, false ) ); to.PlaySound( 0x307 ); // deal the damage SpellHelper.Damage( this, to, GetNewAosDamage( 40, 1, 5, to ), 100, 0, 0, 0, 0 ); // stun the target double stunChance = ( GetBaseSkill( Caster ) + GetBoostSkill( Caster ) ) / 2000.0; stunChance -= GetResistSkill( to ) / 1000.0; if ( Utility.RandomDouble() < stunChance && !ParalyzingBlow.IsInmune( to ) ) { to.Freeze( TimeSpan.FromSeconds( 2.0 ) ); ParalyzingBlow.BeginInmunity( to, TimeSpan.FromSeconds( 10.0 ) ); } } }
// // carry out the special defenses // // If you add a new defense, you must add the code here to define what it actually does when it hits // can optionally return a value that will be used to reduce damage // public int DoSpecialDefense(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, SpecialDefense special) { if (attacker == null || defender == null || weapon == null || special == null) return 0; defender.SendMessage("you defend with {0}!", special.Name); // apply the special defense switch(special.DefenseID) { case SpecialDefenses.MindDrain: { attacker.Mana -= damageGiven; defender.FixedEffect(0x375A, 10, 15); // absorb all of the damage you would have taken return damageGiven; } case SpecialDefenses.StamDrain: { attacker.Stam -= damageGiven; defender.FixedEffect(0x374A, 10, 15); // absorb all of the damage you would have taken return damageGiven; } case SpecialDefenses.SpikeShield: { // return the damage to attacker attacker.Damage(damageGiven, defender); defender.SendMessage("{0} damage reflected!", damageGiven); // absorb all of the damage you would have taken return damageGiven; } case SpecialDefenses.PuffOfSmoke: { defender.Hidden = true; break; } case SpecialDefenses.GiftOfHealth: { defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x202); defender.Hits += damageGiven; defender.SendMessage("healed {0}!", damageGiven); // absorb all of the damage you would have taken return damageGiven; } case SpecialDefenses.ParalyzingFear: { // lose target focus attacker.Combatant = null; // flee if (attacker is BaseCreature) { ((BaseCreature)attacker).BeginFlee(TimeSpan.FromSeconds(6)); } // and become paralyzed attacker.Freeze(TimeSpan.FromSeconds(damageGiven / 10)); attacker.FixedEffect(0x376A, 9, 32); attacker.PlaySound(0x204); break; } default: defender.SendMessage("no effect"); break; } return 0; }
public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message) { if (!dismounted.Mounted) return; if (dismounted is ChaosDragoonElite) { dismounter.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount. } IMount mount = dismounted.Mount; if (mount != null) { mount.Rider = null; BaseMount.SetMountPrevention(dismounted, blockmounttype, delay); if (message) dismounted.SendLocalizedMessage(1040023); // You have been knocked off of your mount! } else if (dismounted.Flying) { if (!OnFlightPath(dismounted)) { dismounted.Flying = false; dismounted.Freeze(TimeSpan.FromSeconds(1)); dismounted.Animate(61, 10, 1, true, false, 0); } } else if (Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted)) { Spells.Ninjitsu.AnimalForm.RemoveContext(dismounted, true); } }
private void CheckPreAOSMoves(Mobile attacker, Mobile defender) { if (!attacker.CanBeginAction <Fists>()) { return; } if (attacker.StunReady) { if (attacker.Skills.Anatomy.Value < 80.0 || attacker.Skills.Wrestling.Value < 80.0) { attacker.SendLocalizedMessage(1004008); // You are not skilled enough to stun your opponent. attacker.StunReady = false; return; } if (attacker.Stam < 15) { attacker.SendLocalizedMessage(1004009); // You are too fatigued to attempt anything. return; } attacker.Stam -= 15; if (CheckMove(attacker, SkillName.Anatomy)) { StartMoveDelay(attacker); attacker.StunReady = false; attacker.SendLocalizedMessage(1004013); // You successfully stun your opponent! defender.SendLocalizedMessage(1004014); // You have been stunned! defender.Freeze(TimeSpan.FromSeconds(4.0)); } else { attacker.SendLocalizedMessage(1004010); // You failed in your attempt to stun. defender.SendLocalizedMessage(1004011); // Your opponent tried to stun you and failed. } } else if (attacker.DisarmReady) { if (!defender.Player && !defender.Body.IsHuman) { attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent. return; } if (attacker.Skills.ArmsLore.Value < 80.0 || attacker.Skills.Wrestling.Value < 80.0) { attacker.SendLocalizedMessage(1004002); // You are not skilled enough to disarm your opponent. attacker.DisarmReady = false; return; } if (attacker.Stam < 15) { attacker.SendLocalizedMessage(1004003); // You are too fatigued to attempt anything. return; } var toDisarm = defender.FindItemOnLayer(Layer.OneHanded); if (toDisarm?.Movable == false) { toDisarm = defender.FindItemOnLayer(Layer.TwoHanded); } var pack = defender.Backpack; if (pack == null || toDisarm?.Movable == false) { attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent. } else if (CheckMove(attacker, SkillName.ArmsLore)) { StartMoveDelay(attacker); attacker.Stam -= 15; attacker.DisarmReady = false; attacker.SendLocalizedMessage(1004006); // You successfully disarm your opponent! defender.SendLocalizedMessage(1004007); // You have been disarmed! pack.DropItem(toDisarm); } else { attacker.Stam -= 15; attacker.SendLocalizedMessage(1004004); // You failed in your attempt to disarm. defender.SendLocalizedMessage(1004005); // Your opponent tried to disarm you but failed. } } }
public override void AOESpecialEffect(Mobile m) { int duration = 5; if (m.ColdResistance > Utility.Random(50) + 40) duration = 4; m.Freeze(TimeSpan.FromSeconds(duration)); m.SendMessage(37,"You are turned into stone."); m.HueMod = 998; Timer.DelayCall(TimeSpan.FromSeconds(duration), new TimerStateCallback(m_RestoreHue), m); }
// // carry out the combo defenses // // If you add a new combo, you must add the code here to define what it actually does when it is activated // public void DoComboDefense(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboDefense combo) { if (attacker == null || defender == null || weapon == null || combo == null) return; defender.SendMessage("You unleash the combo defense {0}!", combo.Name); // apply the combo defense switch(combo.DefenseID) { case ComboDefenses.ColdWind: { // 5 sec paralyze attacker.FixedEffect(0x376A, 9, 32); attacker.PlaySound(0x204); attacker.Freeze(TimeSpan.FromSeconds(5)); // 7x stam drain attacker.Stam -= weapon.MaxDamage * 7; break; } } }
public void Entangle( Mobile m ) { Point3D p = Location; if ( SpellHelper.FindValidSpawnLocation( Map, ref p, true ) ) { TimeSpan delay = TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 10 ) ); m.MoveToWorld( p, Map ); m.Freeze( delay ); m.SendLocalizedMessage( 1042555 ); // You become entangled in the spider web. SpidersWeb web = new SpidersWeb( m, delay ); p.Z += 2; web.MoveToWorld( p, Map ); Combatant = m; } }
// // carry out the special attacks // // If you add a new attack, you must add the code here to define what it actually does when it hits // public void DoSpecialAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, SpecialAttack special) { if (attacker == null || defender == null || weapon == null || special == null) return; attacker.SendMessage("you strike with {0}!", special.Name); // apply the special attack switch(special.AttackID) { case SpecialAttacks.TripleSlash: { defender.Damage(weapon.MaxDamage * 3, attacker); break; } case SpecialAttacks.MindDrain: { defender.Mana -= weapon.MaxDamage; attacker.Mana += weapon.MaxDamage; break; } case SpecialAttacks.VortexStrike: { attacker.PlaySound(0x217); BaseCreature m = new EnergyVortex(); m.Summoned = true; m.SummonMaster = attacker; m.Combatant = defender; m.MoveToWorld(defender.Location, defender.Map); break; } case SpecialAttacks.StamDrain: { defender.Stam -= weapon.MaxDamage; attacker.Stam += weapon.MaxDamage; break; } case SpecialAttacks.PuffOfSmoke: { attacker.Hidden = true; break; } case SpecialAttacks.GiftOfHealth: { attacker.FixedEffect(0x376A, 9, 32); attacker.PlaySound(0x202); attacker.Hits = attacker.HitsMax; break; } case SpecialAttacks.ParalyzingFear: { // lose target focus defender.Combatant = null; // flee if (defender is BaseCreature) { ((BaseCreature)defender).BeginFlee(TimeSpan.FromSeconds(6)); } // and become paralyzed defender.Freeze(TimeSpan.FromSeconds(3)); defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x204); break; } default: attacker.SendMessage("no effect"); break; } }
//Defensive Wrestle Disabled. //public override double GetDefendSkillValue( Mobile attacker, Mobile defender ) //{ // double wresValue = defender.Skills[SkillName.Wrestling].Value; // double anatValue = defender.Skills[SkillName.Anatomy].Value; // double evalValue = defender.Skills[SkillName.EvalInt].Value; // double incrValue = (anatValue + evalValue + 20.0) * 0.5; // // if ( incrValue > 120.0 ) // incrValue = 120.0; // // if ( wresValue > incrValue ) // return wresValue; // else // return incrValue; //} public override TimeSpan OnSwing( Mobile attacker, Mobile defender ) { bool cannotStun = (attacker.Region is CustomRegion && ((CustomRegion)attacker.Region).CannotStun); bool cannotDisarm = (attacker.Region is CustomRegion && ((CustomRegion)attacker.Region).CannotDisarm); if (attacker.StunReady && !cannotStun) { //ADDED THIS IF-ELSE CLAUSE FOR LADDER SYSTEM..... THIS IS THE IF CLAUSE...ugly I know... but hell, alternative is f*****g with skills DuelObject d = Ladder.Ladder.GetDuel(attacker); if (d == null || d.DuelType != 1 ) { //Console.WriteLine("Debug: duel is {0}", d == null ? "null" : "not null"); if (attacker.CanBeginAction(typeof(Fists))) { if (attacker.Skills[SkillName.Anatomy].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0) { if (attacker.Stam >= 15) { attacker.Stam -= 15; if (CheckMove(attacker, SkillName.Anatomy)) { StartMoveDelay(attacker); attacker.StunReady = false; attacker.SendLocalizedMessage(1004013); // You successfully stun your opponent! defender.SendLocalizedMessage(1004014); // You have been stunned! defender.Freeze(TimeSpan.FromSeconds(3.3)); } else { attacker.SendLocalizedMessage(1004010); // You failed in your attempt to stun. defender.SendLocalizedMessage(1004011); // Your opponent tried to stun you and failed. } } else { attacker.SendLocalizedMessage(1004009); // You are too fatigued to attempt anything. } } else { attacker.SendLocalizedMessage(1004008); // You are not skilled enough to stun your opponent. attacker.StunReady = false; } } } //ADDED THIS IF-ELSE CLAUSE FOR LADDER SYSTEM..... THIS IS THE ELSE CLAUSE else { attacker.SendMessage("You cannot use stun in 5x mage duels "); } } else if ( attacker.DisarmReady && !cannotDisarm ) { if ( attacker.CanBeginAction( typeof( Fists ) ) ) { if ( defender.Player || defender.Body.IsHuman ) { if ( attacker.Skills[SkillName.ArmsLore].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0 ) { if ( attacker.Stam >= 15 ) { Item toDisarm = defender.FindItemOnLayer( Layer.OneHanded ); if ( toDisarm == null || !toDisarm.Movable ) toDisarm = defender.FindItemOnLayer( Layer.TwoHanded ); Container pack = defender.Backpack; if ( pack == null || toDisarm == null || !toDisarm.Movable ) { attacker.SendLocalizedMessage( 1004001 ); // You cannot disarm your opponent. } else if ( CheckMove( attacker, SkillName.ArmsLore ) ) { StartMoveDelay( attacker ); attacker.Stam -= 15; attacker.DisarmReady = false; attacker.SendLocalizedMessage( 1004006 ); // You successfully disarm your opponent! defender.SendLocalizedMessage( 1004007 ); // You have been disarmed! pack.DropItem( toDisarm ); } else { attacker.Stam -= 15; attacker.SendLocalizedMessage( 1004004 ); // You failed in your attempt to disarm. defender.SendLocalizedMessage( 1004005 ); // Your opponent tried to disarm you but failed. } } else { attacker.SendLocalizedMessage( 1004003 ); // You are too fatigued to attempt anything. } } else { attacker.SendLocalizedMessage( 1004002 ); // You are not skilled enough to disarm your opponent. attacker.DisarmReady = false; } } else { attacker.SendLocalizedMessage( 1004001 ); // You cannot disarm your opponent. } } } return base.OnSwing( attacker, defender ); }
public override void OnHit( Mobile attacker, Mobile defender, int damage ) { if ( defender.Frozen || UnderEffect( defender ) ) { attacker.SendLocalizedMessage( 1061923 ); // The target is already frozen. return; } if ( !IsBladeweaveAttack ) { if ( !Validate( attacker ) ) return; if ( !CheckMana( attacker, true ) ) return; } ClearCurrentAbility( attacker ); if ( !IsInmune( defender ) ) { attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow! defender.SendLocalizedMessage( 1072221 ); // You have been hit by a paralyzing blow! defender.Freeze( defender.IsPlayer ? PlayerFreezeDuration : NPCFreezeDuration ); BeginInmunity( defender ); } else { attacker.SendLocalizedMessage( 1063346 ); // Your attack was blocked! defender.SendLocalizedMessage( 1070813 ); // You resist paralysis. } defender.FixedEffect( 0x376A, 9, 32 ); defender.PlaySound( 0x204 ); }
public override TimeSpan OnSwing(Mobile attacker, Mobile defender) { if (attacker.StunReady) { if (attacker.CanBeginAction(typeof(Fists))) { if (attacker.Skills[SkillName.Anatomy].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0) { if (attacker.Stam >= 15) { attacker.Stam -= 15; if (CheckMove(attacker, SkillName.Anatomy)) { StartMoveDelay(attacker); attacker.StunReady = false; attacker.SendLocalizedMessage(1004013); // You successfully stun your opponent! defender.SendLocalizedMessage(1004014); // You have been stunned! defender.Freeze(TimeSpan.FromSeconds(4.0)); } else { attacker.SendLocalizedMessage(1004010); // You failed in your attempt to stun. defender.SendLocalizedMessage(1004011); // Your opponent tried to stun you and failed. } } else { attacker.SendLocalizedMessage(1004009); // You are too fatigued to attempt anything. } } else { attacker.SendLocalizedMessage(1004008); // You are not skilled enough to stun your opponent. attacker.StunReady = false; } } } else if (attacker.DisarmReady) { if (attacker.CanBeginAction(typeof(Fists))) { if (defender.Player || defender.Body.IsHuman) { if (attacker.Skills[SkillName.ArmsLore].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0) { if (attacker.Stam >= 15) { Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded); if (toDisarm == null || !toDisarm.Movable) { toDisarm = defender.FindItemOnLayer(Layer.TwoHanded); } Container pack = defender.Backpack; if (pack == null || toDisarm == null || !toDisarm.Movable) { attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent. } else if (CheckMove(attacker, SkillName.ArmsLore)) { StartMoveDelay(attacker); attacker.Stam -= 15; attacker.DisarmReady = false; attacker.SendLocalizedMessage(1004006); // You successfully disarm your opponent! defender.SendLocalizedMessage(1004007); // You have been disarmed! pack.DropItem(toDisarm); } else { attacker.Stam -= 15; attacker.SendLocalizedMessage(1004004); // You failed in your attempt to disarm. defender.SendLocalizedMessage(1004005); // Your opponent tried to disarm you but failed. } } else { attacker.SendLocalizedMessage(1004003); // You are too fatigued to attempt anything. } } else { attacker.SendLocalizedMessage(1004002); // You are not skilled enough to disarm your opponent. attacker.DisarmReady = false; } } else { attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent. } } } return(base.OnSwing(attacker, defender)); }
public override TimeSpan OnSwing( Mobile attacker, Mobile defender ) { if ( attacker.StunReady ) { if ( attacker.CanBeginAction( typeof( Fists ) ) ) { if ( attacker.Skills[SkillName.Anatomy].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0 ) { if ( attacker.Stam >= 15 ) { attacker.Stam -= 15; if ( CheckMove( attacker, SkillName.Anatomy ) ) { StartMoveDelay( attacker ); attacker.StunReady = false; attacker.SendLocalizedMessage( 1004013 ); // You successfully stun your opponent! defender.SendLocalizedMessage( 1004014 ); // You have been stunned! defender.Freeze( TimeSpan.FromSeconds( 4.0 ) ); } else { attacker.SendLocalizedMessage( 1004010 ); // You failed in your attempt to stun. defender.SendLocalizedMessage( 1004011 ); // Your opponent tried to stun you and failed. } } else { attacker.SendLocalizedMessage( 1004009 ); // You are too fatigued to attempt anything. } } else { attacker.SendLocalizedMessage( 1004008 ); // You are not skilled enough to stun your opponent. attacker.StunReady = false; } } } else if ( attacker.DisarmReady ) { if ( attacker.CanBeginAction( typeof( Fists ) ) ) { if ( defender.Player || defender.Body.IsHuman ) { if ( attacker.Skills[SkillName.ArmsLore].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0 ) { if ( attacker.Stam >= 15 ) { Item toDisarm = defender.FindItemOnLayer( Layer.OneHanded ); if ( toDisarm == null || !toDisarm.Movable ) toDisarm = defender.FindItemOnLayer( Layer.TwoHanded ); Container pack = defender.Backpack; if ( pack == null || toDisarm == null || !toDisarm.Movable ) { attacker.SendLocalizedMessage( 1004001 ); // You cannot disarm your opponent. } else if ( CheckMove( attacker, SkillName.ArmsLore ) ) { StartMoveDelay( attacker ); attacker.Stam -= 15; attacker.DisarmReady = false; attacker.SendLocalizedMessage( 1004006 ); // You successfully disarm your opponent! defender.SendLocalizedMessage( 1004007 ); // You have been disarmed! pack.DropItem( toDisarm ); } else { attacker.Stam -= 15; attacker.SendLocalizedMessage( 1004004 ); // You failed in your attempt to disarm. defender.SendLocalizedMessage( 1004005 ); // Your opponent tried to disarm you but failed. } } else { attacker.SendLocalizedMessage( 1004003 ); // You are too fatigued to attempt anything. } } else { attacker.SendLocalizedMessage( 1004002 ); // You are not skilled enough to disarm your opponent. attacker.DisarmReady = false; } } else { attacker.SendLocalizedMessage( 1004001 ); // You cannot disarm your opponent. } } } return base.OnSwing( attacker, defender ); }
public virtual void OnHit( Mobile attacker, Mobile defender ) { PlaySwingAnimation( attacker ); PlayHurtAnimation( defender ); attacker.PlaySound( GetHitAttackSound( attacker, defender ) ); defender.PlaySound( GetHitDefendSound( attacker, defender ) ); int damage = ComputeDamage( attacker, defender ); CheckSlayerResult cs = CheckSlayers( attacker, defender ); if ( cs != CheckSlayerResult.None ) { if ( cs == CheckSlayerResult.Slayer ) defender.FixedEffect( 0x37B9, 10, 5 ); damage *= 2; } int packInstinctBonus = GetPackInstinctBonus( attacker, defender ); if ( packInstinctBonus != 0 ) damage += AOS.Scale( damage, packInstinctBonus ); if ( attacker is BaseCreature ) ((BaseCreature)attacker).AlterMeleeDamageTo( defender, ref damage ); if ( defender is BaseCreature ) ((BaseCreature)defender).AlterMeleeDamageFrom( attacker, ref damage ); WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker ); damage = AbsorbDamage( attacker, defender, damage ); if ( damage < 1 ) damage = 1; AddBlood( attacker, defender, damage ); // adam: always returns phys=100; int phys, fire, cold, pois, nrgy; GetDamageTypes( attacker, out phys, out fire, out cold, out pois, out nrgy ); //check if creature has some immunity to weapon being used, if so reduce damage according to immunity. if(defender is BaseCreature) { BaseWeapon atkWeapon = attacker.Weapon as BaseWeapon; ((BaseCreature)defender).CheckWeaponImmunity(atkWeapon, damage, out damage); } int damageGiven = damage; AOS.ArmorIgnore = ( a is ArmorIgnore ); damageGiven = AOS.Damage( defender, attacker, damage, phys, fire, cold, pois, nrgy ); AOS.ArmorIgnore = false; if ( m_MaxHits > 0 && ((MaxRange <= 1 && (defender is Slime || defender is ToxicElemental)) || Utility.Random( 25 ) == 0) ) // Stratics says 50% chance, seems more like 4%.. { if ( MaxRange <= 1 && (defender is Slime || defender is ToxicElemental) ) attacker.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500263 ); // *Acid blood scars your weapon!* { if ( m_Hits > 1 ) --HitPoints; else Delete(); } } if ( attacker is VampireBatFamiliar ) { BaseCreature bc = (BaseCreature)attacker; Mobile caster = bc.ControlMaster; if ( caster == null ) caster = bc.SummonMaster; if ( caster != null && caster.Map == bc.Map && caster.InRange( bc, 2 ) ) caster.Hits += damage; else bc.Hits += damage; } if ( attacker is BaseCreature ) ((BaseCreature)attacker).OnGaveMeleeAttack( defender ); if ( defender is BaseCreature ) ((BaseCreature)defender).OnGotMeleeAttack( attacker ); if ( a != null ) a.OnHit( attacker, defender, damage ); TimeSpan AbilityDelay = TimeSpan.FromSeconds( 20.0 ); Mobile atkr = attacker; if (atkr.HasAbilityReady && atkr.Mana >= 15 && atkr.NextAbilityTime <= DateTime.Now) { atkr.HasAbilityReady = false; Item weapon = atkr.FindItemOnLayer(Layer.TwoHanded); if (weapon is BaseBashing) { if (atkr.Mana < 15) { atkr.LocalOverheadMessage(MessageType.Emote, 0x3B2, false, "Insufficient mana."); atkr.HasAbilityReady = false; } else { double crushbonus = damage * 0.5; int crush = (int)crushbonus; atkr.Mana -= 15; atkr.HasAbilityReady = false; atkr.NextAbilityTime = DateTime.Now + AbilityDelay; atkr.SendLocalizedMessage(1060090); // You have delivered a crushing blow! defender.SendLocalizedMessage(1060091); // You take extra damage from the crushing attack! defender.PlaySound(0x1E1); defender.FixedParticles(0, 1, 0, 9946, EffectLayer.Head); defender.Damage(crush, atkr); // brings dmg total up to 150% Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z + 50), defender.Map), new Entity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z + 20), defender.Map), 0xFB4, 1, 0, false, false, 0, 3, 9501, 1, 0, EffectLayer.Head, 0x100); } } else if (weapon is BasePoleArm || weapon is BaseAxe) { if (atkr.Mana < 15) { atkr.LocalOverheadMessage(MessageType.Emote, 0x3B2, false, "Insufficient mana."); atkr.HasAbilityReady = false; } else { atkr.Mana -= 15; atkr.SendLocalizedMessage(1060165); // You have delivered a concussion! atkr.HasAbilityReady = false; atkr.NextAbilityTime = DateTime.Now + AbilityDelay; defender.SendLocalizedMessage(1060166); // You feel disoriented! int mana_test = Math.Max(defender.Mana / 2, defender.ManaMax / 2); if (mana_test < defender.Mana) { defender.Mana = mana_test; } defender.PlaySound(0x213); defender.FixedParticles(0x377A, 1, 32, 9949, 1153, 0, EffectLayer.Head); } } else if (weapon is BaseSpear) { if (atkr.Mana < 15) { atkr.LocalOverheadMessage(MessageType.Emote, 0x3B2, false, "Insufficient mana."); atkr.HasAbilityReady = false; } else { defender.SendMessage("You receive a paralyzing blow!"); defender.Freeze(TimeSpan.FromSeconds(3.0)); // paras defender defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x204); atkr.HasAbilityReady = false; atkr.NextAbilityTime = DateTime.Now + AbilityDelay; atkr.SendMessage("You deliver a paralyzing blow!"); atkr.Mana -= 15; atkr.HasAbilityReady = false; } } else { atkr.HasAbilityReady = false; } } CorrodeWeapon(attacker); }
// // carry out the combo attacks // // If you add a new combo, you must add the code here to define what it actually does when it is activated // public void DoComboAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboAttack combo) { if (attacker == null || defender == null || weapon == null || combo == null) return; attacker.SendMessage("You unleash the combo attack {0}!", combo.Name); // apply the combo attack switch(combo.AttackID) { case ComboAttacks.ThunderStrike: { defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x28); // 5x damage defender.Damage(weapon.MaxDamage * 5, attacker); // mana and stam drain defender.Mana -= weapon.MaxDamage * 3; defender.Stam -= weapon.MaxDamage * 3; // full self heal attacker.FixedEffect(0x376A, 9, 32); attacker.Hits = attacker.HitsMax; break; } case ComboAttacks.LightningRain: { defender.Damage(weapon.MaxDamage * 3, attacker); defender.Mana -= weapon.MaxDamage * 7; defender.Stam -= weapon.MaxDamage * 4; break; } case ComboAttacks.SqueezingFist: { // 5 sec paralyze defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x204); defender.Freeze(TimeSpan.FromSeconds(5)); // 7x stam drain defender.Stam -= weapon.MaxDamage * 7; break; } } }