public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) { return; } ClearCurrentAbility(attacker); BaseWeapon weapon = attacker.Weapon as BaseWeapon; if (weapon == null) { return; } if (!CheckMana(attacker, true)) { return; } int level = attacker.Skills[SkillName.Poisoning].Fixed / 250; Poison p = Poison.GetPoison(level); defender.PlaySound(0xDD); defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist); if (defender.ApplyPoison(attacker, p) != ApplyPoisonResult.Immune) { attacker.SendLocalizedMessage(1008096, true, defender.Name); // You have poisoned your target : defender.SendLocalizedMessage(1008097, false, attacker.Name); // : poisoned you! Titles.AwardKarma(attacker, -10, true); } }
protected override void OnTarget(Mobile from, object targeted) { TradeOrderCrate order = targeted as TradeOrderCrate; if (order != null) { if (CityLoyaltySystem.CityTrading.TryTurnIn(from, order, Minister)) { if (List.ContainsKey(from)) { List[from].StopTimer(); } if (order.Entry != null && order.Entry.Distance > 0) { from.AddToBackpack(Minister.GiveReward(order.Entry)); from.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack. } Titles.AwardKarma(from, 100, true); } } else { from.SendLocalizedMessage(1151731); // That is not a valid trade order. Please try again. from.Target = new InternalTarget(Minister); } }
protected override void OnTick() { if (m_From.CheckTargetSkill(SkillName.Poisoning, m_Target, m_MinSkill, m_MaxSkill)) { if (m_Target is Food food) { food.Poison = m_Poison; } else if (m_Target is BaseWeapon weapon) { weapon.Poison = m_Poison; weapon.PoisonCharges = 18 - m_Poison.Level * 2; } else if (m_Target is FukiyaDarts darts) { darts.Poison = m_Poison; darts.PoisonCharges = Math.Min(18 - m_Poison.Level * 2, darts.UsesRemaining); } else if (m_Target is Shuriken shuriken) { shuriken.Poison = m_Poison; shuriken.PoisonCharges = Math.Min(18 - m_Poison.Level * 2, shuriken.UsesRemaining); } m_From.SendLocalizedMessage(1010517); // You apply the poison Titles.AwardKarma(m_From, -20, true); } else // Failed { // 5% of chance of getting poisoned if failed if (m_From.Skills.Poisoning.Base < 80.0 && Utility.Random(20) == 0) { m_From.SendLocalizedMessage(502148); // You make a grave mistake while applying the poison. m_From.ApplyPoison(m_From, m_Poison); } else { if (m_Target is BaseWeapon weapon) { if (weapon.Type == WeaponType.Slashing) { m_From.SendLocalizedMessage( 1010516); // You fail to apply a sufficient dose of poison on the blade } else { m_From.SendLocalizedMessage( 1010518); // You fail to apply a sufficient dose of poison } } else { m_From.SendLocalizedMessage(1010518); // You fail to apply a sufficient dose of poison } } } }
public static void Reward(Mobile m, object targeted, Item reward, String rewardName) //Gift Time! { Mobile t = (Mobile)targeted; bool orcs = IsOrc(t); bool savage = IsSavage(t); if (reward != null) { m.AddToBackpack(reward); t.Say(1074854); // Here, take this... m.SendLocalizedMessage(1074853, rewardName); // You have been given ~1_name~ } else { m.SendMessage("They don't seem notice you"); //Nope didnt get anything at all! } if (!orcs && !savage && m.Karma > -3000) //If greater than -3K Karma you lose some { int toLose = m.Karma + 3000; if (toLose > 40) { toLose = 40; } Titles.AwardKarma(m, -toLose, true); } else { t.SendLocalizedMessage(500404); // They seem unwilling to give you any money. } }
public override void OnAdded(object parent) { base.OnAdded(parent); if (parent is Mobile) { Titles.AwardKarma((Mobile)parent, -20, true); } }
public void Carve(Mobile from, Item item) { if (IsCriminalAction(from) && this.Map != null && (this.Map.Rules & MapRules.HarmfulRestrictions) != 0) { if (m_Owner == null || !m_Owner.Player) { from.SendLocalizedMessage(1005035); // You did not earn the right to loot this creature! } else { from.SendLocalizedMessage(1010049); // You may not loot this corpse. } return; } Mobile dead = m_Owner; if (GetFlag(CorpseFlag.Carved) || dead == null) { from.SendLocalizedMessage(500485); // You see nothing useful to carve from the corpse. } else if (((Body)Amount).IsHuman && ItemID == 0x2006) { new Blood(0x122D).MoveToWorld(Location, Map); new Torso().MoveToWorld(Location, Map); new LeftLeg().MoveToWorld(Location, Map); new LeftArm().MoveToWorld(Location, Map); new RightLeg().MoveToWorld(Location, Map); new RightArm().MoveToWorld(Location, Map); new Head(dead.Name).MoveToWorld(Location, Map); SetFlag(CorpseFlag.Carved, true); ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random(0xECA, 9); // bone graphic Hue = 0; ProcessDelta(); Titles.AwardKarma(from, -50, true); if (IsCriminalAction(from)) { from.CriminalAction(true); } } else if (dead is BaseCreature) { ((BaseCreature)dead).OnCarve(from, this, item); } else { from.SendLocalizedMessage(500485); // You see nothing useful to carve from the corpse. } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is HenchmanFamiliarItem && from.Backpack != null) { HenchmanFamiliarItem ball = targeted as HenchmanFamiliarItem; Container pack = from.Backpack; int toConsume = 0; if (ball.Charges < 50) { toConsume = 500; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING - WIZARD { toConsume = toConsume - (int)((from.Skills[SkillName.Begging].Value * 0.005) * toConsume); } } else { m_Mage.SayTo(from, "That crystal ball has too many charges already."); } if (toConsume == 0) { return; } if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS m_Mage.SayTo(from, "Your crystal ball is charged."); from.SendMessage(String.Format("You pay {0} gold.", toConsume)); Effects.PlaySound(from.Location, from.Map, 0x5C1); ball.Charges = ball.Charges + 5; } else { m_Mage.SayTo(from, "It would cost you {0} gold to have that charged.", toConsume); from.SendMessage("You do not have enough gold."); } } else { m_Mage.SayTo(from, "That does not need my services."); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is PackBeastItem && from.Backpack != null) { PackBeastItem ball = targeted as PackBeastItem; Container pack = from.Backpack; int toConsume = 0; if (ball.Charges < 50) { toConsume = 1000; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING { toConsume = toConsume - (int)((from.Skills[SkillName.Begging].Value * 0.005) * toConsume); } } else { m_Druid.SayTo(from, "You pack animal has been tended to enough."); } if (toConsume == 0) { return; } if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS m_Druid.SayTo(from, "Your pack animal is properly tended to."); from.SendMessage(String.Format("You pay {0} gold.", toConsume)); Effects.PlaySound(from.Location, from.Map, 0x5C1); ball.Charges = ball.Charges + 5; } else { m_Druid.SayTo(from, "It would cost you {0} gold to have that pack animal tended to.", toConsume); from.SendMessage("You do not have enough gold."); } } else { m_Druid.SayTo(from, "That does not need my services."); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BookBox && from.Backpack != null) { m_Thief.SayTo(from, "I cannot help with such a cursed item."); } else if (targeted is LockableContainer && from.Backpack != null) { LockableContainer box = (LockableContainer)targeted; Container pack = from.Backpack; int toConsume = 1000; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING { toConsume = toConsume - (int)((from.Skills[SkillName.Begging].Value * 0.005) * toConsume); } if (toConsume == 0) { return; } if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS m_Thief.SayTo(from, "That is now unlocked."); from.SendMessage(String.Format("You pay {0} gold.", toConsume)); Effects.PlaySound(from.Location, from.Map, 0x241); box.Locked = false; box.TrapPower = 0; box.TrapLevel = 0; box.LockLevel = 0; box.MaxLockLevel = 0; box.RequiredSkill = 0; box.TrapType = TrapType.None; } else { m_Thief.SayTo(from, "It would cost you {0} gold to have that unlocked.", toConsume); from.SendMessage("You do not have enough gold."); } } else { m_Thief.SayTo(from, "That does not need my services."); } }
public override bool OnEquip(Mobile from) { if (from.RawInt > from.RawDex) { Attributes.BonusDex = 0; } else { Attributes.BonusInt = 0; } Titles.AwardKarma(from, -22, true); return(base.OnEquip(from)); }
public static int AntiqueTotalValue(int cost, Mobile player, bool karma) { int gold = cost; gold = gold + AntiqueMerchantGold(cost, player); gold = gold + AntiqueBeggingGold(cost, player); gold = gold + AntiqueGuildGold(cost, player); if (BaseVendor.BeggingPose(player) > 0 && karma) { Titles.AwardKarma(player, -BaseVendor.BeggingKarma(player), false); } return(gold); }
public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 2)) { bool LookInside = true; if (from.Backpack.FindItemByType(typeof(ThiefNote)) != null) { Item mail = from.Backpack.FindItemByType(typeof(ThiefNote)); ThiefNote envelope = (ThiefNote)mail; if (envelope.NoteOwner == from && envelope.NoteItemGot > 0 && HayTown == envelope.NoteDeliverTo && envelope.NoteDeliverType == 2) { LoggingFunctions.LogGeneric(from, "has stolen " + envelope.NoteItem + "."); from.AddToBackpack(new Gold(envelope.NoteReward)); Titles.AwardFame(from, ((int)(envelope.NoteReward / 100)), true); Titles.AwardKarma(from, -((int)(envelope.NoteReward / 100)), true); Server.Items.ThiefNote.SetupNote(envelope, from); from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You collected your reward."); from.SendMessage("You found another secret note for you."); from.SendSound(0x3D); from.CloseGump(typeof(Server.Items.ThiefNote.NoteGump)); Server.Items.ThiefNote.ThiefTimeAllowed(from); LookInside = false; } } if (LookInside) { string message = "There is nothing of interest in here."; if (Utility.RandomMinMax(1, 20) == 1 && Stackable == false) { Server.Misc.ContainerFunctions.GiveRandomItem(from); message = "You pull something out of the hay and it falls by your feet."; } Stackable = true; from.SendSound(0x057); from.SendMessage(message); } } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }
protected override void OnTarget(Mobile from, object targeted) { TradeOrderCrate order = targeted as TradeOrderCrate; if (order != null) { if (CityLoyaltySystem.CityTrading.TryTurnInToSlim(from, order, Slim)) { from.AddToBackpack(Slim.GiveAward()); from.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack. Titles.AwardKarma(from, -100, true); } } else { from.SendLocalizedMessage(1151731); // That is not a valid trade order. Please try again. from.Target = new InternalTarget(Slim); } }
public override bool CheckCast() { if (!base.CheckCast()) { return(false); } if (Caster.Skills[CastSkill].Value < RequiredSkill) { Caster.SendMessage("You lack the skills to use this necromancer liquid!"); return(false); } if (Caster.Karma > -2459) { Titles.AwardKarma(Caster, -50, true); } return(true); }
public override void OnCast() { if (this.CheckSequence()) { TimeSpan duration = TimeSpan.FromSeconds((2 * this.Caster.Skills.Magery.Fixed) / 5); if (Core.AOS) /* Why two diff daemons? TODO: solve this */ { BaseCreature m_Daemon = new SummonedDaemon(); SpellHelper.Summon(m_Daemon, this.Caster, 0x216, duration, false, false); m_Daemon.FixedParticles(0x3728, 8, 20, 5042, EffectLayer.Head); } else { SpellHelper.Summon(new Daemon(), this.Caster, 0x216, duration, false, false); } Titles.AwardKarma(this.Caster, -50, true); } this.FinishSequence(); }
public virtual bool CheckSequence() { int mana = ScaleMana(GetMana()); if (m_Caster.Deleted || !m_Caster.Alive || m_Caster.Spell != this || m_State != SpellState.Sequencing) { DoFizzle(); } else if (m_Scroll != null && !(m_Scroll is Runebook) && (m_Scroll.Amount <= 0 || m_Scroll.Deleted || m_Scroll.RootParent != m_Caster || (m_Scroll is BaseWand && (((BaseWand)m_Scroll).Charges <= 0 || m_Scroll.Parent != m_Caster)) || (m_Scroll is GnarledStaff && (((GnarledStaff)m_Scroll).Charges <= 0 || m_Scroll.Parent != m_Caster)))) { DoFizzle(); } else if (!ConsumeReagents()) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502630); // More reagents are needed for this spell. } else if (m_Caster.Mana < mana) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502625); // Insufficient mana for this spell. } else if (m_Caster.Region is CustomRegion && !(m_Caster.Region).OnBeginSpellCast(m_Caster, this)) { m_Caster.SendMessage("You cannot cast that spell here."); } else if (m_Caster.EraAOS && (m_Caster.Frozen || m_Caster.Paralyzed)) { m_Caster.SendLocalizedMessage(502646); // You cannot cast a spell while frozen. DoFizzle(); } else if (m_Caster is PlayerMobile && ((PlayerMobile)m_Caster).PeacedUntil > DateTime.UtcNow) { m_Caster.SendLocalizedMessage(1072060); // You cannot cast a spell while calmed. DoFizzle(); } else if (CheckFizzle()) { m_Caster.Mana -= mana; if (m_Scroll is SpellScroll) { m_Scroll.Consume(); } else if (m_Scroll is BaseWand) { ((BaseWand)m_Scroll).ConsumeCharge(m_Caster); } else if (m_Scroll is GnarledStaff) { ((GnarledStaff)m_Scroll).ConsumeCharge(m_Caster); } if (m_Scroll is BaseWand || m_Scroll is GnarledStaff) { m_Caster.RevealingAction(); bool m = m_Scroll.Movable; m_Scroll.Movable = false; if (ClearHandsOnCast) { m_Caster.ClearHands(); } m_Scroll.Movable = m; } else { if (ClearHandsOnCast) { m_Caster.ClearHands(); } } int karma = ComputeKarmaAward(); if (karma != 0) { Titles.AwardKarma(Caster, karma, true); } if (m_Caster is PlayerMobile) { Conquests.CheckProgress <SuccessfulSpellConquest>(m_Caster as PlayerMobile, m_Caster.Spell); } return(true); } else { DoFizzle(); } return(false); }
protected override void OnTick() { Container theirPack = m_Target.Backpack; double badKarmaChance = 0.5 - ((double)m_From.Karma / 8570); if (theirPack == null) { m_From.SendLocalizedMessage(500404); // They seem unwilling to give you any money. } else if (m_From.Karma < 0 && badKarmaChance > Utility.RandomDouble()) { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500406); // Thou dost not look trustworthy... no gold for thee today! } else if (m_From.CheckTargetSkill(SkillName.Begging, m_Target, 0.0, 100.0)) { int toConsume = theirPack.GetAmount(typeof(Gold)) / 10; int max = 10 + (m_From.Fame / 2500); if (max > 14) { max = 14; } else if (max < 10) { max = 10; } if (toConsume > max) { toConsume = max; } if (toConsume > 0) { int consumed = theirPack.ConsumeUpTo(typeof(Gold), toConsume); if (consumed > 0) { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500405); // I feel sorry for thee... Gold gold = new Gold(consumed); m_From.AddToBackpack(gold); m_From.PlaySound(gold.GetDropSound()); if (m_From.Karma > -3000) { int toLose = m_From.Karma + 3000; if (toLose > 40) { toLose = 40; } Titles.AwardKarma(m_From, -toLose, true); } } else { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407); // I have not enough money to give thee any! } } else { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407); // I have not enough money to give thee any! } } else { m_Target.SendLocalizedMessage(500404); // They seem unwilling to give you any money. } m_From.NextSkillTime = Core.TickCount + 10000; }
public static void Container_Snoop(Container cont, Mobile from) { if (from.AccessLevel > AccessLevel.Player || from.InRange(cont.GetWorldLocation(), 1)) { Mobile root = cont.RootParent as Mobile; if (root != null && !root.Alive) { return; } if (root != null && root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player) { from.SendLocalizedMessage(500209); // You can not peek into the container. return; } if (root != null && from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed(from, root)) { from.SendLocalizedMessage(1001018); // You cannot perform negative acts on your target. return; } if (root != null && from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random(100)) { Map map = from.Map; if (map != null && !from.Hidden) { string message = String.Format("You notice {0} attempting to peek into {1}'s belongings.", from.Name, root.Name); IPooledEnumerable eable = map.GetClientsInRange(from.Location, 8); foreach (NetState ns in eable) { if (ns.Mobile != from) { ns.Mobile.SendMessage(message); } } eable.Free(); } } if (from.AccessLevel == AccessLevel.Player) { Titles.AwardKarma(from, -4, true); } if (from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill(SkillName.Snooping, cont, 0.0, 100.0)) { if (cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap(from)) { return; } cont.DisplayTo(from); } else { from.SendLocalizedMessage(500210); // You failed to peek into the container. if (from.Skills[SkillName.Hiding].Value / 2 < Utility.Random(100)) { from.RevealingAction(); } } } else { from.SendLocalizedMessage(500446); // That is too far away. } }
protected override void OnTarget(Mobile from, object targeted) { int nCost = 40; int nCost2 = 1000; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING { nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost); if (nCost < 1) { nCost = 1; } nCost2 = nCost2 - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost2); } if (targeted is UnknownLiquid && from.Backpack != null) { Item brew = targeted as Item; Container pack = from.Backpack; int toConsume = nCost; if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS from.SendMessage(String.Format("You pay {0} gold.", toConsume)); m_AlchemistGuildmaster.Animate(34, 5, 1, true, false, 0); m_AlchemistGuildmaster.PlaySound(0x2D6); int potionType = Utility.RandomMinMax(0, 40); string potionName = ""; if (potionType == 0) { from.AddToBackpack(new NightSightPotion()); potionName = "night sight potion"; } else if (potionType == 1) { from.AddToBackpack(new LesserCurePotion()); potionName = "lesser cure potion"; } else if (potionType == 2) { from.AddToBackpack(new CurePotion()); potionName = "cure potion"; } else if (potionType == 3) { from.AddToBackpack(new GreaterCurePotion()); potionName = "greater cure potion"; } else if (potionType == 4) { from.AddToBackpack(new AgilityPotion()); potionName = "agility potion"; } else if (potionType == 5) { from.AddToBackpack(new GreaterAgilityPotion()); potionName = "greater agility potion"; } else if (potionType == 6) { from.AddToBackpack(new StrengthPotion()); potionName = "strength"; } else if (potionType == 7) { from.AddToBackpack(new GreaterStrengthPotion()); potionName = "greater strength potion"; } else if (potionType == 8) { from.AddToBackpack(new LesserPoisonPotion()); potionName = "lesser poison"; } else if (potionType == 9) { from.AddToBackpack(new PoisonPotion()); potionName = "poison"; } else if (potionType == 10) { from.AddToBackpack(new GreaterPoisonPotion()); potionName = "greater poison"; } else if (potionType == 11) { from.AddToBackpack(new DeadlyPoisonPotion()); potionName = "deadly poison"; } else if (potionType == 12) { from.AddToBackpack(new RefreshPotion()); potionName = "refresh potion"; } else if (potionType == 13) { from.AddToBackpack(new TotalRefreshPotion()); potionName = "total refresh potion"; } else if (potionType == 14) { from.AddToBackpack(new LesserHealPotion()); potionName = "lesser heal potion"; } else if (potionType == 15) { from.AddToBackpack(new HealPotion()); potionName = "heal potion"; } else if (potionType == 16) { from.AddToBackpack(new GreaterHealPotion()); potionName = "greater heal potion"; } else if (potionType == 17) { from.AddToBackpack(new LesserExplosionPotion()); potionName = "lesser explosion potion"; } else if (potionType == 18) { from.AddToBackpack(new ExplosionPotion()); potionName = "explosion potion"; } else if (potionType == 19) { from.AddToBackpack(new GreaterExplosionPotion()); potionName = "greater explosion potion"; } else if (potionType == 20) { from.AddToBackpack(new LesserInvisibilityPotion()); potionName = "lesser invisibility potion"; } else if (potionType == 21) { from.AddToBackpack(new InvisibilityPotion()); potionName = "invisibility potion"; } else if (potionType == 22) { from.AddToBackpack(new GreaterInvisibilityPotion()); potionName = "greater invisibility potion"; } else if (potionType == 23) { from.AddToBackpack(new LesserRejuvenatePotion()); potionName = "lesser rejuvenation potion"; } else if (potionType == 24) { from.AddToBackpack(new RejuvenatePotion()); potionName = "rejuvenation potion"; } else if (potionType == 25) { from.AddToBackpack(new GreaterRejuvenatePotion()); potionName = "greater rejuvenation potion"; } else if (potionType == 26) { from.AddToBackpack(new LesserManaPotion()); potionName = "lesser mana potion"; } else if (potionType == 27) { from.AddToBackpack(new ManaPotion()); potionName = "mana potion"; } else if (potionType == 28) { from.AddToBackpack(new GreaterManaPotion()); potionName = "greater mana potion"; } else if (potionType == 29) { from.AddToBackpack(new InvulnerabilityPotion()); potionName = "invulnerability potion"; } else if (potionType == 30) { from.AddToBackpack(new AutoResPotion()); potionName = "resurrection potion"; } else if (potionType == 31) { from.AddToBackpack(new OilMetal()); potionName = "metal enhancement oil"; } else if (potionType == 32) { from.AddToBackpack(new OilLeather()); potionName = "leather enhancement oil"; } else if (potionType == 33) { from.AddToBackpack(new BottleOfAcid()); potionName = "acid"; } else if (potionType == 34) { from.AddToBackpack(new MagicalDyes()); potionName = "magical dye"; } else if (potionType == 35) { from.AddToBackpack(new BeverageBottle(BeverageType.Ale)); potionName = "ale"; } else if (potionType == 36) { from.AddToBackpack(new BeverageBottle(BeverageType.Wine)); potionName = "wine"; } else if (potionType == 37) { from.AddToBackpack(new BeverageBottle(BeverageType.Liquor)); potionName = "liquor"; } else if (potionType == 38) { from.AddToBackpack(new BeverageBottle(BeverageType.Ale)); potionName = "ale"; } else if (potionType == 39) { from.AddToBackpack(new BeverageBottle(BeverageType.Wine)); potionName = "wine"; } else { from.AddToBackpack(new BeverageBottle(BeverageType.Liquor)); potionName = "liquor"; } m_AlchemistGuildmaster.SayTo(from, "This seems to be a bottle of " + potionName + "."); brew.Delete(); } else { m_AlchemistGuildmaster.SayTo(from, "It would cost you {0} gold to have that identified.", toConsume); from.SendMessage("You do not have enough gold."); } } else if (targeted is UnknownKeg && from.Backpack != null) { Item brew = targeted as Item; Container pack = from.Backpack; int toConsume = nCost2; if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS from.SendMessage(String.Format("You pay {0} gold.", toConsume)); m_AlchemistGuildmaster.Animate(34, 5, 1, true, false, 0); m_AlchemistGuildmaster.PlaySound(0x2D6); Item Kitem = new PotionKeg(); PotionKeg barrel = (PotionKeg)Kitem; UnknownKeg tub = (UnknownKeg)brew; barrel.Held = tub.KegFilled; int nBarrel = 0; int potionType = Utility.RandomMinMax(1, 36); if (potionType == 1) { barrel.Type = PotionEffect.Nightsight; } else if (potionType == 2) { barrel.Type = PotionEffect.CureLesser; } else if (potionType == 3) { barrel.Type = PotionEffect.Cure; } else if (potionType == 4) { barrel.Type = PotionEffect.CureGreater; } else if (potionType == 5) { barrel.Type = PotionEffect.Agility; } else if (potionType == 6) { barrel.Type = PotionEffect.AgilityGreater; } else if (potionType == 7) { barrel.Type = PotionEffect.Strength; } else if (potionType == 8) { barrel.Type = PotionEffect.StrengthGreater; } else if (potionType == 9) { barrel.Type = PotionEffect.PoisonLesser; } else if (potionType == 10) { barrel.Type = PotionEffect.Poison; } else if (potionType == 11) { barrel.Type = PotionEffect.PoisonGreater; } else if (potionType == 12) { barrel.Type = PotionEffect.PoisonDeadly; } else if (potionType == 13) { barrel.Type = PotionEffect.Refresh; } else if (potionType == 14) { barrel.Type = PotionEffect.RefreshTotal; } else if (potionType == 15) { barrel.Type = PotionEffect.HealLesser; } else if (potionType == 16) { barrel.Type = PotionEffect.Heal; } else if (potionType == 17) { barrel.Type = PotionEffect.HealGreater; } else if (potionType == 18) { barrel.Type = PotionEffect.ExplosionLesser; } else if (potionType == 19) { barrel.Type = PotionEffect.Explosion; } else if (potionType == 20) { barrel.Type = PotionEffect.ExplosionGreater; } else if (potionType == 21) { barrel.Type = PotionEffect.InvisibilityLesser; } else if (potionType == 22) { barrel.Type = PotionEffect.Invisibility; } else if (potionType == 23) { barrel.Type = PotionEffect.InvisibilityGreater; } else if (potionType == 24) { barrel.Type = PotionEffect.RejuvenateLesser; } else if (potionType == 25) { barrel.Type = PotionEffect.Rejuvenate; } else if (potionType == 26) { barrel.Type = PotionEffect.RejuvenateGreater; } else if (potionType == 27) { barrel.Type = PotionEffect.ManaLesser; } else if (potionType == 28) { barrel.Type = PotionEffect.Mana; } else if (potionType == 29) { barrel.Type = PotionEffect.ManaGreater; } else if (potionType == 30) { barrel.Type = PotionEffect.PoisonLethal; } else if (potionType == 31) { barrel.Type = PotionEffect.Invulnerability; } if (potionType > 31) { nBarrel = 1; from.AddToBackpack(new Keg()); Effects.PlaySound(from.Location, from.Map, 0x026); m_AlchemistGuildmaster.SayTo(from, "This seems to be barrel of dirty water, which I will dump out for you."); } if (nBarrel == 0) { Server.Items.PotionKeg.SetColorKeg(barrel, barrel); from.AddToBackpack(barrel); m_AlchemistGuildmaster.SayTo(from, "This seems to be a " + barrel.Name + "."); } brew.Delete(); } else { m_AlchemistGuildmaster.SayTo(from, "It would cost you {0} gold to have that identified.", toConsume); from.SendMessage("You do not have enough gold."); } } else { m_AlchemistGuildmaster.SayTo(from, "That does not need my services."); } }
public static void EventSink_PlayerDeath(Mobile m) { var killers = new List <Mobile>(); var toGive = new List <Mobile>(); foreach (var ai in m.Aggressors) { if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported) { if (!Core.SE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker)) { killers.Add(ai.Attacker); ai.Reported = true; ai.CanReportMurder = false; } } if (ai.Attacker.Player && DateTime.UtcNow - ai.LastCombatTime < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker)) { toGive.Add(ai.Attacker); } } foreach (var ai in m.Aggressed) { if (ai.Defender.Player && DateTime.UtcNow - ai.LastCombatTime < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Defender)) { toGive.Add(ai.Defender); } } foreach (var g in toGive) { var n = Notoriety.Compute(g, m); var ourKarma = g.Karma; var innocent = n == Notoriety.Innocent; var criminal = n == Notoriety.Criminal || n == Notoriety.Murderer; var fameAward = m.Fame / 200; var karmaAward = 0; if (innocent) { karmaAward = ourKarma > -2500 ? -850 : -110 - m.Karma / 100; } else if (criminal) { karmaAward = 50; } Titles.AwardFame(g, fameAward, false); Titles.AwardKarma(g, karmaAward, true); } if (m is PlayerMobile mobile && mobile.NpcGuild == NpcGuild.ThievesGuild) { return; } if (killers.Count > 0) { new GumpTimer(m, killers).Start(); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BaseMagicStaff && from.Backpack != null) { BaseMagicStaff ba = targeted as BaseMagicStaff; BaseWeapon bw = targeted as BaseWeapon; Container pack = from.Backpack; int toConsume = 0; int spellCircle = 0; int myCharges = 0; if (bw.IntRequirement == 10) { spellCircle = 1; myCharges = 30; } else if (bw.IntRequirement == 15) { spellCircle = 2; myCharges = 23; } else if (bw.IntRequirement == 20) { spellCircle = 3; myCharges = 18; } else if (bw.IntRequirement == 25) { spellCircle = 4; myCharges = 15; } else if (bw.IntRequirement == 30) { spellCircle = 5; myCharges = 12; } else if (bw.IntRequirement == 35) { spellCircle = 6; myCharges = 9; } else if (bw.IntRequirement == 40) { spellCircle = 7; myCharges = 6; } else if (bw.IntRequirement == 45) { spellCircle = 8; myCharges = 3; } if (bw.IntRequirement < 1) { m_Enchanter.SayTo(from, "That does not need my services."); } else if (ba.Charges <= myCharges) { toConsume = spellCircle * 100; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING { toConsume = toConsume - (int)((from.Skills[SkillName.Begging].Value * 0.005) * toConsume); } } else { m_Enchanter.SayTo(from, "That wand has too many charges already."); } if (toConsume == 0) { return; } if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS m_Enchanter.SayTo(from, "Your wand is charged."); from.SendMessage(String.Format("You pay {0} gold.", toConsume)); Effects.PlaySound(from.Location, from.Map, 0x5C1); ba.Charges = ba.Charges + 5; } else { m_Enchanter.SayTo(from, "It would cost you {0} gold to have that charged.", toConsume); from.SendMessage("You do not have enough gold."); } } else { m_Enchanter.SayTo(from, "That does not need my services."); } }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { Mobile m = e.Mobile; if (m.LastKiller != null && (m.LastKiller == m || m.LastKiller is BaseGuard || m.LastKiller is BaseCreature && ((BaseCreature)m.LastKiller).GetMaster() == m)) { return; } var killers = new List <Mobile>(); var toGive = new List <Mobile>(); DateTime now = DateTime.UtcNow; foreach (AggressorInfo ai in m.Aggressors) { //Allow people of the same ethic to flag each other as murderers? Factioners can? if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported && (!m.EraSE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker))) { killers.Add(ai.Attacker); ai.Reported = true; ai.CanReportMurder = false; } if (ai.Attacker.Player && now - ai.LastCombatTime < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker)) { toGive.Add(ai.Attacker); } } foreach (AggressorInfo ai in m.Aggressed.Where( ai => ai.Defender.Player && now - ai.LastCombatTime < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Defender))) { toGive.Add(ai.Defender); } foreach (Mobile g in toGive) { int n = Notoriety.Compute(g, m); //int theirKarma = m.Karma; int ourKarma = g.Karma; bool innocent = (n == Notoriety.Innocent); bool criminal = (n == Notoriety.Criminal || n == Notoriety.Murderer); int fameAward = m.Fame / 200; int karmaAward = 0; if (innocent) { karmaAward = (ourKarma > -2500 ? -850 : -110 - (m.Karma / 100)); } else if (criminal) { karmaAward = 50; } Titles.AwardFame(g, fameAward, false); Titles.AwardKarma(g, karmaAward, true); } if (m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild) { return; } if (killers.Count == 0) { return; } if (m is PlayerMobile && ((PlayerMobile)m).Young && MurderSystemController._MurderYoungFreezeSeconds > 0) { new ParaTimer(m, killers).Start(); } new GumpTimer(m, killers, m.Location, m.Map).Start(); foreach (Mobile killer in killers) { m.RemoveAggressor(killer); if (killer is PlayerMobile) { var playerKiller = (PlayerMobile)killer; foreach (Mobile pet in playerKiller.AllFollowers) { m.RemoveAggressor(pet); } } killer.RemoveAggressed(m); } }
}// an evil orc helm public override bool OnEquip(Mobile from) { Titles.AwardKarma(from, -22, true); return(base.OnEquip(from)); }
protected override void OnTarget(Mobile from, object targeted) { ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (targeted is MagicRobe && from.Backpack != null) { Item ba = targeted as Item; Container pack = from.Backpack; int toConsume = 0; if (ba.ItemID != 0x1F03 && ba.ItemID != 0x1F04) { int nCost = 5; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING - WIZARD { nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost); if (nCost < 1) { nCost = 1; } } toConsume = nCost; } else { m_Weaver.SayTo(from, "That does not need my services."); } if (toConsume == 0) { return; } if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS m_Weaver.SayTo(from, "Here is your robe."); from.SendMessage(String.Format("You pay {0} gold.", toConsume)); Effects.PlaySound(from.Location, from.Map, 0x248); ba.ItemID = 0x1F03; ba.Name = "robe"; } else { m_Weaver.SayTo(from, "It would cost you {0} gold to have that done.", toConsume); from.SendMessage("You do not have enough gold."); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (targeted is MagicCloak && from.Backpack != null) { Item ba = targeted as Item; Container pack = from.Backpack; int toConsume = 0; if (ba.ItemID != 0x1515 && ba.ItemID != 0x1530) { int nCost = 5; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING - WIZARD { nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost); if (nCost < 1) { nCost = 1; } } toConsume = nCost; } else { m_Weaver.SayTo(from, "That does not need my services."); } if (toConsume == 0) { return; } if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS m_Weaver.SayTo(from, "Here is your cloak."); from.SendMessage(String.Format("You pay {0} gold.", toConsume)); Effects.PlaySound(from.Location, from.Map, 0x248); ba.ItemID = 0x1515; ba.Name = "cloak"; } else { m_Weaver.SayTo(from, "It would cost you {0} gold to have that done.", toConsume); from.SendMessage("You do not have enough gold."); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (targeted is BaseHat && from.Backpack != null && !(targeted is DeerMask) && !(targeted is BearMask)) { BaseHat ba = targeted as BaseHat; Container pack = from.Backpack; int toConsume = 0; if (ba.HitPoints < ba.MaxHitPoints) { int nCost = 10; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING - WIZARD { nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost); if (nCost < 1) { nCost = 1; } toConsume = (ba.MaxHitPoints - ba.HitPoints) * nCost; } else { toConsume = (ba.MaxHitPoints - ba.HitPoints) * nCost; } } else if (ba.HitPoints >= ba.MaxHitPoints) { m_Weaver.SayTo(from, "That does not need to be repaired."); } else { m_Weaver.SayTo(from, "I cannot repair that."); } if (toConsume == 0) { return; } if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS m_Weaver.SayTo(from, "Here is your hat."); from.SendMessage(String.Format("You pay {0} gold.", toConsume)); Effects.PlaySound(from.Location, from.Map, 0x248); ba.MaxHitPoints -= 1; ba.HitPoints = ba.MaxHitPoints; } else { m_Weaver.SayTo(from, "It would cost you {0} gold to have that repaired.", toConsume); from.SendMessage("You do not have enough gold."); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (targeted is UnidentifiedItem) { Container packs = from.Backpack; int nCost = 200; UnidentifiedItem WhatIsIt = (UnidentifiedItem)targeted; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING - WIZARD { nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost); if (nCost < 1) { nCost = 1; } } int toConsume = nCost; if (WhatIsIt.VendorCanID != "Tailor") { m_Weaver.SayTo(from, "Sorry, I cannot tell what that is."); } else if (packs.ConsumeTotal(typeof(Gold), toConsume)) { string MyItemName = "item"; Container pack = (Container)targeted; List <Item> items = new List <Item>(); foreach (Item item in pack.Items) { items.Add(item); } foreach (Item item in items) { MyItemName = item.Name; from.AddToBackpack(item); } if (MyItemName == "") { MyItemName = "item"; } from.SendMessage(String.Format("You pay {0} gold.", toConsume)); m_Weaver.SayTo(from, "Let me tell you about this item..."); WhatIsIt.Delete(); } else { m_Weaver.SayTo(from, "It would cost you {0} gold to have that identified.", toConsume); from.SendMessage("You do not have enough gold."); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else { m_Weaver.SayTo(from, "That does not need my services."); } }
public static void Container_Snoop(Container cont, Mobile from) { if (from.IsStaff() || from.InRange(cont.GetWorldLocation(), 1)) { Mobile root = cont.RootParent as Mobile; if (root != null && !root.Alive) { return; } if (from.IsPlayer() && root is BaseCreature && !(cont is StrongBackpack)) { return; } if (root != null && root.IsStaff() && from.IsPlayer()) { from.SendLocalizedMessage(500209); // You can not peek into the container. return; } if (root != null && from.IsPlayer() && !CheckSnoopAllowed(from, root)) { from.SendLocalizedMessage(1001018); // You cannot perform negative acts on your target. return; } if (root != null && from.IsPlayer() && from.Skills[SkillName.Snooping].Value < Utility.Random(100)) { Map map = from.Map; if (map != null) { string message = $"You notice {from.Name} peeking into your belongings!"; root.Send(new AsciiMessage(-1, -1, MessageType.Label, 946, 3, "", message)); } } if (from.IsPlayer()) { Titles.AwardKarma(from, -4, true); } if (from.IsStaff() || from.CheckTargetSkill(SkillName.Snooping, cont, 0.0, 100.0)) { if (cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap(from)) { return; } cont.DisplayTo(from); } else { from.SendLocalizedMessage(500210); // You failed to peek into the container. if (from.Skills[SkillName.Hiding].Value / 2 < Utility.Random(100)) { from.RevealingAction(); } } } else { from.SendLocalizedMessage(500446); // That is too far away. } }
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { Mobile m = e.Mobile; List <Mobile> killers = new List <Mobile>(); List <Mobile> toGive = new List <Mobile>(); foreach (AggressorInfo ai in m.Aggressors) { if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported) { if (!Core.SE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker)) { killers.Add(ai.Attacker); ai.Reported = true; ai.CanReportMurder = false; } } if (ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker)) { toGive.Add(ai.Attacker); } } foreach (AggressorInfo ai in m.Aggressed) { if (ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Defender)) { toGive.Add(ai.Defender); } } foreach (Mobile g in toGive) { int n = Notoriety.Compute(g, m); int theirKarma = m.Karma, ourKarma = g.Karma; bool innocent = (n == Notoriety.Innocent); bool criminal = (n == Notoriety.Criminal || n == Notoriety.Murderer); int fameAward = m.Fame / 200; int karmaAward = 0; if (innocent) { karmaAward = (ourKarma > -2500 ? -850 : -110 - (m.Karma / 100)); } else if (criminal) { karmaAward = 50; } Titles.AwardFame(g, fameAward, false); Titles.AwardKarma(g, karmaAward, true); } if (m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild) { return; } if (killers.Count > 0) { new GumpTimer(m, killers).Start(); } }
public virtual bool CheckSequence() { int mana = ScaleMana(GetMana()); if (m_Caster.Deleted || !m_Caster.Alive || m_Caster.Spell != this || m_State != SpellState.Sequencing) { DoFizzle(); } else if (m_Scroll != null && (m_Scroll.Amount <= 0 || m_Scroll.Deleted || m_Scroll.RootParent != m_Caster || (m_Scroll is BaseWand && (((BaseWand)m_Scroll).Charges <= 0 || m_Scroll.Parent != m_Caster)))) { DoFizzle(); } else if (!ConsumeReagents()) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502630); // More reagents are needed for this spell. } else if (m_Caster.Mana < mana) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502625); // Insufficient mana for this spell. } else if (Core.AOS && (m_Caster.Frozen || m_Caster.Paralyzed)) { m_Caster.SendLocalizedMessage(502646); // You cannot cast a spell while frozen. DoFizzle(); } else if (m_Caster is PlayerMobile && ((PlayerMobile)m_Caster).PeacedUntil > DateTime.UtcNow) { m_Caster.SendLocalizedMessage(1072060); // You cannot cast a spell while calmed. DoFizzle(); } else if (CheckFizzle()) { m_Caster.Mana -= mana; if (m_Scroll is SpellScroll) { m_Scroll.Consume(); } #region SA else if (m_Scroll is SpellStone) { // The SpellScroll check above isn't removing the SpellStones for some reason. m_Scroll.Delete(); } #endregion else if (m_Scroll is BaseWand) { ((BaseWand)m_Scroll).ConsumeCharge(m_Caster); m_Caster.RevealingAction(); } if (m_Scroll is BaseWand) { bool m = m_Scroll.Movable; m_Scroll.Movable = false; if (ClearHandsOnCast) { m_Caster.ClearHands(); } m_Scroll.Movable = m; } else { if (ClearHandsOnCast) { m_Caster.ClearHands(); } } int karma = ComputeKarmaAward(); if (karma != 0) { Titles.AwardKarma(Caster, karma, true); } return(true); } else { DoFizzle(); } return(false); }
protected override void OnTick() { Container theirPack = m_Target.Backpack; double badKarmaChance = 0.5 - ((double)m_From.Karma / 8570); if (theirPack == null && m_Target.Race != Race.Elf) { m_From.SendLocalizedMessage(500404); // They seem unwilling to give you any money. } else if (m_From.Karma < 0 && badKarmaChance > Utility.RandomDouble()) { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500406); // Thou dost not look trustworthy... no gold for thee today! } else if (m_From.CheckTargetSkill(SkillName.Begging, m_Target, 0.0, 100.0)) { if (m_Target.Race != Race.Elf) { int toConsume = theirPack.GetAmount(typeof(Gold)) / 10; int max = 10 + (m_From.Fame / 2500); if (max > 14) { max = 14; } else if (max < 10) { max = 10; } if (toConsume > max) { toConsume = max; } if (toConsume > 0) { int consumed = theirPack.ConsumeUpTo(typeof(Gold), toConsume); if (consumed > 0) { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500405); // I feel sorry for thee... Gold gold = new Gold(consumed); m_From.AddToBackpack(gold); m_From.PlaySound(gold.GetDropSound()); if (m_From.Karma > -3000) { int toLose = m_From.Karma + 3000; if (toLose > 40) { toLose = 40; } Titles.AwardKarma(m_From, -toLose, true); } } else { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407); // I have not enough money to give thee any! } } else { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407); // I have not enough money to give thee any! } } else { double chance = Utility.RandomDouble(); Item reward = new Gold(1); string rewardName = ""; if (chance >= .99) { int rand = Utility.Random(8); if (rand == 0) { reward = new BegBedRoll(); rewardName = "a bedroll"; } else if (rand == 1) { reward = new BegCookies(); rewardName = "a plate of cookies."; } else if (rand == 2) { reward = new BegFishSteak(); rewardName = "a fish steak."; } else if (rand == 3) { reward = new BegFishingPole(); rewardName = "a fishing pole."; } else if (rand == 4) { reward = new BegFlowerGarland(); rewardName = "a flower garland."; } else if (rand == 5) { reward = new BegSake(); rewardName = "a bottle of Sake."; } else if (rand == 6) { reward = new BegTurnip(); rewardName = "a turnip."; } else if (rand == 7) { reward = new BegWine(); rewardName = "a Bottle of wine."; } else if (rand == 8) { reward = new BegWinePitcher(); rewardName = "a Pitcher of wine."; } } else if (chance >= .76) { int rand = Utility.Random(6); if (rand == 0) { reward = new BegStew(); rewardName = "a bowl of stew."; } else if (rand == 1) { reward = new BegCheeseWedge(); rewardName = "a wedge of cheese."; } else if (rand == 2) { reward = new BegDates(); rewardName = "a bunch of dates."; } else if (rand == 3) { reward = new BegLantern(); rewardName = "a lantern."; } else if (rand == 4) { reward = new BegLiquorPitcher(); rewardName = "a Pitcher of liquor"; } else if (rand == 5) { reward = new BegPizza(); rewardName = "pizza"; } else if (rand == 6) { reward = new BegShirt(); rewardName = "a shirt."; } } else if (chance >= .25) { int rand = Utility.Random(1); if (rand == 0) { reward = new BegFrenchBread(); rewardName = "french bread."; } else { reward = new BegWaterPitcher(); rewardName = "a Pitcher of water."; } } m_Target.Say(1074854); // Here, take this... m_From.AddToBackpack(reward); m_From.SendLocalizedMessage(1074853, rewardName); // You have been given ~1_name~ if (m_From.Karma > -3000) { int toLose = m_From.Karma + 3000; if (toLose > 40) { toLose = 40; } Titles.AwardKarma(m_From, -toLose, true); } } } else { m_Target.SendLocalizedMessage(500404); // They seem unwilling to give you any money. } m_From.NextSkillTime = Core.TickCount + 10000; }
public virtual bool CheckSequence() { int mana = ScaleMana(GetMana()); if (m_Caster.Deleted || !m_Caster.Alive || m_Caster.Spell != this || m_State != SpellState.Sequencing) { DoFizzle(); } else if (m_Scroll != null && !(m_Scroll is Runebook) && (m_Scroll.Amount <= 0 || m_Scroll.Deleted || m_Scroll.RootParent != m_Caster || (m_Scroll is BaseWand && (((BaseWand)m_Scroll).Charges <= 0 || m_Scroll.Parent != m_Caster)))) { DoFizzle(); } else if (!ConsumeReagents()) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502630); // More reagents are needed for this spell. } else if (m_Caster.Mana < mana) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502625); // Insufficient mana for this spell. } else if (Core.AOS && (m_Caster.Frozen || m_Caster.Paralyzed)) { m_Caster.SendLocalizedMessage(502646); // You cannot cast a spell while frozen. DoFizzle(); } else if (m_Caster is PlayerMobile && ((PlayerMobile)m_Caster).PeacedUntil > DateTime.UtcNow) { m_Caster.SendLocalizedMessage(1072060); // You cannot cast a spell while calmed. DoFizzle(); } else if (CheckFizzle()) { m_Caster.Mana -= mana; if (m_Scroll is SpellStone) { ((SpellStone)m_Scroll).Use(m_Caster); } if (m_Scroll is SpellScroll) { m_Scroll.Consume(); } else if (m_Scroll is BaseWand) { ((BaseWand)m_Scroll).ConsumeCharge(m_Caster); m_Caster.RevealingAction(); } if (m_Scroll is BaseWand) { bool m = m_Scroll.Movable; m_Scroll.Movable = false; if (ClearHandsOnCast) { m_Caster.ClearHands(); } m_Scroll.Movable = m; } else { if (ClearHandsOnCast) { m_Caster.ClearHands(); } } int karma = ComputeKarmaAward(); if (karma != 0) { Titles.AwardKarma(Caster, karma, true); } if (TransformationSpellHelper.UnderTransformation(m_Caster, typeof(VampiricEmbraceSpell))) { bool garlic = false; for (int i = 0; !garlic && i < m_Info.Reagents.Length; ++i) { garlic = (m_Info.Reagents[i] == Reagent.Garlic); } if (garlic) { m_Caster.SendLocalizedMessage(1061651); // The garlic burns you! AOS.Damage(m_Caster, Utility.RandomMinMax(17, 23), 100, 0, 0, 0, 0); } } return(true); } else { DoFizzle(); } return(false); }
protected override void OnTarget(Mobile from, object targeted) { int nCost = 50; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING - WIZARD { nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost); if (nCost < 1) { nCost = 1; } } if (targeted is UnknownScroll && from.Backpack != null) { Container pack = from.Backpack; int toConsume = nCost; if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS from.SendMessage(String.Format("You pay {0} gold.", toConsume)); m_Scribe.PlaySound(0x249); UnknownScroll rolls = (UnknownScroll)targeted; int paperType = 1; if (rolls.ScrollType == 1) // MAGERY { if (rolls.ScrollLevel == 2) { paperType = Utility.RandomMinMax(13, 24); } else if (rolls.ScrollLevel == 3) { paperType = Utility.RandomMinMax(25, 36); } else if (rolls.ScrollLevel == 4) { paperType = Utility.RandomMinMax(37, 48); } else if (rolls.ScrollLevel == 5) { paperType = Utility.RandomMinMax(49, 60); } else if (rolls.ScrollLevel == 6) { paperType = Utility.RandomMinMax(57, 64); } else { paperType = Utility.RandomMinMax(1, 12); } } else if (rolls.ScrollType == 3) // BARD { paperType = Utility.RandomMinMax(82, 97); } else { if (rolls.ScrollLevel == 2) { paperType = Utility.RandomMinMax(68, 70); } else if (rolls.ScrollLevel == 3) { paperType = Utility.RandomMinMax(71, 73); } else if (rolls.ScrollLevel == 4) { paperType = Utility.RandomMinMax(74, 76); } else if (rolls.ScrollLevel == 5) { paperType = Utility.RandomMinMax(77, 79); } else if (rolls.ScrollLevel == 6) { paperType = Utility.RandomMinMax(80, 81); } else { paperType = Utility.RandomMinMax(65, 67); } } string paperName = ""; if (Utility.RandomMinMax(1, 100) > 10) { if (paperType == 1) { from.AddToBackpack(new ReactiveArmorScroll()); paperName = "reactive armor"; } else if (paperType == 2) { from.AddToBackpack(new ClumsyScroll()); paperName = "clumsy"; } else if (paperType == 3) { from.AddToBackpack(new CreateFoodScroll()); paperName = "create food"; } else if (paperType == 4) { from.AddToBackpack(new FeeblemindScroll()); paperName = "feeblemind"; } else if (paperType == 5) { from.AddToBackpack(new HealScroll()); paperName = "heal"; } else if (paperType == 6) { from.AddToBackpack(new MagicArrowScroll()); paperName = "magic arrow"; } else if (paperType == 7) { from.AddToBackpack(new NightSightScroll()); paperName = "night sight"; } else if (paperType == 8) { from.AddToBackpack(new WeakenScroll()); paperName = "weaken"; } else if (paperType == 9) { from.AddToBackpack(new AgilityScroll()); paperName = "agility"; } else if (paperType == 10) { from.AddToBackpack(new CunningScroll()); paperName = "cunning"; } else if (paperType == 11) { from.AddToBackpack(new CureScroll()); paperName = "cure"; } else if (paperType == 12) { from.AddToBackpack(new HarmScroll()); paperName = "harm"; } else if (paperType == 13) { from.AddToBackpack(new MagicTrapScroll()); paperName = "magic trap"; } else if (paperType == 14) { from.AddToBackpack(new MagicUnTrapScroll()); paperName = "magic untrap"; } else if (paperType == 15) { from.AddToBackpack(new ProtectionScroll()); paperName = "protection"; } else if (paperType == 16) { from.AddToBackpack(new StrengthScroll()); paperName = "strength"; } else if (paperType == 17) { from.AddToBackpack(new BlessScroll()); paperName = "bless"; } else if (paperType == 18) { from.AddToBackpack(new FireballScroll()); paperName = "fireball"; } else if (paperType == 19) { from.AddToBackpack(new MagicLockScroll()); paperName = "magic lock"; } else if (paperType == 20) { from.AddToBackpack(new PoisonScroll()); paperName = "poison"; } else if (paperType == 21) { from.AddToBackpack(new TelekinisisScroll()); paperName = "telekinesis"; } else if (paperType == 22) { from.AddToBackpack(new TeleportScroll()); paperName = "teleport"; } else if (paperType == 23) { from.AddToBackpack(new UnlockScroll()); paperName = "unlock"; } else if (paperType == 24) { from.AddToBackpack(new WallOfStoneScroll()); paperName = "wall of stone"; } else if (paperType == 25) { from.AddToBackpack(new ArchCureScroll()); paperName = "arch cure"; } else if (paperType == 26) { from.AddToBackpack(new ArchProtectionScroll()); paperName = "arch protection"; } else if (paperType == 27) { from.AddToBackpack(new CurseScroll()); paperName = "curse"; } else if (paperType == 28) { from.AddToBackpack(new FireFieldScroll()); paperName = "fire field"; } else if (paperType == 29) { from.AddToBackpack(new GreaterHealScroll()); paperName = "greater heal"; } else if (paperType == 30) { from.AddToBackpack(new LightningScroll()); paperName = "lightning"; } else if (paperType == 31) { from.AddToBackpack(new ManaDrainScroll()); paperName = "mana drain"; } else if (paperType == 32) { from.AddToBackpack(new RecallScroll()); paperName = "recall"; } else if (paperType == 33) { from.AddToBackpack(new BladeSpiritsScroll()); paperName = "blade spirits"; } else if (paperType == 34) { from.AddToBackpack(new DispelFieldScroll()); paperName = "dispel field"; } else if (paperType == 35) { from.AddToBackpack(new IncognitoScroll()); paperName = "incognito"; } else if (paperType == 36) { from.AddToBackpack(new MagicReflectScroll()); paperName = "magic reflect"; } else if (paperType == 37) { from.AddToBackpack(new MindBlastScroll()); paperName = "mind blast"; } else if (paperType == 38) { from.AddToBackpack(new ParalyzeScroll()); paperName = "paralyze"; } else if (paperType == 39) { from.AddToBackpack(new PoisonFieldScroll()); paperName = "poison field"; } else if (paperType == 40) { from.AddToBackpack(new SummonCreatureScroll()); paperName = "summon creature"; } else if (paperType == 41) { from.AddToBackpack(new DispelScroll()); paperName = "dispel"; } else if (paperType == 42) { from.AddToBackpack(new EnergyBoltScroll()); paperName = "energy bolt"; } else if (paperType == 43) { from.AddToBackpack(new ExplosionScroll()); paperName = "explosion"; } else if (paperType == 44) { from.AddToBackpack(new InvisibilityScroll()); paperName = "invisibility"; } else if (paperType == 45) { from.AddToBackpack(new MarkScroll()); paperName = "mark"; } else if (paperType == 46) { from.AddToBackpack(new MassCurseScroll()); paperName = "mass curse"; } else if (paperType == 47) { from.AddToBackpack(new ParalyzeFieldScroll()); paperName = "paralyze field"; } else if (paperType == 48) { from.AddToBackpack(new RevealScroll()); paperName = "reveal"; } else if (paperType == 49) { from.AddToBackpack(new ChainLightningScroll()); paperName = "chain lightning"; } else if (paperType == 50) { from.AddToBackpack(new EnergyFieldScroll()); paperName = "energy field"; } else if (paperType == 51) { from.AddToBackpack(new FlamestrikeScroll()); paperName = "flamestrike"; } else if (paperType == 52) { from.AddToBackpack(new GateTravelScroll()); paperName = "gate travel"; } else if (paperType == 53) { from.AddToBackpack(new ManaVampireScroll()); paperName = "mana vampire"; } else if (paperType == 54) { from.AddToBackpack(new MassDispelScroll()); paperName = "mass dispel"; } else if (paperType == 55) { from.AddToBackpack(new MeteorSwarmScroll()); paperName = "meteor swarm"; } else if (paperType == 56) { from.AddToBackpack(new PolymorphScroll()); paperName = "polymorph"; } else if (paperType == 57) { from.AddToBackpack(new EarthquakeScroll()); paperName = "earthquake"; } else if (paperType == 58) { from.AddToBackpack(new EnergyVortexScroll()); paperName = "energy vortex"; } else if (paperType == 59) { from.AddToBackpack(new ResurrectionScroll()); paperName = "resurrection"; } else if (paperType == 60) { from.AddToBackpack(new SummonAirElementalScroll()); paperName = "summon air elemental"; } else if (paperType == 61) { from.AddToBackpack(new SummonDaemonScroll()); paperName = "summon daemon"; } else if (paperType == 62) { from.AddToBackpack(new SummonEarthElementalScroll()); paperName = "summon earth elemental"; } else if (paperType == 63) { from.AddToBackpack(new SummonFireElementalScroll()); paperName = "summon fire elemental"; } else if (paperType == 64) { from.AddToBackpack(new SummonWaterElementalScroll()); paperName = "summon water elemental"; } else if (paperType == 65) { from.AddToBackpack(new CurseWeaponScroll()); paperName = "curse weapon"; } else if (paperType == 66) { from.AddToBackpack(new BloodOathScroll()); paperName = "blood oath"; } else if (paperType == 67) { from.AddToBackpack(new CorpseSkinScroll()); paperName = "corpse skin"; } else if (paperType == 68) { from.AddToBackpack(new EvilOmenScroll()); paperName = "evil omen"; } else if (paperType == 69) { from.AddToBackpack(new PainSpikeScroll()); paperName = "pain spike"; } else if (paperType == 70) { from.AddToBackpack(new WraithFormScroll()); paperName = "wraith form"; } else if (paperType == 71) { from.AddToBackpack(new MindRotScroll()); paperName = "mind rot"; } else if (paperType == 72) { from.AddToBackpack(new SummonFamiliarScroll()); paperName = "summon familiar"; } else if (paperType == 73) { from.AddToBackpack(new AnimateDeadScroll()); paperName = "animate dead"; } else if (paperType == 74) { from.AddToBackpack(new HorrificBeastScroll()); paperName = "horrific beast"; } else if (paperType == 75) { from.AddToBackpack(new PoisonStrikeScroll()); paperName = "poison strike"; } else if (paperType == 76) { from.AddToBackpack(new WitherScroll()); paperName = "wither"; } else if (paperType == 77) { from.AddToBackpack(new StrangleScroll()); paperName = "strangle"; } else if (paperType == 78) { from.AddToBackpack(new LichFormScroll()); paperName = "lich form"; } else if (paperType == 79) { from.AddToBackpack(new ExorcismScroll()); paperName = "exorcism"; } else if (paperType == 80) { from.AddToBackpack(new VengefulSpiritScroll()); paperName = "vengeful spirit"; } else if (paperType == 81) { from.AddToBackpack(new VampiricEmbraceScroll()); paperName = "vampiric embrace"; } else if (paperType == 82) { from.AddToBackpack(new ArmysPaeonScroll()); paperName = "army's paeon sheet music"; } else if (paperType == 83) { from.AddToBackpack(new EnchantingEtudeScroll()); paperName = "enchanting etude sheet music"; } else if (paperType == 84) { from.AddToBackpack(new EnergyCarolScroll()); paperName = "energy carol sheet music"; } else if (paperType == 85) { from.AddToBackpack(new EnergyThrenodyScroll()); paperName = "energy threnody sheet music"; } else if (paperType == 86) { from.AddToBackpack(new FireCarolScroll()); paperName = "fire carol sheet music"; } else if (paperType == 87) { from.AddToBackpack(new FireThrenodyScroll()); paperName = "fire threnody sheet music"; } else if (paperType == 88) { from.AddToBackpack(new FoeRequiemScroll()); paperName = "foe requiem sheet music"; } else if (paperType == 89) { from.AddToBackpack(new IceCarolScroll()); paperName = "ice carol sheet music"; } else if (paperType == 90) { from.AddToBackpack(new IceThrenodyScroll()); paperName = "ice threnody sheet music"; } else if (paperType == 91) { from.AddToBackpack(new KnightsMinneScroll()); paperName = "knight's minne sheet music"; } else if (paperType == 92) { from.AddToBackpack(new MagesBalladScroll()); paperName = "mage's ballad sheet music"; } else if (paperType == 93) { from.AddToBackpack(new MagicFinaleScroll()); paperName = "magic finale sheet music"; } else if (paperType == 94) { from.AddToBackpack(new PoisonCarolScroll()); paperName = "poison carol sheet music"; } else if (paperType == 95) { from.AddToBackpack(new PoisonThrenodyScroll()); paperName = "poison threnody sheet music"; } else if (paperType == 96) { from.AddToBackpack(new SheepfoeMamboScroll()); paperName = "shepherd's dance sheet music"; } else { from.AddToBackpack(new SinewyEtudeScroll()); paperName = "sinewy etude sheet music"; } m_Scribe.SayTo(from, "This seems to be a scroll of " + paperName + "."); } else { int nJunk = Utility.RandomMinMax(1, 6); switch (nJunk) { case 1: paperName = "useless scribbles"; break; case 2: paperName = "a useless recipe"; break; case 3: paperName = "a useless list of monsters"; break; case 4: paperName = "useless writings"; break; case 5: paperName = "a useless drawing"; break; case 6: paperName = "a useless map"; break; } m_Scribe.SayTo(from, "This seems to be " + paperName + "."); } rolls.Delete(); } else { m_Scribe.SayTo(from, "It would cost you {0} gold to have that identified.", toConsume); from.SendMessage("You do not have enough gold."); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else if (targeted is ScrollClue) { Container packs = from.Backpack; nCost = 100; ScrollClue WhatIsIt = (ScrollClue)targeted; if (BeggingPose(from) > 0) // LET US SEE IF THEY ARE BEGGING - WIZARD { nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost); if (nCost < 1) { nCost = 1; } } int toConsume = nCost; if (WhatIsIt.ScrollIntelligence == 0) { m_Scribe.SayTo(from, "That was already deciphered by someone."); } else if (packs.ConsumeTotal(typeof(Gold), toConsume)) { if (WhatIsIt.ScrollIntelligence >= 80) { WhatIsIt.Name = "diabolically coded parchment"; } else if (WhatIsIt.ScrollIntelligence >= 70) { WhatIsIt.Name = "ingeniously coded parchment"; } else if (WhatIsIt.ScrollIntelligence >= 60) { WhatIsIt.Name = "deviously coded parchment"; } else if (WhatIsIt.ScrollIntelligence >= 50) { WhatIsIt.Name = "cleverly coded parchment"; } else if (WhatIsIt.ScrollIntelligence >= 40) { WhatIsIt.Name = "adeptly coded parchment"; } else if (WhatIsIt.ScrollIntelligence >= 30) { WhatIsIt.Name = "expertly coded parchment"; } else { WhatIsIt.Name = "plainly coded parchment"; } WhatIsIt.ScrollIntelligence = 0; WhatIsIt.InvalidateProperties(); from.SendMessage(String.Format("You pay {0} gold.", toConsume)); m_Scribe.SayTo(from, "Let me show you what this reads..."); WhatIsIt.ScrollSolved = "Deciphered by " + m_Scribe.Name + " the Scribe"; from.PlaySound(0x249); WhatIsIt.InvalidateProperties(); } else { m_Scribe.SayTo(from, "It would cost you {0} gold to have that deciphered.", toConsume); from.SendMessage("You do not have enough gold."); } } else { m_Scribe.SayTo(from, "That does not need my services."); } }