RunUo.Korean.Forum    :: RunUo Document 2.0 RC1 (Beta):: 
Statistics  Archive (html)  S-BLOG  [RSS FEED]   

 
  RunUo.Korean.Forum
ÀæÀºÁú¹®  ÀæÀºÁú¹®    °Ë»ö   °Ë»ö    ȸ¿ø¸®½ºÆ®  È¸¿ø¸®½ºÆ®   À¯Àú±×·ì  À¯Àú±×·ì   Gabbly äÆÃ¿­±â  Ã¤ÆÃ¿­±â 
 
ȸ¿ø°¡ÀÔ  ::  ·Î±×ÀÎ ÂÊÁö ÇÔ È®ÀÎ
 
RunUo.Korean.Forum ¢º FreeBoard ¢º -_-... ¾Æ À̰Š¾î·Æ³×
»õ ±ÛÀ» ÀÛ¼ºÇÕ´Ï´Ù.´äº¯±ÛÀ» ÀÛ¼ºÇÕ´Ï´Ù. Post Printing
¡Ø TOPIC : -_-... ¾Æ À̰Š¾î·Æ³× ÀÌÀü ±Û :: ´ÙÀ½ ±Û
±Û ¾´ÀÌ ¸Þ¼¼Áö ³»¿ë
joker
ÀÛ¼º±ÛÁ¦¸ñ : -_-... ¾Æ À̰Š¾î·Æ³×   ±Û ÀÛ¼º½Ã°£ : 2005-10-27 ¸ñ 1:12 pm ±ÛÀ» ÀοëÇÏ¿© ÀÛ¼ºÇÕ´Ï´Ù.

First Cicle [3]
First Cicle [3]

°¡ÀÔÀÏ: 2005³â 10¿ù 18ÀÏ
°Ô½Ã¹°: 7

ÄÚµå : 
using System;
using Server;
using Server.Network;
using Server.Mobiles;

namespace Server.Items
{
   public class YoungTeleporter : Item
   {
      private bool m_Active, m_Creatures;
      private Point3D m_PointDest;
      private Map m_MapDest;
      private bool m_SourceEffect;
      private bool m_DestEffect;
      private int m_SoundID;
      private TimeSpan m_Delay;

      [CommandProperty( AccessLevel.GameMaster )]
      public bool SourceEffect
      {
         get{ return m_SourceEffect; }
         set{ m_SourceEffect = value; InvalidateProperties(); }
      }

      [CommandProperty( AccessLevel.GameMaster )]
      public bool DestEffect
      {
         get{ return m_DestEffect; }
         set{ m_DestEffect = value; InvalidateProperties(); }
      }

      [CommandProperty( AccessLevel.GameMaster )]
      public int SoundID
      {
         get{ return m_SoundID; }
         set{ m_SoundID = value; InvalidateProperties(); }
      }

      [CommandProperty( AccessLevel.GameMaster )]
      public TimeSpan Delay
      {
         get{ return m_Delay; }
         set{ m_Delay = value; InvalidateProperties(); }
      }

      [CommandProperty( AccessLevel.GameMaster )]
      public bool Active
      {
         get { return m_Active; }
         set { m_Active = value; InvalidateProperties(); }
      }

      [CommandProperty( AccessLevel.GameMaster )]
      public Point3D PointDest
      {
         get { return m_PointDest; }
         set { m_PointDest = value; InvalidateProperties(); }
      }

      [CommandProperty( AccessLevel.GameMaster )]
      public Map MapDest
      {
         get { return m_MapDest; }
         set { m_MapDest = value; InvalidateProperties(); }
      }

      [CommandProperty( AccessLevel.GameMaster )]
      public bool Creatures
      {
         get { return m_Creatures; }
         set { m_Creatures = value; }
      }

      public override int LabelNumber{ get{ return 1026095; } } // ÅÚ·¹Æ÷Æ®

      [Constructable]
      public YoungTeleporter() : this( new Point3D( 0, 0, 0 ), null, false )
      {
      }

      [Constructable]
      public YoungTeleporter( Point3D pointDest, Map mapDest ) : this( pointDest, mapDest, false )
      {
      }

      [Constructable]
      public YoungTeleporter( Point3D pointDest, Map mapDest, bool creatures ) : base( 0x1BC3 )
      {
         Movable = false;
         Visible = false;

         m_Active = true;
         m_PointDest = pointDest;
         m_MapDest = mapDest;
         m_Creatures = creatures;
      }

      public override void GetProperties( ObjectPropertyList list )
      {
         base.GetProperties( list );

         if ( m_Active )
            list.Add( 1060742 ); // active
         else
            list.Add( 1060743 ); // inactive

         if ( m_MapDest != null )
            list.Add( 1060658, "Map\t{0}", m_MapDest );

         if ( m_PointDest != Point3D.Zero )
            list.Add( 1060659, "Coords\t{0}", m_PointDest );

         list.Add( 1060660, "Creatures\t{0}", m_Creatures ? "Yes" : "No" );
      }

      public override void OnSingleClick( Mobile from )
      {
         base.OnSingleClick( from );

         if ( m_Active )
         {
            if ( m_MapDest != null && m_PointDest != Point3D.Zero )
               LabelTo( from, "{0} [{1}]", m_PointDest, m_MapDest );
            else if ( m_MapDest != null )
               LabelTo( from, "[{0}]", m_MapDest );
            else if ( m_PointDest != Point3D.Zero )
               LabelTo( from, m_PointDest.ToString() );
         }
         else
         {
            LabelTo( from, "(inactive)" );
         }
      }

      public virtual void StartTeleport( Mobile m )
      {
         PlayerMobile pm = m as PlayerMobile; // cast the Mobile as a PlayerMobile to enable checking of Young status

         if ( pm != null && !pm.Young && m.AccessLevel < AccessLevel.Counselor ) // if the player is a playermobile (sanity check) AND the player is not young AND the player isn't a staff member
            return; // do nothing
         else if ( m_Delay == TimeSpan.Zero ) // if teleport delay is 0 seconds..
            DoTeleport( m ); // teleport immediately
         else // otherwise..
            Timer.DelayCall( m_Delay, new TimerStateCallback( DoTeleport_Callback ), m ); // start the timer for the delay, then teleport when timer is complete            
      }

      private void DoTeleport_Callback( object state )
      {
         DoTeleport( (Mobile) state );
      }

      public virtual void DoTeleport( Mobile m )
      {
         Map map = m_MapDest;

         if ( map == null || map == Map.Internal )
            map = m.Map;

         Point3D p = m_PointDest;

         if ( p == Point3D.Zero )
            p = m.Location;

         Server.Mobiles.BaseCreature.TeleportPets( m, p, map );

         bool sendEffect = ( !m.Hidden || m.AccessLevel == AccessLevel.Player );

         if ( m_SourceEffect && sendEffect )
            Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 10, 10 );

         m.MoveToWorld( p, map );

         if ( m_DestEffect && sendEffect )
            Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 10, 10 );

         if ( m_SoundID > 0 && sendEffect )
            Effects.PlaySound( m.Location, m.Map, m_SoundID );
      }
      public override bool OnMoveOver( Mobile m )
      {
         if ( m_Active )
         {
            if ( !m_Creatures && !m.Player )
               return true;
            StartTeleport( m );
            return false;
         }

         return true;
      }

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

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

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

         writer.Write( (bool) m_SourceEffect );
         writer.Write( (bool) m_DestEffect );
         writer.Write( (TimeSpan) m_Delay );
         writer.WriteEncodedInt( (int) m_SoundID );

         writer.Write( m_Creatures );

         writer.Write( m_Active );
         writer.Write( m_PointDest );
         writer.Write( m_MapDest );
      }

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

         int version = reader.ReadInt();

         switch ( version )
         {
            case 2:
            {
               m_SourceEffect = reader.ReadBool();
               m_DestEffect = reader.ReadBool();
               m_Delay = reader.ReadTimeSpan();
               m_SoundID = reader.ReadEncodedInt();

               goto case 1;
            }
            case 1:
            {
               m_Creatures = reader.ReadBool();

               goto case 0;
            }
            case 0:
            {
               m_Active = reader.ReadBool();
               m_PointDest = reader.ReadPoint3D();
               m_MapDest = reader.ReadMap();

               break;
            }
         }
      }
   }
}

_________________
VV
¡è ¸Ç À§·Î °¡±â ¡è
ȸ¿ø ÇÁ·ÎÇÊ º¸±â ÂÊÁö º¸³»±â
ÀÌÀü °Ô½Ã¹°º¸±â :
»õ ±ÛÀ» ÀÛ¼ºÇÕ´Ï´Ù.´äº¯±ÛÀ» ÀÛ¼ºÇÕ´Ï´Ù. ÇöÀçÆäÀÌÁö : 1/1

RunUo.Korean.Forum ¢º FreeBoard ¢º -_-... ¾Æ À̰Š¾î·Æ³×
¹Ù·Î°¡±â:


°Ô½Ã¹° ÀÛ¼º : (X)
´äº¯±Û ÀÛ¼º : (X)
°Ô½Ã¹° ¼öÁ¤ : (X)
°Ô½Ã¹° »èÁ¦ : (X)
ÅõÇ¥ Çϱâ : (X)
ÆÄÀÏ ¾÷·Îµå : (X)
ÆÄÀÏ ´Ù¿î·Îµå : (0)



DAJ Glass (1.0.5) template by Dustin Baccetti // template edit by GangPung
EQ graphic based off of a design from www.freeclipart.nu
Powered by phpBB 2001, 2002 phpBB Group, Translated by zzangga

DNS Powered by DNSEver.com