public virtual double GetSlayerDamageScalar(Mobile defender) { Spellbook atkBook = Spellbook.FindEquippedSpellbook(m_Caster); double scalar = 1.0; if (atkBook != null) { SlayerEntry atkSlayer = SlayerGroup.GetEntryByName(atkBook.Slayer); SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2); if (atkSlayer != null && atkSlayer.Slays(defender) || atkSlayer2 != null && atkSlayer2.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); //TODO: Confirm this displays on OSIs scalar = 2.0; } TransformContext context = TransformationSpell.GetContext(defender); if ((atkBook.Slayer == SlayerName.Silver || atkBook.Slayer2 == SlayerName.Silver) && context != null && context.Type != typeof(HorrificBeastSpell)) { scalar += .25; // Every necromancer transformation other than horrific beast take an additional 25% damage } if (scalar != 1.0) { return(scalar); } } ISlayer defISlayer = Spellbook.FindEquippedSpellbook(defender); if (defISlayer == null) { defISlayer = defender.Weapon as ISlayer; } if (defISlayer != null) { SlayerEntry defSlayer = SlayerGroup.GetEntryByName(defISlayer.Slayer); SlayerEntry defSlayer2 = SlayerGroup.GetEntryByName(defISlayer.Slayer2); if (defSlayer != null && defSlayer.Group.OppositionSuperSlays(m_Caster) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays(m_Caster)) { scalar = 2.0; } } return(scalar); }
private bool ValidateTarget(BaseCreature bc) { foreach (var t in _CommandTypes) { if (t == bc.GetType()) { return(true); } } SlayerEntry entry = SlayerGroup.GetEntryByName(SlayerName.Silver); return(entry != null && entry.Slays(bc)); }
public void Target(Mobile m) { bool CanAffect = true; if (m is BaseCreature) { SlayerEntry golem = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction); if (golem.Slays(m)) { CanAffect = false; } } if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (!CanAffect) { Caster.SendMessage("This spell cannot affect golems or constructs."); } else if (CheckHSequence(m)) { SpellHelper.Turn(Caster, m); SpellHelper.CheckReflect(CirclePower, Caster, ref m); TimeSpan duration = TimeSpan.FromSeconds((DamagingSkill(Caster) / 4)); m.FixedParticles(0x3789, 10, 25, 5032, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xBB3), 0, EffectLayer.Head); m.PlaySound(0x19D); if (m is PlayerMobile) { m.Paralyze(duration); m.SendMessage("You are frozen in fear."); } else if (m is BaseCreature) { BaseCreature bc = (BaseCreature)m; bc.BeginFlee(duration); } Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); HarmfulSpell(m); } FinishSequence(); }
public void Target(Mobile m) { bool CanAffect = true; if (m is BaseCreature) { SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); SlayerEntry elly = SlayerGroup.GetEntryByName(SlayerName.ElementalBan); SlayerEntry golem = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction); if (undead.Slays(m) || elly.Slays(m) || golem.Slays(m)) { CanAffect = false; } } if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m.Frozen || m.Paralyzed) { Caster.SendLocalizedMessage(1061923); // The target is already frozen. } else if (!CanAffect) { Caster.SendMessage("This spell cannot affect supernatural creatures, golems, constructs, or elementals."); } else if (CheckHSequence(m)) { SpellHelper.Turn(Caster, m); SpellHelper.CheckReflect(CirclePower, Caster, ref m); TimeSpan duration = TimeSpan.FromSeconds((DamagingSkill(Caster) / 4)); m.Paralyze(duration); m.PlaySound(0x657); m.FixedParticles(0x3039, 9, 32, 5008, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xB72), 0, EffectLayer.Waist); new SleepyTimer(m, duration).Start(); Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); HarmfulSpell(m); } FinishSequence(); }
public static bool IsValidTarget(BaseCreature bc) { if (bc == null || bc.IsParagon || (bc.Controlled && !bc.Allured) || bc.Summoned) { return(false); } SlayerEntry slayer = SlayerGroup.GetEntryByName(SlayerName.Repond); if (slayer != null && slayer.Slays(bc)) { return(true); } return(false); }
public virtual double GetSlayerDamageScalar(Mobile defender) { Spellbook atkBook = Spellbook.FindEquippedSpellbook(m_Caster); double scalar = 1.0; if (atkBook != null) { SlayerEntry atkSlayer = SlayerGroup.GetEntryByName(atkBook.Slayer); SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2); if (atkSlayer != null && atkSlayer.Slays(defender) || atkSlayer2 != null && atkSlayer2.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); //TODO: Confirm this displays on OSIs scalar = 2.0; } if (scalar != 1.0) { return(scalar); } } ISlayer defISlayer = Spellbook.FindEquippedSpellbook(defender); if (defISlayer == null) { defISlayer = defender.Weapon as ISlayer; } if (defISlayer != null) { SlayerEntry defSlayer = SlayerGroup.GetEntryByName(defISlayer.Slayer); SlayerEntry defSlayer2 = SlayerGroup.GetEntryByName(defISlayer.Slayer2); if (defSlayer != null && defSlayer.Group.OppositionSuperSlays(m_Caster) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays(m_Caster)) { scalar = 2.0; } } return(scalar); }
public virtual double GetSlayerDamageScalar(Mobile defender) { Spellbook atkBook = Spellbook.FindEquippedSpellbook(Caster); double scalar = 1.0; if (atkBook != null) { SlayerEntry atkSlayer = SlayerGroup.GetEntryByName(atkBook.Slayer); SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2); if (atkSlayer != null && atkSlayer.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); scalar = Math.Max(scalar, SlayerGroup.IsSuperSlayer(atkSlayer.Name) ? 2.0 : 3.0); } if (atkSlayer2 != null && atkSlayer2.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); scalar = Math.Max(scalar, SlayerGroup.IsSuperSlayer(atkSlayer2.Name) ? 2.0 : 3.0); } TransformContext context = TransformationSpell.GetContext(defender); if ((atkBook.Slayer == SlayerName.Undead || atkBook.Slayer2 == SlayerName.Undead) && context != null && context.Type != typeof(HorrificBeastSpell)) { scalar += .25; // Every necromancer transformation other than horrific beast take an additional 25% damage } if (scalar != 1.0) { return(scalar); } } #region Opposite Slayer if (defender.GetSlayerEntries().Any(e => e.Group.OppositionSuperSlays(Caster))) { scalar = 2.0; } #endregion return(scalar); }
public virtual double GetSlayerBonus() { if (Target == null) { return(1.0); } ISlayer slayer = Instrument as ISlayer; if (slayer != null) { SlayerEntry se1 = SlayerGroup.GetEntryByName(slayer.Slayer); SlayerEntry se2 = SlayerGroup.GetEntryByName(slayer.Slayer2); if ((se1 != null && se1.Slays(Target)) || (se2 != null && se2.Slays(Target))) { return(SlayerBonus); } } return(1.0); }
public override bool OnMoveOver(Mobile m) { bool CanAffect = true; if (m is BaseCreature) { SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); SlayerEntry elly = SlayerGroup.GetEntryByName(SlayerName.ElementalBan); SlayerEntry golem = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction); if (undead.Slays(m) || elly.Slays(m) || golem.Slays(m)) { CanAffect = false; } } if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false) && CanAffect) { if (SpellHelper.CanRevealCaster(m)) { m_Caster.RevealingAction(); } m_Caster.DoHarmful(m); TimeSpan duration = TimeSpan.FromSeconds((DamagingSkill(m_Caster) / 4)); m.Paralyze(duration); m.PlaySound(0x657); m.FixedParticles(0x3039, 9, 32, 5008, Server.Items.CharacterDatabase.GetMySpellHue(m_Caster, 0xB72), 0, EffectLayer.Waist); new SleepyTimer(m, duration).Start(); } return(true); }
public MobileEntry(Type type) { m_MasterType = type; m_Module = type.Module; m_Name = Bestiary.TypeRegistry[m_MasterType].Name; m_Slayer = this.SlayerGroup(); ConstructorInfo ctor = this.HandleSpecialType(type); this.AnalyseILCode(ctor.GetMethodBody().GetILAsByteArray()); #region [Additional data] { BaseCreature bc = (BaseCreature)Activator.CreateInstance(type); if (bc.Unprovokable) { m_Barding |= 0x1; } if (bc.Uncalmable) { m_Barding |= 0x2; } if (bc.BardImmune) { m_Barding |= 0x4; } m_Immunity = bc.PoisonImmune; m_Difficulty = Items.BaseInstrument.GetBaseDifficulty(bc); bc.Delete(); } #endregion if (m_BodyId != 0) { GenerateImage(); } }
public override void OnCast() { Corpse toChannel = null; int regenerate = 0; int bonus = (int)(DamagingSkill(Caster) / 4); if (bonus > 60) { bonus = 60; } if (bonus < 2) { bonus = 2; } foreach (Item item in Caster.GetItemsInRange(3)) { if (item is Corpse && !((Corpse)item).Channeled && !((Corpse)item).Animated) { Corpse body = (Corpse)item; if (!(body.m_Owner is PlayerMobile)) { if (body.m_Owner is BaseCreature) { SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); if (undead.Slays(body.m_Owner)) { toChannel = (Corpse)item; regenerate = (int)(((body.m_Owner).Fame) / 50) + bonus; break; } } } } } if (regenerate > 0) { if (toChannel != null) { toChannel.Channeled = true; toChannel.Hue = 0x835; } int mana = Caster.ManaMax - Caster.Mana; if (mana > regenerate) { Caster.Mana = Caster.Mana + regenerate; regenerate = 0; } else { Caster.Mana = Caster.ManaMax; regenerate = regenerate - mana; } int stam = Caster.ManaMax - Caster.Stam; if (stam > regenerate) { Caster.Stam = Caster.Stam + regenerate; regenerate = 0; } else { Caster.Stam = Caster.StamMax; regenerate = regenerate - stam; } int hits = Caster.ManaMax - Caster.Hits; if (hits > regenerate) { Caster.Hits = Caster.Hits + regenerate; regenerate = 0; } else { Caster.Hits = Caster.HitsMax; regenerate = regenerate - hits; } if (Caster.Karma < 0) { Caster.FixedParticles(0x3400, 1, 15, 9501, 2100, 4, EffectLayer.Waist); } else { Caster.FixedParticles(0x375A, 1, 15, 9501, 2100, 4, EffectLayer.Waist); } if (Caster.Karma < 0) { Caster.Say("Xtee Mee Glau"); Caster.PlaySound(0x481); } else { Caster.Say("Anh Mi Sah Ko"); Caster.PlaySound(0x24A); } Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); KarmaMod(Caster, ((int)RequiredSkill + RequiredMana)); Caster.SendMessage("You speak in strange tongues to the soul of the dead supernatural creature."); } else { Caster.SendMessage("You fail to speak to any dead supernatural creatures in the area."); Caster.PlaySound(0x1D6); } FinishSequence(); }
public void Target(Mobile m) { SlayerEntry exorcism = SlayerGroup.GetEntryByName(SlayerName.Exorcism); if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m is BaseCreature) { BaseCreature bc = m as BaseCreature; double damage = DamagingSkill(Caster) - 30; if (damage > 200) { damage = 200.0; } if (damage < 50) { damage = 50.0; } if (!exorcism.Slays(m)) { Caster.SendMessage("This spell cannot be used on this type of creature."); } else if (bc.IsBonded) { Caster.SendMessage("This spell cannot banish such a creature!"); } else if (exorcism.Slays(m) && !bc.IsDispellable) { m.Say("Your pitiful spell amuses me, mortal!"); m.FixedParticles(0x5508, 10, 30, 5052, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.Head); m.PlaySound(0x653); SpellHelper.Damage(this, Caster, damage, 0, 0, 0, 0, 100); } else if (m.Fame >= 23000) { m.Say("Your magic is puny in comparison to my power!"); m.FixedParticles(0x5508, 10, 30, 5052, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.Head); m.PlaySound(0x653); SpellHelper.Damage(this, Caster, damage, 0, 0, 0, 0, 100); } else if (CheckHSequence(m)) { int exChance = (int)(m.Fame / 200) + 10; if (DamagingSkill(Caster) >= Utility.RandomMinMax(1, exChance)) { m.Say("No! You cannot banish me! I will return from the Underworld!"); SpellHelper.Turn(Caster, m); m.FixedParticles(0x5508, 10, 30, 5052, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.Head); m.PlaySound(0x653); new InternalTimer(m).Start(); } else { Caster.SendMessage("You fail at your exorcism, but did cause some energy damage."); m.FixedParticles(0x5508, 10, 30, 5052, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.Head); m.PlaySound(0x653); SpellHelper.Damage(this, Caster, damage, 0, 0, 0, 0, 100); } } Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); } FinishSequence(); }
private string GetDescription(MarketEntry entry) { StringBuilder sb = new StringBuilder(); sb.AppendLine(String.Format("Seller: {0}", (entry.Seller == null ? "(private)" : entry.Seller.RawName))); int[] cost = Curr.Compress(entry.Cost, 0, 0); sb.AppendLine(String.Format("Total cost: {0} copper, {1} silver, {2} gold", cost[0], cost[1], cost[2])); sb.AppendLine(String.Format("Seller's description: {0}", entry.Description)); sb.AppendLine(); sb.Append("<center>---------------</center>"); sb.Append(String.Format("<center>{0} Details</center>", (entry.ObjectSerial.IsItem ? "Item" : "Mobile"))); IEntity entity = World.FindEntity(entry.ObjectSerial); if (entity is Item) { Item item = (Item)entity; sb.AppendLine("Name: " + item.Name); if (item.Amount > 1) { sb.AppendLine("Quantity: " + item.Amount); } if (item is BaseWeapon) { BaseWeapon weap = (BaseWeapon)item; if (weap.Crafter != null) { sb.AppendLine("Crafted by: " + weap.Crafter.RawName); } sb.AppendLine("Quality: " + weap.Quality); if (weap.Identified) { sb.AppendLine("Durability: " + weap.DurabilityLevel); sb.AppendLine("Accuracy level: " + weap.AccuracyLevel); sb.AppendLine("Damage level: " + weap.DamageLevel); if (weap.Slayer != SlayerName.None) { SlayerEntry se = SlayerGroup.GetEntryByName(weap.Slayer); if (se != null) { sb.AppendLine("Slayer enhancement: " + se.Title); } } if (weap.Slayer2 != SlayerName.None) { SlayerEntry se = SlayerGroup.GetEntryByName(weap.Slayer2); if (se != null) { sb.AppendLine("Slayer enhancement: " + se.Title); } } } else { sb.AppendLine("<i>Unidentified</i>"); } } } else if (entity is Mobile) { Mobile mob = (Mobile)entity; sb.AppendLine("Name: " + mob.Name); if (mob is BaseCreature) { BaseCreature bc = (BaseCreature)mob; sb.AppendLine("Creature type: " + Util.SplitString(bc.GetType().ToString())); sb.AppendLine("Minimum Taming required: " + bc.MinTameSkill.ToString("F2")); sb.AppendLine("Follower Slots required: " + bc.ControlSlots); } } return(sb.ToString()); }
public void Target(Mobile m) { SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m is BaseCreature) { BaseCreature bc = m as BaseCreature; double damage = DamagingSkill(Caster) - 30; if (damage > 200) { damage = 200.0; } if (damage < 50) { damage = 50.0; } if (!undead.Slays(m)) { Caster.SendMessage("This spell cannot be used on this type of creature."); } else if (bc.IsBonded) { Caster.SendMessage("This spell cannot affect such a creature!"); } else if (undead.Slays(m) && !bc.IsDispellable) { m.Say("Your pitiful spell amuses me, mortal!"); Caster.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); Caster.PlaySound(0x208); SpellHelper.Damage(this, Caster, damage, 0, 0, 0, 0, 100); } else if (m.Fame >= 23000) { m.Say("Your magic is puny in comparison to my power!"); Caster.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); Caster.PlaySound(0x208); SpellHelper.Damage(this, Caster, damage, 0, 0, 0, 0, 100); } else if (CheckHSequence(m)) { int exChance = (int)(m.Fame / 200) + 10; if (DamagingSkill(Caster) >= Utility.RandomMinMax(1, exChance)) { m.Say("No! You cannot send me toward the light! Death is not eternal!"); SpellHelper.Turn(Caster, m); m.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); m.PlaySound(0x208); new InternalTimer(m).Start(); } else { Caster.SendMessage("You fail at your attempt, but did cause some energy damage."); Caster.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); Caster.PlaySound(0x208); SpellHelper.Damage(this, Caster, damage, 0, 0, 0, 0, 100); } } Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); } FinishSequence(); }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckHSequence(m)) { if (Caster is TeiravonMobile && (((TeiravonMobile)Caster).IsCleric() || ((TeiravonMobile)Caster).IsDarkCleric() || ((TeiravonMobile)Caster).IsPaladin()) && ((TeiravonMobile)Caster).Faith != TeiravonMobile.Deity.None) { TeiravonMobile Cleric = Caster as TeiravonMobile; SpellHelper.Turn(Caster, m); SpellHelper.CheckReflect((int)this.Circle, Caster, ref m); if (m is TeiravonMobile && ((TeiravonMobile)m).m_CloakOfDarkness) { return; } double damage; switch (Cleric.Faith) { case TeiravonMobile.Deity.Adalia: { damage = GetNewAosDamage(10, 1, 5, Caster.Player && m.Player); SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100); m.Stam -= (int)damage; m.FixedParticles(0x37B9, 10, 30, 5013, 1153, 4, EffectLayer.Waist); m.PlaySound(0x470); } break; case TeiravonMobile.Deity.Cultist: { damage = GetNewAosDamage(5, 1, 5, true); SpellHelper.Damage(this, Caster, damage); damage = GetNewAosDamage(25, 5, 10, true); SpellHelper.Damage(this, m, damage, 20, 20, 20, 20, 20); m.FixedParticles(0x37C3, 10, 30, 5013, 137, 4, EffectLayer.Waist); Caster.FixedParticles(0x37C3, 10, 30, 5013, 137, 4, EffectLayer.Waist); m.PlaySound(0x44E); } break; case TeiravonMobile.Deity.Gruumsh: { int hpMissing = (int)((Caster.HitsMax - Caster.Hits) * .2); damage = GetNewAosDamage(10 + hpMissing, 1, 5, Caster.Player && m.Player); SpellHelper.Damage(this, m, damage, 0, 100, 0, 0, 0); Caster.FixedParticles(0x36FE, 10, 30, 5013, 137, 4, EffectLayer.Waist); m.PlaySound(0x056); } break; case TeiravonMobile.Deity.Jareth: { damage = GetNewAosDamage(1, 2, 2, Caster.Player && m.Player); SpellHelper.Damage(this, m, damage); Caster.MovingEffect(m, 0x1CEE, 10, 30, false, false, 1886, 0); m.PlaySound(0x3AC); } break; case TeiravonMobile.Deity.Kamalini: { damage = GetNewAosDamage(22, 1, 5, Caster.Player && m.Player); if (!m.InRange(Caster, 4)) { damage *= 0.25; // 1/4 damage at > 4 tile range } else if (!m.InRange(Caster, 2)) { damage *= 0.50; // 1/2 damage at 2 tile range } SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0); Caster.Heal((int)damage * (1 - m.ColdResistance / 100)); Caster.PrivateOverheadMessage(MessageType.Spell, 495, false, damage.ToString(), Caster.NetState); Caster.FixedParticles(0x373A, 10, 30, 5013, 157, 4, EffectLayer.Waist); m.FixedParticles(0x374A, 10, 30, 5013, 157, 4, EffectLayer.Waist); m.PlaySound(0x4B2); } break; case TeiravonMobile.Deity.Kinarugi: { damage = GetNewAosDamage(1, 2, 3, Caster.Player && m.Player); int duration = GetNewAosDamage(8, 1, 3, Caster.Player && m.Player); if (!MortalStrike.IsWounded(m)) { MortalStrike.BeginWound(m, TimeSpan.FromSeconds(duration)); } Timer m_Timer = new KinTimer(this, Caster, m, duration, (int)damage); m_Timer.Start(); m.LocalOverheadMessage(MessageType.Spell, 250, false, duration.ToString()); m.FixedParticles(0x3789, 10, 30, 5013, 1888, 2, EffectLayer.Waist); m.PlaySound(0x4B2); } break; case TeiravonMobile.Deity.Lloth: { damage = GetNewAosDamage(10, 1, 5, Caster.Player && m.Player); TavWebbing webbing = XmlAttach.FindAttachmentOnMobile(m, typeof(TavWebbing), "web") as TavWebbing; if (webbing != null) { webbing.Expiration = TimeSpan.FromSeconds(3); webbing.DoWebbing(); } else { TavWebbing newweb = new TavWebbing(5); newweb.Name = "web"; XmlAttach.AttachTo(m, newweb); } int web = Utility.RandomMinMax(3811, 3814); Caster.MovingParticles(m, web, 12, 5, false, false, 0x377a, 0x377a, -1); SpellHelper.Damage(this, m, damage, 50, 0, 0, 50, 0); Spiderling spiderling = new Spiderling(Caster, m, TimeSpan.FromSeconds(5)); spiderling.Combatant = m; Spells.Necromancy.AnimateDeadSpell.Register(Caster, spiderling); spiderling.MoveToWorld(m.Location, m.Map); spiderling.YellowHealthbar = true; Caster.PlaySound(0x21B); } break; case TeiravonMobile.Deity.Narindun: { SlayerEntry atkSlayer = SlayerGroup.GetEntryByName(SlayerName.DaemonDismissal); int val = atkSlayer.Slays(m) ? 45 : 15; damage = GetNewAosDamage(val, 1, 5, Caster.Player & m.Player); SpellHelper.Damage(this, m, damage, 0, 0, 50, 0, 50); m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist); m.PlaySound(0x0FC); } break; case TeiravonMobile.Deity.Occido: { int val = 0; ArrayList targets = new ArrayList(); SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); foreach (Mobile u in m.GetMobilesInRange(5)) { if (undead.Slays(u) || (u is TeiravonMobile && ((TeiravonMobile)u).IsUndead())) { val++; targets.Add(u); } } if (val > 0) { for (int i = 0; i < targets.Count; ++i) { Mobile x = (Mobile)targets[i]; Effects.SendMovingEffect(x, m, Utility.Random(0x1AE0, 4), 30, 10, false, false, 2004, 3); } } val *= 3; damage = GetNewAosDamage(5 + val, 1, 5, Caster.Player & m.Player); SpellHelper.Damage(this, m, damage, 0, 0, 50, 0, 50); m.FixedParticles(0x1F1F, 10, 30, 5013, 2562, 3, EffectLayer.Waist); m.PlaySound(0x44E); } break; case TeiravonMobile.Deity.Saerin: { int rock = Utility.RandomMetalHue(); m.FixedParticles(0x2565, 15, 15, 5013, rock, 1, EffectLayer.Waist); damage = GetNewAosDamage(15, 1, 5, Caster.Player & m.Player); SpellHelper.Damage(this, m, damage, 100, 0, 0, 0, 0); int sound = Utility.RandomMinMax(0x3B8, 0x3BE); ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, -15); m.AddResistanceMod(mod); m.PlaySound(sound); SaerTimer timer = new SaerTimer(m, mod); timer.Start(); if (m.PhysicalResistance <= 0) { m.Animate(21, 5, 1, false, false, 0); m.Freeze(TimeSpan.FromSeconds(.5)); } } break; case TeiravonMobile.Deity.Talathas: { BaseWeapon weap = Caster.Weapon as BaseWeapon; weap.OnHit(Caster, m); Caster.NextCombatTime = DateTime.Now; int effect = weap is Fists ? 0x36FE : weap.ItemID; m.FixedParticles(effect, 10, 30, 5013, 2360, 2, EffectLayer.Waist); } break; case TeiravonMobile.Deity.Valar: { string name = Utility.Random(100).ToString(); StatMod themmod = new StatMod(StatType.Dex, "ValarDrain", (int)(m.Dex * -.33), TimeSpan.FromSeconds(15)); StatMod castmod = new StatMod(StatType.Dex, "ValarDrain", (int)(m.Dex * .33), TimeSpan.FromSeconds(15)); m.AddStatMod(themmod); Caster.AddStatMod(castmod); damage = GetNewAosDamage(15, 1, 5, Caster.Player & m.Player); SpellHelper.Damage(this, m, damage, 0, 0, 0, 50, 50); m.FixedParticles(0x374A, 10, 30, 5013, 2364, 3, EffectLayer.Waist); m.MovingParticles(Caster, 0x36E4, 10, 10, false, false, 2367, 3, 0x035, 0x36FE, 0x035, 0); m.PlaySound(0x456); } break; } } else { SpellHelper.Turn(Caster, m); SpellHelper.CheckReflect((int)this.Circle, Caster, ref m); double damage; if (Core.AOS) { damage = GetNewAosDamage(17, 1, 5, Caster.Player && m.Player); } else { damage = Utility.Random(1, 15); if (CheckResisted(m)) { damage *= 0.75; m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. } damage *= GetDamageScalar(m); } /* * if ( !m.InRange( Caster, 2 ) ) * damage *= 0.25; // 1/4 damage at > 2 tile range * else if ( !m.InRange( Caster, 1 ) ) * damage *= 0.50; // 1/2 damage at 2 tile range */ if (Core.AOS) { m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist); m.PlaySound(0x0FC); } else { m.FixedParticles(0x374A, 10, 15, 5013, EffectLayer.Waist); m.PlaySound(0x1F1); } SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0); } } FinishSequence(); }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SpellHelper.CheckTown(p, Caster) && CheckSequence()) { SpellHelper.Turn(Caster, p); if (p is Item) { p = ((Item)p).GetWorldLocation(); } List <Mobile> targets = new List <Mobile>(); Map map = Caster.Map; if (map != null) { IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 8); bool CanAffect = true; SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); SlayerEntry elly = SlayerGroup.GetEntryByName(SlayerName.ElementalBan); SlayerEntry golem = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction); foreach (Mobile m in eable) { CanAffect = true; Mobile pet = m; if (m is BaseCreature) { pet = ((BaseCreature)m).GetMaster(); } if (m is BaseCreature) { if (undead.Slays(m) || elly.Slays(m) || golem.Slays(m)) { CanAffect = false; } } if (Caster.Region == m.Region && Caster != m && Caster != pet && Caster.InLOS(m) && m.Blessed == false && Caster.CanBeHarmful(m, true) && !m.Paralyzed && CanAffect) { targets.Add(m); } } eable.Free(); } if (targets.Count > 0) { Caster.PlaySound(0x651); for (int i = 0; i < targets.Count; ++i) { Mobile m = targets[i]; SpellHelper.Turn(Caster, m); SpellHelper.CheckReflect(CirclePower, Caster, ref m); TimeSpan duration = TimeSpan.FromSeconds((DamagingSkill(Caster) / 4)); m.Paralyze(duration); new SleepyTimer(m, duration, Caster).Start(); HarmfulSpell(m); } Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, true); } } FinishSequence(); }
public void Target(Mobile m) { BaseCreature bc = m as BaseCreature; SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); SlayerEntry exorcism = SlayerGroup.GetEntryByName(SlayerName.Exorcism); if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m is PlayerMobile) { Caster.SendMessage("Your prayers cannot banish that!"); } else if (!undead.Slays(m) && !exorcism.Slays(m)) { Caster.SendMessage("Your prayers cannot banish such a creature!"); } else if (bc.IsBonded) { Caster.SendMessage("Your prayers cannot banish such a creature!"); } else if (exorcism.Slays(m) && !bc.IsDispellable) { m.Say("Your pitiful prayers are heard by no one, mortal!"); double damage; damage = GetNewAosDamage(48, 1, 5, Caster); Caster.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); Caster.PlaySound(0x208); SpellHelper.Damage(this, Caster, damage, 0, 100, 0, 0, 0); } else if (m.Fame >= 23000) { m.Say("Your pitiful prayers are heard by no one, mortal!"); double damage; damage = GetNewAosDamage(48, 1, 5, Caster); Caster.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); Caster.PlaySound(0x208); SpellHelper.Damage(this, Caster, damage, 0, 100, 0, 0, 0); } else if (CheckHSequence(m)) { SpellHelper.Turn(Caster, m); m.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); m.PlaySound(0x208); if (undead.Slays(m)) { m.Say("No! You cannot banish me! I will return from the Underworld!"); } else { m.Say("No! You cannot kill that which is dead! I will return!"); } new InternalTimer(m).Start(); } FinishSequence(); }
public override void AlterMeleeDamageFrom(Mobile m, ref int damage) { base.AlterMeleeDamageFrom(m, ref damage); BaseWeapon weapon = m.Weapon as BaseWeapon; if (weapon != null) { SlayerEntry slayer = SlayerGroup.GetEntryByName(weapon.Slayer); if (slayer != null && slayer.Slays(m)) { if (slayer == slayer.Group.Super) { damage *= 2; } else { damage *= 3; } } int highest; int type = GetHighestDamageType(m, weapon, out highest); int heal = (int)(damage * (highest / 100.0)); switch (Form) { case Form.Human: /*if(type == 0) * { * damage -= heal; * Hits = Math.Min(Hits + heal, HitsMax); * }*/ break; case Form.Earth: if (type == 0) { damage -= heal; Hits = Math.Min(Hits + heal, HitsMax); } break; case Form.Fire: if (type == 1) { damage -= heal; Hits = Math.Min(Hits + heal, HitsMax); } break; case Form.Cold: if (type == 2) { damage -= heal; Hits = Math.Min(Hits + heal, HitsMax); } break; case Form.Poison: if (type == 3) { damage -= heal; Hits = Math.Min(Hits + heal, HitsMax); } break; case Form.Energy: if (type == 4) { damage -= heal; Hits = Math.Min(Hits + heal, HitsMax); } break; } } }
public void OnTarget(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (Caster == m) { Caster.SendMessage("You cannot target yourself!"); } else if (BardSpell.HasHarmfulEffects(m, this.GetType())) { Caster.SendLocalizedMessage(1115772); //Your target is already under the effect of this spellsong. } else if (CheckHSequence(m)) { SpellHelper.Turn(Caster, m); Target = m; HarmfulSpell(m); m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist); double cast = Caster.Skills[CastSkill].Value; double dam = Caster.Skills[DamageSkill].Value; m_Rounds = (int)(5 + ((cast - 90) * .3667) + (14 * (int)CollectiveBonus)); // 5 - 11 (14) m_PropertyBonus = (int)((5 + ((cast - 90) * .567)) + (14 * (int)CollectiveBonus)); // 5 - 22 (36) m_DamageChance = Math.Max(15, ((dam / 10) * 5)) + (24 * (int)CollectiveBonus); // 15 - 60 (84) m_DamageFactor = Math.Max(8, ((cast / 10) * 2.667)) + (18 * (int)CollectiveBonus); // 8 - 32 (50) m_SlayerBonus = 1; ISlayer slayer = Instrument as ISlayer; if (slayer != null) { SlayerEntry se1 = SlayerGroup.GetEntryByName(slayer.Slayer); SlayerEntry se2 = SlayerGroup.GetEntryByName(slayer.Slayer2); if ((se1 != null && se1.Slays(Target)) || (se2 != null && se2.Slays(Target))) { m_SlayerBonus = 1.5; } } if (m.Player) { // ~1_HCI~% Hit Chance.<br>~2_SDI~% Spell Damage.<br>Damage taken has a ~3_EXP~% chance to cause additional burst of physical damage.<br> BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.TribulationTarget, 1115740, 1115742, String.Format("{0}\t{1}\t{2}", m_PropertyBonus, m_PropertyBonus, (int)m_DamageChance))); } // Target: ~1_val~ <br> Damage Factor: ~2_val~% <br> Damage Chance: ~3_val~% BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.TribulationCaster, 1115740, 1151388, String.Format("{0}\t{1}\t{2}", m.Name, (int)m_DamageFactor, (int)m_DamageChance))); BeginTimer(); } FinishSequence(); }
public void Target(Mobile m) { SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); SlayerEntry exorcism = SlayerGroup.GetEntryByName(SlayerName.Exorcism); if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m is BaseCreature) { BaseCreature bc = m as BaseCreature; if (!undead.Slays(m) && !exorcism.Slays(m)) { Caster.SendMessage("This spell cannot be used on this type of creature."); } else if (exorcism.Slays(m) && !bc.IsDispellable) { m.Say("Your pitiful spell amuses me, mortal!"); double damage; damage = GetNewAosDamage(48, 1, 5, Caster); Caster.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); Caster.PlaySound(0x208); SpellHelper.Damage(this, Caster, damage, 0, 100, 0, 0, 0); } else if (m.Fame >= 23000) { m.Say("Your magic is puny in comparison to my power!"); double damage; damage = GetNewAosDamage(48, 1, 5, Caster); Caster.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); Caster.PlaySound(0x208); SpellHelper.Damage(this, Caster, damage, 0, 100, 0, 0, 0); } else if (CheckHSequence(m)) { int exChance = (int)(m.Fame / 200) + 10; if (Caster.Skills[SkillName.Necromancy].Value >= Utility.RandomMinMax(1, exChance)) { if (undead.Slays(m)) { m.Say("No! You cannot banish me! I will return from the Underworld!"); } else { m.Say("No! You cannot kill that which is dead! I will return!"); } SpellHelper.Turn(Caster, m); m.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); m.PlaySound(0x208); new InternalTimer(m).Start(); } else { Caster.SendMessage("You fail at your exorcism, but did cause some damage."); double damage; damage = GetNewAosDamage(48, 1, 5, Caster); Caster.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); Caster.PlaySound(0x208); SpellHelper.Damage(this, Caster, damage, 0, 100, 0, 0, 0); } } } FinishSequence(); }
public void Target(object obj) { if (obj is Corpse) { Corpse c = (Corpse)obj; Mobile m = c.m_Owner; if (m is BaseCreature) { SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); SlayerEntry exorcism = SlayerGroup.GetEntryByName(SlayerName.Exorcism); SlayerEntry animal = SlayerGroup.GetEntryByName(SlayerName.AnimalHunter); SlayerEntry golems = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction); SlayerEntry plants = SlayerGroup.GetEntryByName(SlayerName.WeedRuin); SlayerEntry repond = SlayerGroup.GetEntryByName(SlayerName.Repond); SlayerEntry dragon = SlayerGroup.GetEntryByName(SlayerName.DragonSlaying); SlayerEntry reptile = SlayerGroup.GetEntryByName(SlayerName.ReptilianDeath); SlayerEntry spider = SlayerGroup.GetEntryByName(SlayerName.ArachnidDoom); SlayerEntry elemental = SlayerGroup.GetEntryByName(SlayerName.ElementalBan); SlayerEntry wizard = SlayerGroup.GetEntryByName(SlayerName.WizardSlayer); SlayerEntry birds = SlayerGroup.GetEntryByName(SlayerName.AvianHunter); SlayerEntry slime = SlayerGroup.GetEntryByName(SlayerName.SlimyScourge); SlayerEntry giant = SlayerGroup.GetEntryByName(SlayerName.GiantKiller); SlayerEntry water = SlayerGroup.GetEntryByName(SlayerName.NeptunesBane); SlayerEntry fey = SlayerGroup.GetEntryByName(SlayerName.Fey); int level_corpse = DifficultyLevel.GetCreatureLevel(m); int level_caster = (int)((Caster.Skills[SkillName.Necromancy].Value + Caster.Skills[SkillName.SpiritSpeak].Value) / 2); if (level_caster > 100) { level_caster = 100; } int slots_max = (int)(level_corpse / 20); if (slots_max > 5) { slots_max = 5; } if (slots_max < 1) { slots_max = 1; } int slots_limit = Caster.FollowersMax - Caster.Followers; if (undead.Slays(m)) { Caster.SendMessage("You cannot animate supernatural creatures!"); } else if (golems.Slays(m)) { Caster.SendMessage("You cannot animate constructs!"); } else if (level_corpse > level_caster) { Caster.SendMessage("You are not powerful enough to animate that!"); } else if (slots_limit >= slots_max) { TimeSpan duration = TimeSpan.FromSeconds(((Caster.Skills[SkillName.Necromancy].Value + Caster.Skills[SkillName.SpiritSpeak].Value) / 2) * 9); BaseCreature bc = (BaseCreature)m; int myBody = bc.Body; if (m.TithingPoints > 0 && bc.Body != 400 && bc.Body != 401) { myBody = m.TithingPoints; } // STORED ORIGINAL BODY VALUE DURING ONAFTERSPAWN IN BASECREATURE.CS int hitpoison = 0; if (bc.HitPoison == Poison.Lesser) { hitpoison = 1; } else if (bc.HitPoison == Poison.Regular) { hitpoison = 2; } else if (bc.HitPoison == Poison.Greater) { hitpoison = 3; } else if (bc.HitPoison == Poison.Deadly) { hitpoison = 4; } else if (bc.HitPoison == Poison.Lethal) { hitpoison = 5; } int immune = 0; if (bc.PoisonImmune == Poison.Lesser) { immune = 1; } else if (bc.PoisonImmune == Poison.Regular) { immune = 2; } else if (bc.PoisonImmune == Poison.Greater) { immune = 3; } else if (bc.PoisonImmune == Poison.Deadly) { immune = 4; } else if (bc.PoisonImmune == Poison.Lethal) { immune = 5; } // THIS MODIFIES THE MONSTER BASED ON THE LEVEL OF THE CORPSE AND THE SKILLS OF THE CASTER // TO GET A ANIMATED CREATURE WITH FULL STATS, A CASTER NEEDS A 125 IN BOTH SKILLS int modify = level_caster - (level_corpse + 50); double mod = 1.0; if (modify < 0) { int lower = (level_corpse + 50) - level_caster; mod = (100 - lower) * 0.01; } BaseCreature creature = new SummonedCorpse((int)(mod * bc.HitsMax), (int)(mod * bc.StamMax), (int)(mod * bc.ManaMax), (int)(mod * bc.RawStr), (int)(mod * bc.RawDex), (int)(mod * bc.RawInt), hitpoison, immune); creature.DamageMin = (int)(mod * bc.DamageMin); creature.DamageMax = (int)(mod * bc.DamageMax); creature.ColdDamage = (int)(mod * bc.ColdDamage); creature.EnergyDamage = (int)(mod * bc.EnergyDamage); creature.FireDamage = (int)(mod * bc.FireDamage); creature.PhysicalDamage = (int)(mod * bc.PhysicalDamage); creature.PoisonDamage = (int)(mod * bc.PoisonDamage); creature.ColdResistSeed = (int)(mod * bc.ColdResistSeed); creature.EnergyResistSeed = (int)(mod * bc.EnergyResistSeed); creature.FireResistSeed = (int)(mod * bc.FireResistSeed); creature.PhysicalResistanceSeed = (int)(mod * bc.PhysicalResistanceSeed); creature.PoisonResistSeed = (int)(mod * bc.PoisonResistSeed); creature.VirtualArmor = (int)(mod * bc.VirtualArmor); creature.CanSwim = bc.CanSwim; if (creature.CanSwim) { creature.CantWalk = bc.CantWalk; } creature.ControlSlots = slots_max; BaseCreature b = (BaseCreature)m; creature.AI = AIType.AI_Melee; bool mage = false; if (b.AI == AIType.AI_Mage) { creature.AI = AIType.AI_Mage; mage = true; } SpellHelper.Summon(creature, Caster, 0x216, duration, false, false); creature.Body = myBody; string ghost = " creature"; if (exorcism.Slays(bc)) { ghost = " demon"; } else if (animal.Slays(bc)) { ghost = " animal"; } else if (plants.Slays(bc)) { ghost = " weed"; } else if (dragon.Slays(bc)) { ghost = " dragon"; } else if (reptile.Slays(bc)) { ghost = " reptile"; } else if (spider.Slays(bc)) { ghost = " insect"; } else if (elemental.Slays(bc)) { ghost = " necromental"; } else if (birds.Slays(bc)) { ghost = " bird"; } else if (slime.Slays(bc)) { ghost = " slime"; } else if (giant.Slays(bc)) { ghost = " giant"; } else if (repond.Slays(bc)) { ghost = ""; } // ZOMBIES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// creature.Hue = Utility.RandomList(0xB97, 0xB98, 0xB99, 0xB9A, 0xB85, 0xB79, 0xB5F, 0xB60, 0xB19, 0xACC, 0xACD, 0xACE, 0xACF, 0xAB0, 0x938, 0x92D); creature.BaseSoundID = 471; if (bc.Body == 400 || bc.Body == 401 || bc.Body == 605 || bc.Body == 606) { creature.Body = Utility.RandomList(3, 728, 305, 181, 304, 307); } switch (Utility.RandomMinMax(0, 5)) { case 0: creature.Name = "a zombie" + ghost; break; case 1: creature.Name = "a dead" + ghost; break; case 2: creature.Name = "a rotten" + ghost; break; case 3: creature.Name = "an undead" + ghost; break; case 4: creature.Name = "a rotting" + ghost; break; case 5: creature.Name = "a decaying" + ghost; break; } // GHOSTS /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (mage) { creature.Hue = Utility.RandomList(0x4001, 0x4001, 1150, 0x9C2); creature.BaseSoundID = 0x482; if (bc.Body == 400 || bc.Body == 401 || bc.Body == 605 || bc.Body == 606) { creature.Body = Utility.RandomList(0x3CA, 310, 26, 84); } switch (Utility.RandomMinMax(0, 6)) { case 0: creature.Name = "a wraith" + ghost; break; case 1: creature.Name = "a ghostly" + ghost; break; case 2: creature.Name = "a spectral" + ghost; break; case 3: creature.Name = "a haunting" + ghost; break; case 4: creature.Name = "a phantasmal" + ghost; break; case 5: creature.Name = "a phantom" + ghost; break; case 6: creature.Name = "a banshee" + ghost; break; } } // SKELETONS //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (repond.Slays(bc) && ghost == "" && Utility.RandomMinMax(0, 1) == 1 && !mage) // MAKE INTO SKELETON { creature.Body = Utility.RandomList(57, 168, 170, 247, 327, 50, 56, 167); creature.Hue = 0; if (creature.Body == 327) { creature.Hue = 0x9C4; } creature.BaseSoundID = 451; switch (Utility.RandomMinMax(0, 6)) { case 0: ghost = " warrior"; break; case 1: ghost = " knight"; break; case 2: ghost = " fighter"; break; case 3: ghost = " champion"; break; case 4: ghost = " crusader"; break; case 5: ghost = " soldier"; break; case 6: ghost = " guard"; break; } switch (Utility.RandomMinMax(0, 2)) { case 0: creature.Name = "a skeletal" + ghost; break; case 1: creature.Name = "a bone" + ghost; break; case 2: creature.Name = "a skeleton" + ghost; break; } } else if (repond.Slays(bc) && wizard.Slays(bc) && Utility.RandomMinMax(0, 1) == 1 && ghost == "" && mage) { creature.Body = Utility.RandomList(148, 110, 24); creature.Hue = 0; creature.BaseSoundID = 0x3E9; switch (Utility.RandomMinMax(0, 6)) { case 0: ghost = " wizard"; break; case 1: ghost = " mage"; break; case 2: ghost = " sorcerer"; break; case 3: ghost = " conjurer"; break; case 4: ghost = " magician"; break; case 5: ghost = " warlock"; break; case 6: ghost = " enchanter"; break; } switch (Utility.RandomMinMax(0, 2)) { case 0: creature.Name = "a skeletal" + ghost; break; case 1: creature.Name = "a bone" + ghost; break; case 2: creature.Name = "a skeleton" + ghost; break; } } else if (dragon.Slays(bc) && Utility.RandomMinMax(0, 1) == 1 && bc.Fame >= 15000 && ghost != "") { creature.Hue = Utility.RandomList(0x83B, 0x89F, 0x8A0, 0x8A1, 0x8A2, 0x8A3, 0x8A4); creature.BaseSoundID = 471; switch (Utility.RandomMinMax(0, 5)) { case 0: creature.Name = "a zombie" + ghost; break; case 1: creature.Name = "a dead" + ghost; break; case 2: creature.Name = "a rotten" + ghost; break; case 3: creature.Name = "an undead" + ghost; break; case 4: creature.Name = "a rotting" + ghost; break; case 5: creature.Name = "a decaying" + ghost; break; } if (Utility.RandomMinMax(0, 1) == 1) { creature.Body = Utility.RandomList(104, 323, 323); creature.BaseSoundID = 0x488; creature.Hue = 0; switch (Utility.RandomMinMax(0, 2)) { case 0: creature.Name = "a skeletal" + ghost; break; case 1: creature.Name = "a bone" + ghost; break; case 2: creature.Name = "a skeleton" + ghost; break; } } } else if (giant.Slays(bc) && Utility.RandomMinMax(0, 1) == 1 && ghost != "") { creature.Body = 999; if (Utility.RandomMinMax(0, 1) == 1) { creature.Body = 308; creature.BaseSoundID = 0x4FB; creature.Hue = 0; switch (Utility.RandomMinMax(0, 2)) { case 0: creature.Name = "a skeletal" + ghost; break; case 1: creature.Name = "a bone" + ghost; break; case 2: creature.Name = "a skeleton" + ghost; break; } } } else if (exorcism.Slays(bc) && Utility.RandomMinMax(0, 5) == 1 && ghost != "") { creature.Body = 339; creature.BaseSoundID = 0x48D; creature.Hue = 0x80F; switch (Utility.RandomMinMax(0, 2)) { case 0: creature.Name = "a skeletal" + ghost; break; case 1: creature.Name = "a bone" + ghost; break; case 2: creature.Name = "a skeleton" + ghost; break; } } if (mage) { creature.SetSkill(SkillName.Meditation, (mod * bc.Skills[SkillName.Meditation].Value)); creature.SetSkill(SkillName.EvalInt, (mod * bc.Skills[SkillName.EvalInt].Value)); creature.SetSkill(SkillName.Magery, (mod * bc.Skills[SkillName.Magery].Value)); creature.SetSkill(SkillName.MagicResist, (mod * bc.Skills[SkillName.MagicResist].Value)); creature.SetSkill(SkillName.Tactics, (mod * bc.Skills[SkillName.Tactics].Value)); creature.SetSkill(SkillName.Wrestling, (mod * bc.Skills[SkillName.Wrestling].Value)); } else { creature.SetSkill(SkillName.MagicResist, (mod * bc.Skills[SkillName.MagicResist].Value)); creature.SetSkill(SkillName.Tactics, (mod * bc.Skills[SkillName.Tactics].Value)); creature.SetSkill(SkillName.Wrestling, (mod * bc.Skills[SkillName.Wrestling].Value)); } creature.Location = c.Location; Effects.SendLocationEffect(creature.Location, creature.Map, 0x3400, 60, 0, 0); Effects.PlaySound(creature.Location, creature.Map, 0x108); c.Delete(); } else { Caster.SendLocalizedMessage(1049645); // You have too many followers to summon that creature. } } else { Caster.SendLocalizedMessage(1061084); // You cannot animate that. } } else { Caster.SendLocalizedMessage(1061084); // You cannot animate that. } FinishSequence(); }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SpellHelper.CheckTown(p, Caster) && CheckSequence()) { SpellHelper.Turn(Caster, p); if (p is Item) { p = ((Item)p).GetWorldLocation(); } List <Mobile> targets = new List <Mobile>(); Map map = Caster.Map; if (map != null) { IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 5); foreach (Mobile m in eable) { Mobile pet = m; if (m is BaseCreature) { pet = ((BaseCreature)m).GetMaster(); } if (Caster.Region == m.Region && Caster != m && Caster != pet && Caster.InLOS(m) && m.Blessed == false && Caster.CanBeHarmful(m, true)) { targets.Add(m); } } eable.Free(); } double damage = DamagingSkill(Caster) / 2; if (damage > 125) { damage = 125.0; } if (damage < 12) { damage = 12.0; } if (targets.Count > 0) { if (targets.Count > 2) { damage = (damage * 2) / targets.Count; } double toDeal; for (int i = 0; i < targets.Count; ++i) { Mobile m = targets[i]; toDeal = damage; Caster.DoHarmful(m); SlayerEntry water = SlayerGroup.GetEntryByName(SlayerName.WaterDissipation); SlayerEntry neptune = SlayerGroup.GetEntryByName(SlayerName.NeptunesBane); if (m is BaseCreature) { if (water.Slays(m)) { toDeal = toDeal * 2; } if (neptune.Slays(m)) { toDeal = toDeal * 2; } } SpellHelper.Damage(this, m, toDeal, 50, 50, 0, 0, 0); Point3D blast1 = new Point3D((m.X), (m.Y), m.Z); Point3D blast2 = new Point3D((m.X - 1), (m.Y), m.Z); Point3D blast3 = new Point3D((m.X + 1), (m.Y), m.Z); Point3D blast4 = new Point3D((m.X), (m.Y - 1), m.Z); Point3D blast5 = new Point3D((m.X), (m.Y + 1), m.Z); Effects.SendLocationEffect(blast1, m.Map, 0x3728, 85, 10, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xB70), 0); if (Utility.RandomBool()) { Effects.SendLocationEffect(blast2, m.Map, 0x3728, 85, 10, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xB70), 0); } if (Utility.RandomBool()) { Effects.SendLocationEffect(blast3, m.Map, 0x3728, 85, 10, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xB70), 0); } if (Utility.RandomBool()) { Effects.SendLocationEffect(blast4, m.Map, 0x3728, 85, 10, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xB70), 0); } if (Utility.RandomBool()) { Effects.SendLocationEffect(blast5, m.Map, 0x3728, 85, 10, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xB70), 0); } Effects.PlaySound(m.Location, m.Map, 0x208); } Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); } } FinishSequence(); }
private bool ValidateTarget(BaseCreature bc) { SlayerEntry entry = SlayerGroup.GetEntryByName(SlayerName.Silver); return(entry != null && entry.Slays(bc)); }
public static void DropSpecialItem(Mobile from, Mobile killer, Container c) { BaseCreature bc = (BaseCreature)from; if (killer != null && c != null && !bc.IsStabled && !bc.Controlled && !bc.IsBonded) { if (killer is BaseCreature) { killer = ((BaseCreature)killer).GetMaster(); } if (killer is PlayerMobile) { Region reg = Region.Find(from.Location, from.Map); if (Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map)) { int fameCycle = (int)(from.Fame / 2400); if (fameCycle > 10) { fameCycle = 10; } if (fameCycle < 1) { fameCycle = 1; } fameCycle = Utility.RandomMinMax(0, fameCycle); while (fameCycle > 0) { fameCycle--; c.DropItem(DungeonLoot.RandomSpaceBag()); } } if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(1, 20) == 1) { int stuffedHue = 1; if (from is ElderBrownBear) { stuffedHue = 0x840; } else if (from is SabretoothBear) { stuffedHue = 0x840; } else if (from is ElderPolarBear) { stuffedHue = 0; } else if (from is ElderBlackBear) { stuffedHue = 0x497; } else if (from is CaveBear) { stuffedHue = 0x6DE; } if (stuffedHue != 1) { StuffedBear trophy = new StuffedBear(); trophy.Hue = stuffedHue; trophy.Name = "stuffed trophy of " + from.Name; trophy.AnimalWhere = "From " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location); string trophyKiller = killer.Name + " the " + Server.Misc.GetPlayerInfo.GetSkillTitle(killer); trophy.AnimalKiller = "Killed by " + trophyKiller; c.DropItem(trophy); } } if (from is ServiceDroid || from is BattleDroid || from is SecurityDroid || from is MaintenanceDroid || from is ExcavationDroid || from is CombatDroid) { if (Utility.RandomMinMax(1, 300) < (from.Fame / 100)) { c.DropItem(new RobotSheetMetal(Utility.RandomMinMax(4, 10))); } if (Utility.RandomMinMax(1, 300) < (from.Fame / 100)) { c.DropItem(new RobotBatteries()); } if (Utility.RandomMinMax(1, 300) < (from.Fame / 100)) { c.DropItem(new RobotEngineParts()); } if (Utility.RandomMinMax(1, 300) < (from.Fame / 100)) { c.DropItem(new RobotCircuitBoard()); } if (Utility.RandomMinMax(1, 300) < (from.Fame / 100)) { c.DropItem(new RobotTransistor()); } if (Utility.RandomMinMax(1, 300) < (from.Fame / 100)) { c.DropItem(new RobotBolt(Utility.RandomMinMax(1, 4))); } if (Utility.RandomMinMax(1, 300) < (from.Fame / 100)) { c.DropItem(new RobotGears(Utility.RandomMinMax(1, 4))); } if (Utility.RandomMinMax(1, 300) < (from.Fame / 100)) { c.DropItem(new RobotOil(Utility.RandomMinMax(1, 2))); } } if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(0, 100) > 95) { int min = (int)(from.Fame / 200); int max = (int)(from.Fame / 100); int props = (int)(from.Fame / 1500) + Utility.RandomMinMax(0, (int)(from.Fame / 2000)); int item = 0; int color = 0; string name = "trinket"; if (from is Cyclops) { item = 0x2C86; name = "eye of " + from.Name + " " + from.Title; } else if (from is ShamanicCyclops) { item = 0x2C86; name = "eye of " + from.Name + " " + from.Title; } else if (from is Beholder) { item = 0x2C9A; name = "eye of " + from.Name + " " + from.Title; } else if (from is Gazer) { item = 0x2C9A; name = "eye of " + from.Name + " " + from.Title; } else if (from is ElderGazer) { item = 0x2C9A; name = "eye of " + from.Name + " " + from.Title; } else if (from is Lich || from is Vordo || from is LichLord || from is DemiLich || from is AncientLich || from is Surtaz || from is LichKing || from is UndeadDruid) { if (from.Backpack.FindItemByType(typeof(EvilSkull)) == null) { item = 0x2C95; name = "skull of " + from.Name + " " + from.Title; } } if (item > 0) { BaseJewel trinket = new MagicTalisman(); BaseRunicTool.ApplyAttributesTo(trinket, false, killer.Luck, props, min, max); trinket.Hue = color; trinket.ItemID = item; trinket.Name = name; c.DropItem(trinket); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(0, 100) > 90 && from.Skills[SkillName.Inscribe].Base >= 20 && from.Skills[SkillName.Magery].Base >= 20) { SlayerEntry wizardkiller = SlayerGroup.GetEntryByName(SlayerName.WizardSlayer); if (wizardkiller.Slays(from)) { c.DropItem(new TomeOfWands()); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (reg.IsPartOf("the Tower of Brass")) { int BrassFame = (int)(from.Fame / 1000); BrassFame = 100 - BrassFame; if (from is FireGiant && Utility.RandomMinMax(1, 100) >= BrassFame) { if (Utility.RandomMinMax(1, 2) == 1) { BaseArmor drop = Loot.RandomArmorOrShield(); if (drop.Resource == CraftResource.Iron) { drop.Resource = CraftResource.Brass; c.DropItem(drop); } else { drop.Delete(); } } else { BaseWeapon drop = Loot.RandomWeapon(); if (drop.Resource == CraftResource.Iron) { drop.Resource = CraftResource.Brass; c.DropItem(drop); } else { drop.Delete(); } } } if (from is BloodDemon && Utility.RandomMinMax(1, 100) >= BrassFame) { if (Utility.RandomMinMax(1, 2) == 1) { BaseArmor drop = Loot.RandomArmorOrShield(); if (drop.Resource == CraftResource.Iron) { MorphingItem.MorphMyItem(drop, "IGNORED", "brass", "IGNORED", MorphingTemplates.TemplateIceDemon("armors")); c.DropItem(drop); } else { drop.Delete(); } } else { BaseWeapon drop = Loot.RandomWeapon(); if (drop.Resource == CraftResource.Iron) { MorphingItem.MorphMyItem(drop, "IGNORED", "brass", "IGNORED", MorphingTemplates.TemplateIceDemon("weapons")); c.DropItem(drop); } else { drop.Delete(); } } } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (reg.IsPartOf("the Ancient Elven Mine")) { if (from is ShamanicCyclops && Utility.RandomMinMax(1, 10) >= 9) { if (Utility.RandomMinMax(1, 2) == 1) { BaseArmor drop = Loot.RandomArmorOrShield(); if (drop.Resource == CraftResource.Iron) { MorphingItem.MorphMyItem(drop, "IGNORED", "silver", "IGNORED", MorphingTemplates.TemplateSilver("armors")); c.DropItem(drop); } else { drop.Delete(); } } else { BaseWeapon drop = Loot.RandomWeapon(); if (drop.Resource == CraftResource.Iron) { MorphingItem.MorphMyItem(drop, "IGNORED", "silver", "IGNORED", MorphingTemplates.TemplateSilver("weapons")); c.DropItem(drop); } else { drop.Delete(); } } } if (Utility.RandomMinMax(1, 10) == 1 && from.Fame > 2000) { Item stone = new RareMetals(Utility.RandomMinMax(5, 15), "silver stones"); c.DropItem(stone); } else if (Utility.RandomMinMax(1, 10) == 1 && from.Fame > 2000) { Item ingot = new ShinySilverIngot(Utility.RandomMinMax(2, 8)); c.DropItem(ingot); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (reg.IsPartOf("the Daemon's Crag")) { if ((GetPlayerInfo.LuckyKiller(killer.Luck) || Utility.RandomMinMax(1, 20) == 1) && (from is EvilMage || from is EvilMageLord)) { PaganArtifact pagan = new PaganArtifact(0); pagan.PaganPoints = Utility.RandomMinMax(80, 100); if (from is EvilMageLord) { pagan.PaganPoints = Utility.RandomMinMax(100, 120); } c.DropItem(pagan); } } if (reg.IsPartOf("the Zealan Tombs")) { if ((GetPlayerInfo.LuckyKiller(killer.Luck) || Utility.RandomMinMax(1, 10) == 1) && from is KhumashGor) { PaganArtifact pagan = new PaganArtifact(16); pagan.PaganPoints = Utility.RandomMinMax(100, 150); c.DropItem(pagan); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ((from is DemonOfTheSea) || (from is BloodDemon) || (from is Devil) || (from is TitanPyros) || (from is Balron) || (from is LesserDemon) || (from is Xurtzar) || (from is FireDemon) || (from is DeepSeaDevil) || (from is ForestDemon) || (from is RadiationDemon) || (from is Daemon) || (from is IceFiend) || (from is BlackGateDemon)) { if (90 < Utility.Random(100)) { c.DropItem(new DemonClaw()); } if (90 < Utility.Random(100)) { DemonSkin goods = new DemonSkin(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } } if (90 < Utility.Random(100) && killer is PlayerMobile) { Server.Misc.Skulls.MakeSkull(from, c, killer, reg.Name); } // MAKE A SKULL //-------------------------- if ((from is Unicorn) || (from is DarkUnicorn)) { if (90 < Utility.Random(100)) { c.DropItem(new UnicornHorn()); } if ((from is Unicorn) && (70 < Utility.Random(100))) { UnicornSkin goods = new UnicornSkin(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } } if (from is Nightmare || from is AncientNightmare) { if (70 < Utility.Random(100)) { NightmareSkin goods = new NightmareSkin(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } } if (from is ObsidianElemental) { if (1 == Utility.Random(1000)) { c.DropItem(new ObsidianStone()); } } if ((from is Troll) || (from is SeaTroll) || (from is SwampTroll) || (from is FrostTroll)) { if (95 < Utility.Random(100)) { TrollSkin goods = new TrollSkin(); goods.Amount = Utility.RandomMinMax(1, 2); c.DropItem(goods); } } if ((from is GoldenSerpent) || (from is BloodSnake) || (from is SilverSerpent) || (from is JungleViper) || (from is IceSerpent) || (from is GiantSerpent) || (from is SeaSnake) || (from is LavaSerpent) || (from is LargeSnake) || (from is GiantAdder)) { if (95 < Utility.Random(100)) { SerpentSkin goods = new SerpentSkin(); goods.Amount = Utility.RandomMinMax(1, 2); c.DropItem(goods); } } if ((from is AncientWyrm) || (from is LavaDragon) || (from is BottleDragon) || (from is SeaDragon) || (from is DeepSeaDragon) || (from is Dragon) || (from is Dragons) || (from is DeepSeaDragon) || (from is SeaDragon) || (from is BlackDragon) || (from is PrimevalFireDragon) || (from is PrimevalGreenDragon) || (from is PrimevalNightDragon) || (from is PrimevalRedDragon) || (from is PrimevalRoyalDragon) || (from is PrimevalRunicDragon) || (from is PrimevalSeaDragon) || (from is ReanimatedDragon) || (from is VampiricDragon) || (from is PrimevalAbysmalDragon) || (from is PrimevalAmberDragon) || (from is PrimevalBlackDragon) || (from is PrimevalDragon) || (from is PrimevalSilverDragon) || (from is PrimevalVolcanicDragon) || (from is PrimevalStygianDragon) || (from is GemDragon) || (from is DragonKing) || (from is VolcanicDragon) || (from is RadiationDragon) || (from is CrystalDragon) || (from is VoidDragon) || (from is ElderDragon) || (from is BlueDragon) || (from is SlasherOfVoid) || (from is GreenDragon) || (from is WhiteDragon) || (from is ZombieDragon) || (from is NightWyrm) || (from is JungleWyrm) || (from is DesertWyrm) || (from is MountainWyrm) || (from is OnyxWyrm) || (from is EmeraldWyrm) || (from is AmethystWyrm) || (from is SapphireWyrm) || (from is GarnetWyrm) || (from is TopazWyrm) || (from is RubyWyrm) || (from is SpinelWyrm) || (from is Wyrms) || (from is QuartzWyrm) || (from is WhiteWyrm)) { if (95 < Utility.Random(100)) { DragonSkin goods = new DragonSkin(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } if (95 < Utility.Random(100)) { DragonBlood goods = new DragonBlood(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } if ((95 < Utility.Random(100)) && (from is DragonKing)) { DragonTooth goods = new DragonTooth(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } } if ((from is Lich) || (from is LichLord) || (from is AncientLich) || (from is UndeadDruid) || (from is TitanLich) || (from is DemiLich) || (from is Surtaz)) { if (from is AncientLich) { LichDust goods = new LichDust(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } else if (80 < Utility.Random(100)) { LichDust goods = new LichDust(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } } if ((from is MonstrousSpider) || (from is WhiteDragon) || (from is BlackDragon) || (from is PrimevalFireDragon) || (from is PrimevalGreenDragon) || (from is PrimevalNightDragon) || (from is PrimevalRedDragon) || (from is PrimevalRoyalDragon) || (from is PrimevalRunicDragon) || (from is PrimevalSeaDragon) || (from is ReanimatedDragon) || (from is VampiricDragon) || (from is PrimevalAbysmalDragon) || (from is PrimevalAmberDragon) || (from is PrimevalBlackDragon) || (from is PrimevalDragon) || (from is PrimevalSilverDragon) || (from is PrimevalVolcanicDragon) || (from is PrimevalStygianDragon) || (from is BlueDragon) || (from is SlasherOfVoid) || (from is Dragon) || (from is Dragons && from.Body == 59) || (from is Wyrms && from.Body == 12) || (from is GreenDragon) || (from is MetalDragon) || (from is LavaDragon) || (from is BottleDragon) || (from is IceDragon) || (from is CaddelliteDragon) || (from is WhiteWyrm) || (from is GemDragon) || (from is NightWyrm) || (from is RadiationDragon) || (from is CrystalDragon) || (from is VoidDragon) || (from is ElderDragon) || (from is JungleWyrm) || (from is DesertWyrm) || (from is MountainWyrm) || (from is AntLion) || (from is MetalBeetle) || (from is OnyxWyrm) || (from is EmeraldWyrm) || (from is AmethystWyrm) || (from is SapphireWyrm) || (from is GarnetWyrm) || (from is TopazWyrm) || (from is RubyWyrm) || (from is SpinelWyrm) || (from is QuartzWyrm) || (from is ShadowWyrm) || (from is AncientWyrm) || (from is DragonKing) || (from is VolcanicDragon)) { int nBodyChance = (int)(from.Fame * 0.002) + 2; int nBodyLevel = (int)(from.Fame * 0.0006); if (nBodyLevel > 10) { nBodyLevel = 10; } if (nBodyLevel < 1) { nBodyLevel = 1; } if (nBodyChance > Utility.Random(100)) { CorpseChest corpseBox = new CorpseChest(nBodyLevel); c.DropItem(corpseBox); } } SlayerEntry wizardrykiller = SlayerGroup.GetEntryByName(SlayerName.WizardSlayer); if (wizardrykiller.Slays(from)) { if (Utility.Random(4) == 1) { if (DifficultyLevel.GetUnidentifiedChance() >= Utility.RandomMinMax(1, 100)) { Item wand = new UnknownWand(); c.DropItem(wand); } else { Item wand = Loot.RandomWand(); Server.Misc.MaterialInfo.ColorMetal(wand, 0); string wandOwner = ""; if (Utility.RandomMinMax(1, 3) == 1) { wandOwner = Server.LootPackEntry.MagicWandOwner() + " "; } wand.Name = wandOwner + wand.Name; c.DropItem(wand); } } if (Utility.Random(20) == 1) { c.DropItem(Server.Items.DungeonLoot.RandomRuneMagic()); } } // WIZARD'S HIGH SEAS ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ((from is DeepSeaSerpent) || (from is SeaDragon) || (from is GiantSquid) || (from is DeepSeaDragon) || (from is SeaSerpent) || (from is Kraken) || (from is Leviathan)) { int nBodyChance = (int)(from.Fame * 0.002) + 2; int nBodyLevel = (int)(from.Fame * 0.0006); if (nBodyLevel > 10) { nBodyLevel = 10; } if (nBodyLevel < 1) { nBodyLevel = 1; } if (nBodyChance > Utility.Random(100)) { CorpseSailor corpseBox = new CorpseSailor(nBodyLevel); c.DropItem(corpseBox); } } SlayerEntry neptune = SlayerGroup.GetEntryByName(SlayerName.NeptunesBane); if (neptune.Slays(from) && from.Fame >= 11500) { int nWeedChance = (int)(from.Fame * 0.002) + 2; if (nWeedChance > Utility.Random(100)) { EnchantedSeaweed goods = new EnchantedSeaweed(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods); } int nPearlChance = (int)(from.Fame * 0.001) + 1; if (nPearlChance > Utility.Random(100)) { c.DropItem(new MysticalPearl()); } } //------------------------------------------------------------------------- if ((neptune.Slays(from) && from.WhisperHue == 999) || Server.Misc.Worlds.IsSeaDungeon(from.Location, from.Map)) // ONLY SEA CREATURES ON THE HIGH SEAS DROP from STUFF { int nWreckChance = (int)(from.Fame * 0.002) + 2; if (nWreckChance > Utility.Random(100)) { HighSeasRelic goods = new HighSeasRelic(); goods.RelicGoldValue = goods.RelicGoldValue + (int)(from.RawStatTotal / 3); c.DropItem(goods); } int nBottleChance = (int)(from.Fame * 0.002) + 1; if (nBottleChance > Utility.Random(100)) { int messageLevel = 0; if (from.Fame < 2500) { messageLevel = 1; } else if (from.Fame < 5000) { messageLevel = 2; } else if (from.Fame < 10000) { messageLevel = 3; } else { messageLevel = 4; } if (20 > Utility.Random(100)) { messageLevel = 0; } // 20% CHANCE FOR A RANDOM LEVEL BOTTLE Item message = new MessageInABottle(killer.Map, messageLevel, killer.Location, killer.X, killer.Y); c.DropItem(message); } int nBoxChance = (int)(from.Fame * 0.001) - 1; if (nBoxChance > Utility.Random(100) && !(from is StormGiant)) // STORM GIANTS ALREADY DROP A BOX { int boxLevel = 0; if (from.Fame < 2500) { boxLevel = 1; } else if (from.Fame < 5000) { boxLevel = 2; } else if (from.Fame < 10000) { boxLevel = 3; } else if (from.Fame < 20000) { boxLevel = 4; } else { boxLevel = 5; } LootChest MyChest = new LootChest(boxLevel); MyChest.Name = "seaweed covered chest"; MyChest.Hue = Utility.RandomList(0xB97, 0xB98, 0xB99, 0xB9A, 0xB88); c.DropItem(MyChest); } } } } }
public static string ComputeName(BaseWeapon bw) { if (bw.IsRenamed && !string.IsNullOrEmpty(bw.Name)) { return(bw.Name); } string name; if (bw.Name == null) { name = CliLoc.LocToString(bw.LabelNumber); } else { name = bw.Name; } if (bw.Amount > 1) { name = name + "s"; } var resource = string.Empty; if (bw.Slayer != SlayerName.None) { SlayerEntry entry = SlayerGroup.GetEntryByName(bw.Slayer); if (entry != null) { string slayername = CliLoc.LocToString(entry.Title); name = slayername + " " + name.ToLower(); } } if (bw.Resource != CraftResource.None && bw.Resource != CraftResource.Iron) { resource = CraftResources.GetName(bw.Resource); } if ((bw.DamageLevel != WeaponDamageLevel.Regular || bw.AccuracyLevel != WeaponAccuracyLevel.Regular) && bw.Resource == CraftResource.Iron) { //If the weapon is accurate or magical if (bw.DamageLevel != WeaponDamageLevel.Regular && bw.AccuracyLevel != WeaponAccuracyLevel.Regular) { name = string.Format("{0} {1} of {2}", ComputeAccuracyLevel(bw), name.ToLower(), CliLoc.LocToString((1038015 + (int)bw.DamageLevel)).ToLower()); } else if (bw.AccuracyLevel != WeaponAccuracyLevel.Regular) { name = string.Format("{0} {1}", ComputeAccuracyLevel(bw), name.ToLower()); } else { name = string.Format("{0} of {1}", name, CliLoc.LocToString((1038015 + (int)bw.DamageLevel)).ToLower()); } if (bw.Quality == WeaponQuality.Exceptional) { name = "Exceptional " + name.ToLower(); } } else if (bw.Resource != CraftResource.None) { //If it's crafted by a player if (bw.Crafter != null) { if (bw.Quality == WeaponQuality.Exceptional) { if (bw.Resource != CraftResource.Iron) { name = string.Format("{0} {1} {2} crafted by {3}", "Exceptional", resource.ToLower(), name.ToLower(), bw.Crafter.Name); } else { name = string.Format("{0} {1} crafted by {2}", "Exceptional", name.ToLower(), bw.Crafter.Name); } } else if (bw.Resource != CraftResource.Iron) { if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1} crafted by {2}", resource, name.ToLower(), bw.Crafter.Name); } else { name = string.Format("{0} crafted by {1}", name, bw.Crafter.Name); } } else { name = string.Format("{0} crafted by {1}", name, bw.Crafter.Name); } } else if (bw.Resource != CraftResource.Iron) { if (bw.Quality == WeaponQuality.Exceptional) { if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1} {2}", "Exceptional", resource.ToLower(), name.ToLower()); } else { name = string.Format("{0}, {1}", "Exceptional", name.ToLower()); } } else if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1}", resource, name.ToLower()); } else { name = string.Format(name); } } else if (bw.Resource == CraftResource.Iron) { if (bw.Quality == WeaponQuality.Exceptional) { name = string.Format("{0} {1}", "Exceptional", name.ToLower()); } } } if (bw.Amount > 1) { name = bw.Amount + " " + name; } return(name); }
protected override void OnTarget(Mobile from, object targeted) { if (!from.Alive) { from.SendLocalizedMessage(500331); // The spirits of the dead are not the province of animal lore. } else if (targeted is HenchmanMonster || targeted is HenchmanWizard || targeted is HenchmanFighter || targeted is HenchmanArcher) { from.SendLocalizedMessage(500329); // That's not an animal! } else if (targeted is BaseCreature) { BaseCreature c = (BaseCreature)targeted; SlayerEntry skipTypeA = SlayerGroup.GetEntryByName(SlayerName.SlimyScourge); SlayerEntry skipTypeB = SlayerGroup.GetEntryByName(SlayerName.ElementalBan); SlayerEntry skipTypeC = SlayerGroup.GetEntryByName(SlayerName.Repond); SlayerEntry skipTypeD = SlayerGroup.GetEntryByName(SlayerName.Silver); SlayerEntry skipTypeE = SlayerGroup.GetEntryByName(SlayerName.GiantKiller); SlayerEntry skipTypeF = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction); if (!c.IsDeadPet) { if (!skipTypeA.Slays(c) && !skipTypeB.Slays(c) && !skipTypeC.Slays(c) && !skipTypeD.Slays(c) && !skipTypeE.Slays(c) && !skipTypeF.Slays(c)) { if (c.ControlMaster == from) { from.CloseGump(typeof(AnimalLoreGump)); from.SendGump(new AnimalLoreGump(c, 0)); } else if ((!c.Controlled || !c.Tamable) && from.Skills[SkillName.AnimalLore].Value < 100.0) { from.SendLocalizedMessage(1049674); // At your skill level, you can only lore tamed creatures. } else if (!c.Tamable && from.Skills[SkillName.AnimalLore].Value < 110.0) { from.SendLocalizedMessage(1049675); // At your skill level, you can only lore tamed or tameable creatures. } else if (!from.CheckTargetSkill(SkillName.AnimalLore, c, 0.0, 120.0)) { from.SendLocalizedMessage(500334); // You can't think of anything you know offhand. } else { from.CloseGump(typeof(AnimalLoreGump)); from.SendGump(new AnimalLoreGump(c, 0)); } } else { from.SendLocalizedMessage(500329); // That's not an animal! } } else { from.SendLocalizedMessage(500331); // The spirits of the dead are not the province of animal lore. } } else { from.SendLocalizedMessage(500329); // That's not an animal! } }
public virtual double GetSlayerDamageScalar(Mobile defender) { // ==== Alan Mod ===== if (defender is PlayerMobile || defender is HumanMob) // there are no slayers that should slay them { return(1.0); } // first check for XmlSlayer attachments List <XmlSlayer> slayerattachments = XmlAttach.GetSlayerAttachments(m_Caster); if (slayerattachments != null) { foreach (XmlSlayer slayerattachment in slayerattachments) { if (slayerattachment.Slayer == SlayerName.None) { continue; } if (slayerattachment.Slayer == SlayerName.All) { return(SpellDamageController._SlayerMultiplier); } SlayerEntry attachmentSlayer = SlayerGroup.GetEntryByName(slayerattachment.Slayer); if (attachmentSlayer != null && attachmentSlayer.Slays(defender)) { return(SpellDamageController._SlayerMultiplier); } } } // ==== End Alan Mod ==== Spellbook atkBook = Spellbook.FindEquippedSpellbook(m_Caster); if (atkBook != null) { if (atkBook.Slayer == SlayerName.All) { return(SpellDamageController._SlayerMultiplier); } if (atkBook.Slayer2 == SlayerName.All) { return(SpellDamageController._SlayerMultiplier); } SlayerEntry atkSlayer = SlayerGroup.GetEntryByName(atkBook.Slayer); SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2); if (atkSlayer != null && atkSlayer.Slays(defender) || atkSlayer2 != null && atkSlayer2.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); //TODO: Confirm this displays on OSIs return(SpellDamageController._SlayerMultiplier); } } /* * ISlayer defISlayer = Spellbook.FindEquippedSpellbook( defender ); * * if( defISlayer == null ) * defISlayer = defender.Weapon as ISlayer; * * if( defISlayer != null ) * { * SlayerEntry defSlayer = SlayerGroup.GetEntryByName( defISlayer.Slayer ); * SlayerEntry defSlayer2 = SlayerGroup.GetEntryByName( defISlayer.Slayer2 ); * * if( defSlayer != null && defSlayer.Group.OppositionSuperSlays( m_Caster ) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays( m_Caster ) ) * scalar = 1.1; * } */ return(1.0); }
public void Target(Mobile m) { bool CanAffect = true; if (m is BaseCreature) { SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver); SlayerEntry elly = SlayerGroup.GetEntryByName(SlayerName.ElementalBan); SlayerEntry golem = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction); if (undead.Slays(m) || elly.Slays(m) || golem.Slays(m)) { CanAffect = false; } } if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (!(m is BaseCreature)) { Caster.SendMessage("This spell cannot affect those type of creatures."); } else if (!CanAffect) { Caster.SendMessage("You cannot charm supernatural creatures, golems, constructs, or elementals."); } else if (m is BaseCreature) { BaseCreature bc = (BaseCreature)m; int pFame = (int)(DamagingSkill(Caster)) * 60; int mFame = m.Fame; if (bc.ControlMaster != null) { Caster.SendMessage("That is already controlled by another."); } else if (bc.FightMode != FightMode.Closest && bc.FightMode != FightMode.Aggressor) { Caster.SendMessage("These charms will not work very well on that."); } else if (mFame > pFame) { Caster.SendMessage("That creature is too powerful for you to charm."); } else if (CheckHSequence(m)) { SpellHelper.Turn(Caster, m); SpellHelper.CheckReflect(CirclePower, Caster, ref m); TimeSpan duration = TimeSpan.FromSeconds((DamagingSkill(Caster) / 4)); if (bc.FightMode == FightMode.Closest) { bc.FightMode = FightMode.CharmMonster; } else if (bc.FightMode == FightMode.Aggressor) { bc.FightMode = FightMode.CharmAnimal; } m.PlaySound(0x20B); m.FixedParticles(0x3039, 9, 32, 5008, 0x48F, 0, EffectLayer.Waist); new CharmTimer(m, duration).Start(); Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); HarmfulSpell(m); } FinishSequence(); } }