|
||
|
|||||||
| New Join Forum So your new to RunUO and looking to work with people that are new, this is the place. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#2 (permalink) |
|
UO Gamers: Demise Administrator
Join Date: Oct 2002
Location: Swamp
Age: 29
Posts: 10,799
|
Yes. Create a new gate using code similar to the PublicMoongate.cs file, but pointing to the Dungeons instead.
__________________
psz Demise' Creator (Retired) The RunUO.com Forum Moderator Team Former Official RunUO Scripter (Retired) Websites: My 360 Blog My Gaming Site(Old Link) My Gaming Site(New Link) |
|
|
|
|
|
#3 (permalink) |
|
Forum Expert
Join Date: Sep 2004
Age: 37
Posts: 1,006
|
this made me kinda curious, so I opened up publicmoongate.cs and took a look.
havent actually done it, but the awy I would go about it is to create a new script file called dungeonmoongate or something similar, and inherit all the classes fom publicmoongate, so that that becomes the base class for the new type of cate. I'd change the color to something other than blue while your at it (red comes to mind, but whatever). now, override the PMList class and write your own lists based on whats in the publicmoongate.cs file. for instance, this is the trammel list from publicmoongate.cs: Code:
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), 1046259 ) // Haven
} );
Code:
public PMEntry( Point3D loc, int number ) Point3D is from map.cs. pretty easy to understand, it's simply the X, Y, Z tile location that you want the destination to be at. 101 way's to get that info. anyway, good luck. ![]() |
|
|
|
|
|
#5 (permalink) |
|
Forum Expert
Join Date: Sep 2004
Age: 37
Posts: 1,006
|
well, you can either stick it in the scripts/items/misc directory along side publicmoongate.cs, or stick it in a scripts/custom folder. actually, it really doesn't make much of a difference where you locate the file, as long as its in the scripts folder someplace, but for mantiainability, most people create a custom folder for all non-distro files.
after that's done, simply start (or restart) the server so that it compiles the scripts again. once the server compiles it, it'll be available just like a public moongate is, to [add. "[add publicmoongate" would add a regular moongate, "[add dungeonmoongate" would add one of your new gates. |
|
|
|
|
|
#6 (permalink) |
|
Join Date: Jun 2005
Age: 38
Posts: 38
|
What part of the code shown above would be the name?
notice it says //Moonglow ... what part of the code changes this? Is it the Numerical value to the right? Where do these numbers come from? Thanks again for the help and information. |
|
|
|
|
|
#7 (permalink) | |
|
Account Terminated
|
Quote:
|
|
|
|
|
|
|
#8 (permalink) |
|
Join Date: Jun 2005
Age: 38
Posts: 38
|
Oh man ... I am lost.
Is there any way someone can show me exactly what parts of the script would need to be changed? I am wadding through the code but that last post about changing the function call has me a little nervous. Newbie jitters ... |
|
|
|
|
|
#9 (permalink) | |
|
God of Pandora
Join Date: Jun 2003
Location: Gainesville GA
Age: 31
Posts: 2,000
|
Quote:
if you subscribe, you may use mine, its already completed and has all the major dungeons on it already Help with MysticHat.cs and SpellHelper.cs
__________________
The Den of KillerBeeZ...Kender's Komments, uncensored commentary from the Kender. Plus anything else the Kender might have in his pouches.
|
|
|
|
|
|
|
#10 (permalink) | |
|
Account Terminated
|
Quote:
|
|
|
|
|
|
|
#11 (permalink) |
|
Join Date: Jun 2005
Age: 38
Posts: 38
|
I have looked through this code and not been able to grasp how it works. This system contains a number of files and works completely different from the publicmoongate.cs file.
Is there another script submission out there I am missing? Thanks. |
|
|
|
|
|
#12 (permalink) | |
|
Account Terminated
|
Quote:
|
|
|
|
|
|
|
#13 (permalink) | ||
|
Forum Expert
Join Date: Sep 2004
Age: 37
Posts: 1,006
|
Quote:
Quote:
the name of any class in C# is the first part after the namespace declaration. "public class yaddayadda" then, theres a constructor which looks just like a member function but has no return variables and no parameters, with the same name as the class. you'll notice everything that I talked about in the first post and this one in publicmoongates.cs if you don't know how to program at all, or are completely new to C#, i would recommend doing some reading and trying a few example programs and tutorials before starting anything like this though. If you need that, I would reccomend www.codeproject.com or a similar site. |
||
|
|
|
|
|
#16 (permalink) |
|
Master of the Internet
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
|
You can't. There is no cliloc for "Deceit". The way the PMEntry method works is that it takes a cliloc value, not a string, so yu can't just say "Deceit". I tried this, and traced the method all the way into the core without being able to fix it, I think.
You either have to re-write the PMEntry class, or you have to give up.
__________________
Goodbye, folks. |
|
|
|
|
|
#18 (permalink) |
|
Master of the Internet
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
|
Actually...there may be (a cliloc for Deceit). Go read the thread "Where" in Script/Server Support, d/l the cliloc finder, and see if there IS a cliloc for Deceit. If there is, pass its number to PMEntry and you're gtg.
__________________
Goodbye, folks. |
|
|
|
|
|
#19 (permalink) | |
|
Forum Expert
Join Date: Sep 2004
Age: 37
Posts: 1,006
|
from my fisrt reply:
Quote:
hehe |
|
|
|
|
|
|
#20 (permalink) |
|
Forum Expert
Join Date: Feb 2003
Location: East Coast USA
Posts: 1,358
|
Grab the custom moongate script and then just use that to add or edit moongates or moongate categories. Or you could use this modified script. I'd recommend the custom moongates script tho. :>
PublicMoongate.cs - modified to accept strings. Code:
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
namespace Server.Items
{
public class PublicMoongate : Item
{
[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 )
{
return !m.Player || UseGate( m );
}
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()
{
Server.Commands.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()
{
ArrayList list = new ArrayList();
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.Text == "Umbra" ) // was - if ( entry.Number == 1060642 )
item.Hue = 0x497;
}
return list.Entries.Length;
}
}
// ** BEGIN CHANGES DESTINATIONS **
public class PMEntry
{
private Point3D m_Location;
private string m_Text; // was - private int m_Number;
public Point3D Location
{
get
{
return m_Location;
}
}
public string Text // was - public int Number
{
get
{
return m_Text; // was - return m_Number;
}
}
public PMEntry( Point3D loc, string text ) // was - public PMEntry( Point3D loc, int number )
{
m_Location = loc;
m_Text = text; // was - m_Number = number;
}
}
// ** END CHANGES DESTINATIONS **
// ** BEGIN CHANGES FACETS **
public class PMList
{
private string m_Text, m_SelText; // was - private int m_Number, m_SelNumber;
private Map m_Map;
private PMEntry[] m_Entries;
public string Text // was - public int Number
{
get
{
return m_Text; // was - return m_Number;
}
}
public string SelText // was - public int SelNumber
{
get
{
return m_SelText; // was - 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 text, string selText, Map map, PMEntry[] entries )
{
m_Text = text; // was - m_Number = number;
m_SelText = selText; // was - m_SelNumber = selNumber;
m_Map = map;
m_Entries = entries;
}
// ** END CHANGES FACETS
// ** BEGIN CHANGES DESTINATIONS & FACETS ** Change cliloc number to text.
// ** Change PMList lines if changing facets in this script. Do this for all facets.
// ** Change PMEntry lines if changing destination names in this script. Do this for all destinations.
public static readonly PMList Trammel =
new PMList( "Market", "<BASEFONT COLOR=#2DDC1B>Market</BASEFONT>", Map.Trammel, new PMEntry[]
{
// new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow
// new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain
// new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom
// new PMEntry( new Point3D( 771, 752, 5 ), "Yew" ), // Yew
// new PMEntry( new Point3D( 2701, 692, 5 ), "Minoc" ), // Minoc
// new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic
// new PMEntry( new Point3D( 643, 2067, 5 ), "Skara Brae" ), // Skara Brae
// new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia
new PMEntry( new Point3D( 3763, 2771, 50), "Haven (Bazaar)" ) // Haven
} );
public static readonly PMList Felucca =
new PMList( "Britannia", "<BASEFONT COLOR=#2DDC1B>Britannia</BASEFONT>", Map.Felucca, new PMEntry[]
{
new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow
new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain
new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom
new PMEntry( new Point3D( 771, 752, 5 ), "Yew" ), // Yew
new PMEntry( new Point3D( 2701, 692, 5 ), "Minoc" ), // Minoc
new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic
new PMEntry( new Point3D( 643, 2067, 5 ), "Skara Brae" ), // Skara Brae
new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia
new PMEntry( new Point3D( 2711, 2234, 0 ), "Buccaneer's Den" ) // Buccaneer's Den
} );
public static readonly PMList Ilshenar =
new PMList( "Underworld", "<BASEFONT COLOR=#2DDC1B>Underworld</BASEFONT>", Map.Ilshenar, new PMEntry[]
{
new PMEntry( new Point3D( 1215, 467, -13 ), "Compassion" ), // Compassion
new PMEntry( new Point3D( 722, 1366, -60 ), "Honesty" ), // Honesty
new PMEntry( new Point3D( 744, 724, -28 ), "Honor" ), // Honor
new PMEntry( new Point3D( 281, 1016, 0 ), "Humility" ), // Humility
new PMEntry( new Point3D( 987, 1011, -32 ), "Justice" ), // Justice
new PMEntry( new Point3D( 1174, 1286, -30 ), "Sacrifice" ), // Sacrifice
new PMEntry( new Point3D( 1532, 1340, - 3 ), "Spirituality" ), // Spirituality
new PMEntry( new Point3D( 528, 216, -45 ), "Valor" ), // Valor
new PMEntry( new Point3D( 1721, 218, 96 ), "Chaos" ) // Chaos
} );
public static readonly PMList Malas =
new PMList( "Gargoyle Land", "<BASEFONT COLOR=#2DDC1B>Gargoyle Land</BASEFONT>", Map.Malas, new PMEntry[]
{
new PMEntry( new Point3D( 1015, 527, -65 ), "Luna" ), // Luna
new PMEntry( new Point3D( 1997, 1386, -85 ), "Umbra" ) // Umbra
} );
public static readonly PMList Tokuno =
new PMList( "Tokuno", "<BASEFONT COLOR=#2DDC1B>Tokuno</BASEFONT>", Map.Tokuno, new PMEntry[]
{
new PMEntry( new Point3D( 1169, 998, 41 ), "Isamu-Jima" ), // Isamu-Jima
new PMEntry( new Point3D( 802, 1204, 25 ), "Makoto-Jima" ), // Makoto-Jima
new PMEntry( new Point3D( 270, 628, 15 ), "Homare-Jima" ) // Homare-Jima
} );
// ** END CHANGES DESTINATIONS & FACETS **
// public static readonly PMList[] UORLists = new PMList[]{ Trammel, Felucca };
// public static readonly PMList[] LBRLists = new PMList[]{ Trammel, Felucca, Ilshenar };
// public static readonly PMList[] AOSLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas };
// public static readonly PMList[] RedLists = new PMList[]{ Felucca };
public static readonly PMList[] UORLists = new PMList[] { Trammel, Felucca };
public static readonly PMList[] UORlistsYoung = new PMList[] { Trammel, Felucca };
public static readonly PMList[] LBRLists = new PMList[] { Trammel, Felucca, Ilshenar };
public static readonly PMList[] LBRListsYoung = new PMList[] { Trammel, Felucca, Ilshenar };
public static readonly PMList[] AOSLists = new PMList[] { Trammel, Felucca, Ilshenar, Malas };
public static readonly PMList[] AOSListsYoung = new PMList[] { Trammel, Felucca, Ilshenar, Malas };
public static readonly PMList[] SELists = new PMList[] { Trammel, Felucca, Ilshenar, Malas, Tokuno };
public static readonly PMList[] SEListsYoung = new PMList[] { Trammel, Felucca, 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 >= 1 )
{
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 );
// ** BEGIN CHANGES FACETS **
// AddHtmlLocalized( 30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false );
AddHtml( 30, 35 + (i * 25), 150, 20, checkLists[i].Text, false, false );
// ** END CHANGES FACETS **
}
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 );
// ** BEGIN CHANGES FACETS **
// AddHtmlLocalized( 30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false );
AddHtml( 30, 35 + (offset * 25), 150, 20, list.SelText, false, false );
// ** END CHANGES FACETS **
PMEntry[] entries = list.Entries;
for ( int i = 0; i < entries.Length; ++i )
{
AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i );
// ** BEGIN CHANGES DESTINATIONS **
// AddHtmlLocalized( 225, 35 + (i * 25), 150, 20, entries[i].Number, false, false );
AddHtml( 225, 35 + (i * 25), 150, 20, entries[i].Text, false, false );
// ** END CHANGES DESTINATIONS **
}
}
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 ( !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 >= 1 && 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.Map = list.Map;
//m_Mobile.Location = entry.Location;
m_Mobile.MoveToWorld( entry.Location, list.Map );
Effects.PlaySound( entry.Location, list.Map, 0x1FE );
}
}
}
}
__________________
the-retelling.org : scripts and tech demo |
|
|
|
|
|
#22 (permalink) |
|
Forum Novice
Join Date: Dec 2003
Location: South-Africa
Age: 19
Posts: 165
|
Hey sneakabout, I searched the old Archives for a script that uses strings, instead of ClilocID's
http://runuo.com/forum/showthread.ph...light=Moongate I quickly modified Marcus247's script and added the dungeons in Trammel, Felucca and Malas for you, Im sure if you look at how its done, you can add Ilshenar / Your own (Its 5AM here, and Im pooped, so you'll have to do them )It works with 1.0.0 so you shouldent have any problems. Click here to Download the one WITH Dungeons already added (Notice, that link will expire within about 2 hours, download it ASAP)
__________________
|
|
|
|
|
|
#23 (permalink) |
|
Forum Expert
Join Date: Sep 2004
Age: 37
Posts: 1,006
|
yea, you Cheaters!
sneakabout seemed like he was workin it out on his own. i'm sure he's a bit frustrated, but i'm also sure that he's learning quite a bit... jsut hope he doesn't give up on his own script. btw, congrats TM! ![]() |
|
|
|