public InternalGump(Mobile mobile, StatCapScroll scroll) : base(25, 50) { m_Mobile = mobile; m_Scroll = scroll; AddPage(0); AddBackground(25, 10, 420, 200, 5054); AddImageTiled(33, 20, 401, 181, 2624); AddAlphaRegion(33, 20, 401, 181); AddHtmlLocalized(40, 48, 387, 100, 1049469, true, true); /* Using a scroll increases the maximum amount of a specific skill or your maximum statistics. * When used, the effect is not immediately seen without a gain of points with that skill or statistics. * You can view your maximum skill values in your skills window. * You can view your maximum statistic value in your statistics window. */ AddHtmlLocalized(125, 148, 200, 20, 1049478, 0xFFFFFF, false, false); // Do you wish to use this scroll? AddButton(100, 172, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(135, 172, 120, 20, 1046362, 0xFFFFFF, false, false); // Yes AddButton(275, 172, 4005, 4007, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(310, 172, 120, 20, 1046363, 0xFFFFFF, false, false); // No int value = scroll.m_Value; if (value == 230) { // Wonderous Scroll (+5 Maximum Stats): AddHtmlLocalized(40, 20, 260, 20, 1049458, 0xFFFFFF, false, false); } else if (value == 235) { // Exalted Scroll (+10 Maximum Stats): AddHtmlLocalized(40, 20, 260, 20, 1049459, 0xFFFFFF, false, false); } else if (value == 240) { // Mythical Scroll (+15 Maximum Stats): AddHtmlLocalized(40, 20, 260, 20, 1049460, 0xFFFFFF, false, false); } else if (value == 245) { // Legendary Scroll (+20 Maximum Stats): AddHtmlLocalized(40, 20, 260, 20, 1049461, 0xFFFFFF, false, false); } else if (value == 250) { // Ultimate Scroll (+25 Maximum Stats): AddHtmlLocalized(40, 20, 260, 20, 1049462, 0xFFFFFF, false, false); } else { AddHtml(40, 20, 260, 20, String.Format("<basefont color=#FFFFFF>Power Scroll ({0}{1} Maximum Stats):</basefont>", (value - 225) >= 0 ? "+" : "", value - 225), false, false); } AddHtmlLocalized(310, 20, 120, 20, 1038019, 0xFFFFFF, false, false); // Power }
private void Initialize(Mobile from, Item item) { if (m_ScrollType != ScrollType.None) { return; // sanity, should never happen } if (item is PowerScroll) { PowerScroll ps = item as PowerScroll; m_ScrollType = ScrollType.PowerScroll; m_Skill = ps.Skill; switch ((int)ps.Value) { default: case 105: m_Value = 5; m_Required = 8; break; case 110: m_Value = 10; m_Required = 12; break; case 115: m_Value = 15; m_Required = 10; break; } OnTargetPowerScroll(from, item); } else if (item is StatCapScroll) { StatCapScroll ss = item as StatCapScroll; m_ScrollType = ScrollType.StatsScroll; switch (ss.Value) { case 230: m_Value = 5; m_Required = 6; break; case 235: m_Value = 10; m_Required = 8; break; case 240: m_Value = 15; m_Required = 8; break; case 245: m_Value = 20; m_Required = 5; break; } OnTargetStatsScroll(from, item); } else if (item is ScrollOfTranscendence) { ScrollOfTranscendence sot = item as ScrollOfTranscendence; m_ScrollType = ScrollType.ScrollOfTranscendence; m_Skill = sot.Skill; m_Required = 20; OnTargetSoT(from, item); } }
private void OnTargetStatsScroll(Mobile from, Item item) { StatCapScroll ss = item as StatCapScroll; if (ss == null || (ss.Value - 225) != m_Value) { // This scroll does not match the type currently being bound. from.SendLocalizedMessage(1113143); } else { item.Delete(); Total++; CheckCompleted(from); } }
private bool VerifyScroll(Mobile from, Item scroll) { PowerScroll ps = scroll as PowerScroll; StatCapScroll ss = scroll as StatCapScroll; ScrollOfTranscendence sot = scroll as ScrollOfTranscendence; if (ps == null && ss == null && sot == null) { // You may only bind powerscrolls, stats scrolls or scrolls of transcendence. from.SendLocalizedMessage(1113142); return(false); } else if ((ps != null && ps.Value >= 120.0) || (ss != null && ss.Value >= 250) || (sot != null && sot.Value >= 5.0)) { // This scroll is already the highest of its type and cannot be bound. from.SendLocalizedMessage(1113144); return(false); } return(true); }
public InternalGump( Mobile mobile, StatCapScroll scroll ) : base(25, 50) { m_Mobile = mobile; m_Scroll = scroll; AddPage( 0 ); AddBackground( 25, 10, 420, 200, 5054 ); AddImageTiled( 33, 20, 401, 181, 2624 ); AddAlphaRegion( 33, 20, 401, 181 ); AddHtmlLocalized( 40, 48, 387, 100, 1049469, true, true ); /* Using a scroll increases the maximum amount of a specific skill or your maximum statistics. * When used, the effect is not immediately seen without a gain of points with that skill or statistics. * You can view your maximum skill values in your skills window. * You can view your maximum statistic value in your statistics window. */ AddHtmlLocalized( 125, 148, 200, 20, 1049478, 0xFFFFFF, false, false ); // Do you wish to use this scroll? AddButton( 100, 172, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 135, 172, 120, 20, 1046362, 0xFFFFFF, false, false ); // Yes AddButton( 275, 172, 4005, 4007, 0, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 310, 172, 120, 20, 1046363, 0xFFFFFF, false, false ); // No int value = scroll.m_Value; if ( value == 230 ) AddHtmlLocalized( 40, 20, 260, 20, 1049458, 0xFFFFFF, false, false ); // Wonderous Scroll (+5 Maximum Stats): else if ( value == 235 ) AddHtmlLocalized( 40, 20, 260, 20, 1049459, 0xFFFFFF, false, false ); // Exalted Scroll (+10 Maximum Stats): else if ( value == 240 ) AddHtmlLocalized( 40, 20, 260, 20, 1049460, 0xFFFFFF, false, false ); // Mythical Scroll (+15 Maximum Stats): else if ( value == 245 ) AddHtmlLocalized( 40, 20, 260, 20, 1049461, 0xFFFFFF, false, false ); // Legendary Scroll (+20 Maximum Stats): else if ( value == 250 ) AddHtmlLocalized( 40, 20, 260, 20, 1049462, 0xFFFFFF, false, false ); // Ultimate Scroll (+25 Maximum Stats): else AddHtml( 40, 20, 260, 20, String.Format( "<basefont color=#FFFFFF>Power Scroll ({0}{1} Maximum Stats):</basefont>", (value - 225) >= 0 ? "+" : "", value - 225), false, false ); AddHtmlLocalized( 310, 20, 120, 20, 1038019, 0xFFFFFF, false, false ); // Power }
private void GiveRewards(Mobile from, int jackpotindex) { Item item = null; switch (m_SlotTheme) { case SlotThemeType.GruesomeGambling: { switch (jackpotindex) { case 0: //Hooded Shroud of Shadows { Type t = typeof(HoodedShroudOfShadows); item = CreateItem(from, t, 10001); if (item == null) return; item.Name = "Hooded Shroud Of Shadows"; GiveItem(from, item); break; } default: break; } break; } case SlotThemeType.LadyLuck: { switch (jackpotindex) { case 0: //Lucky Necklace or Robe (50/50 chance for either) { if (Utility.Random(2) == 0) { Type t = typeof(GoldNecklace); item = CreateItem(from, t, 10002); if (item == null) return; item.Hue = 1150; item.LootType = LootType.Blessed; ((BaseJewel)item).Attributes.Luck = 200; item.Name = "Lucky Necklace"; GiveItem(from, item); } else { Type t = typeof(LadyLuckRobe); item = CreateItem(from, t, 10003); if (item == null) return; GiveItem(from, item); } break; } case 1: //Lucky Cloak { Type t = typeof(LadyLuckCloak); item = CreateItem(from, t, 10004); if (item == null) return; GiveItem(from, item); break; } case 2: //Lucky Sash { Type t = typeof(LadyLuckSash); item = CreateItem(from, t, 10005); if (item == null) return; GiveItem(from, item); break; } default: break; } break; } #if MINIHOUSES case SlotThemeType.MiniHouses: if (jackpotindex == 0) { if (!m_GiveReward) { from.SendMessage("Sorry, no ship model this time matey!"); break; } Type t = typeof(ShipModelOfTheHMSCape); item = CreateItem(from, t, 10009); if (item == null) return; NameAndHueModel(item); item.LootType = LootType.Blessed; GiveItem(from, item); } break; #endif case SlotThemeType.Pirates: if (jackpotindex == 0) { if (!m_GiveReward) { from.SendMessage("Sorry, no ship model this time matey!"); break; } Type t = typeof(ShipModelOfTheHMSCape); item = CreateItem(from, t, 10009); if (item == null) return; NameAndHueModel(item); item.LootType = LootType.Blessed; GiveItem(from, item); } break; case SlotThemeType.PowerScrolls: if (jackpotindex >= 0 && jackpotindex < 3) { item = CreatePowerScroll(m_Symbols[jackpotindex], 20 - (jackpotindex * 5)); if (item != null) GiveItem(from, item); } else if (jackpotindex == 8) { if (Utility.Random(100) == 45) { item = CreatePowerScroll(m_ReelThree, 5); if (item != null) { item.LootType = LootType.Blessed; GiveItem(from, item); } } } break; case SlotThemeType.StatScrolls: if (jackpotindex == 0) { int level; double random = Utility.RandomDouble(); if (0.1 >= random) level = 25; else if (0.25 >= random) level = 20; else if (0.45 >= random) level = 15; else if (0.70 >= random) level = 10; else level = 5; item = new StatCapScroll(225 + level); if (item != null) GiveItem(from, item); else SlotOffline(10010); } break; case SlotThemeType.TailorTreats: { if (jackpotindex >= 0 && jackpotindex <= 2) { if (!m_GiveReward) { from.SendMessage("Sorry, no Runic Kit on this Jackpot."); m_GiveReward = true; break; } try { item = CreateRunicKit(3 - jackpotindex); } catch { from.SendMessage("This slot machine has a problem!"); from.SendMessage("An error code has been recorded, page a GM for help."); if (jackpotindex == 0) SlotOffline(10006); // Set an ErrorCode else if (jackpotindex == 1) SlotOffline(10007); else SlotOffline(10008); return; } if (jackpotindex == 0) item.Name = "Barbed Leather Runic Sewing Kit"; else if (jackpotindex == 1) item.Name = "Horned Leather Runic Sewing Kit"; else item.Name = "Spined Leather Runic Sewing Kit"; GiveItem(from, item); } else if (jackpotindex == 6) { if (Utility.Random(100) == 45 || Utility.Random(100) == 13 || Utility.Random(100) == 6) { Type t = typeof(UncutCloth); item = CreateItem(from, t, 10005); if (item == null) return; item.Hue = Utility.RandomList(1150, 1151, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173); item.Name = "Special Cloth"; item.Amount = 10; from.PlaySound(1481); GiveItem(from, item); } } break; } default: break; } }
public void OnTarget(Mobile from, object targeted) { if (targeted is Item && !((Item)targeted).IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it. return; } switch (BinderType) { case BinderType.None: { if (targeted is PowerScroll) { PowerScroll ps = (PowerScroll)targeted; if (ps.Value >= 120) { from.SendLocalizedMessage(1113144); // This scroll is already the highest of its type and cannot be bound. return; } double value = ps.Value; int needed = 0; if (value == 105) { needed = 8; } else if (value == 110) { needed = 12; } else if (value == 115) { needed = 10; } else { return; } Value = value; Needed = needed; Has = 1; Skill = ps.Skill; BinderType = BinderType.PowerScroll; ps.Delete(); } else if (targeted is StatCapScroll) { StatCapScroll ss = (StatCapScroll)targeted; if (ss.Value >= 250) { from.SendLocalizedMessage(1113144); //This scroll is already the highest of its type and cannot be bound. return; } double value = ss.Value; int needed = 0; if (value == 230) { needed = 6; } else if (value == 235) { needed = 8; } else if (value == 240) { needed = 8; } else if (value == 245) { needed = 5; } else { return; } Value = value; Needed = needed; Has = 1; BinderType = BinderType.StatScroll; ss.Delete(); } else if (targeted is ScrollOfTranscendence) { ScrollOfTranscendence sot = (ScrollOfTranscendence)targeted; if (sot.Value >= 5.0) { from.SendLocalizedMessage(1113144); //This scroll is already the highest of its type and cannot be bound. return; } Skill = sot.Skill; BinderType = BinderType.SOT; Needed = 2; Has = sot.Value; sot.Delete(); } else { from.SendLocalizedMessage(1113142); // You may only bind powerscrolls, stats scrolls or scrolls of transcendence. } break; } case BinderType.PowerScroll: { if (targeted is PowerScroll) { PowerScroll ps = (PowerScroll)targeted; if (ps.Skill != Skill || ps.Value != Value) { from.SendLocalizedMessage(1113143); // This scroll does not match the type currently being bound. return; } Has++; if (Has >= Needed) { GiveItem(from, new PowerScroll(Skill, Value + 5)); from.SendLocalizedMessage(1113145); // You've completed your binding and received an upgraded version of your scroll! ps.Delete(); Delete(); } else { ps.Delete(); } } else if (targeted is ScrollBinderDeed) { ScrollBinderDeed sb = (ScrollBinderDeed)targeted; if (sb == this) { return; } if (sb.BinderType != BinderType || sb.Value != Value || sb.Skill != Skill) { from.SendLocalizedMessage(1113143); // This scroll does not match the type currently being bound. return; } Has += sb.Has; double rest = Has - Needed; if (Has >= Needed) { GiveItem(from, new PowerScroll(Skill, Value + 5)); from.SendLocalizedMessage(1113145); // You've completed your binding and received an upgraded version of your scroll! Delete(); } if (rest > 0) { sb.Has = rest; } else { sb.Delete(); } } break; } case BinderType.StatScroll: { if (targeted is StatCapScroll) { StatCapScroll ss = (StatCapScroll)targeted; if (ss.Value != Value) { from.SendLocalizedMessage(1113143); // This scroll does not match the type currently being bound. return; } Has++; if (Has >= Needed) { GiveItem(from, new StatCapScroll((int)Value + 5)); from.SendLocalizedMessage(1113145); // You've completed your binding and received an upgraded version of your scroll! ss.Delete(); Delete(); } else { ss.Delete(); } } else if (targeted is ScrollBinderDeed) { ScrollBinderDeed sb = (ScrollBinderDeed)targeted; if (sb == this) { return; } if (sb.BinderType != BinderType || sb.Value != Value) { from.SendLocalizedMessage(1113143); // This scroll does not match the type currently being bound. return; } Has += sb.Has; double rest = Has - Needed; if (Has >= Needed) { GiveItem(from, new StatCapScroll((int)Value + 5)); from.SendLocalizedMessage(1113145); // You've completed your binding and received an upgraded version of your scroll! Delete(); } if (rest > 0) { sb.Has = rest; } else { sb.Delete(); } } break; } case BinderType.SOT: { if (targeted is ScrollOfTranscendence) { ScrollOfTranscendence sot = (ScrollOfTranscendence)targeted; if (sot.Skill != Skill) { from.SendLocalizedMessage(1113143); // This scroll does not match the type currently being bound. return; } if (sot.Value >= 5.0) { from.SendLocalizedMessage(1113144); // This scroll is already the highest of its type and cannot be bound. return; } double newValue = sot.Value + Has; if (newValue > 2 && Needed == 2) { Needed = 5; } if (newValue == Needed) { GiveItem(from, new ScrollOfTranscendence(Skill, Needed)); from.SendLocalizedMessage(1113145); // You've completed your binding and received an upgraded version of your scroll! Delete(); } else if (newValue > Needed) { from.SendGump(new BinderWarningGump(newValue, this, sot, Needed)); } else { Has += sot.Value; sot.Delete(); } } else if (targeted is ScrollBinderDeed) { ScrollBinderDeed sb = (ScrollBinderDeed)targeted; if (sb == this) { return; } if (sb.BinderType != BinderType || sb.Skill != Skill) { from.SendLocalizedMessage(1113143); // This scroll does not match the type currently being bound. return; } double newValue = sb.Has + Has; if (newValue > 2 && Needed == 2) { Needed = 5; } Has = newValue; double rest = Has - Needed; if (Has >= Needed) { GiveItem(from, new ScrollOfTranscendence(Skill, Needed)); from.SendLocalizedMessage(1113145); // You've completed your binding and received an upgraded version of your scroll! Delete(); } if (rest > 0) { sb.Has = rest; } else { sb.Delete(); } } break; } } }
public void OnTarget(Mobile from, object targeted) { if (targeted is Item && !((Item)targeted).IsChildOf(from.Backpack)) { from.SendMessage("The scroll must be in your backpack to bind."); return; } switch (m_BinderType) { case BinderType.None: { if (targeted is PowerScroll) { PowerScroll ps = (PowerScroll)targeted; if (ps.Value >= 120) { from.SendLocalizedMessage(1113144); //This scroll is already the highest of its type and cannot be bound. } else { double value = ps.Value; int needed = 0; if (value == 105) { needed = 8; } else if (value == 110) { needed = 12; } else if (value == 115) { needed = 10; } else { return; } m_Value = value; m_Needed = needed; m_Has = 1; m_Skill = ps.Skill; m_BinderType = BinderType.PowerScroll; ps.Delete(); from.SendMessage("Binding Powerscroll."); from.PlaySound(0x249); } } else if (targeted is StatCapScroll) { StatCapScroll ps = (StatCapScroll)targeted; if (ps.Value >= 250) { from.SendLocalizedMessage(1113144); //This scroll is already the highest of its type and cannot be bound. } else { double value = ps.Value; int needed = 0; if (value == 230) { needed = 6; } else if (value == 235) { needed = 8; } else if (value == 240) { needed = 8; } else if (value == 245) { needed = 5; } else { return; } m_Value = value; m_Needed = needed; m_Has = 1; m_BinderType = BinderType.StatScroll; ps.Delete(); from.SendMessage("Binding Stat Scroll."); from.PlaySound(0x249); } } else if (targeted is ScrollofTranscendence) { ScrollofTranscendence sot = (ScrollofTranscendence)targeted; m_Skill = sot.Skill; m_BinderType = BinderType.SOT; m_Needed = 5; m_Has = sot.Value; sot.Delete(); from.SendLocalizedMessage(1113146); //Binding Scrolls of Transcendence from.PlaySound(0x249); } else { from.SendLocalizedMessage(1113142); //You may only bind powerscrolls, stats scrolls or scrolls of transcendence. } break; } case BinderType.PowerScroll: { if (targeted is PowerScroll) { PowerScroll ps = (PowerScroll)targeted; if (ps.Value == m_Value) { if (ps.Skill == m_Skill) { m_Has++; if (m_Has >= m_Needed) { GiveItem(from, new PowerScroll(m_Skill, m_Value + 5)); from.SendLocalizedMessage(1113145); //You've completed your binding and received an upgraded version of your scroll! ps.Delete(); Delete(); } else { ps.Delete(); from.PlaySound(0x249); from.SendMessage("Binding Powerscroll."); } } else { from.SendLocalizedMessage(1113143); //This scroll does not match the type currently being bound. } } else { from.SendLocalizedMessage(1113143); //This scroll does not match the type currently being bound. } } else { from.SendLocalizedMessage(1113143); //This scroll does not match the type currently being bound. } break; } case BinderType.StatScroll: { if (targeted is StatCapScroll) { StatCapScroll stat = (StatCapScroll)targeted; if (stat.Value == m_Value) { m_Has++; if (m_Has >= m_Needed) { GiveItem(from, new StatCapScroll((int)m_Value + 5)); from.SendLocalizedMessage(1113145); //You've completed your binding and received an upgraded version of your scroll! stat.Delete(); Delete(); } else { from.SendMessage("Binding Stat Scroll."); from.PlaySound(0x249); stat.Delete(); } } else { from.SendLocalizedMessage(1113143); //This scroll does not match the type currently being bound. } } else { from.SendLocalizedMessage(1113143); //This scroll does not match the type currently being bound. } break; } case BinderType.SOT: { if (targeted is ScrollofTranscendence) { ScrollofTranscendence sot = (ScrollofTranscendence)targeted; if (sot.Skill == m_Skill) { double newValue = sot.Value + m_Has; if (newValue == m_Needed) { GiveItem(from, new ScrollofTranscendence(m_Skill, m_Needed)); from.SendLocalizedMessage(1113145); //You've completed your binding and received an upgraded version of your scroll! Delete(); } else if (newValue > m_Needed) { from.SendGump(new BinderWarningGump(newValue, this, sot, m_Needed)); } else { m_Has += sot.Value; sot.Delete(); from.PlaySound(0x249); from.SendLocalizedMessage(1113146); //Binding Scrolls of Transcendence } } else { from.SendLocalizedMessage(1113143); //This scroll does not match the type currently being bound. } } else { from.SendLocalizedMessage(1113143); //This scroll does not match the type currently being bound. } break; } } InvalidateProperties(); }
public void CreateLoot() { int chance = Utility.Random( 100 ); Item m_Reward = null; if ( chance < 3 ) m_Reward = new NameChangeDeed(); else if ( chance < 33 ) m_Reward = new PowerScroll( PowerScroll.Skills[Utility.Random(PowerScroll.Skills.Count)], (100+(Utility.Random(3)+2)*5) ); else if ( chance < 50 ) m_Reward = new StatCapScroll( (225+(Utility.Random(2)+1)*5) ); else if ( chance < 55 ) m_Reward = new MagicSewingKit(); else if ( chance < 60 ) m_Reward = new ClothingBlessDeed(); else if ( chance < 70 ) m_Reward = new RunicSewingKit(CraftResource.BarbedLeather, ( Utility.Random( 2 ) + 3 ) ); else { int amount = Utility.RandomMinMax( 5, 10 )*10000; m_Reward = new BankCheck(amount); } PackItem( new CopperBar(Utility.Random( 2 ) + 2) ); if (m_Reward != null) { PackItem( m_Reward ); Timer m_TimerCursed = new CursedArtifactSystem.CursedTimer( m_Reward, 6 ); m_TimerCursed.Start(); } }
public void GivePowerScrolls( ArrayList toGive ) { if ( NoKillAwards ) return; for ( int i = 0; i < toGive.Count; i++ ) { Mobile m = (Mobile) toGive[i]; if ( !m.Alive && m.Corpse == null ) toGive.Remove( m ); } for ( int i = 0; i < 16; ++i ) { int level; double random = Utility.RandomDouble(); if ( 0.1 >= random ) level = 25; else if ( 0.25 >= random ) level = 20; else if ( 0.45 >= random ) level = 15; else if ( 0.70 >= random ) level = 10; else level = 5; Mobile m = (Mobile) toGive[i % toGive.Count]; StatCapScroll scs = new StatCapScroll( 225 + level ); m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power! if ( m.Alive ) { m.AddToBackpack( scs ); } else { Container corpse = m.Corpse; if ( corpse != null ) corpse.DropItem( scs ); } if ( m is PlayerMobile ) { PlayerMobile pm = (PlayerMobile) m; for ( int j = 0; j < pm.JusticeProtectors.Count; ++j ) { Mobile prot = (Mobile) pm.JusticeProtectors[j]; if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) ) continue; int chance = 0; switch ( VirtueHelper.GetLevel( prot, VirtueName.Justice ) ) { case VirtueLevel.Seeker: chance = 60; break; case VirtueLevel.Follower: chance = 80; break; case VirtueLevel.Knight: chance = 100; break; } if ( chance > Utility.Random( 100 ) ) { prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice! prot.AddToBackpack( new StatCapScroll( 225 + level ) ); } } } } }