public override void OnRemoved(object parent) { if (parent is Mobile) { if (m_SummonedCreature != null && m_SummonedCreature.CheckAlive()) { Effects.SendLocationParticles(EffectItem.Create(m_SummonedCreature.Location, m_SummonedCreature.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 2100, 3, 5042, 0); m_SummonedCreature.PlaySound(0x201); m_SummonedCreature.Delete(); } //-------- Charged Time Left ----------- m_isequiped = false; InvalidateProperties(); if (m_ChargeTimer != null) { m_ChargeTimer.Stop(); } //------ FIN Charged Time Left --------- Mobile from = (Mobile)parent; m_SkillBonuses.Remove(); string modName = this.Serial.ToString(); from.RemoveStatMod(modName + "Str"); from.RemoveStatMod(modName + "Dex"); from.RemoveStatMod(modName + "Int"); from.CheckStatTimers(); } }
protected override void OnTick() { m_Count++; if (isCreature) { DamageEntry de = m_Creature.FindMostRecentDamageEntry(false); bool alreadyOwned = m_Creature.Owners.Contains(m_From); if (!m_From.InRange(m_Creature, 6)) { m_From.NextSkillTime = Core.TickCount; m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You are too far away to continue hypnotizing.", m_From.NetState); Stop(); } else if (!m_From.CheckAlive()) { m_From.NextSkillTime = Core.TickCount; m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You are dead, and cannot continue hypnotizing.", m_From.NetState); Stop(); } else if (!m_Creature.CheckAlive()) { m_From.NextSkillTime = Core.TickCount; m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "The creature is dead, so you cannot continue hypnotizing it.", m_From.NetState); Stop(); } else if (m_Creature.Controlled && m_Creature.ControlMaster == m_From) { m_From.NextSkillTime = Core.TickCount; m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "The creature will already obey you.", m_From.NetState); Stop(); } else if (!m_From.CanSee(m_Creature) || !m_From.InLOS(m_Creature)) { m_From.NextSkillTime = Core.TickCount; m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You do not have a clear path to the creature you are hypnotizing, and must cease your attempt.", m_From.NetState); Stop(); } else if (m_Creature.Frozen && m_Creature.Paralyzed) { m_From.NextSkillTime = Core.TickCount; m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "It appears to be already in a trance.", m_From.NetState); Stop(); } else if (m_Count < m_FullCount) { m_From.RevealingAction(); switch (Utility.Random(5)) { case 0: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "You are getting sleepy....", false); break; case 1: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Look into my eyes....", false); break; case 2: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Look deep into my eyes....", false); break; case 3: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Your eyes are getting very heavy....", false); break; case 4: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Sleepy....very sleepy....", false); break; } if (!alreadyOwned) // Passively check animal lore for gain { m_From.CheckTargetSkill(SkillName.AnimalLore, m_Creature, 0.0, 120.0); } } else { m_From.RevealingAction(); m_From.NextSkillTime = Core.TickCount; double minSkill = (double)m_Creature.Int / 3.0; if (minSkill < -10.0) { minSkill = -10.0; } if (minSkill > 90.0) { minSkill = 90.0; } minSkill += 8.3; LokaiSkill lokaiSkill = LokaiSkillUtilities.XMLGetSkills(m_From).Hypnotism; SuccessRating rating = LokaiSkillUtilities.CheckLokaiSkill(m_From, lokaiSkill, minSkill, alreadyOwned ? minSkill : minSkill + 40); if (rating >= SuccessRating.PartialSuccess) { if (rating == SuccessRating.TooEasy) { m_From.SendLocalizedMessage(502797); // That wasn't even challenging. } else { m_From.SendMessage("You succeed in hypnotizing the creature."); } double duration = 15.0; switch (rating) { case SuccessRating.PartialSuccess: break; case SuccessRating.Success: duration += 5.0; break; case SuccessRating.CompleteSuccess: duration += 15.0; break; case SuccessRating.ExceptionalSuccess: duration += 25.0; break; case SuccessRating.TooEasy: duration += 45; break; } m_Creature.Freeze(TimeSpan.FromSeconds(duration)); m_Creature.Paralyze(TimeSpan.FromSeconds(duration)); m_Creature.Pacify(m_From, DateTime.Now.AddSeconds(duration)); } else { m_From.SendMessage("You fail to hypnotize the creature."); } } } else { DamageEntry de = m_Mobile.FindMostRecentDamageEntry(false); if (!m_From.InRange(m_Mobile, 6)) { m_From.NextSkillTime = Core.TickCount; m_Mobile.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You are too far away to continue hypnotizing.", m_From.NetState); Stop(); } else if (!m_From.CheckAlive()) { m_From.NextSkillTime = Core.TickCount; m_Mobile.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You are dead, and cannot continue hypnotizing.", m_From.NetState); Stop(); } else if (!m_From.CanSee(m_Mobile) || !m_From.InLOS(m_Mobile)) { m_From.NextSkillTime = Core.TickCount; m_Mobile.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "You do not have a clear path to the person you are hypnotizing, and must cease your attempt.", m_From.NetState); Stop(); } else if (!m_Mobile.CheckAlive()) { m_From.NextSkillTime = Core.TickCount; m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "The person is dead, so you cannot continue hypnotizing them.", m_From.NetState); Stop(); } else if (m_Mobile is BaseEscortable && ((BaseEscortable)m_Mobile).Controlled && ((BaseEscortable)m_Mobile).ControlMaster == m_From) { m_From.NextSkillTime = Core.TickCount; m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "They will already obey you.", m_From.NetState); Stop(); } else if (m_Mobile.Frozen && m_Mobile.Paralyzed) { m_From.NextSkillTime = Core.TickCount; m_From.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "They appear to be already in a trance.", m_From.NetState); Stop(); } else if (m_Count < m_FullCount) { m_From.RevealingAction(); switch (Utility.Random(5)) { case 0: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "You are getting sleepy....", false); break; case 1: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Look into my eyes....", false); break; case 2: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Look deep into my eyes....", false); break; case 3: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Your eyes are getting very heavy....", false); break; case 4: m_From.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Sleepy....very sleepy....", false); break; } m_From.CheckTargetSkill(SkillName.EvalInt, m_Mobile, 0.0, 120.0); } else { m_From.RevealingAction(); m_From.NextSkillTime = Core.TickCount; m_From.CheckTargetSkill(SkillName.EvalInt, m_Mobile, 0.0, 120.0); double minSkill = (double)m_Mobile.Int / 3.0; if (minSkill < -10.0) { minSkill = -10.0; } if (minSkill > 90.0) { minSkill = 90.0; } minSkill += 10.0; LokaiSkill lokaiSkill = LokaiSkillUtilities.XMLGetSkills(m_From).Hypnotism; SuccessRating rating = LokaiSkillUtilities.CheckLokaiSkill(m_From, lokaiSkill, minSkill, minSkill + 40); if (rating >= SuccessRating.PartialSuccess) { double duration = 15.0; switch (rating) { case SuccessRating.PartialSuccess: break; case SuccessRating.Success: duration += 5.0; break; case SuccessRating.CompleteSuccess: duration += 15.0; break; case SuccessRating.ExceptionalSuccess: duration += 25.0; break; case SuccessRating.TooEasy: duration += 45; break; } m_From.SendMessage("You successfully put your subject in a trance."); Mobile master = null; if (m_Mobile is BaseEscortable) { BaseEscortable target = (BaseEscortable)m_Mobile; if (((BaseEscortable)m_Mobile).Controlled) { master = target.ControlMaster; } target.Controlled = true; target.ControlMaster = m_From; m_From.SendMessage("The target will obey you for {0} seconds.", duration.ToString("F1")); new EscortableTimer(m_From, master, target, (int)duration).Start(); } else { m_Mobile.Freeze(TimeSpan.FromSeconds(duration)); m_Mobile.Paralyze(TimeSpan.FromSeconds(duration)); m_Mobile.SendMessage("You have been hypnotized!"); m_From.SendGump(new HypnotismGump(m_From, m_Mobile, duration, 1)); } } else { m_From.SendMessage("You fail to hypnotize your subject."); } } } }