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. 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
    • Ultima Online Oyuncu Rehberi

      Ultima Online Oyuncu Rehberi

      Oyunu hakkında tanıcı bilgiler ve ipuçları

    • Ultima Online Portal

      Ultima Online Portal

      Ultima Online oyununun topluluk portalı

    • Ultima Online Server List

      Ultima Online Server List

      Önemli özellikleri ve online oyuncu sayıları

    • Ultima Online Script

      Ultima Online Script

      Sphere, RunUO, Razor scriptleri

  • FORUM
  • DOKÜMAN
  • İNDİR
  • DISCORD 28
   Üye ol    Giriş
745
  1. UO Scriptleri
  2. RunUO Scripts
  3. Gumps
  4. Custom MoonGate

Custom MoonGate

  • 2006-05-02 21:54
  • 0 Yorumlar
  • 1672 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
  • EgeERKEK
    Sistem Güncellemeleri: Portal, Sunucu Listesi ve...

    Duyurular 7 saat önce

  • Lucretius
    AutoMod - AI Destekli Forum Moderasyon

    Duyurular 1 gün önce

  • Syntax
    UO:Nimloth Yeniden Doğuyor !

    Sunucular 1 hafta önce

  • Gececi
    Üyeliği 18 yıl ve üstünde olanlar.

    Ultima Online 1 hafta önce

  • Floody
    Üyeliği 15 yıl ve üzerinde olanlar.

    Ultima Online 2 hafta önce

  • Çağdaş İLHAN
    Viox/phobos Sphere Script Pack Alınacaktır

    Sphere Scripting 3 hafta önce

  • Venus
    World of UO'da Geçmişe Yolculuk Başladı

    Sunucular 3 hafta önce

  • HaldiUo
    HaldiUO (Pc-Mobile)

    Sunucular 3 hafta önce

  • TheFXon
    CS 1.6 P0ndenush Config

    CS 1.6 1 ay önce

  • TheNorthShield
    The North Shield ( TNS ) - Golden Age 2017

    Sunucular 2 ay önce

  • System_Error
    Sphere X Kurulum İş İlanı

    Sphere Scripting 2 ay önce

  • Esgaroth UO
    Esgaroth UO

    Sunucular 3 ay önce

  • sarhos7573
    Scripting / script

    Ultima Online 3 ay önce

  • Vanq
    Yapay zekayla UO kodlamaya çalışan var mı? Cursor...

    Sphere Scripting 4 ay önce

  • TSuN@Mi
    Counter-Strike 1.6 İndir - Tek Link Hızlı-

    Counter-Strike 4 ay önce

  • 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

  • Ultima Online, ClassicUO ile resmi işbirliği yapıyor! Performans iyileştirmeleri, geniş oyun penceresi ve daha fazlası geliyor.

    Ultima Online, ClassicUO ile Resmi İşbirliğine Gidiyor

    2024-09-26 14:21

  • Centred#

    2024-07-08 22:50

  • CentrED+ 7.9

    2024-07-08 22:34

  • Distance(uzaklık) Sorgusu Hakkında

    2024-06-19 22:05

  • UoFiddler

    2024-06-01 02:19

  • UoFiddler ile Map Kopyalama

    2024-05-31 21:17

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 - 2025 Ultima-Strike. Her hakkı saklıdır.