//Scirpt By Lord Streamline
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
namespace Server.Gumps
{
public class RarelerGump : Gump
{
public static void Initialize()
{
Server.Commands.Register("Rareler", AccessLevel.Player, new CommandEventHandler(Rareler_OnCommand));
}
[Usage("Rareler")]
[Description("Kullanildiginda sunucudaki rare binekler hakkında bilgi verir.")]
public static void Rareler_OnCommand(CommandEventArgs e)
{
e.Mobile.CloseGump(typeof(RarelerGump));
e.Mobile.SendGump(new RarelerGump());
}
ArrayList a_FireSteed = new ArrayList();
ArrayList a_Unicorn = new ArrayList();
ArrayList a_SilverSteed = new ArrayList();
ArrayList a_Kirin = new ArrayList();
ArrayList a_Nightmare = new ArrayList();
//ArrayList a_FireBeetle = new ArrayList();
public RarelerGump()
: base(0, 0)
{
foreach (Mobile m in World.Mobiles.Values)
{
if (m is BaseCreature)
{
BaseCreature bc = m as BaseCreature;
if (bc is FireSteed && bc.ControlMaster != null && bc.Controled)
a_FireSteed.Add(bc);
if (bc is Unicorn && bc.ControlMaster != null && bc.Controled)
a_Unicorn.Add(bc);
if (bc is SilverSteed && bc.ControlMaster != null && bc.Controled)
a_SilverSteed.Add(bc);
if (bc is Kirin && bc.ControlMaster != null && bc.Controled)
a_Kirin.Add(bc);
if (bc is Nightmare && bc.ControlMaster != null && bc.Controled)
a_Nightmare.Add(bc);
//if (bc is FireBeetle && bc.ControlMaster != null && bc.Controled)
//a_FireBeetle.Add(bc);
}
}
this.Closable = true;
this.Disposable = true;
this.Dragable = true;
this.Resizable = false;
this.AddPage(0);
this.AddBackground(167, 77, 325, 423, 9270);
this.AddImageTiled(178, 87, 303, 403, 2702);
this.AddHtml(233, 97, 200, 21, @"<basefont color=#FFFFFF><center><big>HayaletUo </big></center></basefont>", (bool)false, (bool)false);
this.AddPage(1);
this.AddItem(193, 141, 8689);
this.AddButton(243, 152, 2117, 2118, 601, GumpButtonType.Page, 2);
this.AddLabel(263, 149, 62, @"Fire Steed [" + a_FireSteed.Count + "]");
this.AddItem(198, 194, 9678);
this.AddButton(243, 207, 2117, 2118, 602, GumpButtonType.Page, 100);
this.AddLabel(263, 204, 62, @"Unicorn [" + a_Unicorn.Count + "]");
this.AddItem(192, 257, 8480, 1154);
this.AddButton(243, 265, 2117, 2118, 603, GumpButtonType.Page, 200);
this.AddLabel(263, 262, 62, @"Silver Steed [" + a_SilverSteed.Count + "]");
this.AddItem(181, 311, 9632);
this.AddButton(243, 323, 2117, 2118, 604, GumpButtonType.Page, 300);
this.AddLabel(263, 320, 62, @"Kirin [" + a_Kirin.Count + "]");
this.AddItem(192, 373, 8481, 1108);
this.AddButton(243, 379, 2117, 2118, 605, GumpButtonType.Page, 400);
this.AddLabel(263, 377, 62, @"Nightmare [" + a_Nightmare.Count + "]");
//this.AddItem(189, 433, 10268);
//this.AddButton(243, 438, 2117, 2118, 606, GumpButtonType.Page, 500);
//this.AddLabel(263, 435, 62, @"Fire Beetle [" + a_FireBeetle.Count + "]");
this.AddPage(2);
Print(2, a_FireSteed, 8689, 0, "Fire Steed");
this.AddPage(100);
Print(100, a_Unicorn, 9678, 0, "Unicorn");
this.AddPage(200);
Print(200, a_SilverSteed, 8480, 1154, "Silver Steed");
this.AddPage(300);
Print(300, a_Kirin, 9632, 0, "Kirin");
this.AddPage(400);
Print(400, a_Nightmare, 8481, 1108, "Nightmare");
//this.AddPage(500);
//Print(500, a_FireBeetle, 10268, 0, "Fire Beetle");
}
public enum Buttons
{
}
public override void OnResponse(NetState sender, RelayInfo info)
{
}
public void Print(int i_PageNo, ArrayList a_List, int i_AvatarID, int i_AvatarHue, string s_Name)
{
this.AddItem(206, 137, i_AvatarID, i_AvatarHue);
this.AddLabel(198, 185, 62, s_Name + @" Sahipleri");
for (int i = 0; i < a_List.Count; ++i)
{
if ((i % 10) == 0)
{
if (i != 0)
this.AddButton(335, 463, 5601, 5605, 0, GumpButtonType.Page, (i / 10) + i_PageNo);
AddPage((i / 10) + i_PageNo);
this.AddItem(206, 137, i_AvatarID, i_AvatarHue);
this.AddLabel(198, 185, 62, s_Name + @" Sahipleri");
if (i != 0)
this.AddButton(318, 463, 5603, 5607, 0, GumpButtonType.Page, (i / 10) + (i_PageNo - 1));
}
BaseCreature bc = (BaseCreature)a_List[i];
string name;
if ((name = bc.ControlMaster.Name) != null && (name = name.Trim()).Length <= 0)
name = "(empty)";
this.AddLabel(241, 213 + ((i % 10) * 25), 37, (i + 1) + ". " + name);
}
}
}
}