public static void EventSink_Speech(SpeechEventArgs args) { Mobile from = args.Mobile; if (args.Speech.ToLower().IndexOf("all release") >= 0) { foreach (Mobile m in from.GetMobilesInRange(15)) { if (m is BaseCreature && from != m && from.InLOS(m)) { BaseCreature p = m as BaseCreature; if (p.Controlled && p.Commandable) { bool isOwner = (from == p.ControlMaster); bool isFriend = (!isOwner && p.IsPetFriend(from)); if (!p.Deleted && from.Alive && (isOwner || isFriend) && p.CheckControlChance(from)) { p.ControlTarget = null; p.ControlOrder = OrderType.Release; } } } } } }
public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { if (info.ButtonID == 2) { if (!m_Pet.Deleted && m_Pet.Controlled && m_From == m_Pet.ControlMaster && m_From.CheckAlive() && m_Pet.CheckControlChance(m_From)) { if (m_Pet.Map == m_From.Map) { if (m_RangeCheck == true && !m_Pet.InRange(m_From, 14)) { m_From.SendMessage("You are too far away from your pet."); return; } m_Pet.ControlTarget = null; m_Pet.ControlOrder = OrderType.Release; //Pix: added kick to Obey because when we added the ability to release a 'lost' // pet, if there were no players around, the pet would not release until a player // got in range of the pet. This wasn't an issue before because there was // a range check involved so there was always a player around when releasing the pet. m_Pet.AIObject.Obey(); BaseHire m_Hire = m_Pet as BaseHire; //added by Old Salty from here . . . if (m_Hire != null && m_Hire.IsHired) { m_Hire.IsHired = false; } //. . . to here } } } }
public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { if (info.ButtonID == 2) { if (!m_Pet.Deleted && m_Pet.Controled && m_From == m_Pet.ControlMaster && m_From.CheckAlive() && m_Pet.CheckControlChance(m_From)) { if (m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14)) { m_Pet.Home = m_Pet.Location; m_Pet.ControlTarget = null; m_Pet.ControlOrder = OrderType.Release; } } } }
public override void OnDoubleClick(Mobile from) { BaseCreature bc = (BaseCreature)Creature; if (this.Owner != from && this.ForSale) { this.Owner = from; } if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else if (Creature == null) { this.Delete(); from.SendMessage("Nothing was linked to this shrink item. Contact a game master if you feel you got this message in error."); } else if (!ShrinkSystemCore.Core.Enabled) { from.SendMessage("The shrink system is currently offline! Contact a game master for details."); } else if (this.Owner != from) { from.SendMessage("You are not the owner of this pet you cannot claim it."); } else if (!bc.CheckControlChance(from)) { from.SendMessage("You lack the required skill to control this pet."); } else if ((bc.ControlSlots + from.Followers) > from.FollowersMax) { from.SendMessage("You have to many followers to claim this pet."); } else if (Server.Spells.SpellHelper.CheckCombat(from)) { from.SendMessage("You cannot claim this pet while in combat."); } else { IEntity p1a = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z), from.Map); IEntity p2a = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map); Effects.SendMovingParticles(p1a, p2a, ShrinkTable.Lookup(Creature), 1, 0, true, false, 0, 3, 1153, 1, 0, EffectLayer.Head, 0x100); from.PlaySound(492); bc.ControlMaster = from; bc.ControlTarget = from; bc.ControlOrder = OrderType.Follow; if (bc.IsBonded == true && this.ForSale == true) { bc.IsBonded = false; } bc.Direction = Direction.South; bc.MoveToWorld(from.Location, from.Map); from.SendMessage("You unshrink the animal."); this.Delete(); } }