public override void OnCancel( Network.NetState state ) { if ( GuildMenu.BadLeader( m_Mobile, m_Guild ) ) return; m_Mobile.SendMenu( new GuildmasterMenu( m_Mobile, m_Guild ) ); }
public override void OnResponse( Network.NetState state, int index ) { if ( GuildMenu.BadLeader( m_Mobile, m_Guild ) ) return; switch ( index ) { case 0: //toggle protection { m_Mobile.SendMenu( new ConfirmToggle( m_Mobile, m_Guild, !m_Guild.IsProtected( m_Guild.Leader ) ) ); break; } case 1: //set house sign m_Mobile.SendMenu( new HouseSignMenu( m_Mobile, m_Guild ) ); break; case 2: //grant protection if ( m_Guild.IsProtected( m_Guild.Leader ) ) { List<Mobile> list = new List<Mobile>( m_Guild.Members ); list.Remove( m_Guild.Leader ); m_Mobile.SendMenu( new GrantProtectionMenu( m_Mobile, m_Guild, list, 0 ) ); } else { m_Mobile.SendAsciiMessage( "You must enable guild protection first." ); m_Mobile.SendMenu( new GuildProtectionMenu( m_Mobile, m_Guild ) ); } break; case 3: //revoke protection if ( m_Guild.IsProtected( m_Guild.Leader ) ) { List<Mobile> list = new List<Mobile>( m_Guild.Protected ); list.Remove( m_Guild.Leader ); m_Mobile.SendMenu( new RevokeProtectionMenu( m_Mobile, m_Guild, list, 0 ) ); } else { m_Mobile.SendAsciiMessage( "You must enable guild protection first." ); m_Mobile.SendMenu( new GuildProtectionMenu( m_Mobile, m_Guild ) ); } break; case 4: //return to main menu default: m_Mobile.SendMenu( new GuildmasterMenu( m_Mobile, m_Guild ) ); break; } }
public override void OnResponse( Network.NetState state, int index ) { if ( GuildMenu.BadLeader( m_Mobile, m_Guild ) ) return; if ( index == 0 ) //yes { if ( TurnOn ) { Container bank = m_Mobile.FindBankNoCreate(); // Add guild leader as protected if ( !m_Guild.AddProtection( m_Mobile ) ) { m_Mobile.SendAsciiMessage("You already have guild protection on another character."); return; } if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 10000 ) ) { m_Guild.LastProtectionPayment = DateTime.Now; } else { m_Guild.RemoveProtection( m_Mobile ); m_Mobile.SendAsciiMessage( "You lack the required funds in your bank account to enable protection." ); } } else { m_Guild.ClearAllProtection(); } m_Mobile.SendMenu( new GuildProtectionMenu( m_Mobile, m_Guild ) ); } else //no { m_Mobile.SendMenu( new GuildProtectionMenu( m_Mobile, m_Guild ) ); } }
public override void OnResponse(Network.NetState sender, RelayInfo info) { if( m_Box == null || m_Box.Deleted || info.ButtonID == 0 ) return; Mobile from = sender.Mobile; int curritem = 1; foreach( SeedInfo si in m_Box.UnknownStorage ) { foreach( SeedHue sh in si.Hues ) { if( info.ButtonID == curritem ) { if( AddToPack( from, si.Type, sh.Hue, false ) ) { sh.Amount--; m_Box.Stored--; if( sh.Amount < 1 ) si.Hues.Remove( sh ); if( si.Hues.Count < 1 ) m_Box.UnknownStorage.Remove( si ); } //from.SendGump( new SeedBoxGump( from, m_Box ) ); return; } curritem++; } } foreach( SeedInfo si in m_Box.KnownStorage ) { foreach( SeedHue sh in si.Hues ) { if( info.ButtonID == curritem ) { if( AddToPack( from, si.Type, sh.Hue, true ) ) { sh.Amount--; m_Box.Stored--; if( sh.Amount < 1 ) si.Hues.Remove( sh ); if( si.Hues.Count < 1 ) m_Box.KnownStorage.Remove( si ); } from.SendGump( new SeedBoxGump(m_Box ) ); return; } curritem++; } } from.SendLocalizedMessage( 500065 ); // Object not found }