public static void TryPossessCreature(Mobile from, BaseCreature Subject) { if (from == null || Subject == null) { return; } if (HasPermissionsToPossess(from, Subject)) { if (Subject.NetState != null) { from.SendMessage("Target creature is already under player control!"); return; } if (from.AccessLevel < FullAccessStaffLevel) { if (IsInHouseOrBoat(Subject.Location, Map.Felucca)) { from.SendMessage("You cannot possess a creature in a house or boat."); return; } if (Subject.Blessed == true) { from.SendMessage("You cannot possess invulnerable mobs."); return; } } if (Subject.Controlled && !IsAuthorizedStaff(from)) { from.SendMessage("You cannot possess tamed or summoned creatures!"); return; } //Subject.HasBeenPseudoseerControlled = true; if (Subject.Backpack == null) { // create a backpack for things like animals that have no backpack // ... this prevents client crash in case somebody has their pack auto-opening on login Subject.PackItem(new Gold(1)); } LoggingCustom.LogPseudoseer(DateTime.Now + "\t" + from.Account + "\t" + from.Name + "\tpossessing\t" + Subject + "\tRegion: " + Subject.Region + "\tLocation: " + Subject.Location); ConnectClientToNPC(from.NetState, Subject); } else { from.SendMessage("You are not permitted to possess that creature type, only staff can grant this permission."); } }
private static void EventSink_Speech(SpeechEventArgs args) { Mobile m = args.Mobile; if (m == null) { return; } DateTime now = DateTime.Now; // check for logging (pseudoseer or counselor) if (m.AccessLevel == AccessLevel.Counselor) { LoggingCustom.LogCounselor(now + "\t" + m.Name + ":\t" + args.Speech); } if (m.Account != null && PseudoSeerStone.Instance != null && PseudoSeerStone.Instance.PseudoSeers.ContainsKey(m.Account)) { LoggingCustom.LogPseudoseer(now + "\t" + m.Account + "\t" + m.Name + ":\t" + args.Speech); } if (m is PlayerMobile && ((PlayerMobile)m).Companion) { LoggingCustom.Log( Path.Combine(new[] { CompanionListGump.LogFileLocation, m.Name + ".txt" }), now + "\t" + m.Name + ":\t" + args.Speech); LoggingCustom.LogCompanion(now + "\t" + m.Name + ":\t" + args.Speech); } if (!args.Blocked) // might turn it to true if return override encountered { if (XmlScript.HasTrigger(m, TriggerName.onSay)) { args.Blocked = Trigger(m, m, TriggerName.onSay, null, args.Speech); } args.Handled = args.Blocked; } else if (XmlScript.HasTrigger(m, TriggerName.onSay)) { Trigger(m, m, TriggerName.onSay, null, args.Speech); } }