public override void OnPlayerCast() { if (SphereSpellTarget is TrapableContainer) { Target((TrapableContainer)SphereSpellTarget); } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else { DoFizzle(); } }
public override void OnPlayerCast() { if (SphereSpellTarget is Mobile) { Target((Mobile)SphereSpellTarget); } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else { DoFizzle(); } }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckSequence()) { SpellHelper.GetSurfaceTop(ref p); List <Mobile> targets = new List <Mobile>(); Map map = Caster.Map; if (map != null) { IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 8); foreach (Mobile m in eable) { targets.Add(m); } eable.Free(); } foreach (Mobile m in targets) { if (m is BaseCreature) { Spells.Sixth.DispelSpell.RemoveAllEffects((BaseCreature)m, Caster); } else { Spells.Sixth.DispelSpell.RemoveAllEffects(m, Caster); } } } Caster.PlaySound(Sound); FinishSequence(); }
public void Target(IPoint3D p) { Map map = Caster.Map; SpellHelper.GetSurfaceTop(ref p); if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if ((map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z)) && !(SphereSpellTarget is Mobile)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (/*SpellHelper.CheckTown(p, Caster) && */ CheckSequence()) { TimeSpan duration; if (Core.AOS) { duration = TimeSpan.FromSeconds(90.0); } else { duration = TimeSpan.FromSeconds(Utility.Random(300, 240)); } if (Caster.InLOS(p)) { GuardedRegion reg = (GuardedRegion)Region.Find(new Point3D(p), Caster.Map).GetRegion(typeof(GuardedRegion)); if (reg != null && !reg.Disabled) { Caster.CriminalAction(true); } BaseCreature.Summon(new EnergyVortex(), false, Caster, new Point3D(p), Sound, duration); } else { Caster.SendAsciiMessage("You can't see that."); } } FinishSequence(); }
public override void OnPlayerCast() { if (SphereSpellTarget is TrapableContainer) //Taran: Telekinesis only works on trapable containers //if (SphereSpellTarget is ITelekinesisable) { Target((ITelekinesisable)SphereSpellTarget); } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else { Caster.SendAsciiMessage("This spell only works on trapable containers!"); DoFizzle(); } }
public void Target(IPoint3D p) { Map map = Caster.Map; SpellHelper.GetSurfaceTop(ref p); if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if ((map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z)) && !(SphereSpellTarget is Mobile)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (/*SpellHelper.CheckTown(p, Caster) && */ CheckSequence()) { TimeSpan duration; if (Core.AOS) { duration = TimeSpan.FromSeconds(90.0); } else { duration = TimeSpan.FromSeconds(Utility.Random(300, 240)); } if (Caster.InLOS(p)) { //BaseCreature.Summon(new Daemon(), false, Caster, new Point3D(p), 0x212, duration); SpellHelper.Summon(new WaterElemental(), Caster, Sound, duration, false, false, new Point3D(p)); } else { Caster.SendAsciiMessage("You can't see that."); } } FinishSequence(); }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (/*SpellHelper.CheckTown(p, Caster) && */ CheckSequence()) { //if (CheckSequence()) SpellHelper.GetSurfaceTop(ref p); int dx = Caster.Location.X - p.X; int dy = Caster.Location.Y - p.Y; int rx = (dx - dy) * 44; int ry = (dx + dy) * 44; bool eastToWest; if (rx >= 0 && ry >= 0) { eastToWest = false; } else if (rx >= 0) { eastToWest = true; } else if (ry >= 0) { eastToWest = true; } else { eastToWest = false; } Effects.PlaySound(p, Caster.Map, Sound); int itemID = eastToWest ? 0x398C : 0x3996; TimeSpan duration; if (Core.AOS) { duration = TimeSpan.FromSeconds((15 + (Caster.Skills.Magery.Fixed / 5)) / 4); } else { duration = TimeSpan.FromSeconds(4.0 + (Caster.Skills[SkillName.Magery].Value * 0.5)); } List <InternalItem> itemList = new List <InternalItem>(); for (int i = -3; i <= 3; ++i) { Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z); //bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false); //if (!canFit) // continue; IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0); foreach (Mobile m in eable) { if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young)) { continue; } //Taran: The whole field counts as a harmful action, not just the target if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10) { Caster.DoHarmful(m); } if (m is BaseCreature) { ((BaseCreature)m).OnHarmfulSpell(Caster); } } InternalItem toAdd = new InternalItem(itemID, loc, Caster, Caster.Map, duration, i); itemList.Add(toAdd); } if (itemList.Count > 0) { new SoundTimer(itemList, Sound).Start(); } if (SphereSpellTarget is Mobile) { InternalItem castItem = new InternalItem(itemID, (SphereSpellTarget as Mobile).Location, Caster, Caster.Map, duration, 3); castItem.OnMoveOver(SphereSpellTarget as Mobile); //Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile castItem.Delete(); } } FinishSequence(); }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckSequence()) { SpellHelper.GetSurfaceTop(ref p); int dx = Caster.Location.X - p.X; int dy = Caster.Location.Y - p.Y; int rx = (dx - dy) * 44; int ry = (dx + dy) * 44; bool eastToWest; if (rx >= 0 && ry >= 0) { eastToWest = false; } else if (rx >= 0) { eastToWest = true; } else if (ry >= 0) { eastToWest = true; } else { eastToWest = false; } Effects.PlaySound(p, Caster.Map, Sound); TimeSpan duration; if (Core.AOS) { duration = TimeSpan.FromSeconds((15 + (Caster.Skills.Magery.Fixed / 5)) / 7); } else { duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 0.28 + 2.0); // (28% of magery) + 2.0 seconds } int itemID = eastToWest ? 0x3946 : 0x3956; List <Item> itemList = new List <Item>(); for (int i = -3; i <= 3; ++i) { Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z); bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false); if (!canFit) { continue; } Item item = new InternalItem(loc, Caster.Map, duration, itemID, Caster); itemList.Add(item); item.ProcessDelta(); Effects.SendLocationParticles(EffectItem.Create(loc, Caster.Map, EffectItem.DefaultDuration), 0x376A, 9, 10, 5051); } if (itemList.Count > 0) { new SoundTimer(itemList, Sound).Start(); } } FinishSequence(); }
private static void CreateItem(PilferFlags pilfer, SuccessRating rating, Mobile from) { switch (pilfer) { case PilferFlags.ArcheryWeapon: { Item item = Loot.RandomRangedWeapon(); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Armor: { Item item = Loot.RandomArmorOrHat(); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Clothes: { Item item = Loot.RandomClothing(from.Map == Map.Tokuno, true); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Food: { Item item = RandomFood(); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Jewel: { Item item = Loot.RandomJewelry(); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.MetalWeapon: { Item item = Loot.RandomWeapon(); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Potion: { Item item = Loot.RandomPotion(); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Reagent: { Item item = Loot.RandomPossibleReagent(); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Scroll: { int max = 0; SpellbookType book = (SpellbookType)Utility.Random(2); if (book == SpellbookType.Regular) { max = Loot.RegularScrollTypes.Length; switch (rating) { case SuccessRating.PartialSuccess: { max /= 8; break; } case SuccessRating.Success: { max /= 4; break; } case SuccessRating.CompleteSuccess: { max /= 2; break; } case SuccessRating.ExceptionalSuccess: { break; } } } if (book == SpellbookType.Necromancer) { max = Loot.SENecromancyScrollTypes.Length; } Item item = Loot.RandomScroll(0, max, book); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Spellbook: { Item item = RandomSpellbook(rating); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.DefaultName) ? "an" : "a", item.DefaultName); } break; } case PilferFlags.Wand: { BaseWand item = Loot.RandomWand(); if (item == null || !from.AddToBackpack(item)) { from.SendMessage("Unable to add item to backpack."); } else { from.SendMessage("You pilfer {0} {1}.", StartsWithVowel(item.Effect.ToString()) ? "an" : "a", item.Effect.ToString()); } break; } } }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckSequence()) { if (p is Item) { p = ((Item)p).GetWorldLocation(); } //if ( Core.AOS ) // damage = GetNewAosDamage( 48, 1, 5, true ); double damage = Scroll != null?Utility.Random(35, 32) : Utility.Random(40, 35); ArrayList targets = new ArrayList(); Map map = Caster.Map; if (map != null) { IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2); foreach (Mobile m in eable) { if (Core.AOS && m == Caster) { continue; } if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && Caster.InLOS(m)) { targets.Add(m); } } eable.Free(); } if (targets.Count > 0) { if (Core.AOS && targets.Count > 1) { damage = (damage * 2) / targets.Count; } else if (!Core.AOS) { damage /= targets.Count; } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; double toDeal = damage; if (!Core.AOS && CheckResisted(m)) { toDeal *= 0.5; m.SendMessage("You feel yourself resisting magic"); // You feel yourself resisting magical energy. } Caster.DoHarmful(m); SpellHelper.Damage(this, m, toDeal, 0, 0, 0, 0, 100); m.BoltEffect(0); } } else { Caster.PlaySound(Sound); } } FinishSequence(); }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckSequence()) { SpellHelper.GetSurfaceTop(ref p); int dx = Caster.Location.X - p.X; int dy = Caster.Location.Y - p.Y; int rx = (dx - dy) * 44; int ry = (dx + dy) * 44; bool eastToWest; if (rx >= 0 && ry >= 0) { eastToWest = false; } else if (rx >= 0) { eastToWest = true; } else if (ry >= 0) { eastToWest = true; } else { eastToWest = false; } Effects.PlaySound(p, Caster.Map, Sound); int itemID = eastToWest ? 0x3967 : 0x3979; TimeSpan duration = TimeSpan.FromSeconds(3.0 + (Caster.Skills[SkillName.Magery].Value / 3.0)); List <Item> itemList = new List <Item>(); for (int i = -3; i <= 3; ++i) { Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z); //bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false); //if (!canFit) // continue; IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0); foreach (Mobile m in eable) { if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young)) { continue; } //Taran: The whole field counts as a harmful action, not just the target if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10) { Caster.DoHarmful(m); } if (m is BaseCreature) { ((BaseCreature)m).OnHarmfulSpell(Caster); } } Item item = new InternalItem(Caster, itemID, loc, Caster.Map, duration); itemList.Add(item); item.ProcessDelta(); } if (itemList.Count > 0) { new FreezeTimer(itemList, Sound, duration.Seconds).Start(); } if (SphereSpellTarget is Mobile) { InternalItem castItem = new InternalItem(Caster, itemID, (SphereSpellTarget as Mobile).Location, Caster.Map, duration); castItem.OnMoveOver(SphereSpellTarget as Mobile); //Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile castItem.Delete(); if (SphereSpellTarget is BaseCreature && ((BaseCreature)SphereSpellTarget).ParalyzeImmune) { ((Mobile)SphereSpellTarget).PublicOverheadMessage(MessageType.Emote, 0x3B2, true, "The paralyze spell seems to have no effect"); } } //Mobile mob = SphereSpellTarget as Mobile; /*if (mob != null) * { * InternalItem castItem = new InternalItem(Caster, itemID, mob.Location, Caster.Map, duration); * castItem.OnMoveOver(mob); * Caster.DoHarmful(mob); * * * castItem.Delete(); * }*/ } FinishSequence(); }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendAsciiMessage("Target is not in line of sight."); DoFizzle();//One line so i could use VS Replace, feel free to change/remove comment:p } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckBSequence(m)) { if ((m.Player && m.Int <= 120 && m.Str <= 120 && m.Dex <= 120 && m.RawStatTotal <= 300) || (!m.Player)) { if (CurseSpell.UnderEffect(m)) { bool message = true; if (m.Str < m.RawStr) { m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Str)); message = false; } if (m.Dex < m.RawDex) { m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Dex)); message = false; } if (m.Int < m.RawInt) { m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Int)); message = false; } if (message) { m.SendAsciiMessage("You are under the effect of a curse spell and cannot get any stat bonuses"); } } else { SpellHelper.AddStatBonus(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true; SpellHelper.AddStatBonus(Caster, m, StatType.Dex); SpellHelper.AddStatBonus(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false; } } m.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist); m.PlaySound(Sound); int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, false) * 100); TimeSpan length = SpellHelper.GetDuration(Caster, m); m_UnderEffect[m] = Timer.DelayCall(length, new TimerStateCallback(RemoveEffect), m); string args = String.Format("{0}\t{1}\t{2}", percentage, percentage, percentage); BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Bless, 1075847, 1075848, length, m, args)); } FinishSequence(); }
public override void OnCast() { if (Core.AOS) { /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances. * 15 + (Inscription/20) Physcial bonus * -5 Elemental * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again. * (+20 physical -5 elemental at 100 Inscription) */ if (CheckSequence()) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[])m_Table[targ]; if (mods == null) { targ.PlaySound(Sound); targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist); mods = new ResistanceMod[5] { new ResistanceMod(ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)), new ResistanceMod(ResistanceType.Fire, -5), new ResistanceMod(ResistanceType.Cold, -5), new ResistanceMod(ResistanceType.Poison, -5), new ResistanceMod(ResistanceType.Energy, -5) }; m_Table[targ] = mods; for (int i = 0; i < mods.Length; ++i) { targ.AddResistanceMod(mods[i]); } int physresist = 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20); string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", physresist, 5, 5, 5, 5); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, 1075813, args.ToString())); } else { targ.PlaySound(0x1ED); targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist); m_Table.Remove(targ); for (int i = 0; i < mods.Length; ++i) { targ.RemoveResistanceMod(mods[i]); } BuffInfo.RemoveBuff(Caster, BuffIcon.ReactiveArmor); } } FinishSequence(); } else { if (Caster.MeleeDamageAbsorb > 0) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (!Caster.CanBeginAction(typeof(DefensiveSpell))) { Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(DefensiveSpell))) { int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Meditation].Value + Caster.Skills[SkillName.Inscribe].Value); value /= 3; if (value < 0) { value = 1; } else if (value > 1) { value = 1; } Caster.MeleeDamageAbsorb = value; Caster.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist); Caster.PlaySound(0x1F2); } else { Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time. } } FinishSequence(); } }
public override void OnCast() { RecallSpell m_Owner = this; Mobile from = Caster; if (SphereSpellTarget is RecallRune) { RecallRune rune = (RecallRune)SphereSpellTarget; if (Caster.InLOS(rune) || (from.BankBox != null && rune.IsChildOf(from.BankBox))) { if (rune.Marked) { if (rune.ChargesLeft == 0) { from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune's magic has faded"); DoFizzle(); return; } if (rune.ChargesLeft <= 10 && rune.ChargesLeft >= 1) { from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune is starting to fade"); } m_Owner.Effect(rune.Target, rune.TargetMap, true); } else { from.SendLocalizedMessage(501805); // That rune is not yet marked. if (from is PlayerMobile) { ((PlayerMobile)from).SpellCheck(); } } } else { Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501031); // I cannot see that object. if (from is PlayerMobile) { ((PlayerMobile)from).SpellCheck(); } } } else if (SphereSpellTarget is Runebook) { RunebookEntry e = ((Runebook)SphereSpellTarget).Default; if (e != null) { m_Owner.Effect(e.Location, e.Map, true); } else { from.SendLocalizedMessage(502354); // Target is not marked. } } else if (SphereSpellTarget is Key && ((Key)SphereSpellTarget).KeyValue != 0 && ((Key)SphereSpellTarget).Link is BaseBoat) { BaseBoat boat = ((Key)SphereSpellTarget).Link as BaseBoat; if (!boat.Deleted && boat.CheckKey(((Key)SphereSpellTarget).KeyValue)) { m_Owner.Effect(boat.GetMarkedLocation(), boat.Map, false); boat.Refresh(); } else { from.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object. } } else if (m_Entry != null) { /*if (m_Entry.ChargesLeft == 0) * { * from.LocalOverheadMessage(MessageType.Regular, 906, true, "The runebook's recall rune's magic has faded"); * DoFizzle(); * return; * } * else if (m_Entry.ChargesLeft <= 10 && m_Entry.ChargesLeft >= 1) * from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune in your runebook is starting to fade"); */ m_Owner.Effect(m_Entry.Location, m_Entry.Map, true); } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else { from.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object. if (from is PlayerMobile) { ((PlayerMobile)from).SpellCheck(); } } }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendAsciiMessage("Target is not in line of sight."); DoFizzle(); } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (/*SpellHelper.CheckTown(p, Caster) && */ CheckSequence()) { SpellHelper.GetSurfaceTop(ref p); int dx = Caster.Location.X - p.X; int dy = Caster.Location.Y - p.Y; int rx = (dx - dy) * 44; int ry = (dx + dy) * 44; bool eastToWest; if (rx >= 0 && ry >= 0) { eastToWest = false; } else if (rx >= 0) { eastToWest = true; } else if (ry >= 0) { eastToWest = true; } else { eastToWest = false; } Effects.PlaySound(p, Caster.Map, Sound); int itemID = eastToWest ? 0x3915 : 0x3922; TimeSpan duration = TimeSpan.FromSeconds(3 + (Caster.Skills.Magery.Fixed / 25)); List <InternalItem> itemList = new List <InternalItem>(); for (int i = -3; i <= 3; ++i) { Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z); IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0); foreach (Mobile m in eable) { if (m.AccessLevel != AccessLevel.Player || !m.Alive || (m is PlayerMobile && ((PlayerMobile)m).Young)) { continue; } //Taran: The whole field counts as a harmful action, not just the target if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10) { Caster.DoHarmful(m); } } InternalItem item = new InternalItem(itemID, loc, Caster, Caster.Map, duration, i); itemList.Add(item); } if (SphereSpellTarget is Mobile) { InternalItem castItem = new InternalItem(itemID, (SphereSpellTarget as Mobile).Location, Caster, Caster.Map, duration, 3); castItem.OnMoveOver(SphereSpellTarget as Mobile); //Caster.DoHarmful(SphereSpellTarget as Mobile); - This check is now made for each field tile castItem.Delete(); } if (itemList.Count > 0) { new SoundTimer(itemList, 517).Start(); } FinishSequence(); } }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckSequence()) { SpellHelper.GetSurfaceTop(ref p); List <Mobile> targets = new List <Mobile>(); Map map = Caster.Map; Mobile directTarget = p as Mobile; if (map != null) { bool feluccaRules = (map.Rules == MapRules.FeluccaRules); // You can target any living mobile directly, beneficial checks apply if (directTarget != null && Caster.CanBeBeneficial(directTarget, false)) { targets.Add(directTarget); } IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2); foreach (Mobile m in eable) { if (m == directTarget) { continue; } if (AreaCanTarget(m, feluccaRules)) { targets.Add(m); } } eable.Free(); } Effects.PlaySound(p, Caster.Map, Sound); if (targets.Count > 0) { int cured = 0; for (int i = 0; i < targets.Count; ++i) { Mobile m = targets[i]; Caster.DoBeneficial(m); Poison poison = m.Poison; if (poison != null) { int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) - ((poison.Level + 1) * 1750); chanceToCure /= 100; if (m.CurePoison(Caster)) { ++cured; } } //m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist ); m.PlaySound(Sound); } //if ( cured > 0 ) // Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons! } } FinishSequence(); }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m is PlayerMobile) { Caster.SendAsciiMessage("You can't cast this spell on players."); } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckHSequence(m)) { SpellHelper.CheckReflect((int)Circle, Caster, ref m); if (m.Spell != null) { m.Spell.OnCasterHurt(); } m.Paralyzed = false; int toDrain = 0; if (Core.AOS) { toDrain = (int)(GetDamageSkill(Caster) - GetResistSkill(m)); if (!m.Player) { toDrain /= 2; } if (toDrain < 0) { toDrain = 0; } else if (toDrain > m.Mana) { toDrain = m.Mana; } } else { if (CheckResisted(m)) { m.SendMessage("You feel yourself resisting magic"); // You feel yourself resisting magical energy. } else { toDrain = m.Mana; } } if (toDrain > (Caster.ManaMax - Caster.Mana)) { toDrain = Caster.ManaMax - Caster.Mana; } m.Mana -= toDrain; Caster.Mana += toDrain; if (Core.AOS) { m.FixedParticles(0x374A, 1, 15, 5054, 23, 7, EffectLayer.Head); m.PlaySound(Sound); Caster.FixedParticles(0x0000, 10, 5, 2054, EffectLayer.Head); } else { m.FixedParticles(0x374A, 10, 15, 5054, EffectLayer.Head); m.PlaySound(Sound); } HarmfulSpell(m); } FinishSequence(); }
public override void OnResponse(NetState sender, RelayInfo info) { Container pack = sender.Mobile.Backpack; if (pack == null) { sender.Mobile.SendMessage(1192, "You need a backpack."); return; } int items = 0; BaseCustomWand wand = null; BaseWand magewand = null; switch ((Buttons)info.ButtonID) { case Buttons.MainMenu: { if (sender.Mobile.HasGump(typeof(SpellBindingGump))) { sender.Mobile.CloseGump(typeof(SpellBindingGump)); } sender.Mobile.SendGump(new SpellBindingGump()); break; } case Buttons.Magery: { if (sender.Mobile.HasGump(typeof(SpellBindingGump))) { sender.Mobile.CloseGump(typeof(SpellBindingGump)); } sender.Mobile.SendGump(new SpellBindingGump(Buttons.Magery)); break; } case Buttons.Necromancy: { if (sender.Mobile.HasGump(typeof(SpellBindingGump))) { sender.Mobile.CloseGump(typeof(SpellBindingGump)); } sender.Mobile.SendGump(new SpellBindingGump(Buttons.Necromancy)); break; } case Buttons.Chivalry: { if (sender.Mobile.HasGump(typeof(SpellBindingGump))) { sender.Mobile.CloseGump(typeof(SpellBindingGump)); } sender.Mobile.SendGump(new SpellBindingGump(Buttons.Chivalry)); break; } case Buttons.Golems: { if (sender.Mobile.HasGump(typeof(SpellBindingGump))) { sender.Mobile.CloseGump(typeof(SpellBindingGump)); } sender.Mobile.SendGump(new SpellBindingGump(Buttons.Golems)); break; } #region Magery case Buttons.Clumsy: { items = pack.ConsumeTotal( new Type[] { typeof(Bloodmoss), typeof(Nightshade), typeof(ArcaneGem) }, new int[] { 50, 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new ClumsyWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.Feeble: { items = pack.ConsumeTotal( new Type[] { typeof(Ginseng), typeof(Nightshade), typeof(ArcaneGem) }, new int[] { 50, 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new FeebleWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.Fireball: { items = pack.ConsumeTotal( new Type[] { typeof(BlackPearl), typeof(ArcaneGem) }, new int[] { 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new FireballWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.GreaterHeal: { items = pack.ConsumeTotal( new Type[] { typeof(Garlic), typeof(Ginseng), typeof(MandrakeRoot), typeof(SpidersSilk), typeof(ArcaneGem) }, new int[] { 50, 50, 50, 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new GreaterHealWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.Harm: { items = pack.ConsumeTotal( new Type[] { typeof(Nightshade), typeof(SpidersSilk), typeof(ArcaneGem) }, new int[] { 50, 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new HarmWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.Identification: { sender.Mobile.SendMessage(1192, "The Spell Binders of Tolaria have not concentrated on this area of work yet."); goto case Buttons.Magery; } case Buttons.Lightning: { items = pack.ConsumeTotal( new Type[] { typeof(MandrakeRoot), typeof(SulfurousAsh), typeof(ArcaneGem) }, new int[] { 50, 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new LightningWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.MagicArrow: { items = pack.ConsumeTotal( new Type[] { typeof(SulfurousAsh), typeof(ArcaneGem) }, new int[] { 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new MagicArrowWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.ManaDrain: { items = pack.ConsumeTotal( new Type[] { typeof(BlackPearl), typeof(MandrakeRoot), typeof(SpidersSilk), typeof(ArcaneGem) }, new int[] { 50, 50, 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new ManaDrainWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.Weakness: { items = pack.ConsumeTotal( new Type[] { typeof(Garlic), typeof(Nightshade), typeof(ArcaneGem) }, new int[] { 50, 50, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || items != -1 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & 100 mana.<br>" + "Items: An Arcane Gem." + "Regents: 50 of the regents the spell requires."); goto case Buttons.Magery; } magewand = new WeaknessWand(); magewand.Crafter = sender.Mobile; pack.DropItem(magewand); goto case Buttons.Magery; } case Buttons.MarkRune: { sender.Mobile.SendMessage(1192, "The Spell Binders of Tolaria have not concentrated on this area of work yet."); goto case Buttons.Magery; } case Buttons.ArcaneGem: { items = pack.ConsumeTotal( new Type[] { typeof(BlackPearl), typeof(Bloodmoss), typeof(Garlic), typeof(Ginseng), typeof(MandrakeRoot), typeof(Nightshade), typeof(SpidersSilk), typeof(SulfurousAsh) }, new int[] { 10, 10, 10, 10, 10, 10, 10, 10 }); if (sender.Mobile.Skills[SkillName.ItemID].Base < 100.0 || items != -1 || sender.Mobile.Mana < 25) { SendFailedGump(sender.Mobile, "Skill Required: ItemID 100.0+ & 25 mana.<br>" + "Regents: 10 of all magery regents."); goto case Buttons.Magery; } sender.Mobile.SendMessage(1192, "The Spell Binders of Tolaria have not concentrated on this area of work yet."); goto case Buttons.Magery; } #endregion #region Necromancy case Buttons.PainSpike: { items = pack.ConsumeTotal( new Type[] { typeof(GnarledStaff), typeof(ArcaneGem), typeof(GraveDust), typeof(PigIron) }, new int[] { 1, 1, 20, 20 }); if (sender.Mobile.Skills[SkillName.Necromancy].Base < 40.0 || items != -1 || sender.Mobile.Mana < 24) { SendFailedGump(sender.Mobile, "Skill Required: Necromancy 40.0+ & 25 mana.<br>" + "Items: An Arcane Gem, a Gnarled Staff (enchantments will be removed).<br>" + "Regents: 20 each of Grave Dust, Pig Iron."); goto case Buttons.Necromancy; } sender.Mobile.Mana -= 25; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new PainSpikeStaff(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Necromancy; } case Buttons.BloodOath: { items = pack.ConsumeTotal( new Type[] { typeof(GnarledStaff), typeof(ArcaneGem), typeof(DaemonBlood) }, new int[] { 1, 1, 20 }); if (sender.Mobile.Skills[SkillName.Necromancy].Base < 40.0 || items != -1 || sender.Mobile.Mana < 64) { SendFailedGump(sender.Mobile, "Skill Required: Necromancy 40.0+ & 25 mana.<br>" + "Items: An Arcane Gem, a Gnarled Staff (enchantments will be removed).<br>" + "Regents: 20 Daemon Blood."); goto case Buttons.Necromancy; } sender.Mobile.Mana -= 65; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new BloodOathStaff(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Necromancy; } case Buttons.CorpseSkin: { items = pack.ConsumeTotal( new Type[] { typeof(GnarledStaff), typeof(ArcaneGem), typeof(BatWing), typeof(GraveDust) }, new int[] { 1, 1, 20, 20 }); if (sender.Mobile.Skills[SkillName.Necromancy].Base < 40.0 || items != -1 || sender.Mobile.Mana < 54) { SendFailedGump(sender.Mobile, "Skill Required: Necromancy 40.0+ & 25 mana.<br>" + "Items: An Arcane Gem, a Gnarled Staff (enchantments will be removed).<br>" + "Regents: 20 each of Bat Wing, Grave Dust."); goto case Buttons.Necromancy; } sender.Mobile.Mana -= 55; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new CorpseSkinStaff(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Necromancy; } case Buttons.EvilOmen: { items = pack.ConsumeTotal( new Type[] { typeof(GnarledStaff), typeof(ArcaneGem), typeof(BatWing), typeof(NoxCrystal) }, new int[] { 1, 1, 20, 20 }); if (sender.Mobile.Skills[SkillName.Necromancy].Base < 40.0 || items != -1 || sender.Mobile.Mana < 54) { SendFailedGump(sender.Mobile, "Skill Required: Necromancy 40.0+ & 25 mana.<br>" + "Items: An Arcane Gem, a Gnarled Staff (enchantments will be removed).<br>" + "Regents: 20 of each Bat Wing, Nox Crystal."); goto case Buttons.Necromancy; } sender.Mobile.Mana -= 55; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new EvilOmenStaff(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Necromancy; } case Buttons.AnimateDead: { items = pack.ConsumeTotal( new Type[] { typeof(GnarledStaff), typeof(ArcaneGem), typeof(GraveDust), typeof(DaemonBlood) }, new int[] { 1, 2, 20, 20 }); if (sender.Mobile.Skills[SkillName.Necromancy].Base < 60.0 || items != -1 || sender.Mobile.Mana < 114) { SendFailedGump(sender.Mobile, "Skill Required: Necromancy 40.0+ & 25 mana.<br>" + "Items: 2 Arcane Gems, a Gnarled Staff (enchantments will be removed).<br>" + "Regents: 20 of each Grave Dust, Daemon Blood."); goto case Buttons.Necromancy; } sender.Mobile.Mana -= 115; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new AnimateDeadStaff(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Necromancy; } #endregion #region Chivalry case Buttons.CleanseByFire: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(Mace), }, new int[] { 1, 1 }); if (sender.Mobile.Skills[SkillName.Chivalry].Base < 25.0 || items != -1 || sender.Mobile.TithingPoints < 50 || sender.Mobile.Mana < 50) { SendFailedGump(sender.Mobile, "Skill Required: Chivalry 25.0+ & 50 mana.<br>" + "Items: Arcane Gem, a Mace (enchantments will be removed).<br>" + "Tithing: 50."); goto case Buttons.Chivalry; } sender.Mobile.Mana -= 50; sender.Mobile.TithingPoints -= 50; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new CleanseByFireMace(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Chivalry; } case Buttons.CloseWounds: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(WarMace), }, new int[] { 1, 1 }); if (sender.Mobile.Skills[SkillName.Chivalry].Base < 20.0 || items != -1 || sender.Mobile.TithingPoints < 50 || sender.Mobile.Mana < 50) { SendFailedGump(sender.Mobile, "Skill Required: Chivalry 20.0+ & 50 mana.<br>" + "Items: Arcane Gem, a War Mace (enchantments will be removed).<br>" + "Tithing: 50."); goto case Buttons.Chivalry; } sender.Mobile.Mana -= 50; sender.Mobile.TithingPoints -= 50; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new CloseWoundsWarMace(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Chivalry; } case Buttons.ConsecrateWeapon: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(HammerPick), }, new int[] { 1, 1 }); if (sender.Mobile.Skills[SkillName.Chivalry].Base < 35.0 || items != -1 || sender.Mobile.TithingPoints < 50 || sender.Mobile.Mana < 50) { SendFailedGump(sender.Mobile, "Skill Required: Chivalry 35.0+ & 50 mana.<br>" + "Items: Arcane Gem, a Hammer Pick (enchantments will be removed).<br>" + "Tithing: 50."); goto case Buttons.Chivalry; } sender.Mobile.Mana -= 50; sender.Mobile.TithingPoints -= 50; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new ConsecrateWeaponHammerPick(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Chivalry; } case Buttons.RemoveCurse: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(Scepter), }, new int[] { 1, 1 }); if (sender.Mobile.Skills[SkillName.Chivalry].Base < 25.0 || items != -1 || sender.Mobile.TithingPoints < 50 || sender.Mobile.Mana < 100) { SendFailedGump(sender.Mobile, "Skill Required: Chivalry 25.0+ & 100 mana.<br>" + "Items: Arcane Gem, a Sceptor (enchantments will be removed).<br>" + "Tithing: 50."); goto case Buttons.Chivalry; } sender.Mobile.Mana -= 100; sender.Mobile.TithingPoints -= 50; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new RemoveCurseScepter(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Chivalry; } case Buttons.DivineFury: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(WarHammer), }, new int[] { 1, 1 }); if (sender.Mobile.Skills[SkillName.Chivalry].Base < 45.0 || items != -1 || sender.Mobile.TithingPoints < 50 || sender.Mobile.Mana < 75) { SendFailedGump(sender.Mobile, "Skill Required: Chivalry 45.0+ & 75 mana.<br>" + "Items: Arcane Gem, a War Hammer (enchantments will be removed).<br>" + "Tithing: 50."); goto case Buttons.Chivalry; } sender.Mobile.Mana -= 75; sender.Mobile.TithingPoints -= 50; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); wand = new DivineFuryWarHammer(); wand.Crafter = sender.Mobile; pack.DropItem(wand); goto case Buttons.Chivalry; } #endregion #region Golems case Buttons.BloodGolem: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(PowerCrystal), typeof(Garlic), typeof(Ginseng), typeof(MandrakeRoot), typeof(SpidersSilk), typeof(Head), typeof(LeftArm), typeof(RightArm), typeof(LeftLeg), typeof(RightLeg) }, new int[] { 3, 1, 50, 50, 50, 50, 1, 1, 1, 1, 1 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 50.0 || sender.Mobile.Skills[SkillName.Necromancy].Base < 50.0 || items != -1 || sender.Mobile.Mana < 74 || sender.Mobile.Hits < 100) { SendFailedGump(sender.Mobile, "Skill Required: Magery 50.0+ & Necromancy 50.0+ & 75 mana.<br>" + "Items: 3 Arcane Gems, Power Crystal, All the flesh parts from a humanoid corpse.<br>" + "Regents: 50 each of Garlic, Ginsing, Mandrake Root, Spider's Silk." + "Special: 100 Hit Points."); goto case Buttons.Golems; } sender.Mobile.Hits -= 100; sender.Mobile.Mana -= 75; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); pack.DropItem(new GolemItem(GolemType.Blood)); goto case Buttons.Golems; } case Buttons.ClayGolem: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(PowerCrystal), typeof(FertileDirt), typeof(Bloodmoss), typeof(GraveDust), typeof(NoxCrystal), typeof(SpidersSilk), }, new int[] { 2, 1, 4, 50, 50, 50, 50 }); if (items == -1) { Item[] itemlist = pack.FindItemsByType(typeof(Pitcher)); if (itemlist.Length == 0) { items = 0; } Pitcher p = null; int found = 0; for (int i = 0; i < itemlist.Length; i++) { p = (Pitcher)itemlist[i]; if (p.IsFull && p.Content == BeverageType.Water) { found++; } } if (found < 4) { items = 0; } } if (sender.Mobile.Skills[SkillName.Magery].Base < 75.0 || sender.Mobile.Skills[SkillName.Necromancy].Base < 75.0 || items != -1 || sender.Mobile.Mana < 99) { SendFailedGump(sender.Mobile, "Skill Required: Magery 75.0+ & Necromancy 75.0+ & 100 mana<br>" + "Items: 2 Arcane Gems, Power Crystal, 4 Fertile Dirt, 4 Pitchers full of water.<br>" + "Regents: 50 each of Bloodmoss, Grave Dust, Nox Crystal, Spider's Silk."); goto case Buttons.Golems; } sender.Mobile.Mana -= 100; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); pack.DropItem(new GolemItem(GolemType.Clay)); goto case Buttons.Golems; } case Buttons.IronGolem: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(PowerCrystal), typeof(BatWing), typeof(Nightshade), typeof(PigIron) }, new int[] { 4, 2, 50, 50, 100 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 100.0 || sender.Mobile.Skills[SkillName.Necromancy].Base < 100.0 || items != -1 || sender.Mobile.Mana < 124) { SendFailedGump(sender.Mobile, "Skill Required: Magery 100.0+ & Necromancy 100.0+ & 125 mana.<br>" + "Items: 4 Arcane Gems, 2 Power Crystals.<br>" + "Regents: 50 each of Bat Wing, Nightshade & 100 Pig Iron.<br>" + "Special: Armor or Weapon (consumed on use)"); goto case Buttons.Golems; } sender.Mobile.Mana -= 125; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); pack.DropItem(new GolemItem(GolemType.Iron)); goto case Buttons.Golems; } case Buttons.FireGolem: { items = pack.ConsumeTotal( new Type[] { typeof(ArcaneGem), typeof(PowerCrystal), typeof(BlackPearl), typeof(DaemonBlood), typeof(MandrakeRoot), typeof(SulfurousAsh), }, new int[] { 5, 2, 50, 50, 50, 200 }); if (sender.Mobile.Skills[SkillName.Magery].Base < 115.0 || sender.Mobile.Skills[SkillName.Necromancy].Base < 115.0 || items != -1 || sender.Mobile.Mana < 149) { SendFailedGump(sender.Mobile, "Skill Required: Magery 115.0+ & Necromancy 115.0+ & 150 mana." + "Items: 5 Arcane Gems, 2 Power Crystals, 200 Sulfurous Ash" + "Regents: 50 each of Black Peral, Daemon Blood, Mandrake Root & 200 Sulfurous Ash" + "Special: Armor or Weapon"); goto case Buttons.Golems; } sender.Mobile.Mana -= 150; sender.Mobile.SendMessage(1192, "You bound the spell to the item."); pack.DropItem(new GolemItem(GolemType.Fire)); goto case Buttons.Golems; } #endregion } }
public void Target(object op) { IPoint3D p = op as IPoint3D; Mobile mobileTarget = op as Mobile; IPoint3D orig = p; Map map = Caster.Map; SpellHelper.GetSurfaceTop(ref p); if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom)) { } else if (!SpellHelper.CheckTravel(Caster, map, new Point3D(p), TravelCheckType.TeleportTo)) { } else if (mobileTarget == null && (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (Region.Find(new Point3D(p), map) is HouseRegion) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.CheckMulti(new Point3D(p), map)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckSequence()) { if (op != null && Caster.InLOS(p) && Caster.InRange(new Point2D(p.X, p.Y), 14)) { Mobile m = Caster; Point3D from = m.Location; Point3D to = new Point3D(p); m.Location = to; m.RevealingAction(); m.ProcessDelta(); Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023); Effects.SendLocationParticles(EffectItem.Create(to, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); m.PlaySound(Sound); IPooledEnumerable eable = m.GetItemsInRange(0); foreach (Item item in eable) { if (item is Server.Spells.Sixth.ParalyzeFieldSpell.InternalItem || item is Server.Spells.Fifth.PoisonFieldSpell.InternalItem || item is Server.Spells.Fourth.FireFieldSpell.InternalItem) { item.OnMoveOver(m); } } eable.Free(); } else { Caster.SendAsciiMessage("You can't see that target!"); } } FinishSequence(); }
public override void OnCast() { if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (TransformationSpellHelper.UnderTransformation(Caster)) { Caster.SendLocalizedMessage(1061633); // You cannot polymorph while in that form. } else if (DisguiseTimers.IsDisguised(Caster)) { Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised. } else if (Caster.BodyMod == 183 || Caster.BodyMod == 184) { Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint } /* * else if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) ) * { * DoFizzle(); * }*/ else if (CheckSequence()) { StopTimer(Caster); //Reset polymorph spell if (Caster.BeginAction(typeof(PolymorphSpell))) { if (m_PolymorphEntry.BodyID != 0) { if (!((Body)m_PolymorphEntry.BodyID).IsHuman) { IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } if (m_PolymorphEntry.BodyID == 0x3B) //Dragon, two different body IDs { Caster.BodyMod = Utility.RandomList(0x3B, 0xC); } else { Caster.BodyMod = m_PolymorphEntry.BodyID; } Caster.PlaySound(Sound); StopTimer(Caster); Timer t = new InternalTimer(Caster, m_PolymorphEntry); m_Timers.Add(Caster, t); t.Start(); BaseArmor.ValidateMobile(Caster); BaseWeapon.ValidateMobile(Caster); if (Caster.NameMod != null) //Caster has incognito, need to update name { Caster.NameMod = IncognitoSpell.GetNameMod(Caster.BodyValue); } } } else { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } } FinishSequence(); }
public override void OnCast() //xuo chro : probably foox up the runebook { Mobile from = Caster; if (Caster.Region is HouseRegion) { Caster.SendMessage("You cannot cast that spell here."); return; } if (SphereSpellTarget is RecallRune && Caster.InLOS(SphereSpellTarget)) { RecallRune rune = (RecallRune)SphereSpellTarget; if (rune.Marked) { if (rune.ChargesLeft == 0) { Caster.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune's magic has faded"); DoFizzle(); return; } else if (rune.ChargesLeft <= 10 && rune.ChargesLeft >= 1) { Caster.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune is starting to fade"); } Effect(rune.Target, rune.TargetMap, true); } else { Caster.SendLocalizedMessage(501805); // That rune is not yet marked. if (from is PlayerMobile) { ((PlayerMobile)from).SpellCheck(); } } } else if (SphereSpellTarget is Runebook) { RunebookEntry e = ((Runebook)SphereSpellTarget).Default; if (e != null) { Effect(e.Location, e.Map, true); } else { Caster.SendLocalizedMessage(502354); // Target is not marked. } } else if (SphereSpellTarget is Key && ((Key)SphereSpellTarget).KeyValue != 0 && ((Key)SphereSpellTarget).Link is BaseBoat) { BaseBoat boat = (BaseBoat)((Key)SphereSpellTarget).Link; if (!boat.Deleted && boat.CheckKey(((Key)SphereSpellTarget).KeyValue)) { Effect(boat.GetMarkedLocation(), boat.Map, false); } else { Caster.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object. } } else if (m_Entry != null) { /*if (m_Entry.ChargesLeft == 0) * { * from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune in your runebook has faded"); * DoFizzle(); * return; * } * else if (m_Entry.ChargesLeft <= 10 && m_Entry.ChargesLeft >= 1) * from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune in your runebook is starting to fade"); */ Effect(m_Entry.Location, m_Entry.Map, true); } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); }/* * else if (SphereSpellTarget is HouseRaffleDeed && ((HouseRaffleDeed)SphereSpellTarget).ValidLocation()) * { * HouseRaffleDeed deed = (HouseRaffleDeed)SphereSpellTarget; * * m_Owner.Effect(deed.PlotLocation, deed.PlotFacet, true); * }*/ else { if (!Caster.InLOS(SphereSpellTarget)) { Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501031); // I cannot see that object. } else { Caster.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object. } if (from is PlayerMobile) { ((PlayerMobile)from).SpellCheck(); } } }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SphereSpellTarget is BaseWand) { BaseWand bw = SphereSpellTarget as BaseWand; bw.RechargeWand(Caster, this); } else if (CheckSequence()) { SpellHelper.GetSurfaceTop(ref p); int dx = Caster.Location.X - p.X; int dy = Caster.Location.Y - p.Y; int rx = (dx - dy) * 44; int ry = (dx + dy) * 44; bool eastToWest; if (rx >= 0 && ry >= 0) { eastToWest = false; } else if (rx >= 0) { eastToWest = true; } else if (ry >= 0) { eastToWest = true; } else { eastToWest = false; } Effects.PlaySound(p, Caster.Map, Sound); //Loki edit: Wall length reduced CustomRegion cR = Caster.Region as CustomRegion; int wallsize; if (cR != null && cR.Controller.LokiPvP) { wallsize = 2; } else { wallsize = 3; } for (int i = -wallsize; i <= wallsize; ++i) //End Loki edit: Was: int i = -3; i <= 3; ++i { //Iza -- Always fit Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z); /*bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 22, true); * * if (!canFit) * continue;*/ IPooledEnumerable eable = Caster.Map.GetMobilesInRange(loc, 0); bool canFit = true; foreach (Mobile m in eable) { if (m.AccessLevel != AccessLevel.Player || !m.Alive) { continue; } if (m.Location.Z - loc.Z < 18 && m.Location.Z - loc.Z > -10) { //Taran: The whole field counts as a harmful action, not just the target Caster.DoHarmful(m); //Taran: Make a hole in the wall if a mobile is there canFit = false; break; } } eable.Free(); if (!canFit) { continue; } //Rob edit: Delete existing wall items eable = Caster.Map.GetItemsInRange(loc, 0); foreach (Item item in eable) { if (item is InternalItem) { item.Delete(); } } eable.Free(); new InternalItem(loc, Caster.Map, Caster); } } FinishSequence(); }
public WandTarget(BaseWand item) : base(6, false, TargetFlags.None) => m_Item = item;
public WandTarget(BaseWand item) : base(6, false, TargetFlags.None) { AllowNonlocal = true; m_Item = item; }