public override void OnDamage(int amount, Mobile from, bool willKill) { base.OnDamage(amount, from, willKill); if (0.1 >= Utility.RandomDouble()) { PlayerMobile target = SelectWebTarget() as PlayerMobile; if (target != null) { Direction = this.GetDirectionTo(target); if (0.25 > Utility.RandomDouble()) { target.MoveToWorld(TeleportLocations[Utility.Random(TeleportLocations.Length)], target.Map); } else { Combatant = target; } target.PlaySound(0x389); Effects.SendPacket(Location, Map, new HuedEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0xEE3 + Utility.Random(4), Location, target.Location, 10, 0, false, false, 0, 0)); NavreysWeb web = new NavreysWeb((PlayerMobile)target); web.MoveToWorld(target.Location, target.Map); web.Movable = false; target.Frozen = true; target.SendLocalizedMessage(1113247); // You are wrapped in spider webbing and cannot move! } } }
private Mobile SelectWebTarget() { foreach (Mobile mob in this.GetMobilesInRange(RangePerception)) { Mobile m = mob; if (m.AccessLevel > AccessLevel.Player) { continue; } if (mob is BaseCreature) { BaseCreature bc = mob as BaseCreature; if (bc.Summoned) { m = bc.SummonMaster; } if (bc.Controlled) { m = bc.ControlMaster; } } if (m.IsPlayer && !NavreysWeb.IsTrapped(m) && this.InRange(m, RangePerception)) { return(m); } } return(null); }
public InternalTimer( NavreysWeb web, PlayerMobile target ) : base(TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 )) { m_Target = target; m_Web = web; m_Ticks = 10; }