public override void OnResponse(NetState state, RelayInfo info)
{
int cat = info.ButtonID;
switch (cat)
{
case 0:
return;
case 1:
{
GuildGump.EnsureClosed(m_Mobile);
m_Mobile.SendGump(new ViewGuildRosterGump(m_Mobile, m_ThierGuild));
return;
}
case 2:
{
if (m_Guild == null)
{
m_Mobile.SendMessage("You are not in a guild");
}
else if (m_ThierGuild == null)
{
m_Mobile.SendMessage("You have selected an invalid guild");
}
else if (m_Guild == m_ThierGuild)
{
m_Mobile.SendMessage("You cannot declare war with your own guild");
}
else if (m_Guild.Leader != m_Mobile)
{
m_Mobile.SendMessage("You are not the leader of this guild");
}
else if ((m_Guild.WarInvitations.Contains(m_ThierGuild) && m_ThierGuild.WarDeclarations.Contains(m_Guild)) || m_Guild.IsWar(m_ThierGuild))
{
m_Mobile.SendMessage("You are already at war with that guild.");
}
else
{
if (!m_Guild.WarDeclarations.Contains(m_ThierGuild))
{
m_Guild.WarDeclarations.Add(m_ThierGuild);
m_Guild.GuildMessage(1018019, true, "{0} ({1})", m_ThierGuild.Name, m_ThierGuild.Abbreviation); // Guild Message: Your guild has sent an invitation for war:
}
if (!m_ThierGuild.WarInvitations.Contains(m_Guild))
{
m_ThierGuild.WarInvitations.Add(m_Guild);
m_ThierGuild.GuildMessage(1018021, true, "{0} ({1})", m_Guild.Name, m_Guild.Abbreviation); // Guild Message: Your guild has received an invitation to war:
}
}
break;
}
}
m_Mobile.SendGump(new GuildWarInfoGump(m_Mobile, m_Guild));
}