public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } string myQuest = CharacterDatabase.GetQuestInfo(m_Mobile, "FishingQuest"); int nAllowedForAnotherQuest = FishingQuestFunctions.QuestTimeNew(m_Mobile); int nServerQuestTimeAllowed = MyServerSettings.GetTimeBetweenQuests(); int nWhenForAnotherQuest = nServerQuestTimeAllowed - nAllowedForAnotherQuest; string sAllowedForAnotherQuest = nWhenForAnotherQuest.ToString(); if (CharacterDatabase.GetQuestState(m_Mobile, "FishingQuest")) { m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You are already on a quest. Return here when you are done.", m_Mobile.NetState); } else if (nWhenForAnotherQuest > 0) { m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, "There are no quests at the moment. Check back in " + sAllowedForAnotherQuest + " minutes.", m_Mobile.NetState); } else { int nFame = m_Mobile.Fame * 2; nFame = Utility.RandomMinMax(0, nFame) + 2000; FishingQuestFunctions.FindTarget(m_Mobile, nFame); string TellQuest = FishingQuestFunctions.QuestStatus(m_Mobile) + "."; m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, TellQuest, m_Mobile.NetState); } }
public static void SetupCoffer(Coffer coffer) { if ((coffer.Name).Contains(" coffer")) { coffer.CofferType = (coffer.Name).Replace(" coffer", ""); } coffer.Name = "coffer"; coffer.Hue = 0x6A5; if (Utility.RandomMinMax(0, 13) != 13) { coffer.Hue = Server.Misc.RandomThings.GetRandomWoodColor(); } int money1 = 30; int money2 = 120; double w1 = money1 * (MyServerSettings.GetGoldCutRate() * .01); double w2 = money2 * (MyServerSettings.GetGoldCutRate() * .01); money1 = (int)w1; money2 = (int)w2; coffer.CofferGold = Utility.RandomMinMax(money1, money2); coffer.CofferRobber = ""; coffer.CofferRobbed = 0; coffer.CofferSnooperA = null; coffer.CofferSnooperB = null; coffer.CofferSnooperC = null; coffer.CofferSnooperD = null; coffer.CofferSnooperE = null; }
public void BeginRepair(Mobile from) { int money = 1000; double w = money * (MyServerSettings.GetGoldCutRate() * .01); money = (int)w; if (Deleted || !from.Alive) { return; } int nCost = money; 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; } SayTo(from, "Since you are begging, do you still want me to decipher a treasure map for you, it will only cost " + nCost.ToString() + " gold per level of the map?"); } else { SayTo(from, "If you want me to decipher a treasure map for you, it will cost " + nCost.ToString() + " gold per level of the map"); } from.Target = new RepairTarget(this); }
public PirateBounty() : base(0x0DEB) { Name = "Pirate Bounty"; Weight = 1.0; ItemID = Utility.RandomList(0x0DEB, 0x0DED); BountyWho = NameList.RandomName("male") + " the pirate"; BountyValue = Utility.RandomMinMax(1000, 3000); BountyValue = (int)(BountyValue * (MyServerSettings.GetGoldCutRate() * .01)); }
public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } PlayerMobile mobile = (PlayerMobile)m_Mobile; string myQuest = CharacterDatabase.GetQuestInfo(m_Mobile, "AssassinQuest"); int nAllowedForAnotherQuest = AssassinFunctions.QuestTimeNew(m_Mobile); int nServerQuestTimeAllowed = MyServerSettings.GetTimeBetweenQuests(); int nWhenForAnotherQuest = nServerQuestTimeAllowed - nAllowedForAnotherQuest; string sAllowedForAnotherQuest = nWhenForAnotherQuest.ToString(); if (CharacterDatabase.GetQuestState(m_Mobile, "AssassinQuest")) { m_Giver.Say("You already have your orders. Return to me when you are done with the task."); } else if (mobile.NpcGuild != NpcGuild.AssassinsGuild) // HE WILL ONLY TALK GUILD MEMBERS { m_Giver.Say("Hmmm...you do not seem the type I wish to discuss matters with."); } else if (m_Mobile.Karma > -1250) // HE WILL ONLY TALK TO THE UNSAVORY GUILD MEMBERS { m_Giver.Say("Hmmm...maybe show me that you could handle such tasks first."); } else if (nWhenForAnotherQuest > 0) { m_Giver.Say("I have nothing for you at the moment. Check back in " + sAllowedForAnotherQuest + " minutes."); } else { int nFame = m_Mobile.Fame * 2; nFame = Utility.RandomMinMax(0, nFame) + 2000; if (Utility.RandomMinMax(1, 100) > 30) { AssassinFunctions.FindTarget(m_Mobile, nFame); } else { AssassinFunctions.FindInnocentTarget(m_Mobile); } string TellQuest = AssassinFunctions.QuestStatus(m_Mobile) + "."; m_Giver.Say(TellQuest); } }
public static string ThiefAllowed(Mobile from) { int nAllowedForAnotherQuest = ThiefTimeNew(from); int nServerQuestTimeAllowed = MyServerSettings.GetTimeBetweenQuests(); int nWhenForAnotherQuest = nServerQuestTimeAllowed - nAllowedForAnotherQuest; string sAllowedForAnotherQuest = nWhenForAnotherQuest.ToString(); if (nWhenForAnotherQuest > 0) { return(sAllowedForAnotherQuest); } return(null); }
public override void OnMovement(Mobile m, Point3D oldLocation) { if (m is PlayerMobile && MyServerSettings.EnableDungeonSoundEffects()) { if (DateTime.Now >= m_NextSound && Utility.InRange(m.Location, this.Location, 10)) { if (Utility.RandomBool()) { int sound = HiddenChest.DungeonSounds(this); m.PlaySound(sound); } m_NextSound = (DateTime.Now + TimeSpan.FromSeconds(60)); } } }
public override void OnDoubleClick(Mobile m) { if (m.InRange(this.GetWorldLocation(), 2) && MyServerSettings.AllowAlienChoice()) { DoTeleport(m); } else if (!MyServerSettings.AllowAlienChoice()) { m.SendMessage("This door doesn't seem to budge."); } else { m.SendLocalizedMessage(502138); // That is too far away for you to use } }
public static void GiveArtifactTo(Mobile m) { Item item = new UnidentifiedArtifact(); if (MyServerSettings.GetUnidentifiedChance() >= Utility.RandomMinMax(1, 100)) { item = Loot.RandomArty(); } if (item == null) { return; } // TODO: Confirm messages if (m.AddToBackpack(item)) { m.SendMessage("As a reward for slaying the mighty leviathan, an artifact has been placed in your backpack."); } else { m.SendMessage("As your backpack is full, your reward for destroying the legendary leviathan has been placed at your feet."); } }
public static void SetRumor(Mobile m, MuseumBook book) { book.RumorGoal = Utility.RandomMinMax(1, 2); if (book.ItemValue < 1) { book.ItemValue = Utility.RandomMinMax(120, 200) * 100; book.ItemValue = (int)(book.ItemValue * (MyServerSettings.GetGoldCutRate() * .01)); } string searchLocation = "the Land of Sosaria"; switch (Utility.RandomMinMax(0, 10)) { case 0: searchLocation = "the Land of Sosaria"; break; case 1: searchLocation = "the Land of Lodoria"; break; case 2: searchLocation = "the Serpent Island"; break; case 3: searchLocation = "the Land of Sosaria"; break; case 4: searchLocation = "the Land of Lodoria"; break; case 5: searchLocation = "the Serpent Island"; break; case 6: searchLocation = "the Island of Umber Veil"; break; case 7: searchLocation = "the Land of Ambrosia"; break; case 8: searchLocation = "the Isles of Dread"; break; case 9: searchLocation = "the Savaged Empire"; break; case 10: searchLocation = "the Bottle World of Kuldar"; break; } string dungeon = "the Dungeon of Doom"; int aCount = 0; ArrayList targets = new ArrayList(); if (book.RumorGoal == 1) { foreach (Mobile target in World.Mobiles.Values) { if (target.Region is DungeonRegion && target.Fame >= 18000 && !(target is Exodus || target is CodexGargoyleA || target is CodexGargoyleB || target is Syth)) { if (Server.Misc.Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation) { targets.Add(target); aCount++; } } } } else { foreach (Item target in World.Items.Values) { if (target is SearchBase || target is StealBase) { if (Server.Misc.Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation) { targets.Add(target); aCount++; } } } } aCount = Utility.RandomMinMax(1, aCount); int xCount = 0; for (int i = 0; i < targets.Count; ++i) { xCount++; if (xCount == aCount) { if (book.RumorGoal == 1) { Mobile finding = ( Mobile )targets[i]; dungeon = Server.Misc.Worlds.GetRegionName(finding.Map, finding.Location); } else { Item finding = ( Item )targets[i]; dungeon = Server.Misc.Worlds.GetRegionName(finding.Map, finding.Location); } } } book.RumorWorld = searchLocation; book.RumorDungeon = dungeon; book.RumorFrom = "" + m.Name + " " + m.Title + ""; }
protected override void OnTarget(Mobile from, object targeted) { int money = 1000; double w = money * (MyServerSettings.GetGoldCutRate() * .01); money = (int)w; if (targeted is TreasureMap && from.Backpack != null) { TreasureMap tmap = targeted as TreasureMap; Container pack = from.Backpack; int toConsume = tmap.Level * money; 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 (tmap.Decoder != null) { m_Mapmaker.SayTo(from, "That map has already been deciphered."); } else if (pack.ConsumeTotal(typeof(Gold), toConsume)) { if (BeggingPose(from) > 0) { Titles.AwardKarma(from, -BeggingKarma(from), true); } // DO ANY KARMA LOSS if (tmap.Level == 1) { m_Mapmaker.SayTo(from, "This map was really quite simple."); } else if (tmap.Level == 2) { m_Mapmaker.SayTo(from, "Seemed pretty easy...so here it is."); } else if (tmap.Level == 3) { m_Mapmaker.SayTo(from, "This map was a bit of a challenge."); } else if (tmap.Level == 4) { m_Mapmaker.SayTo(from, "Whoever drew this map, did not want it found."); } else if (tmap.Level == 5) { m_Mapmaker.SayTo(from, "This took more research than normal."); } else { m_Mapmaker.SayTo(from, "With the ancient writings and riddles, this map should now lead you there."); } from.SendMessage(String.Format("You pay {0} gold.", toConsume)); Effects.PlaySound(from.Location, from.Map, 0x249); tmap.Decoder = from; } else { m_Mapmaker.SayTo(from, "It would cost you {0} gold for me to decipher that map.", toConsume); from.SendMessage("You do not have enough gold."); } } else { m_Mapmaker.SayTo(from, "That does not need my services."); } }
public static bool IsEnabled() { return(MyServerSettings.OpenBasements()); }
protected override void OnTick() { int z = m_Map.GetAverageZ(m_X, m_Y); bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false); for (int i = -3; !canFit && i <= 3; ++i) { canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false); if (canFit) { z += i; } } if (!canFit) { return; } Item g = new Gold(100, 200); g.Delete(); int r1 = (int)(Utility.RandomMinMax(80, 160) * (MyServerSettings.GetGoldCutRate() * .01)); int r2 = (int)(Utility.RandomMinMax(200, 400) * (MyServerSettings.GetGoldCutRate() * .01)); int r3 = (int)(Utility.RandomMinMax(400, 800) * (MyServerSettings.GetGoldCutRate() * .01)); int r4 = (int)(Utility.RandomMinMax(800, 1200) * (MyServerSettings.GetGoldCutRate() * .01)); int r5 = (int)(Utility.RandomMinMax(1200, 1600) * (MyServerSettings.GetGoldCutRate() * .01)); switch (Utility.Random(21)) { case 0: g = new Crystals(r1); break; case 1: g = new DDGemstones(r2); break; case 2: g = new DDJewels(r2); break; case 3: g = new DDGoldNuggets(r3); break; case 4: g = new Gold(r3); break; case 5: g = new Gold(r3); break; case 6: g = new Gold(r3); break; case 7: g = new DDSilver(r4); break; case 8: g = new DDSilver(r4); break; case 9: g = new DDSilver(r4); break; case 10: g = new DDSilver(r4); break; case 11: g = new DDSilver(r4); break; case 12: g = new DDSilver(r4); break; case 13: g = new DDCopper(r5); break; case 14: g = new DDCopper(r5); break; case 15: g = new DDCopper(r5); break; case 16: g = new DDCopper(r5); break; case 17: g = new DDCopper(r5); break; case 18: g = new DDCopper(r5); break; case 19: g = new DDCopper(r5); break; case 20: g = new DDCopper(r5); break; } g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map); if (0.5 >= Utility.RandomDouble()) { switch (Utility.Random(3)) { case 0: // Fire column { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(g, g.Map, 0x208); break; } case 1: // Explosion { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044); Effects.PlaySound(g, g.Map, 0x307); break; } case 2: // Ball of fire { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052); break; } } } }
public override void OnDoubleClick(Mobile from) { if (IsDeadPet) { return; } if (from.IsBodyMod && !from.Body.IsHuman) { if (Core.AOS) // You cannot ride a mount in your current form. { PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, 1062061, from.NetState); } else { from.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } return; } if (!CheckMountAllowed(from, true)) { return; } if (from.Mounted) { from.SendLocalizedMessage(1005583); // Please dismount first. return; } if (from.Female ? !AllowFemaleRider : !AllowMaleRider) { OnDisallowedRider(from); return; } if (!Multis.DesignContext.Check(from)) { return; } if (from.HasTrade) { from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time return; } if (Server.Misc.MyServerSettings.NoMountsInCertainRegions() && Server.Mobiles.AnimalTrainer.IsNoMountRegion(from, from.Region)) { from.SendMessage("You cannot mount that while you are in this place."); return; } else if ((Server.Misc.MyServerSettings.NoMountBuilding() && Server.Misc.Worlds.InBuilding(from)) || (from.Region is HouseRegion && MyServerSettings.NoMountsInHouses())) { from.SendMessage("You cannot mount that while you are in here."); return; } int range = 1; if (Server.Misc.MyServerSettings.FriendsAvoidHeels()) { range = 5; } if (from.InRange(this, range)) { bool canAccess = (from.AccessLevel >= AccessLevel.GameMaster) || (Controlled && ControlMaster == from) || (Summoned && SummonMaster == from); if (canAccess) { if (this.Poisoned) { PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, 1049692, from.NetState); // This mount is too ill to ride. } else { Server.Mobiles.BaseMount.Ride(this, from); } } else if (!Controlled && !Summoned) { // That mount does not look broken! You would have to tame it to ride it. PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, 501263, from.NetState); } else { // This isn't your mount; it refuses to let you ride. PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, 501264, from.NetState); } } else { from.SendLocalizedMessage(500206); // That is too far away to ride. } }
public RuneGuardian() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4) { Name = "a sentinel"; Body = Utility.RandomList(244, 428, 88, 306, 313, 314, 139, 144, 287, 715, 319, 772, 784, 753, 754); Timer.DelayCall(TimeSpan.FromMinutes((double)(Utility.RandomMinMax(60, 90))), new TimerCallback(Delete)); NameHue = 0x22; if (Utility.RandomBool()) { AI = AIType.AI_Melee; } if (Body == 244) // BEETLE { BaseSoundID = 0x388; gBrthPhys = 0; gBrthCold = 0; gBrthFire = 0; gBrthPois = 100; gBrthEngy = 0; gBrthEffectHue = 0x48F; gBrthEffectSound = 0x012; gBrthEffectItemID = 0x1A85; gBrthType = 36; } else if (Body == 428) // OGRE { BaseSoundID = 427; gBrthPhys = 100; gBrthCold = 0; gBrthFire = 0; gBrthPois = 0; gBrthEngy = 0; gBrthEffectHue = 0; gBrthEffectSound = 0x65A; gBrthEffectItemID = 0x1365; gBrthType = 7; } else if (Body == 88) // DEMON { BaseSoundID = 357; gBrthPhys = 20; gBrthCold = 20; gBrthFire = 20; gBrthPois = 20; gBrthEngy = 20; gBrthEffectHue = 0x496; gBrthEffectSound = 0x658; gBrthEffectItemID = 0x37BC; gBrthType = 23; } else if (Body == 306) // SERPENTOID { BaseSoundID = 639; gBrthPhys = 0; gBrthCold = 0; gBrthFire = 0; gBrthPois = 100; gBrthEngy = 0; gBrthEffectHue = 0x3F; gBrthEffectSound = 0x658; gBrthEffectItemID = 0x36D4; gBrthType = 10; } else if (Body == 784) // ANTOID { BaseSoundID = 0x24D; gBrthPhys = 20; gBrthCold = 20; gBrthFire = 20; gBrthPois = 20; gBrthEngy = 20; gBrthEffectHue = 0x844; gBrthEffectSound = 0x658; gBrthEffectItemID = 0x37BC; gBrthType = 24; } else if (Body == 313) // TREE { BaseSoundID = 442; gBrthPhys = 20; gBrthCold = 20; gBrthFire = 20; gBrthPois = 20; gBrthEngy = 20; gBrthEffectHue = 0x9C1; gBrthEffectSound = 0x653; gBrthEffectItemID = 0x37BC; gBrthType = 25; } else if (Body == 314) // SPHINX { BaseSoundID = 0x668; gBrthPhys = 50; gBrthCold = 50; gBrthFire = 0; gBrthPois = 0; gBrthEngy = 0; gBrthEffectHue = 0x96D; gBrthEffectSound = 0x654; gBrthEffectItemID = 0x36D4; gBrthType = 15; } else if (Body == 715) // WYRM { BaseSoundID = 362; gBrthPhys = 0; gBrthCold = 0; gBrthFire = 100; gBrthPois = 0; gBrthEngy = 0; gBrthEffectHue = 0; gBrthEffectSound = 0x227; gBrthEffectItemID = 0x36D4; gBrthType = 9; } else if (Body == 139) // DRAGON { BaseSoundID = 362; gBrthPhys = 0; gBrthCold = 100; gBrthFire = 0; gBrthPois = 0; gBrthEngy = 0; gBrthEffectHue = 0x481; gBrthEffectSound = 0x64F; gBrthEffectItemID = 0x36D4; gBrthType = 12; } else if (Body == 144) // NAGA { BaseSoundID = 644; gBrthPhys = 0; gBrthCold = 0; gBrthFire = 0; gBrthPois = 0; gBrthEngy = 100; gBrthEffectHue = 0x9C2; gBrthEffectSound = 0x665; gBrthEffectItemID = 0x3818; gBrthType = 13; } else if (Body == 754) // GOLEM { BaseSoundID = 268; gBrthPhys = 0; gBrthCold = 0; gBrthFire = 0; gBrthPois = 0; gBrthEngy = 100; gBrthEffectHue = 0x9C2; gBrthEffectSound = 0x665; gBrthEffectItemID = 0x3818; gBrthType = 14; } else if (Body == 753) // ELEMENTAL { BaseSoundID = 268; gBrthPhys = 50; gBrthCold = 0; gBrthFire = 0; gBrthPois = 0; gBrthEngy = 50; gBrthEffectHue = 0x9B7; gBrthEffectSound = 0x658; gBrthEffectItemID = 0; gBrthType = 33; } else if (Body == 287) // CERBERUS { BaseSoundID = 362; gBrthPhys = 0; gBrthCold = 0; gBrthFire = 100; gBrthPois = 0; gBrthEngy = 0; gBrthEffectHue = 0; gBrthEffectSound = 0x227; gBrthEffectItemID = 0x36D4; gBrthType = 9; } else if (Body == 319) // SPIDER { BaseSoundID = 0x388; gBrthPhys = 0; gBrthCold = 0; gBrthFire = 0; gBrthPois = 100; gBrthEngy = 0; gBrthEffectHue = 0x3F; gBrthEffectSound = 0x658; gBrthEffectItemID = 0x36D4; gBrthType = 10; } else if (Body == 772) // GIANT { BaseSoundID = 609; gBrthPhys = 50; gBrthCold = 0; gBrthFire = 0; gBrthPois = 0; gBrthEngy = 50; gBrthEffectHue = 0; gBrthEffectSound = 0x665; gBrthEffectItemID = 0x3818; gBrthType = 46; } SetStr(986, 1185); SetDex(177, 255); SetInt(1066, 1145); SetHits(592, 711); SetDamage(22, 29); SetDamageType(ResistanceType.Physical, 20); SetDamageType(ResistanceType.Fire, 20); SetDamageType(ResistanceType.Energy, 20); SetDamageType(ResistanceType.Poison, 20); SetDamageType(ResistanceType.Energy, 20); SetResistance(ResistanceType.Physical, 40, 60); SetResistance(ResistanceType.Fire, 40, 60); SetResistance(ResistanceType.Cold, 40, 60); SetResistance(ResistanceType.Poison, 40, 60); SetResistance(ResistanceType.Energy, 40, 60); SetSkill(SkillName.Anatomy, 90.1, 120.0); SetSkill(SkillName.EvalInt, 90.1, 120.0); SetSkill(SkillName.Magery, 90.1, 120.0); SetSkill(SkillName.Meditation, 90.1, 120.0); SetSkill(SkillName.MagicResist, 90.1, 120.0); SetSkill(SkillName.Tactics, 90.1, 120.0); SetSkill(SkillName.Wrestling, 90.1, 120.0); VirtualArmor = 90; MyServerSettings.AdditionalHitPoints(this, 4); }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is Mobile) { Mobile iArmor = targeted as Mobile; if (iArmor is BaseCreature) { BaseCreature xArmor = (BaseCreature)iArmor; if ((xArmor is Horse || xArmor is ZebraRiding) && xArmor.ControlMaster == from && xArmor is BaseMount) { BaseMount mArmor = (BaseMount)xArmor; if (MyServerSettings.ClientVersion()) { mArmor.Body = 587; mArmor.ItemID = 587; } else { mArmor.Body = 0xE2; mArmor.ItemID = 0x3EA0; } int mod = 5; if (xArmor.Hue == MaterialInfo.GetMaterialColor("dull copper", "classic", 0)) { mod = mod - 1; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("shadow iron", "classic", 0)) { mod = mod - 2; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("copper", "classic", 0)) { mod = mod - 3; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("bronze", "classic", 0)) { mod = mod - 4; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("gold", "classic", 0)) { mod = mod - 5; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("agapite", "classic", 0)) { mod = mod - 6; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("verite", "classic", 0)) { mod = mod - 7; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("valorite", "classic", 0)) { mod = mod - 8; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("nepturite", "classic", 0)) { mod = mod - 9; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("obsidian", "classic", 0)) { mod = mod - 10; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("steel", "classic", 0)) { mod = mod - 11; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("brass", "classic", 0)) { mod = mod - 12; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("mithril", "classic", 0)) { mod = mod - 13; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("xormite", "classic", 0)) { mod = mod - 14; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("dwarven", "classic", 0)) { mod = mod - 15; } else if (xArmor.Hue == MaterialInfo.GetMaterialColor("silver", "classic", 0)) { mod = mod - 0; } if (m_ArmorMaterial == "Dull Copper") { mod = mod + 1; xArmor.Hue = MaterialInfo.GetMaterialColor("dull copper", "classic", 0); } else if (m_ArmorMaterial == "Shadow Iron") { mod = mod + 2; xArmor.Hue = MaterialInfo.GetMaterialColor("shadow iron", "classic", 0); } else if (m_ArmorMaterial == "Copper") { mod = mod + 3; xArmor.Hue = MaterialInfo.GetMaterialColor("copper", "classic", 0); } else if (m_ArmorMaterial == "Bronze") { mod = mod + 4; xArmor.Hue = MaterialInfo.GetMaterialColor("bronze", "classic", 0); } else if (m_ArmorMaterial == "Gold") { mod = mod + 5; xArmor.Hue = MaterialInfo.GetMaterialColor("gold", "classic", 0); } else if (m_ArmorMaterial == "Agapite") { mod = mod + 6; xArmor.Hue = MaterialInfo.GetMaterialColor("agapite", "classic", 0); } else if (m_ArmorMaterial == "Verite") { mod = mod + 7; xArmor.Hue = MaterialInfo.GetMaterialColor("verite", "classic", 0); } else if (m_ArmorMaterial == "Valorite") { mod = mod + 8; xArmor.Hue = MaterialInfo.GetMaterialColor("valorite", "classic", 0); } else if (m_ArmorMaterial == "Nepturite") { mod = mod + 9; xArmor.Hue = MaterialInfo.GetMaterialColor("nepturite", "classic", 0); } else if (m_ArmorMaterial == "Obsidian") { mod = mod + 10; xArmor.Hue = MaterialInfo.GetMaterialColor("obsidian", "classic", 0); } else if (m_ArmorMaterial == "Steel") { mod = mod + 11; xArmor.Hue = MaterialInfo.GetMaterialColor("steel", "classic", 0); } else if (m_ArmorMaterial == "Brass") { mod = mod + 12; xArmor.Hue = MaterialInfo.GetMaterialColor("brass", "classic", 0); } else if (m_ArmorMaterial == "Mithril") { mod = mod + 13; xArmor.Hue = MaterialInfo.GetMaterialColor("mithril", "classic", 0); } else if (m_ArmorMaterial == "Xormite") { mod = mod + 14; xArmor.Hue = MaterialInfo.GetMaterialColor("xormite", "classic", 0); } else if (m_ArmorMaterial == "Dwarven") { mod = mod + 15; xArmor.Hue = MaterialInfo.GetMaterialColor("dwarven", "classic", 0); } else { mod = mod + 0; xArmor.Hue = MaterialInfo.GetMaterialColor("silver", "classic", 0); } xArmor.SetStr(xArmor.RawStr + mod); xArmor.SetDex(xArmor.RawDex + mod); xArmor.SetInt(xArmor.RawInt + mod); xArmor.SetHits(xArmor.HitsMax + mod); xArmor.SetDamage(xArmor.DamageMin + mod, xArmor.DamageMax + mod); xArmor.SetResistance(ResistanceType.Physical, xArmor.PhysicalResistance + mod); xArmor.SetSkill(SkillName.MagicResist, xArmor.Skills[SkillName.MagicResist].Base + mod); xArmor.SetSkill(SkillName.Tactics, xArmor.Skills[SkillName.Tactics].Base + mod); xArmor.SetSkill(SkillName.Wrestling, xArmor.Skills[SkillName.Wrestling].Base + mod); from.RevealingAction(); from.PlaySound(0x0AA); m_Horse.Consume(); } else { from.SendMessage("This armor is only for horses you own."); } } else { from.SendMessage("This armor is only for horses you own."); } } }
private static void World_Login(LoginEventArgs args) { Mobile m = args.Mobile; (( PlayerMobile )m).BankBox.MaxItems = 201; if (m.Hue >= 33770) { m.Hue = m.Hue - 32768; } CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); if (DB == null) { CharacterDatabase MyDB = new CharacterDatabase(); MyDB.CharacterOwner = m; m.BankBox.DropItem(MyDB); } CharacterDatabase DataBase = Server.Items.CharacterDatabase.GetDB(m); // LET US SET THEIR ORIGINAL COLORS FOR LATER USE if (DataBase.CharHue > 0) { if (DataBase.CharHue >= 33770) { DataBase.CharHue = DataBase.CharHue - 32768; } } else { DataBase.CharHue = m.Hue; DataBase.CharHairHue = m.HairHue; } if (!MyServerSettings.AllowCustomTitles()) { m.Title = null; } LoggingFunctions.LogAccess(m, "login"); if (m.Region.GetLogoutDelay(m) == TimeSpan.Zero && !m.Poisoned) { m.Hits = 1000; m.Stam = 1000; m.Mana = 1000; } // FULLY REST UP ON LOGIN if (m.FindItemOnLayer(Layer.Shoes) != null) { Item shoes = m.FindItemOnLayer(Layer.Shoes); if (shoes is BootsofHermes) { if (Server.Misc.MyServerSettings.NoMountsInCertainRegions() && Server.Mobiles.AnimalTrainer.IsNoMountRegion(m, Region.Find(m.Location, m.Map))) { m.Send(SpeedControl.Disable); shoes.Weight = 5.0; m.SendMessage("These boots seem to have their magic diminished here."); } else { m.Send(SpeedControl.MountSpeed); shoes.Weight = 3.0; } } } if (Server.Misc.MyServerSettings.NoMountsInCertainRegions() && Server.Mobiles.AnimalTrainer.IsNoMountRegion(m, Region.Find(m.Location, m.Map)) && !Server.Mobiles.AnimalTrainer.AllowMagicSpeed(m, Region.Find(m.Location, m.Map))) { m.Send(SpeedControl.Disable); Server.Spells.Mystic.WindRunner.RemoveEffect(m); Server.Spells.Syth.SythSpeed.RemoveEffect(m); Server.Spells.Jedi.Celerity.RemoveEffect(m); } }
public override void Open(Mobile from) { if (this.Weight > 10.0) { int nStolen = Utility.RandomMinMax(1, 3); if (nStolen == 1) { Item i = Loot.RandomArty(); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); } else if (nStolen == 2) { Item i = DungeonLoot.RandomSlayer(); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); } else if (nStolen < 5) { Item i = Loot.RandomSArty(); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); } else if (nStolen < 9) { Item i = Loot.RandomRelic(); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); } else { Item idropped = DungeonLoot.RandomRare(); if (idropped is OilLeather || idropped is OilMetal) { idropped.Amount = Utility.RandomMinMax(1, 8); } else if (idropped is MagicalDyes) { idropped.Amount = Utility.RandomMinMax(3, 10); } else if (idropped.Stackable == true) { idropped.Amount = Utility.RandomMinMax(5, 20); } DropItem(idropped); BaseContainer.DropItemFix(idropped, from, ItemID, GumpID); } int money = Utility.RandomMinMax(1000, 4000); double w = money * (MyServerSettings.GetGoldCutRate() * .01); money = (int)w; Item g = new Gold(money); DropItem(g); BaseContainer.DropItemFix(g, from, ItemID, GumpID); this.Weight = 10.0; } base.Open(from); }
public override void OnDoubleClick(Mobile e) { int pieces = 0; if (e.Backpack.FindItemByType(typeof(Dice4)) != null) { pieces++; } if (e.Backpack.FindItemByType(typeof(Dice6)) != null) { pieces++; } if (e.Backpack.FindItemByType(typeof(Dice8)) != null) { pieces++; } if (e.Backpack.FindItemByType(typeof(Dice10)) != null) { pieces++; } if (e.Backpack.FindItemByType(typeof(Dice12)) != null) { pieces++; } if (e.Backpack.FindItemByType(typeof(Dice20)) != null) { pieces++; } if (e.Backpack.FindItemByType(typeof(DungeonMastersGuide)) != null) { pieces++; } if (e.Backpack.FindItemByType(typeof(PlayersHandbook)) != null) { pieces++; } if (e.Backpack.FindItemByType(typeof(MonsterManual)) != null) { pieces++; } if (!IsChildOf(e.Backpack)) { e.SendMessage("This must be in your backpack to use."); return; } else if (e.Map == Map.Lodor && e.X >= 6261 && e.Y >= 40 && e.X <= 6279 && e.Y <= 60 && pieces > 8) { e.Backpack.FindItemByType(typeof(Dice4)).Delete(); e.Backpack.FindItemByType(typeof(Dice6)).Delete(); e.Backpack.FindItemByType(typeof(Dice8)).Delete(); e.Backpack.FindItemByType(typeof(Dice10)).Delete(); e.Backpack.FindItemByType(typeof(Dice12)).Delete(); e.Backpack.FindItemByType(typeof(Dice20)).Delete(); e.Backpack.FindItemByType(typeof(DungeonMastersGuide)).Delete(); e.Backpack.FindItemByType(typeof(PlayersHandbook)).Delete(); e.Backpack.FindItemByType(typeof(MonsterManual)).Delete(); StatueGygaxAddonDeed relic = new StatueGygaxAddonDeed(); MaterialInfo.ColorMetal(relic, 0); relic.RelicColor = relic.Hue; relic.Name = "Statue of Gygax"; relic.RelicGoldValue = Utility.RandomMinMax(120, 200) * 100; relic.RelicGoldValue = (int)(relic.RelicGoldValue * (MyServerSettings.GetGoldCutRate() * .01)); e.AddToBackpack(relic); CharacterDatabase.SetKeys(e, "Gygax", true); e.LocalOverheadMessage(MessageType.Emote, 1150, true, "You claim the Statue of Gygax!"); e.SendSound(0x3D); this.Delete(); } else { e.CloseGump(typeof(GygaxGump)); e.SendGump(new GygaxGump(e)); e.PlaySound(0x249); } }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is Gold) { int Coins = dropped.Amount; string sMessage = ""; if (Coins == 500) { if (from.Skills[SkillName.Inscribe].Value >= 30) { if (Server.Misc.Research.AlreadyHasBag(from)) { this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Good luck with your research.")); } else { ResearchBag bag = new ResearchBag(); from.PlaySound(0x2E6); Server.Misc.Research.SetupBag(from, bag); from.AddToBackpack(bag); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Good luck with your research.")); } dropped.Delete(); } else { sMessage = "You need to be a neophyte scribe before I sell that to you."; from.AddToBackpack(dropped); } } else if (Coins == 10000 || Coins == 9000 || Coins == 8000 || Coins == 7000 || Coins == 6000 || Coins == 5000 ) { int nAllowedForAnotherQuest = SearchPage.ArtifactQuestTimeNew(from); int nServerQuestTimeAllowed = MyServerSettings.GetTimeBetweenArtifactQuests(); int nWhenForAnotherQuest = nServerQuestTimeAllowed - nAllowedForAnotherQuest; if (nWhenForAnotherQuest > 0) { TimeSpan t = TimeSpan.FromMinutes(nWhenForAnotherQuest); string wait = string.Format("{0:D2} days {1:D2} hours and {2:D2} minutes", t.Days, t.Hours, t.Minutes); sMessage = "I have no artifact encyclopedias at the moment. Check back in " + wait + "."; from.AddToBackpack(dropped); } else { sMessage = "Good luck in your quest."; ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is SearchBook) { SearchBook searchbook = (SearchBook)item; if (searchbook.owner == from) { targets.Add(item); } } else if (item is SearchPage) { SearchPage searchpage = (SearchPage)item; if (searchpage.owner == from) { targets.Add(item); } } } for (int i = 0; i < targets.Count; ++i) { Item item = ( Item )targets[i]; item.Delete(); } from.AddToBackpack(new SearchBook(from, Coins)); dropped.Delete(); } } else { sMessage = "You look like you need this more than I do."; from.AddToBackpack(dropped); } this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, from.NetState); } return(base.OnDragDrop(from, dropped)); }
public static int QuestValue() { return((int)(400000 * (MyServerSettings.GetGoldCutRate() * .01))); }
public override void OnDoubleClick(Mobile from) { if (Server.Misc.MyServerSettings.NoMountsInCertainRegions() && Server.Mobiles.AnimalTrainer.IsNoMountRegion(from, from.Region)) { from.SendMessage("You cannot mount that while you are in this place."); } else if ((Server.Misc.MyServerSettings.NoMountBuilding() && Server.Misc.Worlds.InBuilding(from)) || (from.Region is HouseRegion && MyServerSettings.NoMountsInHouses())) { from.SendMessage("You cannot mount that while you are in here."); } else { if (this is NecroHorse) { m_RegularID = 0x2617; m_MountedID = 0x3EBB; } else if ((this.GetType()).IsAssignableFrom(typeof(SkeletalMount))) { m_RegularID = 0x2617; m_MountedID = 0x3EBB; } else if (this is DeathKnightWarhorse) { m_RegularID = 0x2617; m_MountedID = 0x3EBB; } else if (this is PaladinWarhorse) { m_RegularID = 0x4C59; m_MountedID = 0x3EBE; } else if (this is Warhorse) { Hue = 0; m_RegularID = 0x211F; m_MountedID = 0x3EA0; ItemID = 0x211F; if (Server.Misc.MyServerSettings.ClientVersion()) { m_RegularID = 0x55DC; m_MountedID = 594; ItemID = 0x55DC; } } else if (this is EtherealHorse) { m_RegularID = 0x20DD; m_MountedID = 0x3EA0; } else if (this is EtherealLlama) { m_RegularID = 0x20F6; m_MountedID = 0x3EA6; } else if (this is EtherealOstard) { m_RegularID = 0x2135; m_MountedID = 0x3EA3; } else if (this is EtherealRidgeback) { m_RegularID = 0x2615; m_MountedID = 0x3E92; } else if (this is EtherealUnicorn) { m_RegularID = 0x25CE; m_MountedID = 0x3EB4; } else if (this is EtherealBeetle) { m_RegularID = 0x260F; m_MountedID = 0x3E95; } else if (this is EtherealKirin) { m_RegularID = 0x25A0; m_MountedID = 0x3EAD; } else if (this is EtherealSwampDragon) { m_RegularID = 0x2619; m_MountedID = 0x3EBD; } else if (this is RideablePolarBear) { m_RegularID = 0x20E1; m_MountedID = 16069; } else if (this is EtherealCuSidhe) { m_RegularID = 0x2D96; m_MountedID = 0x3E91; } else if (this is EtherealHiryu) { m_RegularID = 0x276A; m_MountedID = 0x3E94; } else if (this is EtherealReptalon) { m_RegularID = 0x2d95; m_MountedID = 0x3E90; } else if (this is ChargerOfTheFallen) { m_RegularID = 0x0499; m_MountedID = 0x3EBA; } if (Validate(from)) { new EtherealSpell(this, from, from).Cast(); } } }