21.YILTürkiye'nin en eski ve aktif online oyun platformu, Ultima Online, Counter-Strike ve diğer online oyunlar hakkında Türkçe haber, bilgi ve forum sunuyor. Türkiye'nin en eski ve aktif online oyun platformu, Ultima Online, Counter-Strike ve diğer online oyunlar hakkında Türkçe haber, bilgi ve forum sunuyor.
  • ANASAYFA
  • ULTIMA ONLINE
  • FORUM
  • DOKÜMAN
  • İNDİR
   Üye ol    Giriş
473
43
  1. Anasayfa
  2. UO Scriptleri
  3. RunUO Scripts
  4. Gumps
  5. Custom MoonGate

Custom MoonGate

  • 2006-05-02 21:54
  • 0 Yorumlar
  • 1859 Görüntüleme
using System; 
using System.Collections;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Network;

namespace Server.Items
{
public class CustomMoongate : Item
{
private AccessLevel m_AccessLevel = (AccessLevel)3;//4 = Admin, 3 = Seer, 2 = Gm etc

private ArrayList m_Destinations = new ArrayList();
private ArrayList m_DestX = new ArrayList();
private ArrayList m_DestY = new ArrayList();
private ArrayList m_DestZ = new ArrayList();
private ArrayList m_DestMaps = new ArrayList();

[Constructable]
public CustomMoongate() : base( 3948 )//moongate
{
Movable = false;
Light = LightType.Circle225;
}

public CustomMoongate( Serial serial ) : base( serial )
{
}

public override bool OnMoveOver( Mobile m )
{
if ( m_Destinations.Count > 0 )
{
m.SendGump( new CustomMoongateGump( m, this,false ));
}
else
{
m.SendMessage("The moongate doesn't appear to go anywhere...");
if ( m.AccessLevel >= m_AccessLevel )
m.SendMessage("Double-Click this to configure it");
}
return true;
}

public override void OnDoubleClick( Mobile from )
{
if ( from.AccessLevel >= m_AccessLevel )
from.SendGump(new CustomMoongateGump(from, this,true));
else
{
if ( m_Destinations.Count > 0 )
{
if ( Utility.InRange( this.Location, from.Location, 1 ) )
from.SendGump( new CustomMoongateGump( from, this, false ));
else
from.SendMessage("That is too far away");
}
else
from.SendMessage("The moongate doesn't appear to go anywhere...");
}
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

writer.Write( (int) 0 ); // version

writer.Write( (int)m_Destinations.Count );
for ( int i = 0; i < m_Destinations.Count; ++i )
{
writer.Write( (string)m_Destinations[i] );
writer.Write( (int)m_DestX[i] );
writer.Write( (int)m_DestY[i] );
writer.Write( (int)m_DestZ[i] );
writer.Write( (int)m_DestMaps[i] );
}
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );

int version = reader.ReadInt();
switch ( version )
{
case 0:
{
int count = reader.ReadInt();
for ( int i = 0; i < count; ++i )
{
m_Destinations.Add( reader.ReadString() );
m_DestX.Add( reader.ReadInt() );
m_DestY.Add( reader.ReadInt() );
m_DestZ.Add( reader.ReadInt() );
m_DestMaps.Add( reader.ReadInt() );
}
break;
}
}
}

private class CustomMoongateGump : Gump
{
private CustomMoongate m_Gate;
private bool EditMode;
public void AddTextField( int x, int y, int width, int height, int index )
{
AddBackground( x - 2, y - 2, width + 4, height + 4, 0x2486 );
AddTextEntry( x + 2, y + 2, width - 4, height - 4, 0, index, "" );
}

public CustomMoongateGump( Mobile from, CustomMoongate gate, bool editmode ) : base( 100,50 )
{
EditMode = editmode;
from.CloseGump( typeof( CustomMoongateGump ) );
PlayerMobile pm = from as PlayerMobile;
m_Gate = gate;
int width = 248;
if ( EditMode == true )
width = 435;
else
Effects.PlaySound( from.Location, from.Map, 0x20E );
int height = 224;
if ( m_Gate.m_Destinations.Count > 3 )
height = ((m_Gate.m_Destinations.Count*32)+95);//350;//Varies for no. Entries
AddBackground( 0, 0, width, height, 2600 );
if ( EditMode == true )
AddLabel( (width/2)-128, 16, 33, "Nokta Ekleme Modu" );
else
AddLabel( (width/2)-80, 16, 33, "Gideceğiniz yeri seçin" );
AddPage( 1 );

if ( EditMode == true )
{
AddButton( 128, 48, 4029, 4031, 11, GumpButtonType.Reply, 0 );// Add Destination
AddLabel(160, 48, 33, "Yeni Gidilecek Noktayı Ekle" );
AddTextField( 128, 96, 150, 20, 1 );
AddLabel(128, 72, 33, "Mapin Adı" );
AddTextField( 128, 144, 150, 20, 0 );
AddLabel(128, 120, 33, "Noktanın Adı" );
AddTextField( 148, 168, 80, 20, 2 );
AddLabel(128, 168, 33, "X" );
AddTextField( 248, 168, 80, 20, 3 );
AddLabel(228, 168, 33, "Y" );
AddTextField( 348, 168, 60, 20, 4 );
AddLabel(328, 168, 33, "Z" );
}

for ( int i = 0; i < m_Gate.m_Destinations.Count; ++i )
{
AddLabel( 48, (32*i)+40, 33, (string)m_Gate.m_Destinations[i] );
if ( EditMode == true )
AddButton( 16, (32*i)+40, 4017, 4019, i+12, GumpButtonType.Reply, 0 );//Del Destination
else
AddButton( 16, (32*i)+40, 4005, 4007, i+1, GumpButtonType.Reply, 0 );//Teleport
}

AddPage( 0 );
}

public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
string name = "";
Point3D dest = new Point3D( 0, 0, 0 );
string map = "";
int m_Map = 0;
int x = 0;
int y = 0;
int z = 0;

foreach( TextRelay tr in info.TextEntries )
{
switch ( tr.EntryID )
{
case 0: //Name
{
if ( tr.Text != null )
{
if ( tr.Text != "" )
{
name = tr.Text;
}
}
break;
}
case 1://Map
{
if ( tr.Text != null )
{
if ( tr.Text != "" )
{
map = tr.Text;
}
}
break;
}
case 2://X
{
if ( tr.Text != null )
{
if ( tr.Text != "" )
{
x = int.Parse(tr.Text);
}
}
break;
}
case 3://Y
{
if ( tr.Text != null )
{
if ( tr.Text != "" )
{
y = int.Parse(tr.Text);
}
}
break;
}
case 4://Z
{
if ( tr.Text != null )
{
if ( tr.Text != "" )
{
z = int.Parse(tr.Text);//Convert to Int
}
}
break;
}
}
}

if ( info.ButtonID == 0 )
{
}
else if ( info.ButtonID >= 1 && info.ButtonID <= 10 )
{//Go
if ( Utility.InRange( m_Gate.Location, from.Location, 2 ) )
{
dest = new Point3D(((int)m_Gate.m_DestX[info.ButtonID-1]), ((int)m_Gate.m_DestY[info.ButtonID-1]), ((int)m_Gate.m_DestZ[info.ButtonID-1]) );
m_Map = (int)m_Gate.m_DestMaps[info.ButtonID-1];

Map mp = Map.Internal;
if ( dest == Point3D.Zero )
dest = from.Location;

if ( m_Map == 0 )
mp = Map.Felucca;
else if ( m_Map == 1 )
mp = Map.Trammel;
else if ( m_Map == 2 )
mp = Map.Ilshenar;
else if ( m_Map == 3 )
mp = Map.Malas;

if ( m_Map == 0 )
{
from.Location = dest;
}
else
{//Swap comments inside brackets if beta36
//from.Location = dest;
//from.Map = (Map)mp;
from.MoveToWorld( dest, (Map)mp );
}

Effects.PlaySound( from.Location, from.Map, 0x1FE );
}
else
from.SendMessage("You are too far away");
}
else if ( info.ButtonID == 11 )
{//ADD
if ( m_Gate.m_Destinations.Count <= 14 )//Change to max. entries, more than about 15 will be offscreen to some players
{
if ( ( ( x != 0 ) || ( y != 0 ) ) && ( name != "" ) )
{
if ( map == "felucca" || map == "Felucca" )
m_Gate.m_DestMaps.Add( 0 );
else if ( map == "trammel" || map == "Trammel" )
m_Gate.m_DestMaps.Add( 1 );
else if ( map == "ilshenar" || map == "Ilshenar" )
m_Gate.m_DestMaps.Add( 2 );
else if ( map == "malas" || map == "Malas" )
m_Gate.m_DestMaps.Add( 3 );
else
{
if ( m_Gate.Map == Map.Felucca )
m_Gate.m_DestMaps.Add( 0 );
else if ( m_Gate.Map == Map.Trammel )
m_Gate.m_DestMaps.Add( 1 );
else if ( m_Gate.Map == Map.Ilshenar )
m_Gate.m_DestMaps.Add( 2 );
else if ( m_Gate.Map == Map.Malas )
m_Gate.m_DestMaps.Add( 3 );
}
m_Gate.m_DestX.Add( x );
m_Gate.m_DestY.Add( y );
m_Gate.m_DestZ.Add( z );
m_Gate.m_Destinations.Add( name );
from.SendMessage("Nokta Eklendi");
}
else
from.SendMessage("Lütfen (x,y,z'leri) veya Map adı , Nokta adı yazıp tekrar deneyin!!!");
}
else
from.SendMessage("Birşey ekleyemezsiniz.Çünkü gate doldu!");
from.SendGump( new CustomMoongateGump( from, m_Gate,true ));
}
else if ( info.ButtonID >= 12 && info.ButtonID <= 21 )
{//DEL
m_Gate.m_DestMaps.RemoveAt( info.ButtonID-12 );
m_Gate.m_DestX.RemoveAt( info.ButtonID-12 );
m_Gate.m_DestY.RemoveAt( info.ButtonID-12 );
m_Gate.m_DestZ.RemoveAt( info.ButtonID-12 );
m_Gate.m_Destinations.RemoveAt( info.ButtonID-12 );
from.SendMessage("Nokta silindi");
from.SendGump( new CustomMoongateGump( from, m_Gate,true ));
}
}
}
}
}

Değerlendirmeler

0 0

Total votes: 0

Üye Ol veya Giriş Yap

Bu içeriğe yorum atmak istiyorsanız hemen üye olun veya giriş yapın.

Discord ile Bağlan
Twitch ile Bağlan
Steam ile Bağlan
Google ile Bağlan

Yorumlar (0)

Henüz yorum yapılmamış
Sadece kayıtlı kullanıcılar yeni yorum yapabilir.


Ultima-Strike Discord
Benzer Sayfalar
  • Moongate

    2016-09-10 20:34

  • Moongate

    2009-07-05 18:49

  • .Moongate

    2009-03-28 16:14

  • Yew Moongate

    2008-07-10 03:00

  • Güzel Bi Moongate

    2009-05-15 00:29



  • Son Forumlar
  • Sayfalar
  • Özgür Bora
    Eryndor UO

    Sunucular 12 saat önce

  • Mortal
    UO:Nimloth Yeniden Doğuyor !

    Sunucular 5 gün önce

  • Rowall
    Volantis Ultima Online Hakkında

    Sunucular 6 gün önce

  • Mortal
    SphereNet: SphereServer Source-X'in Modern .NET 9...

    Ultima Online 1 hafta önce

  • stark_nephilim_uo
    Nephilim Pvp - Age Of Gold

    Sunucular 1 hafta önce

  • [Lancelot]
    Ultoria – Efsane Yeniden Başlıyor!

    Sunucular 1 hafta önce

  • Tovertis
    WEST ULTİMA ONLİNE

    Sunucular 1 hafta önce

  • Koschey0
    HaldiUO (Pc-Mobile)

    Sunucular 2 hafta önce

  • Sirlather
    Rampage Pvp : The Bloodwing Awaken

    Sunucular 2 hafta önce

  • AnhElUs 333
    Tek oynayan oyunculara özel Discord Sunucusu...

    Ultima Online 2 hafta önce

  • ENDOTUO
    ENDOT UO | Age of Shadows (AOS) RunUO | Büyük...

    Sunucular 3 hafta önce

  • Aykut cosar
    [Tanıtım] Aslan PvP – [CENTER]

    Ultima Online 3 hafta önce

  • Nightwish
    Medieval UO Scripter Egosu

    Sunucular 4 hafta önce

  • Galentos
    Üyeliği 20 yıl ve üstünde olanlar.

    Ultima Online 1 ay önce

  • Ege ERKEK
    Ultima Online: New Legacy – Season 2 | İşte Bütün...

    Ultima Online 1 ay önce

  • Gumpart Spell Icons

    2026-10-29 23:02

  • UOFiddler Arama Plugin

    2026-10-01 15:40

  • Ultima Online .mul Konu anim4.mul ile Binek ekleme

    2026-01-25 20:19

  • MMORPG'de Devrim Yaptı: Sınıf Tanımayan Ultima Online!

    2025-12-27 21:13

  • Ultima Online'ın Oynanışını Tamamen Değiştiren Harita Kararı!

    2025-12-23 23:17

  • Yeni Başlayanlar İçin Ultima Online

    2025-11-27 19:07

  • Skill seçimlerinizi planlamak artık çok daha kolay

    Ultima Online Karakter Yapılandırma Aracı Bölümü Açıldı!

    2024-10-31 22:47

  • Ultima Online topluluğu, ClassicUO'nun sadece web client olarak kullanılabileceğinin açıklanmasının ardından tepkili.

    Resmi UO, Oyuncuları İkiye Böldü: Web Client Yeterli mi?

    2024-10-14 17:45

Menü
  • ANASAYFA
  • FORUM
  • DOKÜMAN
  • İNDİR
  • İLETİŞİM
  • Bağlantılar
  • CS 1.6 indir
  • CS 1.6 Türkçe
  • CS 1.6 Bot
  • CS 1.6 CFG
  • CS 1.6 Rate Ayarları
  • UO Server
  • Ghost Mouse indir
  • FPS Nedir?
  • Ultima Online PVP Server
  • Makroman
  • UO Karakter Yapılandırma
    © 2004 - 2026 Ultima-Strike. Her hakkı saklıdır.