public BinderWarningGump(double value, ScrollBinderDeed binder, ScrollOfTranscendence scroll, int needed) : base(340, 340) { TypeID = 0x236C; m_Value = value; m_Needed = needed; m_Scroll = scroll; m_Binder = binder; AddPage(0); AddBackground(0, 0, 291, 99, 0x13BE); AddImageTiled(5, 6, 280, 20, 0xA40); AddHtmlLocalized(9, 8, 280, 20, 1113146, 0x7FFF, false, false); // Binding Scrolls of Transcendence AddImageTiled(5, 31, 280, 40, 0xA40); AddHtmlLocalized(9, 35, 272, 40, 1113147, 0x7FFF, false, false); // Binding this SoT will exceed the cap of 5, some points will be lost. Proceed? AddButton(215, 73, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(250, 75, 65, 20, 1006044, 0x7FFF, false, false); // OK AddButton(5, 73, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(40, 75, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL }
public BinderWarningGump(double value, ScrollBinderDeed binder, ScrollofTranscendence scroll, int needed) { m_Value = value; m_Needed = needed; m_Scroll = scroll; m_Binder = binder; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////INITIALIZEEVENT--INITIALIZEEVENT--///////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////STARTPVPENVENT - STARTPVPEVENT/////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Starts the PvP Event /// </summary> public void StartPvP() { if (!Running) { Running = true; AcceptingPlayers = true; LastEvent = DateTime.UtcNow; BCastTimer = new BroadcastTimer(this, TimeSpan.FromSeconds(BroadCastTickDelay), TimeSpan.FromSeconds(BroadCastTickDelay)); BCastTimer.Start(); string text = "A Bridge Event is starting up. Type [joinbridge To Join."; World.Broadcast(m_BroadcastHue, true, String.Format("{0}", text)); switch (Utility.Random(4)) { case 0: // Wooden Chest SunriseScroll Scroll = new SunriseScroll(); Scroll.MoveToWorld(new Point3D(6952, 2121, 5), Map.Felucca); // <-------Place the reward on the other platform break; case 1: // Metal Chest BankBell Bell = new BankBell(); Bell.MoveToWorld(new Point3D(6952, 2121, 5), Map.Felucca); // <-------Place the reward on the other platform break; case 2: // Metal Golden Chest SunriseScroll Scrolls = new SunriseScroll(); Scrolls.MoveToWorld(new Point3D(6952, 2121, 5), Map.Felucca); // <-------Place the reward on the other platform break; case 3: // Keg ScrollBinderDeed Scroll2 = new ScrollBinderDeed(); Scroll2.MoveToWorld(new Point3D(6952, 2121, 5), Map.Felucca); // <-------Place the reward on the other platform break; } } }
public InternalTarget(ScrollBinderDeed binder) : base(-1, false, TargetFlags.None) { m_Binder = binder; }
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 ScrollBinderTarget(ScrollBinderDeed deed) : base(1, false, TargetFlags.None) { m_Deed = deed; }