public override void OnDoubleClick(Mobile from) { if (from.Talisman != this) { from.SendLocalizedMessage(502641); // You must equip this item to use it. } else if (m_ChargeTime > 0) { from.SendLocalizedMessage(1074882, m_ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge. } else if (m_Charges == 0 && m_MaxCharges > 0) { from.SendLocalizedMessage(1042544); // This item is out of charges. } else { Type type = GetSummoner(); if (m_Summoner != null && !m_Summoner.IsEmpty) { type = m_Summoner.Type; } if (type != null) { object obj; try { obj = Activator.CreateInstance(type); } catch { obj = null; } if (obj is Item) { Item item = (Item)obj; int count = 1; if (m_Summoner != null && m_Summoner.Amount > 1) { if (item.Stackable) { item.Amount = m_Summoner.Amount; } else { count = m_Summoner.Amount; } } if (from.Backpack == null || count * item.Weight > from.Backpack.MaxWeight || from.Backpack.Items.Count + count > from.Backpack.MaxItems) { from.SendLocalizedMessage(500720); // You don't have enough room in your backpack! item.Delete(); item = null; return; } for (int i = 0; i < count; i++) { from.PlaceInBackpack(item); if (i + 1 < count) { item = Activator.CreateInstance(type) as Item; } } if (item is Board) { from.SendLocalizedMessage(1075000); // You have been given some wooden boards. } else if (item is IronIngot) { from.SendLocalizedMessage(1075001); // You have been given some ingots. } else if (item is Bandage) { from.SendLocalizedMessage(1075002); // You have been given some clean bandages. } else if (m_Summoner != null && m_Summoner.Name != null) { from.SendLocalizedMessage(1074853, m_Summoner.Name.ToString()); // You have been given ~1_name~ } } else if (obj is BaseCreature) { BaseCreature mob = (BaseCreature)obj; if ((m_Creature != null && !m_Creature.Deleted) || from.Followers + mob.ControlSlots > from.FollowersMax) { from.SendLocalizedMessage(1074270); // You have too many followers to summon another one. mob.Delete(); return; } BaseCreature.Summon(mob, from, from.Location, mob.BaseSoundID, TimeSpan.FromMinutes(10)); Effects.SendLocationParticles(EffectItem.Create(mob.Location, mob.Map, EffectItem.DefaultDuration), 0x3728, 1, 10, 0x26B6); mob.Summoned = false; mob.ControlOrder = OrderType.Friend; m_Creature = mob; } OnAfterUse(from); } if (m_Removal != TalismanRemoval.None) { from.Target = new TalismanTarget(this); } } }
protected override void OnTarget(Mobile from, object o) { if (m_Talisman == null || m_Talisman.Deleted) { return; } Mobile target = o as Mobile; if (from.Talisman != m_Talisman) { from.SendLocalizedMessage(502641); // You must equip this item to use it. } else if (target == null) { from.SendLocalizedMessage(1046439); // That is not a valid target. } else if (m_Talisman.ChargeTime > 0) { from.SendLocalizedMessage(1074882, m_Talisman.ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge. } else if (m_Talisman.Charges == 0 && m_Talisman.MaxCharges > 0) { from.SendLocalizedMessage(1042544); // This item is out of charges. } else { switch (m_Talisman.Removal) { case TalismanRemoval.Curse: target.PlaySound(0xF6); target.PlaySound(0x1F7); target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map); IEntity mto = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map); Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 9501, 1, 0, EffectLayer.Head, 0x100, 13, 3); StatMod mod; mod = target.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Str Offset"); } mod = target.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Dex Offset"); } mod = target.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Int Offset"); } target.Paralyzed = false; EvilOmenSpell.TryEndEffect(target); StrangleSpell.RemoveCurse(target); CorpseSkinSpell.RemoveCurse(target); CurseSpell.RemoveEffect(target); BuffInfo.RemoveBuff(target, BuffIcon.Clumsy); BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(target, BuffIcon.Weaken); BuffInfo.RemoveBuff(target, BuffIcon.MassCurse); target.SendLocalizedMessage(1072408); // Any curses on you have been lifted if (target != from) { from.SendLocalizedMessage(1072409); // Your targets curses have been lifted } break; case TalismanRemoval.Damage: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); BleedAttack.EndBleed(target, true); MortalStrike.EndWound(target); BuffInfo.RemoveBuff(target, BuffIcon.Bleed); BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike); target.SendLocalizedMessage(1072405); // Your lasting damage effects have been removed! if (target != from) { from.SendLocalizedMessage(1072406); // Your Targets lasting damage effects have been removed! } break; case TalismanRemoval.Ward: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); MagicReflectSpell.EndReflect(target); ReactiveArmorSpell.EndArmor(target); ProtectionSpell.EndProtection(target); target.SendLocalizedMessage(1072402); // Your wards have been removed! if (target != from) { from.SendLocalizedMessage(1072403); // Your target's wards have been removed! } break; case TalismanRemoval.Wildfire: // TODO break; } m_Talisman.OnAfterUse(from); } }