Kod:
using System;
using Server;
using System.IO;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
using System.Net;
using System.Net.Sockets;
using System.Collections;
using Server.Items;
using Server.Spells;
using Server.Accounting;
namespace Server.Gumps
{
public class shardevent : Gump
{
private Point3D m_loc;
private Mobile m;
private static bool m_Enabled;
public static void Initialize()
{
Commands.Register( "PvpEvent", AccessLevel.Player, new CommandEventHandler( Event_OnCommand ) );
Commands.Register( "SetEvent", AccessLevel.GameMaster, new CommandEventHandler( SetEvent_OnCommand ) );
}
public static bool SetEventEnabled
{
get{ return m_Enabled; }
set{ m_Enabled = value; }
}
[Usage( "Set <true | false>" )]
[Description( "Enables or disables Start Quest or Event" )]
public static void SetEvent_OnCommand( CommandEventArgs e )
{
if ( e.Length == 1 )
{
m_Enabled = e.GetBoolean( 0 );
if ( m_Enabled )
{
e.Mobile.SendMessage( "Successful! You have started the Quest or Event." );
World.Broadcast( 0x482, true, String.Format( "Message from {0}: There will be an event starting soon! Please Type [PvpEvent", e.Mobile.Name ) );
}
else
{
e.Mobile.SendMessage("You have canceled the PvpEvent");
World.Broadcast( 0x482, true, String.Format( "Message from {0}: The PvpEvent has been closed", e.Mobile.Name ) );
}
e.Mobile.SendMessage( "PvpEvent has been {0}.", m_Enabled ? "enabled" : "disabled" );
}
else
{
e.Mobile.SendMessage( "Format: SetEvent <true | false>" );
e.Mobile.SendMessage( "SetEvent is currently {0}.", m_Enabled ? "enabled" : "disabled" );
return;
}
}
[Usage( "PvpEvent" )]
[Description( "Go to PvpEvent Place." )]
public static void Event_OnCommand( CommandEventArgs args )
{
if ( m_Enabled )
args.Mobile.SendGump( new shardevent( args.Mobile ) );
else
args.Mobile.SendMessage("No PvpEvent currently running");
}
public shardevent(Mobile from): base( 0, 0 )
{
Closable=false;
Disposable=true;
Dragable=true;
Resizable=false;
m = from;
AddPage( 0 );
AddBackground(32, 30, 253, 125, 9200);
AddImage(280, 20, 10431);
AddImage(279, 130, 10460);
AddImage(267, 5, 10430);
AddButton(39, 112, 10810, 10810,1, GumpButtonType.Reply, 0);
AddLabel(80, 117, 1190, "Cancel");
AddButton(39, 64, 10810, 10810,2, GumpButtonType.Reply, 0);
AddLabel(80, 67, 1190, "Enter the PvpEvent!");
AddLabel(40, 38, 1135, "What do you want to do:");
}
public override void OnResponse( NetState sender, RelayInfo info )
{
Point3D m_curloc = new Point3D(m.X,m.Y,m.Z);
switch ( info.ButtonID )
{
case 1:
{
m.SendMessage( "You decide not to go." );
break;
}
case 2: // pvpevent location
{
m.SendMessage( "You enter the Event!" );
m_loc = new Point3D(5493,1205,0);
MobileTeleport(m, m_loc, m_curloc, Map.Felucca);
break;
}
}
}
public void MobileTeleport( Mobile m, Point3D loc, Point3D cur_loc, Map map )
{
if (m.InRange(loc, 4))
{
m.SendMessage( "You are already there." );
}
else
{
BaseCreature.TeleportPets( m, m_loc, map );
Effects.SendLocationParticles( EffectItem.Create( cur_loc , m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
Effects.PlaySound( cur_loc, m.Map, 0x1FE );
m.MoveToWorld( loc, map);
Effects.SendLocationParticles( EffectItem.Create( loc , map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
Effects.PlaySound( loc, m.Map, 0x1FE );
}
}
}
}
using Server;
using System.IO;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
using System.Net;
using System.Net.Sockets;
using System.Collections;
using Server.Items;
using Server.Spells;
using Server.Accounting;
namespace Server.Gumps
{
public class shardevent : Gump
{
private Point3D m_loc;
private Mobile m;
private static bool m_Enabled;
public static void Initialize()
{
Commands.Register( "PvpEvent", AccessLevel.Player, new CommandEventHandler( Event_OnCommand ) );
Commands.Register( "SetEvent", AccessLevel.GameMaster, new CommandEventHandler( SetEvent_OnCommand ) );
}
public static bool SetEventEnabled
{
get{ return m_Enabled; }
set{ m_Enabled = value; }
}
[Usage( "Set <true | false>" )]
[Description( "Enables or disables Start Quest or Event" )]
public static void SetEvent_OnCommand( CommandEventArgs e )
{
if ( e.Length == 1 )
{
m_Enabled = e.GetBoolean( 0 );
if ( m_Enabled )
{
e.Mobile.SendMessage( "Successful! You have started the Quest or Event." );
World.Broadcast( 0x482, true, String.Format( "Message from {0}: There will be an event starting soon! Please Type [PvpEvent", e.Mobile.Name ) );
}
else
{
e.Mobile.SendMessage("You have canceled the PvpEvent");
World.Broadcast( 0x482, true, String.Format( "Message from {0}: The PvpEvent has been closed", e.Mobile.Name ) );
}
e.Mobile.SendMessage( "PvpEvent has been {0}.", m_Enabled ? "enabled" : "disabled" );
}
else
{
e.Mobile.SendMessage( "Format: SetEvent <true | false>" );
e.Mobile.SendMessage( "SetEvent is currently {0}.", m_Enabled ? "enabled" : "disabled" );
return;
}
}
[Usage( "PvpEvent" )]
[Description( "Go to PvpEvent Place." )]
public static void Event_OnCommand( CommandEventArgs args )
{
if ( m_Enabled )
args.Mobile.SendGump( new shardevent( args.Mobile ) );
else
args.Mobile.SendMessage("No PvpEvent currently running");
}
public shardevent(Mobile from): base( 0, 0 )
{
Closable=false;
Disposable=true;
Dragable=true;
Resizable=false;
m = from;
AddPage( 0 );
AddBackground(32, 30, 253, 125, 9200);
AddImage(280, 20, 10431);
AddImage(279, 130, 10460);
AddImage(267, 5, 10430);
AddButton(39, 112, 10810, 10810,1, GumpButtonType.Reply, 0);
AddLabel(80, 117, 1190, "Cancel");
AddButton(39, 64, 10810, 10810,2, GumpButtonType.Reply, 0);
AddLabel(80, 67, 1190, "Enter the PvpEvent!");
AddLabel(40, 38, 1135, "What do you want to do:");
}
public override void OnResponse( NetState sender, RelayInfo info )
{
Point3D m_curloc = new Point3D(m.X,m.Y,m.Z);
switch ( info.ButtonID )
{
case 1:
{
m.SendMessage( "You decide not to go." );
break;
}
case 2: // pvpevent location
{
m.SendMessage( "You enter the Event!" );
m_loc = new Point3D(5493,1205,0);
MobileTeleport(m, m_loc, m_curloc, Map.Felucca);
break;
}
}
}
public void MobileTeleport( Mobile m, Point3D loc, Point3D cur_loc, Map map )
{
if (m.InRange(loc, 4))
{
m.SendMessage( "You are already there." );
}
else
{
BaseCreature.TeleportPets( m, m_loc, map );
Effects.SendLocationParticles( EffectItem.Create( cur_loc , m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
Effects.PlaySound( cur_loc, m.Map, 0x1FE );
m.MoveToWorld( loc, map);
Effects.SendLocationParticles( EffectItem.Create( loc , map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
Effects.PlaySound( loc, m.Map, 0x1FE );
}
}
}
}
Yorumlar
Henüz yorum yapılmamıştır.
|
OylamalarOylama :![]()
Üyelerin oylama ortalaması (10 dışında) : 10.00
![]() Oylar: 1 den itibaren 11-12-2011 18:55 |
Benzer Sayfalar
| Sayfalar | Yorumlar | Gönderen | Tarih |
| Undead Event | 0 | TheRaskol | 05-08-2009 |
| Crash Fix Event | 0 | TheRaskol | 01-08-2009 |
| Event Yapımı | 0 | TheRaskol | 29-07-2009 |
| Staff Event | 0 | TheRaskol | 28-07-2009 |
| Krallık Event | 0 | TheRaskol | 28-07-2009 |







