protected override void OnTick() { if ((m_DragonSpikeTrap.Xa + 5) > m_DragonSpikeTrap.X) { m_DragonSpikeTrap.X++; List <Mobile> list = new List <Mobile>(); foreach (Mobile mob in m_DragonSpikeTrap.GetMobilesInRange(1)) { Point3D traploc = m_DragonSpikeTrap.GetWorldLocation(); //Point3D mobloc = mob.X(); if ((mob.X == (m_DragonSpikeTrap.X + 1) & mob.Y == m_DragonSpikeTrap.Y || mob.X == (m_DragonSpikeTrap.X - 1) & mob.Y == m_DragonSpikeTrap.Y) & mob.Alive) { //if (mob is Mobile & mob.Alive) list.Add(mob); } } foreach (Mobile mob in list) { if (mob is PlayerMobile) { mob.PlaySound(mob.Female ? 0x327 : 0x437); mob.Animate(20, 1, 1, true, false, 0); Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, Utility.RandomMinMax(45, 50)); } else { BaseCreature bc = (BaseCreature)mob; bc.PlaySound(bc.GetAngerSound()); if (bc.Body.IsAnimal) { bc.Animate(10, 5, 1, true, false, 0); Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, Utility.RandomMinMax(0, 0)); } else if (bc.Body.IsMonster) { bc.Animate(18, 5, 1, true, false, 0); Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, Utility.RandomMinMax(0, 0)); } } } Start(); } else { Stop(); m_DragonSpikeTrap.m_XMinus = new XMinus(m_DragonSpikeTrap); m_DragonSpikeTrap.m_XMinus.Start(); } }
private void UnshrinkPet(Mobile from) { m_Pet.SetControlMaster(from); m_Pet.IsStabled = false; m_Pet.MoveToWorld(from.Location, from.Map); m_Pet.Animate(5, 5, 1, true, false, 0); if (m_Pet.Owners.Count == 0) //Add player to owner if the animal didn't have any previous owner { m_Pet.Owners.Add(from); } if (m_Pet is Horse || m_Pet is Mustang) { Effects.PlaySound(m_Pet, m_Pet.Map, 168); } if (m_Pet is Zostrich) { Effects.PlaySound(m_Pet, m_Pet.Map, 629); } if (m_Pet is Orn || m_Pet is Oclock) { Effects.PlaySound(m_Pet, m_Pet.Map, 624); } if (m_Pet is Llama) { Effects.PlaySound(m_Pet, m_Pet.Map, 184); } if (from != m_Owner) { m_Pet.IsBonded = false; } m_Pet = null; Delete(); }
protected override void OnTick() { if (m_Item.Deleted) { return; } if (!m_Item.Visible) { if (m_InLOS && m_CanFit) { m_Item.Visible = true; } else { m_Item.Delete(); } if (!m_Item.Deleted) { m_Item.ProcessDelta(); Effects.SendLocationParticles(EffectItem.Create(m_Item.Location, m_Item.Map, EffectItem.DefaultDuration), m_Item.ItemID, 9, 10, 5029); } } else if (DateTime.Now > m_Item.m_End) { m_Item.Delete(); Stop(); } else { Map map = m_Item.Map; BaseCreature caster = m_Item.m_Caster; if (map != null && caster != null) { foreach (Mobile m in m_Item.GetMobilesInRange(0)) { if ((m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && ValidTarget(caster, m)) { m_Queue.Enqueue(m); } } while (m_Queue.Count > 0) { Mobile m = (Mobile)m_Queue.Dequeue(); if (caster.Name == ("an ice dragon")) { caster.Animate(19, 10, 2, true, false, 0); return; } if (caster.Name == ("a fire dragon")) { caster.Animate(19, 10, 2, true, false, 0); return; } caster.DoHarmful(m); caster.BreathDealDamage(m); caster.AOESpecialEffect(m); /* * int damage = Utility.Random(8) + 3; * * if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0)) * { * damage = 1; * * m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. * } * * AOS.Damage(m, caster, damage, 0, 0, 100, 0, 0); */ m.PlaySound(0x15); } } } }