|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
Join Date: Jan 2006
Posts: 25
|
Trying to figure out how to edit the labels on the Moongate gump. I see how to edit the locations in the publicmoongate.cs. I am trying to make custom locations on the Ilshenar Map. Can anyone stear me in the right direction? I know I need to edit the clilocentry but I need a way to figure out what they would be for my custom names.
Last edited by Darkhelm; 09-04-2007 at 03:38 AM. |
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
|
You can just edit your PublicMoongate.cs a little to make it possible to add new Lists and Locations.
Code:
using System;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Commands;
namespace Server.Items
{
public class PublicMoongate : Item
{
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
[Constructable]
public PublicMoongate() : base( 0xF6C )
{
Movable = false;
Light = LightType.Circle300;
}
public PublicMoongate( Serial serial ) : base( serial )
{
}
public override void OnDoubleClick( Mobile from )
{
if ( !from.Player )
return;
if ( from.InRange( GetWorldLocation(), 1 ) )
UseGate( from );
else
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
public override bool OnMoveOver( Mobile m )
{
// Changed so criminals are not blocked by it.
if ( m.Player )
UseGate( m );
return true;
}
public override bool HandlesOnMovement{ get{ return true; } }
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if ( m is PlayerMobile )
{
if ( !Utility.InRange( m.Location, this.Location, 1 ) && Utility.InRange( oldLocation, this.Location, 1 ) )
m.CloseGump( typeof( MoongateGump ) );
}
}
public bool UseGate( Mobile m )
{
if ( m.Criminal )
{
m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
{
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
else if ( m.Spell != null )
{
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
return false;
}
else
{
m.CloseGump( typeof( MoongateGump ) );
m.SendGump( new MoongateGump( m, this ) );
if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
Effects.PlaySound( m.Location, m.Map, 0x20E );
return true;
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public static void Initialize()
{
CommandSystem.Register( "MoonGen", AccessLevel.Administrator, new CommandEventHandler( MoonGen_OnCommand ) );
}
[Usage( "MoonGen" )]
[Description( "Generates public moongates. Removes all old moongates." )]
public static void MoonGen_OnCommand( CommandEventArgs e )
{
DeleteAll();
int count = 0;
count += MoonGen( PMList.Trammel );
count += MoonGen( PMList.Felucca );
count += MoonGen( PMList.Ilshenar );
count += MoonGen( PMList.Malas );
count += MoonGen( PMList.Tokuno );
World.Broadcast( 0x35, true, "{0} moongates generated.", count );
}
private static void DeleteAll()
{
List<Item> list = new List<Item>();
foreach ( Item item in World.Items.Values )
{
if ( item is PublicMoongate )
list.Add( item );
}
foreach ( Item item in list )
item.Delete();
if ( list.Count > 0 )
World.Broadcast( 0x35, true, "{0} moongates removed.", list.Count );
}
private static int MoonGen( PMList list )
{
foreach ( PMEntry entry in list.Entries )
{
Item item = new PublicMoongate();
item.MoveToWorld( entry.Location, list.Map );
if ( entry.Number == 1060642 ) // Umbra
item.Hue = 0x497;
}
return list.Entries.Length;
}
}
public class PMEntry
{
private Point3D m_Location;
private int m_Number;
public Point3D Location
{
get
{
return m_Location;
}
}
public int Number
{
get
{
return m_Number;
}
}
public PMEntry( Point3D loc, int number )
{
m_Location = loc;
m_Number = number;
}
//--- Soteric. START
private string m_Name; // A new variable to store the name of our location
public string Name
{ get { return m_Name; } }
private Map m_Map; // A new variable to store the map of our location
public Map Map
{ get { return m_Map; } }
public PMEntry(Point3D loc, Map map, string name) // A new PMEntry constructor that uses Name and Map variables
{
m_Location = loc;
m_Map = map;
m_Name = name;
}
//--- Soteric. END
}
public class PMList
{
private int m_Number, m_SelNumber;
private Map m_Map;
private PMEntry[] m_Entries;
public int Number
{
get
{
return m_Number;
}
}
public int SelNumber
{
get
{
return m_SelNumber;
}
}
public Map Map
{
get
{
return m_Map;
}
//--- Soteric. START
set { m_Map = value; } // Adding Set property to be able to change Map variable
//--- Soteric. END
}
public PMEntry[] Entries
{
get
{
return m_Entries;
}
}
public PMList( int number, int selNumber, Map map, PMEntry[] entries )
{
m_Number = number;
m_SelNumber = selNumber;
m_Map = map;
m_Entries = entries;
}
//--- Soteric. START
private string m_Name; // A new variable to store the name of list of new locations
public string Name
{ get { return m_Name; } }
public PMList(string name, PMEntry[] entries) // A new PMList constructor that uses Name
{
m_Name = name;
m_Entries = entries;
}
public static readonly PMList OtherLocations = // Adding new list of locations to our PublicMoongate gump
new PMList("Other Locations", new PMEntry[]
{
new PMEntry( new Point3D( 4465, 1284, 5 ), Map.Trammel, "Testing" ) // Adding a new location
// Here should be added any locations you need
});
// To add a new list of locations just follow the example above
//--- Soteric. END
public static readonly PMList Trammel =
new PMList( 1012000, 1012012, Map.Trammel, new PMEntry[]
{
new PMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow
new PMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain
new PMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom
new PMEntry( new Point3D( 771, 752, 5 ), 1012006 ), // Yew
new PMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc
new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae
new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
new PMEntry( new Point3D( 3763, 2771, 50), 1078098 ) // New Haven
} );
public static readonly PMList Felucca =
new PMList( 1012001, 1012013, Map.Felucca, new PMEntry[]
{
new PMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow
new PMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain
new PMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom
new PMEntry( new Point3D( 771, 752, 5 ), 1012006 ), // Yew
new PMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc
new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae
new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
new PMEntry( new Point3D( 2711, 2234, 0 ), 1019001 ) // Buccaneer's Den
} );
public static readonly PMList Ilshenar =
new PMList( 1012002, 1012014, Map.Ilshenar, new PMEntry[]
{
new PMEntry( new Point3D( 1215, 467, -13 ), 1012015 ), // Compassion
new PMEntry( new Point3D( 722, 1366, -60 ), 1012016 ), // Honesty
new PMEntry( new Point3D( 744, 724, -28 ), 1012017 ), // Honor
new PMEntry( new Point3D( 281, 1016, 0 ), 1012018 ), // Humility
new PMEntry( new Point3D( 987, 1011, -32 ), 1012019 ), // Justice
new PMEntry( new Point3D( 1174, 1286, -30 ), 1012020 ), // Sacrifice
new PMEntry( new Point3D( 1532, 1340, - 3 ), 1012021 ), // Spirituality
new PMEntry( new Point3D( 528, 216, -45 ), 1012022 ), // Valor
new PMEntry( new Point3D( 1721, 218, 96 ), 1019000 ) // Chaos
} );
public static readonly PMList Malas =
new PMList( 1060643, 1062039, Map.Malas, new PMEntry[]
{
new PMEntry( new Point3D( 1015, 527, -65 ), 1060641 ), // Luna
new PMEntry( new Point3D( 1997, 1386, -85 ), 1060642 ) // Umbra
} );
public static readonly PMList Tokuno =
new PMList( 1063258, 1063415, Map.Tokuno, new PMEntry[]
{
new PMEntry( new Point3D( 1169, 998, 41 ), 1063412 ), // Isamu-Jima
new PMEntry( new Point3D( 802, 1204, 25 ), 1063413 ), // Makoto-Jima
new PMEntry( new Point3D( 270, 628, 15 ), 1063414 ) // Homare-Jima
} );
public static readonly PMList[] UORLists = new PMList[] { Trammel, Felucca };
public static readonly PMList[] UORListsYoung = new PMList[] { Trammel };
public static readonly PMList[] LBRLists = new PMList[] { Trammel, Felucca, Ilshenar };
public static readonly PMList[] LBRListsYoung = new PMList[] { Trammel, Ilshenar };
public static readonly PMList[] AOSLists = new PMList[] { Trammel, Felucca, Ilshenar, Malas };
public static readonly PMList[] AOSListsYoung = new PMList[] { Trammel, Ilshenar, Malas };
public static readonly PMList[] SELists = new PMList[] { Trammel, Felucca, Ilshenar, Malas, Tokuno, OtherLocations }; //--- Soteric. The names of your locations lists should be added here
public static readonly PMList[] SEListsYoung = new PMList[] { Trammel, Ilshenar, Malas, Tokuno };
public static readonly PMList[] RedLists = new PMList[] { Felucca };
public static readonly PMList[] SigilLists = new PMList[] { Felucca };
}
public class MoongateGump : Gump
{
private Mobile m_Mobile;
private Item m_Moongate;
private PMList[] m_Lists;
public MoongateGump( Mobile mobile, Item moongate ) : base( 100, 100 )
{
m_Mobile = mobile;
m_Moongate = moongate;
PMList[] checkLists;
if ( mobile.Player )
{
if ( Factions.Sigil.ExistsOn( mobile ) )
{
checkLists = PMList.SigilLists;
}
else if ( mobile.Kills >= 5 )
{
checkLists = PMList.RedLists;
}
else
{
int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags;
bool young = mobile is PlayerMobile ? ((PlayerMobile)mobile).Young : false;
if ( Core.SE && (flags & 0x10) != 0 )
checkLists = young ? PMList.SEListsYoung : PMList.SELists;
else if ( Core.AOS && (flags & 0x8) != 0 )
checkLists = young ? PMList.AOSListsYoung : PMList.AOSLists;
else if ( (flags & 0x4) != 0 )
checkLists = young ? PMList.LBRListsYoung : PMList.LBRLists;
else
checkLists = young ? PMList.UORListsYoung : PMList.UORLists;
}
}
else
{
checkLists = PMList.SELists;
}
m_Lists = new PMList[checkLists.Length];
for ( int i = 0; i < m_Lists.Length; ++i )
m_Lists[i] = checkLists[i];
for ( int i = 0; i < m_Lists.Length; ++i )
{
if ( m_Lists[i].Map == mobile.Map )
{
PMList temp = m_Lists[i];
m_Lists[i] = m_Lists[0];
m_Lists[0] = temp;
break;
}
}
AddPage( 0 );
AddBackground( 0, 0, 380, 280, 5054 );
AddButton( 10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 210, 140, 25, 1011036, false, false ); // OKAY
AddButton( 10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 235, 140, 25, 1011012, false, false ); // CANCEL
AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination:
for ( int i = 0; i < checkLists.Length; ++i )
{
AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 );
//--- Soteric. START
if (checkLists[i].Name != null)
AddHtml(30, 35 + (i * 25), 150, 20, checkLists[i].Name, false, false); // Using our names instead of cliloc names
else
//--- Soteric. END
AddHtmlLocalized( 30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false );
}
for ( int i = 0; i < m_Lists.Length; ++i )
RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) );
}
private void RenderPage( int index, int offset )
{
PMList list = m_Lists[index];
AddPage( index + 1 );
AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 );
//--- Soteric. START
if (list.Name != null)
AddHtml(30, 35 + (offset * 25), 150, 20, list.Name, false, false); // Using our names instead of cliloc names
else
//--- Soteric. END
AddHtmlLocalized( 30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false );
PMEntry[] entries = list.Entries;
for ( int i = 0; i < entries.Length; ++i )
{
AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i );
//--- Soteric. START
if (entries[i].Name != null)
AddHtml(225, 35 + (i * 25), 150, 20, entries[i].Name, false, false); // Using our names instead of cliloc names
else
//--- Soteric. END
AddHtmlLocalized( 225, 35 + (i * 25), 150, 20, entries[i].Number, false, false );
}
}
public override void OnResponse( NetState state, RelayInfo info )
{
if ( info.ButtonID == 0 ) // Cancel
return;
else if ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null )
return;
int[] switches = info.Switches;
if ( switches.Length == 0 )
return;
int switchID = switches[0];
int listIndex = switchID / 100;
int listEntry = switchID % 100;
if ( listIndex < 0 || listIndex >= m_Lists.Length )
return;
PMList list = m_Lists[listIndex];
if ( listEntry < 0 || listEntry >= list.Entries.Length )
return;
PMEntry entry = list.Entries[listEntry];
//--- Soteric. START
if (entry.Name != null) // If it's a location we added manually
list.Map = entry.Map; // Then use the map of this location
//--- Soteric. END
if ( !m_Mobile.InRange( m_Moongate.GetWorldLocation(), 1 ) || m_Mobile.Map != m_Moongate.Map )
{
m_Mobile.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate.
}
else if ( m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca )
{
m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Factions.Sigil.ExistsOn( m_Mobile ) && list.Map != Factions.Faction.Facet )
{
m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( m_Mobile.Criminal )
{
m_Mobile.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( Server.Spells.SpellHelper.CheckCombat( m_Mobile ) )
{
m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( m_Mobile.Spell != null )
{
m_Mobile.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
}
else if ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) )
{
m_Mobile.SendLocalizedMessage( 1019003 ); // You are already there.
}
else
{
BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map );
m_Mobile.Combatant = null;
m_Mobile.Warmode = false;
m_Mobile.Hidden = true;
m_Mobile.MoveToWorld( entry.Location, list.Map );
Effects.PlaySound( entry.Location, list.Map, 0x1FE );
}
}
}
}
Last edited by Soteric; 09-04-2007 at 04:03 AM. |
|
|
|
|
|
#3 (permalink) |
|
Newbie
Join Date: Jan 2006
Posts: 25
|
I got this error
Items/Misc/PublicMoongate.cs cs1501: Line 259: No overload for method 'PMEntry' takes '3' arguements My line 259 is where you add your custom location you mentioned above. THis is what my line of code looks like Code:
new PMEntry( new Point3D( 539, 460, -60 ), Map.Ilshenar, "Elf City" ) // Adding a new location |
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
|
I think you have forgotten to add this part (~182 line):
Code:
//--- Soteric. START
private string m_Name; // A new variable to store the name of our location
public string Name
{ get { return m_Name; } }
private Map m_Map; // A new variable to store the map of our location
public Map Map
{ get { return m_Map; } }
public PMEntry(Point3D loc, Map map, string name) // A new PMEntry constructor that uses Name and Map variables
{
m_Location = loc;
m_Map = map;
m_Name = name;
}
//--- Soteric. END
|
|
|
|
|
|
#5 (permalink) |
|
Newbie
Join Date: Jan 2006
Posts: 25
|
Here are my errors now.
Error 1 Expected class, delegate, enum, interface, or struct C:\Documents and Settings\Danny\My Documents\Scripts\Scripts\Items\Misc\PublicMoongat e.cs 183 13 Scripts Error 2 Expected class, delegate, enum, interface, or struct C:\Documents and Settings\Danny\My Documents\Scripts\Scripts\Items\Misc\PublicMoongat e.cs 184 16 Scripts Error 3 Expected class, delegate, enum, interface, or struct C:\Documents and Settings\Danny\My Documents\Scripts\Scripts\Items\Misc\PublicMoongat e.cs 187 17 Scripts Error 4 Expected class, delegate, enum, interface, or struct C:\Documents and Settings\Danny\My Documents\Scripts\Scripts\Items\Misc\PublicMoongat e.cs 188 16 Scripts Error 5 Expected class, delegate, enum, interface, or struct C:\Documents and Settings\Danny\My Documents\Scripts\Scripts\Items\Misc\PublicMoongat e.cs 191 16 Scripts Here is my script after I made the changes... Code:
using System;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Commands;
namespace Server.Items
{
public class PublicMoongate : Item
{
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
[Constructable]
public PublicMoongate() : base( 0xF6C )
{
Movable = false;
Light = LightType.Circle300;
}
public PublicMoongate( Serial serial ) : base( serial )
{
}
public override void OnDoubleClick( Mobile from )
{
if ( !from.Player )
return;
if ( from.InRange( GetWorldLocation(), 1 ) )
UseGate( from );
else
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
public override bool OnMoveOver( Mobile m )
{
// Changed so criminals are not blocked by it.
if ( m.Player )
UseGate( m );
return true;
}
public override bool HandlesOnMovement{ get{ return true; } }
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if ( m is PlayerMobile )
{
if ( !Utility.InRange( m.Location, this.Location, 1 ) && Utility.InRange( oldLocation, this.Location, 1 ) )
m.CloseGump( typeof( MoongateGump ) );
}
}
public bool UseGate( Mobile m )
{
if ( m.Criminal )
{
m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
{
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
else if ( m.Spell != null )
{
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
return false;
}
else
{
m.CloseGump( typeof( MoongateGump ) );
m.SendGump( new MoongateGump( m, this ) );
if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
Effects.PlaySound( m.Location, m.Map, 0x20E );
return true;
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public static void Initialize()
{
CommandSystem.Register( "MoonGen", AccessLevel.Administrator, new CommandEventHandler( MoonGen_OnCommand ) );
}
[Usage( "MoonGen" )]
[Description( "Generates public moongates. Removes all old moongates." )]
public static void MoonGen_OnCommand( CommandEventArgs e )
{
DeleteAll();
int count = 0;
count += MoonGen( PMList.Trammel );
count += MoonGen( PMList.Felucca );
count += MoonGen( PMList.Ilshenar );
count += MoonGen( PMList.Malas );
count += MoonGen( PMList.Tokuno );
World.Broadcast( 0x35, true, "{0} moongates generated.", count );
}
private static void DeleteAll()
{
List<Item> list = new List<Item>();
foreach ( Item item in World.Items.Values )
{
if ( item is PublicMoongate )
list.Add( item );
}
foreach ( Item item in list )
item.Delete();
if ( list.Count > 0 )
World.Broadcast( 0x35, true, "{0} moongates removed.", list.Count );
}
private static int MoonGen( PMList list )
{
foreach ( PMEntry entry in list.Entries )
{
Item item = new PublicMoongate();
item.MoveToWorld( entry.Location, list.Map );
if ( entry.Number == 1060642 ) // Umbra
item.Hue = 0x497;
}
return list.Entries.Length;
}
}
public class PMEntry
{
private Point3D m_Location;
private int m_Number;
public Point3D Location
{
get
{
return m_Location;
}
}
public int Number
{
get
{
return m_Number;
}
}
public PMEntry( Point3D loc, int number )
{
m_Location = loc;
m_Number = number;
}
}
private string m_Name; // A new variable to store the name of our location
public string Name
{ get { return m_Name; } }
private Map m_Map; // A new variable to store the map of our location
public Map Map
{ get { return m_Map; } }
public PMEntry(Point3D loc, Map map, string name) // A new PMEntry constructor that uses Name and Map variables
{
m_Location = loc;
m_Map = map;
m_Name = name;
}
}
public class PMList
{
private int m_Number, m_SelNumber;
private Map m_Map;
private PMEntry[] m_Entries;
public int Number
{
get
{
return m_Number;
}
}
public int SelNumber
{
get
{
return m_SelNumber;
}
}
public Map Map
{
get
{
return m_Map;
}
set { m_Map = value; } // Adding Set property to be able to change Map variable
}
public PMEntry[] Entries
{
get
{
return m_Entries;
}
}
public PMList( int number, int selNumber, Map map, PMEntry[] entries )
{
m_Number = number;
m_SelNumber = selNumber;
m_Map = map;
m_Entries = entries;
}
private string m_Name; // A new variable to store the name of list of new locations
public string Name
{ get { return m_Name; } }
public PMList(string name, PMEntry[] entries) // A new PMList constructor that uses Name
{
m_Name = name;
m_Entries = entries;
}
public static readonly PMList OtherLocations = // Adding new list of locations to our PublicMoongate gump
new PMList("Other Locations", new PMEntry[]
{
new PMEntry( new Point3D( 539, 460, -60 ), Map.Ilshenar, "Elf City" ) // Adding a new location
// Here should be added any locations you need
});
// To add a new list of locations just follow the example above
public static readonly PMList Trammel =
new PMList( 1012000, 1012012, Map.Trammel, new PMEntry[]
{
new PMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow
new PMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain
new PMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom
new PMEntry( new Point3D( 771, 752, 5 ), 1012006 ), // Yew
new PMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc
new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae
new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
new PMEntry( new Point3D( 3763, 2771, 50), 1078098 ) // New Haven
} );
public static readonly PMList Felucca =
new PMList( 1012001, 1012013, Map.Felucca, new PMEntry[]
{
new PMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow
new PMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain
new PMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom
new PMEntry( new Point3D( 771, 752, 5 ), 1012006 ), // Yew
new PMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc
new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae
new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
new PMEntry( new Point3D( 2711, 2234, 0 ), 1019001 ) // Buccaneer's Den
} );
public static readonly PMList Ilshenar =
new PMList( 1012002, 1012014, Map.Ilshenar, new PMEntry[]
{
new PMEntry( new Point3D( 1215, 467, -13 ), 1012015 ), // Compassion
new PMEntry( new Point3D( 722, 1366, -60 ), 1012016 ), // Honesty
new PMEntry( new Point3D( 744, 724, -28 ), 1012017 ), // Honor
new PMEntry( new Point3D( 281, 1016, 0 ), 1012018 ), // Humility
new PMEntry( new Point3D( 987, 1011, -32 ), 1012019 ), // Justice
new PMEntry( new Point3D( 1174, 1286, -30 ), 1012020 ), // Sacrifice
new PMEntry( new Point3D( 1532, 1340, - 3 ), 1012021 ), // Spirituality
new PMEntry( new Point3D( 528, 216, -45 ), 1012022 ), // Valor
new PMEntry( new Point3D( 1721, 218, 96 ), 1019000 ) // Chaos
} );
public static readonly PMList Malas =
new PMList( 1060643, 1062039, Map.Malas, new PMEntry[]
{
new PMEntry( new Point3D( 1015, 527, -65 ), 1060641 ), // Luna
new PMEntry( new Point3D( 1997, 1386, -85 ), 1060642 ) // Umbra
} );
public static readonly PMList Tokuno =
new PMList( 1063258, 1063415, Map.Tokuno, new PMEntry[]
{
new PMEntry( new Point3D( 1169, 998, 41 ), 1063412 ), // Isamu-Jima
new PMEntry( new Point3D( 802, 1204, 25 ), 1063413 ), // Makoto-Jima
new PMEntry( new Point3D( 270, 628, 15 ), 1063414 ) // Homare-Jima
} );
public static readonly PMList[] UORLists = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] UORListsYoung = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] LBRLists = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] LBRListsYoung = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] AOSLists = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] AOSListsYoung = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] SELists = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] SEListsYoung = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] RedLists = new PMList[] { Ilshenar, Malas };
public static readonly PMList[] SigilLists = new PMList[] { Ilshenar, Malas };
}
public class MoongateGump : Gump
{
private Mobile m_Mobile;
private Item m_Moongate;
private PMList[] m_Lists;
public MoongateGump( Mobile mobile, Item moongate ) : base( 100, 100 )
{
m_Mobile = mobile;
m_Moongate = moongate;
PMList[] checkLists;
if ( mobile.Player )
{
if ( Factions.Sigil.ExistsOn( mobile ) )
{
checkLists = PMList.SigilLists;
}
else if ( mobile.Kills >= 5 )
{
checkLists = PMList.RedLists;
}
else
{
int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags;
bool young = mobile is PlayerMobile ? ((PlayerMobile)mobile).Young : false;
if ( Core.SE && (flags & 0x10) != 0 )
checkLists = young ? PMList.SEListsYoung : PMList.SELists;
else if ( Core.AOS && (flags & 0x8) != 0 )
checkLists = young ? PMList.AOSListsYoung : PMList.AOSLists;
else if ( (flags & 0x4) != 0 )
checkLists = young ? PMList.LBRListsYoung : PMList.LBRLists;
else
checkLists = young ? PMList.UORListsYoung : PMList.UORLists;
}
}
else
{
checkLists = PMList.SELists;
}
m_Lists = new PMList[checkLists.Length];
for ( int i = 0; i < m_Lists.Length; ++i )
m_Lists[i] = checkLists[i];
for ( int i = 0; i < m_Lists.Length; ++i )
{
if ( m_Lists[i].Map == mobile.Map )
{
PMList temp = m_Lists[i];
m_Lists[i] = m_Lists[0];
m_Lists[0] = temp;
break;
}
}
AddPage( 0 );
AddBackground( 0, 0, 380, 280, 5054 );
AddButton( 10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 210, 140, 25, 1011036, false, false ); // OKAY
AddButton( 10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 235, 140, 25, 1011012, false, false ); // CANCEL
AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination:
for ( int i = 0; i < checkLists.Length; ++i )
{
AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 );
if (checkLists[i].Name != null)
AddHtml(30, 35 + (i * 25), 150, 20, checkLists[i].Name, false, false); // Using our names instead of cliloc names
else
AddHtmlLocalized( 30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false );
}
for ( int i = 0; i < m_Lists.Length; ++i )
RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) );
}
private void RenderPage( int index, int offset )
{
PMList list = m_Lists[index];
AddPage( index + 1 );
AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 );
if (list.Name != null)
AddHtml(30, 35 + (offset * 25), 150, 20, list.Name, false, false); // Using our names instead of cliloc names
else
AddHtmlLocalized( 30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false );
PMEntry[] entries = list.Entries;
for ( int i = 0; i < entries.Length; ++i )
{
AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i );
if (entries[i].Name != null)
AddHtml(225, 35 + (i * 25), 150, 20, entries[i].Name, false, false); // Using our names instead of cliloc names
else
AddHtmlLocalized( 225, 35 + (i * 25), 150, 20, entries[i].Number, false, false );
}
}
public override void OnResponse( NetState state, RelayInfo info )
{
if ( info.ButtonID == 0 ) // Cancel
return;
else if ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null )
return;
int[] switches = info.Switches;
if ( switches.Length == 0 )
return;
int switchID = switches[0];
int listIndex = switchID / 100;
int listEntry = switchID % 100;
if ( listIndex < 0 || listIndex >= m_Lists.Length )
return;
PMList list = m_Lists[listIndex];
if ( listEntry < 0 || listEntry >= list.Entries.Length )
return;
PMEntry entry = list.Entries[listEntry];
if (entry.Name != null) // If it's a location we added manually
list.Map = entry.Map; // Then use the map of this location
if ( !m_Mobile.InRange( m_Moongate.GetWorldLocation(), 1 ) || m_Mobile.Map != m_Moongate.Map )
{
m_Mobile.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate.
}
else if ( m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca )
{
m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Factions.Sigil.ExistsOn( m_Mobile ) && list.Map != Factions.Faction.Facet )
{
m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( m_Mobile.Criminal )
{
m_Mobile.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( Server.Spells.SpellHelper.CheckCombat( m_Mobile ) )
{
m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( m_Mobile.Spell != null )
{
m_Mobile.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
}
else if ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) )
{
m_Mobile.SendLocalizedMessage( 1019003 ); // You are already there.
}
else
{
BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map );
m_Mobile.Combatant = null;
m_Mobile.Warmode = false;
m_Mobile.Hidden = true;
m_Mobile.MoveToWorld( entry.Location, list.Map );
Effects.PlaySound( entry.Location, list.Map, 0x1FE );
}
}
}
|
|
|
|
|
|
#8 (permalink) |
|
Forum Expert
|
I have done this before and added my hole edited public moongates script into this thread just copy it and edit the locations and names.
Public Moongates
__________________
Advertise Your Server On JoinUO! JoinUO @ - joinuo.com
|
|
|
|
|
|
#9 (permalink) |
|
Lurker
Join Date: Dec 2006
Age: 34
Posts: 7
|
hi, ok i tried adding to the script in the specified ways, was able to get it to run without error with no problem at all, but when i add a entry to the script it still adds the button but has Error [Megacliloc] : instead of Cove, just as it would have before if i had put in a number it didn't recognize
public static readonly AotMList Trammel = new AotMList( 1012000, 1012012, Map.Trammel, new AotMEntry[] { new AotMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow new AotMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain new AotMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom new AotMEntry( new Point3D( 771, 752, 5 ), 1012006 ), // Yew new AotMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc new AotMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic new AotMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae new AotMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia new AotMEntry( new Point3D( 2711, 2234, 0 ), 1019001 ), // Buccaneer's Den new AotMEntry( new Point3D( 2285, 1209, 0 ), Map.Trammel, "Cove" ) // Cove } ); was wondering if maybe i did something wrong or what. |
|
|
|
|
|
#12 (permalink) |
|
Forum Expert
|
String version of PublicMoongate.CS
Just remove (Backup) old version, use this file thats attached, I've left the re-marked original code in it so you can hopefully learn what i changed... 10 minutes to do this ![]() Codes here too... Code:
using System;
using System.Collections.Generic;
using Server;
using Server.Commands;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
using Server.Spells;
namespace Server.Items
{
publicclass PublicMoongate : Item
{
publicoverridebool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
[Constructable]
public PublicMoongate() : base( 0xF6C )
{
Movable = false;
Light = LightType.Circle300;
}
public PublicMoongate( Serial serial ) : base( serial )
{
}
publicoverridevoid OnDoubleClick( Mobile from )
{
if ( !from.Player )
return;
if ( from.InRange( GetWorldLocation(), 1 ) )
UseGate( from );
else
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
publicoverridebool OnMoveOver( Mobile m )
{
// Changed so criminals are not blocked by it.
if ( m.Player )
UseGate( m );
returntrue;
}
publicoverridebool HandlesOnMovement{ get{ returntrue; } }
publicoverridevoid OnMovement( Mobile m, Point3D oldLocation )
{
if ( m is PlayerMobile )
{
if ( !Utility.InRange( m.Location, this.Location, 1 ) && Utility.InRange( oldLocation, this.Location, 1 ) )
m.CloseGump( typeof( MoongateGump ) );
}
}
publicbool UseGate( Mobile m )
{
if ( m.Criminal )
{
m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
returnfalse;
}
elseif ( SpellHelper.CheckCombat( m ) )
{
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
returnfalse;
}
elseif ( m.Spell != null )
{
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
returnfalse;
}
else
{
m.CloseGump( typeof( MoongateGump ) );
m.SendGump( new MoongateGump( m, this ) );
if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
Effects.PlaySound( m.Location, m.Map, 0x20E );
returntrue;
}
}
publicoverridevoid Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
publicoverridevoid Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
publicstaticvoid Initialize()
{
CommandSystem.Register( "MoonGen", AccessLevel.Administrator, new CommandEventHandler( MoonGen_OnCommand ) );
}
[Usage( "MoonGen" )]
[Description( "Generates public moongates. Removes all old moongates." )]
publicstaticvoid MoonGen_OnCommand( CommandEventArgs e )
{
DeleteAll();
int count = 0;
count += MoonGen( PMList.Trammel );
count += MoonGen( PMList.Felucca );
count += MoonGen( PMList.Ilshenar );
count += MoonGen( PMList.Malas );
count += MoonGen( PMList.Tokuno );
World.Broadcast( 0x35, true, "{0} moongates generated.", count );
}
privatestaticvoid DeleteAll()
{
List<Item> list = newList<Item>();
foreach ( Item item in World.Items.Values )
{
if ( item is PublicMoongate )
list.Add( item );
}
foreach ( Item item in list )
item.Delete();
if ( list.Count > 0 )
World.Broadcast( 0x35, true, "{0} moongates removed.", list.Count );
}
privatestaticint MoonGen( PMList list )
{
foreach ( PMEntry entry in list.Entries )
{
Item item = new PublicMoongate();
item.MoveToWorld( entry.Location, list.Map );
// if ( entry.Number == 1060642 ) // Umbra
if (entry.Number == "Umbra") // Umbra 1060642
item.Hue = 0x497;
}
return list.Entries.Length;
}
}
publicclass PMEntry
{
private Point3D m_Location;
privatestring m_Number; // int
public Point3D Location
{
get
{
return m_Location;
}
}
publicstring Number // int
{
get
{
return m_Number;
}
}
public PMEntry(Point3D loc, string number) // int
{
m_Location = loc;
m_Number = number;
}
}
publicclass PMList
{
privatestring m_Number, m_SelNumber; // int
private Map m_Map;
private PMEntry[] m_Entries;
publicstring Number // int
{
get
{
return m_Number;
}
}
publicstring SelNumber // int
{
get
{
return m_SelNumber;
}
}
public Map Map
{
get
{
return m_Map;
}
}
public PMEntry[] Entries
{
get
{
return m_Entries;
}
}
// public PMList( int number, int selNumber, Map map, PMEntry[] entries )
public PMList(string number, string selNumber, Map map, PMEntry[] entries)
{
m_Number = number;
m_SelNumber = selNumber;
m_Map = map;
m_Entries = entries;
}
publicstaticreadonly PMList Trammel =
// new PMList( 1012000, 1012012, Map.Trammel, new PMEntry[]
new PMList("Trammel", "<BASEFONT COLOR=#00EE00>Trammel", Map.Trammel, new PMEntry[]
{
// new PMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow
// new PMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain
// new PMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom
// new PMEntry( new Point3D( 771, 752, 5 ), 1012006 ), // Yew
// new PMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc
// new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
// new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae
// new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
// new PMEntry( new Point3D( 3450, 2677, 25), 1078098 ) // New Haven
new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow 1012003
new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain 1012004
new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom 1012005
new PMEntry( new Point3D( 771, 752, 5 ), "Yew" ), // Yew 1012006
new PMEntry( new Point3D( 2701, 692, 5 ), "Minoc" ), // Minoc 1012007
new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic 1012008
new PMEntry( new Point3D( 643, 2067, 5 ), "Skara Brae" ), // Skara Brae 1012009
new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia 1012010
new PMEntry( new Point3D( 3450, 2677, 25), "New Haven" ) // Haven 1046259
} );
publicstaticreadonly PMList Felucca =
// new PMList( 1012001, 1012013, Map.Felucca, new PMEntry[]
new PMList("Felucca", "<BASEFONT COLOR=#00EE00>Felucca", Map.Felucca, new PMEntry[]
{
// new PMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow
// new PMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain
// new PMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom
// new PMEntry( new Point3D( 771, 752, 5 ), 1012006 ), // Yew
// new PMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc
// new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
// new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae
// new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
// new PMEntry( new Point3D( 2711, 2234, 0 ), 1019001 ) // Buccaneer's Den
new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow 1012003
new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain 1012004
new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom 1012005
new PMEntry( new Point3D( 771, 752, 5 ), "Yew" ), // Yew 1012006
new PMEntry( new Point3D( 2701, 692, 5 ), "Minoc" ), // Minoc 1012007
new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic 1012008
new PMEntry( new Point3D( 643, 2067, 5 ), "Skara Brae" ), // Skara Brae 1012009
new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia 1012010
new PMEntry( new Point3D( 2711, 2234, 0 ), "Buccaneer's Den" ) // Buccaneer's Den 1019001
} );
publicstaticreadonly PMList Ilshenar =
// new PMList( 1012002, 1012014, Map.Ilshenar, new PMEntry[]
new PMList("Ilshenar", "<BASEFONT COLOR=#00EE00>Ilshenar", Map.Ilshenar, new PMEntry[]
{
// new PMEntry( new Point3D( 1215, 467, -13 ), 1012015 ), // Compassion
// new PMEntry( new Point3D( 722, 1366, -60 ), 1012016 ), // Honesty
// new PMEntry( new Point3D( 744, 724, -28 ), 1012017 ), // Honor
// new PMEntry( new Point3D( 281, 1016, 0 ), 1012018 ), // Humility
// new PMEntry( new Point3D( 987, 1011, -32 ), 1012019 ), // Justice
// new PMEntry( new Point3D( 1174, 1286, -30 ), 1012020 ), // Sacrifice
// new PMEntry( new Point3D( 1532, 1340, - 3 ), 1012021 ), // Spirituality
// new PMEntry( new Point3D( 528, 216, -45 ), 1012022 ), // Valor
// new PMEntry( new Point3D( 1721, 218, 96 ), 1019000 ) // Chaos
new PMEntry( new Point3D( 1215, 467, -13 ), "Compassion" ), // Compassion 1012015
new PMEntry( new Point3D( 722, 1366, -60 ), "Honesty" ), // Honesty 1012016
new PMEntry( new Point3D( 744, 724, -28 ), "Honor" ), // Honor 1012017
new PMEntry( new Point3D( 281, 1016, 0 ), "Humility" ), // Humility 1012018
new PMEntry( new Point3D( 987, 1011, -32 ), "Justice" ), // Justice 1012019
new PMEntry( new Point3D( 1174, 1286, -30 ), "Sacrifice" ), // Sacrifice 1012020
new PMEntry( new Point3D( 1532, 1340, - 3 ), "Spirituality" ), // Spirituality 1012021
new PMEntry( new Point3D( 528, 216, -45 ), "Valor" ), // Valor 1012022
new PMEntry( new Point3D( 1721, 218, 96 ), "Chaos" ) // Chaos 1019000
} );
publicstaticreadonly PMList Malas =
// new PMList( 1060643, 1062039, Map.Malas, new PMEntry[]
new PMList("Malas", "<BASEFONT COLOR=#00EE00>Malas", Map.Malas, new PMEntry[]
{
// new PMEntry( new Point3D( 1015, 527, -65 ), 1060641 ), // Luna
// new PMEntry( new Point3D( 1997, 1386, -85 ), 1060642 ) // Umbra
new PMEntry( new Point3D( 1015, 527, -65 ), "Luna" ), // Luna 1060641
new PMEntry( new Point3D( 1997, 1386, -85 ), "Umbra" ) // Umbra 1060642
} );
publicstaticreadonly PMList Tokuno =
// new PMList( 1063258, 1063415, Map.Tokuno, new PMEntry[]
new PMList("Tokuno", "<BASEFONT COLOR=#00EE00>Tokuno", Map.Tokuno, new PMEntry[]
{
// new PMEntry( new Point3D( 1169, 998, 41 ), 1063412 ), // Isamu-Jima
// new PMEntry( new Point3D( 802, 1204, 25 ), 1063413 ), // Makoto-Jima
// new PMEntry( new Point3D( 270, 628, 15 ), 1063414 ) // Homare-Jima
new PMEntry( new Point3D( 1169, 998, 41 ), "Isamu-Jima" ), // Isamu-Jima 1063412
new PMEntry( new Point3D( 802, 1204, 25 ), "Makoto-Jima" ), // Makoto-Jima 1063413
new PMEntry( new Point3D( 270, 628, 15 ), "Homare-Jima" ) // Homare-Jima 1063414
} );
publicstaticreadonly PMList[] UORLists = new PMList[] { Trammel, Felucca };
publicstaticreadonly PMList[] UORListsYoung = new PMList[] { Trammel };
publicstaticreadonly PMList[] LBRLists = new PMList[] { Trammel, Felucca, Ilshenar };
publicstaticreadonly PMList[] LBRListsYoung = new PMList[] { Trammel, Ilshenar };
publicstaticreadonly PMList[] AOSLists = new PMList[] { Trammel, Felucca, Ilshenar, Malas };
publicstaticreadonly PMList[] AOSListsYoung = new PMList[] { Trammel, Ilshenar, Malas };
publicstaticreadonly PMList[] SELists = new PMList[] { Trammel, Felucca, Ilshenar, Malas, Tokuno };
publicstaticreadonly PMList[] SEListsYoung = new PMList[] { Trammel, Ilshenar, Malas, Tokuno };
publicstaticreadonly PMList[] RedLists = new PMList[] { Felucca };
publicstaticreadonly PMList[] SigilLists = new PMList[] { Felucca };
}
publicclass MoongateGump : Gump
{
private Mobile m_Mobile;
private Item m_Moongate;
private PMList[] m_Lists;
public MoongateGump( Mobile mobile, Item moongate ) : base( 100, 100 )
{
m_Mobile = mobile;
m_Moongate = moongate;
PMList[] checkLists;
if ( mobile.Player )
{
if ( Factions.Sigil.ExistsOn( mobile ) )
{
checkLists = PMList.SigilLists;
}
elseif ( mobile.Kills >= 5 )
{
checkLists = PMList.RedLists;
}
else
{
int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags;
bool young = mobile is PlayerMobile ? ((PlayerMobile)mobile).Young : false;
if ( Core.SE && (flags & 0x10) != 0 )
checkLists = young ? PMList.SEListsYoung : PMList.SELists;
elseif ( Core.AOS && (flags & 0x8) != 0 )
checkLists = young ? PMList.AOSListsYoung : PMList.AOSLists;
elseif ( (flags & 0x4) != 0 )
checkLists = young ? PMList.LBRListsYoung : PMList.LBRLists;
else
checkLists = young ? PMList.UORListsYoung : PMList.UORLists;
}
}
else
{
checkLists = PMList.SELists;
}
m_Lists = new PMList[checkLists.Length];
for ( int i = 0; i < m_Lists.Length; ++i )
m_Lists[i] = checkLists[i];
for ( int i = 0; i < m_Lists.Length; ++i )
{
if ( m_Lists[i].Map == mobile.Map )
{
PMList temp = m_Lists[i];
m_Lists[i] = m_Lists[0];
m_Lists[0] = temp;
break;
}
}
AddPage( 0 );
AddBackground( 0, 0, 380, 280, 5054 );
AddButton( 10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 );
// AddHtmlLocalized( 45, 210, 140, 25, 1011036, false, false ); // OKAY
AddHtml(45, 210, 140, 25, (string.Format("OKAY")), false, false); // OKAY
AddButton( 10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0 );
// AddHtmlLocalized( 45, 235, 140, 25, 1011012, false, false ); // CANCEL
AddHtml(45, 235, 140, 25, (string.Format("CANCEL")), false, false); // CANCEL
AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination:
for ( int i = 0; i < checkLists.Length; ++i )
{
AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 );
// AddHtmlLocalized( 30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false );
AddHtml(30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false);
}
for ( int i = 0; i < m_Lists.Length; ++i )
RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) );
}
privatevoid RenderPage( int index, int offset )
{
PMList list = m_Lists[index];
AddPage( index + 1 );
AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 );
// AddHtmlLocalized( 30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false );
AddHtml(30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false);
PMEntry[] entries = list.Entries;
for ( int i = 0; i < entries.Length; ++i )
{
AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i );
// AddHtmlLocalized( 225, 35 + (i * 25), 150, 20, entries[i].Number, false, false );
AddHtml(225, 35 + (i * 25), 150, 20, entries[i].Number, false, false);
}
}
publicoverridevoid OnResponse( NetState state, RelayInfo info )
{
if ( info.ButtonID == 0 ) // Cancel
return;
elseif ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null )
return;
int[] switches = info.Switches;
if ( switches.Length == 0 )
return;
int switchID = switches[0];
int listIndex = switchID / 100;
int listEntry = switchID % 100;
if ( listIndex < 0 || listIndex >= m_Lists.Length )
return;
PMList list = m_Lists[listIndex];
if ( listEntry < 0 || listEntry >= list.Entries.Length )
return;
PMEntry entry = list.Entries[listEntry];
if ( !m_Mobile.InRange( m_Moongate.GetWorldLocation(), 1 ) || m_Mobile.Map != m_Moongate.Map )
{
m_Mobile.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate.
}
elseif ( m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca )
{
m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
elseif ( Factions.Sigil.ExistsOn( m_Mobile ) && list.Map != Factions.Faction.Facet )
{
m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
elseif ( m_Mobile.Criminal )
{
m_Mobile.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
elseif ( SpellHelper.CheckCombat( m_Mobile ) )
{
m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
elseif ( m_Mobile.Spell != null )
{
m_Mobile.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
}
elseif ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) )
{
m_Mobile.SendLocalizedMessage( 1019003 ); // You are already there.
}
else
{
BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map );
m_Mobile.Combatant = null;
m_Mobile.Warmode = false;
m_Mobile.Hidden = true;
m_Mobile.MoveToWorld( entry.Location, list.Map );
Effects.PlaySound( entry.Location, list.Map, 0x1FE );
}
}
}
}
__________________
![]() We can now be found on listUO.com & ConnectUO.Com
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|