public PoisoningPickBottleGump( PoisoningCraftState craftstate ) : base(0, 0) { m_CraftState = craftstate; this.Closable=true; this.Disposable=false; this.Dragable=true; this.Resizable=false; this.AddPage(0); this.AddBackground(80, 33, 264, 246, 9200); int[] x = { 94, 102, 114 }; // background, bottle, button int[] y = { 43, 79, 96 }; for ( int i = 0; i < Bottles.Length; i++ ) { this.AddBackground(x[0], y[0], 53, 57, 5120); this.AddItem( x[0], y[0], Bottles[i] ); this.AddButton(x[2], y[2], 2117, 2118, i+10, GumpButtonType.Reply, 0); x[0]+=60; x[1]+=60; x[2]+=60; if ( ((i+1) % 4) == 0 ) // new line { x[0]=94; x[1]=102; x[2]=114; y[0]+=75; y[1]+=75; y[2]+=75; } } }
public PoisoningGump( PoisoningCraftState craftstate ) : base(0, 0) { m_CraftState = craftstate; this.Closable=true; this.Disposable=false; this.Dragable=true; this.Resizable=false; this.AddPage(0); this.AddBackground(453, 38, 203, 324, 2620); this.AddBackground(453, 38, 203, 44, 2620); this.AddBackground(50, 33, 416, 367, 9270); this.AddHtml( 63, 336, 392, 52, m_CraftState.LastMessage, (bool)true, (bool)false); this.AddLabel(234, 46, 59, "Poisoning"); this.AddHtml( 473, 88, 175, 261, m_CraftState.HTMLEffects(), (bool)false, (bool)false); this.AddLabel(523, 51, 56, "Toxin Effects"); this.AddImage(411, 11, 1417, 2720); int[] x = new int[]{ 87, 92 }; // button, ingredient int[] y = new int[]{ 80, 89 }; for ( int i = 0; i<10; i++ ) { this.AddButton(x[0], y[0], 9800, 9800, 500+i, GumpButtonType.Reply, 0); if ( m_CraftState.GumpComponents[i].Graphic > 0 ) this.AddItem(x[1], y[1], m_CraftState.GumpComponents[i].Graphic, m_CraftState.GumpComponents[i].Hue); x[0]+=60; x[1]+=60; if ( ((i+1) % 5) == 0 ) // new line { x[0] = 87; x[1] = 92; y[0]+=60; y[1]+=60; } } this.AddLabel(97, 261, 55, "Choose bottle type"); this.AddButton(78, 263, 2117, 2118, (int)Buttons.ChooseBottle, GumpButtonType.Reply, 0); this.AddLabel(97, 281, 55, "Read Recipe"); this.AddButton(78, 283, 2117, 2118, (int)Buttons.ReadRecipe, GumpButtonType.Reply, 0); this.AddLabel(327, 261, 55, "Attempt craft"); this.AddButton(308, 263, 2117, 2118, (int)Buttons.AttemptCraft, GumpButtonType.Reply, 0); this.AddLabel(327, 281, 55, "Write Recipe"); this.AddButton(308, 283, 2117, 2118, (int)Buttons.WriteRecipe, GumpButtonType.Reply, 0); this.AddLabel(198, 309, 70, "Success chance: " + (int)(100*m_CraftState.CraftChance()) + "%"); this.AddItem(436, 37, m_CraftState.BottleID); this.AddImage(92, 89, 3982); this.AddLabel(77, 214, 55, "Toxin name:"); this.AddImage(152, 212, 1141); this.AddTextEntry(163, 214, 251, 14, 0, (int)Buttons.ToxinName, m_CraftState.Name); this.AddImageTiled(60, 200, 396, 3, 96); }
public PickIngredientTarget( PoisoningCraftState craftstate, int index ) : base(15, false, TargetFlags.None) { m_CraftState = craftstate; m_Index = index; }
public PickFormulaWriteTarget( PoisoningCraftState craftstate ) : base(15, false, TargetFlags.None) { m_CraftState = craftstate; }
protected override void OnTarget( Mobile from, object targ ) { PoisoningCraftState newState = new PoisoningCraftState( from, m_CraftState.Tool ); if ( targ is BaseRecipe ) { if ( newState.ReadRecipe( targ as BaseRecipe ) ) from.SendGump( new PoisoningGump( newState ) ); else { m_CraftState.LastMessage = newState.LastMessage; from.SendGump( new PoisoningGump( m_CraftState ) ); } } else { from.SendMessage( "That's not a valid recipe." ); from.SendGump( new PoisoningGump( m_CraftState ) ); } }