Eraser Shroud üyesi avatar
Güle güle kullanın

using System;
using System.Collections;
using System.IO; 
using System.Net;
using System.Text;
using System.Diagnostics;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Menus;
using Server.Menus.Questions;
using Server.Accounting;
using Server.Multis;
using Server.Guilds;
using Server.Mobiles;
using Server.Misc;
using Server.Scripts.Commands;
using Server.Items;
using Server.Prompts;

namespace Server.Engines.Help
{
public class ContainedMenu : QuestionMenu
{
private Mobile m_From;

public ContainedMenu( Mobile from ) : base( "Yardim talebinizi zaten gondermissiniz, en kisa surede yardim edilecektir.", new string[]{ "Eski talebimi oldugu gibi birak!", "Yardim talebimi siradan kaldir!" } )
{
m_From = from;
}

public override void OnCancel( NetState state )
{
m_From.SendMessage(1153, "Yardım talebiniz değiştirilmedi.", 0x35, true ); // Yardım talebiniz değiştirilmedi.
}

public override void OnResponse( NetState state, int index )
{
if ( index == 0 )
{
m_From.SendMessage(1153, "Yardım talebiniz değiştirilmedi.", 0x35, true ); // Yardım talebiniz değiştirilmedi.
}
else if ( index == 1 )
{
PageEntry entry = PageQueue.GetEntry( m_From );

if ( entry != null && entry.Handler == null )
{
m_From.SendMessage(1153, "Yardım talebiniz sıradan kaldırıldı.", 0x35, true ); // Yardım talebiniz sıradan kaldırıldı.
PageQueue.Remove( entry );
}
else
{
m_From.SendMessage(1153, "Yardım talebiniz değiştirilmedi.", 0x35, true ); // Yardım talebiniz değiştirilmedi.
}
}
}
}

public class HelpGump : Gump
{
public static void Initialize()
{
EventSink.HelpRequest += new HelpRequestEventHandler( EventSink_HelpRequest );
}

private static void EventSink_HelpRequest( HelpRequestEventArgs e )
{
foreach ( Gump g in e.Mobile.NetState.Gumps )
{
if ( g is HelpGump )
return;
}

if ( !PageQueue.CheckAllowedToPage( e.Mobile ) )
return;

if ( PageQueue.Contains( e.Mobile ) )
e.Mobile.SendMenu( new ContainedMenu( e.Mobile ) );
else
e.Mobile.SendGump( new HelpGump( e.Mobile ) );
}

private static bool IsYoung( Mobile m )
{
if ( m is PlayerMobile )
return ((PlayerMobile)m).Young;

return false;
}

private static int NumberOfStaffs()
{
	
int staffCount = 0;
		
foreach (NetState net in NetState.Instances)
{
if (net != null && net.Mobile != null && net.Mobile.AccessLevel > AccessLevel.Player )
staffCount++;
}		
return staffCount;	
}

public static bool CheckCombat( Mobile m )
{
for ( int i = 0; i < m.Aggressed.Count; ++i )
{
AggressorInfo info = (AggressorInfo)m.Aggressed[i];

if ( DateTime.Now - info.LastCombatTime < TimeSpan.FromSeconds( 30.0 ) )
return true;
}

return false;
}

public HelpGump( Mobile from ) : base( 0, 0 )
{
from.CloseGump( typeof( HelpGump ) );

bool isYoung = IsYoung( from );

int pagecount = PageQueue.List.Count;

this.Closable	 =	true;
this.Disposable	 = 	true;
this.Dragable	 = 	true;
this.Resizable 	 =	false;
this.AddBackground(35, 54, 629, 414, 2620);
this.AddAlphaRegion(445, 120, 190, 124);
this.AddAlphaRegion(62, 120, 314, 288);
this.AddAlphaRegion(446, 259, 189, 148);
this.AddLabel(509, 139, 1152, @"Page gönder");
this.AddLabel(509, 180, 1152, @"Takılma (Stuck)");
this.AddLabel(512, 264, 1152, @"Komutlar");
this.AddLabel(452, 290, 30, @"[Bandageself");
this.AddLabel(452, 315, 30, @"[Haberler");
this.AddLabel(452, 338, 30, @"[Jailtime");
this.AddLabel(452, 363, 30, @"[Katıl");
this.AddLabel(452, 386, 30, @"[Küfür");
this.AddLabel(558, 290, 30, @"[Online");
this.AddLabel(558, 315, 30, @"[Crim");
this.AddLabel(558, 386, 30, @"Boş");
this.AddLabel(558, 338, 30, @"[Gc");
this.AddLabel(558, 363, 30, @"Boş");
this.AddHtml( 44, 61, 630, 26, "<basefont color=#FFFFFF><center><big> Yardım Sayfası</big</center></basefont>", (bool)false, (bool)false);
this.AddImage(70, 151, 1211);
this.AddLabel(130, 168, 1152, @"Online Sayısı");
this.AddLabel(130, 198, 1152, @"Item Sayısı");
this.AddLabel(130, 227, 1152, @"Mobile Sayısı");
this.AddLabel(231, 168, 1152, String.Format(": {0}", Server.Network.NetState.Instances.Count) );
this.AddLabel(231, 198, 1152, @": " + World.Items.Count);
this.AddLabel(231, 227, 1152, @": " + World.Mobiles.Count);
this.AddLabel(130, 276, 1152, @"Fc / Fcr Cap  :");
this.AddLabel(231, 276, 1152, @": 2/6");
this.AddLabel(130, 304, 1152, @"Lmc Cap");
this.AddLabel(130, 334, 1152, @"Damage Cap");
this.AddLabel(130, 364, 1152, @"Spell Damage");
this.AddLabel(231, 304, 1152, @": 40%");
this.AddLabel(231, 334, 1152, @": 100%");
this.AddLabel(231, 364, 1152, @": 20%");
this.AddLabel(130, 413, 1152, @"Bekleyen page sayısı: "+ pagecount.ToString());
this.AddLabel(452, 413, 1152, @"Online staff sayısı: " + NumberOfStaffs() );
//this.AddLabel(452, 413, 1152, @"Online staff sayısı: " + m.Name.ToString() );
//this.AddHtml( 588, 442, 92, 21, "<basefont color=#FFFFFF><center><big>Kleo</big</center></basefont>", (bool)false, (bool)false);
this.AddLabel(509, 221, 1152, @"Web site");
AddButton(461, 221, 4005, 4006, 3, GumpButtonType.Reply, 0 );

AddButton(461, 139, 4005, 4006, 1, GumpButtonType.Reply, 2 );

AddButton(461, 180, 4005, 4006, 2, GumpButtonType.Reply, 0 );


}

public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;

PageType type = (PageType)(-1);

switch ( info.ButtonID )
{
case 0: // Close/Cancel
{
from.SendMessage(38, "Yardım talebi penceresini kapattınız!", 0x35, true ); // Yardim Talebi Iptal Edildi.

break;
}
case 1: // General question
{
type = PageType.Question;
break;
}
case 2: // Stuck
{
BaseHouse house = BaseHouse.FindHouseAt( from );

if ( house != null && house.IsAosRules )
{
from.Location = house.BanLocation;
}
else if ( from.Region is Server.Regions.Jail )
{
from.SendMessage(38, "Hapiste olduğunuz için stuck hakkınızı kullanamazsınız!", 0x35, true ); // You'll need a better jailbreak plan then that!
}
else if ( Factions.Sigil.ExistsOn( from ) )
{
from.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
}
else if ( from.CanUseStuckMenu() && from.Region.CanUseStuckMenu( from ) && !CheckCombat( from ) && !from.Frozen && !from.Criminal && (Core.AOS || from.Kills < 5) )
{
StuckMenu menu = new StuckMenu( from, from, true );

menu.BeginClose();

from.SendGump( menu );
}
else
{
type = PageType.Stuck;
}

break;
}
case 3: // Report bug or contact Origin
{

from.LaunchBrowser( "https://www.websiteniz.com" ); 
break;
}
case 4: // Game suggestion
{
type = PageType.Suggestion;
break;
}
case 5: // Account management
{
type = PageType.Account;
break;
}
case 6: // Other
{
type = PageType.Other;
break;
}
case 7: // Harassment: verbal/exploit
{
type = PageType.VerbalHarassment;
break;
}
case 8: // Harassment: physical
{
type = PageType.PhysicalHarassment;
break;
}
case 9: // Young player transport
{
if ( IsYoung( from ) )
{
if ( from.Region is Regions.Jail )
{
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
}
else if ( from.Region.Name == "Haven" )
{
from.SendLocalizedMessage( 1041529 ); // You're already in Haven
}
else
{
from.MoveToWorld( new Point3D( 3618, 2587, 0 ), Map.Trammel );
}
}

break;
}
}

if ( type != (PageType)(-1) && PageQueue.CheckAllowedToPage( from ) )
from.SendGump( new PagePromptGump( from, type ) );
}
}
}

Resim



Scripti alan kardaşlardan ricam Sağınısa soluna ismisinizi yazmayın ve buradan alan kişilerinde emeğe saygılı olmasını istiyorum

Bu konu Eraser Shroud tarafından düzenlendi(2010-06-03 22:16, 15 yıl önce)
NaPsTeR_WHaT üyesi avatar
Teşekkürler.
Eraser Shroud üyesi avatar
Güle Güle kullanın. Zamanım olsa farklı scriptlerde paylaşırım

Üye Ol veya Giriş Yap

Bu forum başlığına mesaj atmak istiyorsanız hemen üye olun veya giriş yapın.

Benzer Konular