Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 07-02-2008, 10:47 AM   #1 (permalink)
Lurker
 
Join Date: Jul 2008
Posts: 7
Default StatStone & SkillStone

I've searched the forums rather extensively in search of a working stat/skill stone and there doesn't seem to be one lying around anywhere.

What I did find out is that people said just to use the one built into the testcenter.cs but I don't want to do that and I'm sure many others don't want to either.

What I'm looking for is a stone that when double clicked gives the option to select stats (that must total 225 and not exceed 100 each) and a skill stone (to select a total of 700 skills each not exceeding 100).

I saw a picture of this on goggle. It's not exactly what I'm looking for but it would be a starting point.



Any help would be appreciated.
silverzx1 is offline   Reply With Quote
Old 07-02-2008, 02:39 PM   #2 (permalink)
Newbie
 
Join Date: Aug 2003
Location: Pennsylvania
Posts: 75
Send a message via AIM to valarnin Send a message via Yahoo to valarnin
Default

First off, take a look at this gump guide. Next, take a look at the Test Center's code to change the player's skills.
__________________
Chances are I'm bored, so I'll probably help you. If I'm really bored I might do a few scripts on request, but contact me by messenger if you want that.
valarnin is offline   Reply With Quote
Old 07-02-2008, 07:28 PM   #3 (permalink)
Lurker
 
Join Date: Jul 2008
Posts: 7
Default

Followed that guide. That is great but doesn't have the script counter part. Or what I mean is I don't know how to make it run scripts when options are selected/input.

Edit: How do I stop the test center from sending all the junk items to the bank?

Last edited by silverzx1; 07-02-2008 at 07:32 PM.
silverzx1 is offline   Reply With Quote
Old 07-03-2008, 01:02 AM   #4 (permalink)
Newbie
 
Join Date: Aug 2003
Location: Pennsylvania
Posts: 75
Send a message via AIM to valarnin Send a message via Yahoo to valarnin
Default

Post what you've got, and we'll go from there.
__________________
Chances are I'm bored, so I'll probably help you. If I'm really bored I might do a few scripts on request, but contact me by messenger if you want that.
valarnin is offline   Reply With Quote
Old 07-03-2008, 06:27 AM   #5 (permalink)
Lurker
 
Join Date: Jul 2008
Posts: 7
Default

Ok well this is what I got so far. Basically I've made what It should look like but haven't changed its script at all and it won't even compile properly.. What I want is for people to be able to enter a total of 225 numbers in the three boxes obviously representing their stats.. It needs to check if each one exceeds 100 and needs to make sure it MUST total 225. Heres a SS and my code.



Code:
//#define RunUo2_0

using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;

namespace Server.Gumps
{
    public class StatStoneGump : Gump
    {
        Mobile caller;

        public static void Initialize()

        {
#if(RunUo2_0)
            CommandSystem.Register("[Stats", AccessLevel.Player, new CommandEventHandler([Stats_OnCommand));
#else
            Register("[Stats", AccessLevel.Player, new CommandEventHandler([Stats_OnCommand));
#endif
        }

        [Usage("[Stats")]
        [Description("Makes a call to your custom gump.")]
        public static void [Stats_OnCommand(CommandEventArgs e)
        {
            caller = e.Mobile;

            if (caller.HasGump(typeof(StatStoneGump)))
                caller.CloseGump(typeof(StatStoneGump));
            caller.SendGump(new StatStoneGump(caller));
        }

        public StatStoneGump(Mobile from) : this()
        {
            caller = from;
        }

        public StatStoneGump() : base( 0, 0 )
        {
            this.Closable=true;
			this.Disposable=false;
			this.Dragable=false;
			this.Resizable=false;

			AddPage(0);
			AddBackground(8, 14, 185, 228, 5170);
			AddLabel(60, 38, 0, @"Stat Stone");
			AddButton(66, 192, 247, 248, 0, GumpButtonType.Reply, 0);
			AddTextEntry(94, 140, 55, 18, 0, 0, @"");
			AddTextEntry(94, 113, 55, 18, 0, 0, @"");
			AddTextEntry(94, 86, 55, 18, 0, 0, @"");
			AddLabel(45, 85, 0, @"Str");
			AddLabel(45, 110, 0, @"Dex");
			AddLabel(46, 139, 0, @"Int");
			

            			TextRelay entry0 = info.GetTextEntry(0);
			string text0 = (entry0 == null ? "" : entry0.Text.Trim());

			TextRelay entry0 = info.GetTextEntry(0);
			string text0 = (entry0 == null ? "" : entry0.Text.Trim());

			TextRelay entry0 = info.GetTextEntry(0);
			string text0 = (entry0 == null ? "" : entry0.Text.Trim());


        }

        

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch(info.ButtonID)
            {
                				case 0:
				{

					break;
				}

            }
        }
    }
}
silverzx1 is offline   Reply With Quote
Old 07-03-2008, 10:16 AM   #6 (permalink)
Newbie
 
Join Date: Aug 2003
Location: Pennsylvania
Posts: 75
Send a message via AIM to valarnin Send a message via Yahoo to valarnin
Default

Here, this should do exactly what you want it to do:
Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;

namespace Server.Gumps
{
	public class StatStoneG : Gump
	{
		public static void Initialize()
		{
			CommandSystem.Register("[Stats", AccessLevel.Player, new CommandEventHandler(Stats_OnCommand));
		}

		[Usage("[Stats")]
		[Description("Makes a call to your custom gump.")]
		public static void Stats_OnCommand(CommandEventArgs e)
		{
			Mobile caller = e.Mobile;

			if (caller.HasGump(typeof(StatStoneG)))
				caller.CloseGump(typeof(StatStoneG));
			caller.SendGump(new StatStoneG( "", caller.RawStr, caller.RawDex, caller.RawInt ));
		}

		public StatStoneG() : this( "", 0, 0, 0 )
		{
		}

		public StatStoneG( string ExtraText ) : this( ExtraText, 0, 0, 0 )
		{
		}

		public StatStoneG( string ExtraText, int STR, int DEX, int INT ) : base( 0, 0 )
		{
			this.Closable = true;
			this.Disposable = false;
			this.Dragable = true;
			this.Resizable = false;
			int GumpStr = 0, GumpDex = 0, GumpInt = 0;
			string StrStr, DexStr, IntStr;
			if (STR != 0 || DEX != 0 || INT != 0)
			{
				GumpStr = STR;
				GumpDex = DEX;
				GumpInt = INT;
			}
			StrStr = (GumpStr > 100 ? @"!! Str" : @"Str");
			DexStr = (GumpDex > 100 ? @"!! Dex" : @"Dex");
			IntStr = (GumpInt > 100 ? @"!! Int" : @"Int");
			AddPage(0);
			AddBackground(8, 14, 185, 228, 5170);
			AddLabel(60, 38, 0, @"Stats");
			if (ExtraText.Length > 0)
			{
				AddLabel(30, 62, 0, ExtraText.Remove((ExtraText.Length > 14 ? 14 : ExtraText.Length)));
				AddLabel(30, 89, 0, ExtraText.Remove(0, (ExtraText.Length > 15 ? 15 : ExtraText.Length)));
			}
			AddLabel(30, 113, 0, StrStr);
			AddTextEntry(94, 113, 55, 18, 0, 2, GumpStr.ToString());
			AddLabel(30, 140, 0, DexStr);
			AddTextEntry(94, 140, 55, 18, 0, 1, GumpDex.ToString());
			AddLabel(30, 167, 0, IntStr);
			AddTextEntry(94, 167, 55, 18, 0, 0, GumpInt.ToString());
			AddButton(66, 192, 247, 248, 0, GumpButtonType.Reply, 0);
		}



		public override void OnResponse(NetState sender, RelayInfo info)
		{
			Mobile from = sender.Mobile;

			switch(info.ButtonID)
			{
				case 0:
				{
					TextRelay entry = info.GetTextEntry(0);
					int Intelligence = int.Parse(entry.Text.Trim());
					entry = info.GetTextEntry(1);
					int Dexterity = int.Parse(entry.Text.Trim());
					entry = info.GetTextEntry(2);
					int Strength = int.Parse(entry.Text.Trim());
                    int Total = Intelligence + Dexterity + Strength;
					if (Total != 225)
					{
						from.SendGump(new StatStoneG( "Total of stats must equal 225", Strength, Dexterity, Intelligence ));
					}
					else if (Intelligence > 100 || Dexterity > 100 || Strength > 100)
					{
						from.SendGump(new StatStoneG( "All stats must be below 100", Strength, Dexterity, Intelligence ));
					}
					else
					{
						from.RawStr = Strength;
						from.RawDex = Dexterity;
						from.RawInt = Intelligence;
					}
					break;
				}
			}
		}
	}
}
__________________
Chances are I'm bored, so I'll probably help you. If I'm really bored I might do a few scripts on request, but contact me by messenger if you want that.
valarnin is offline   Reply With Quote
Old 07-03-2008, 02:44 PM   #7 (permalink)
Lurker
 
Join Date: Jul 2008
Posts: 7
Default

Woah thanks a lot man. Only problem is I can't get it to run.. I tried changing the command and stuff but it won't run... Err, I'm prob just being a noob but [Stats is already a preset RunUO command and when I tried changing where it says [Stats to something else it still ceased to work...
silverzx1 is offline   Reply With Quote
Old 07-03-2008, 02:49 PM   #8 (permalink)
Newbie
 
Join Date: Aug 2003
Location: Pennsylvania
Posts: 75
Send a message via AIM to valarnin Send a message via Yahoo to valarnin
Default

Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;

namespace Server.Gumps
{
	public class StatStoneG : Gump
	{
		public static void Initialize()
		{
			CommandSystem.Register("[ChangeStats", AccessLevel.Player, new CommandEventHandler(ChangeStats_OnCommand));
		}

		[Usage("[ChangeStats")]
		[Description("Makes a call to your custom gump.")]
		public static void ChangeStats_OnCommand(CommandEventArgs e)
		{
			Mobile caller = e.Mobile;

			if (caller.HasGump(typeof(StatStoneG)))
				caller.CloseGump(typeof(StatStoneG));
			caller.SendGump(new StatStoneG( "", caller.RawStr, caller.RawDex, caller.RawInt ));
		}

		public StatStoneG() : this( "", 0, 0, 0 )
		{
		}

		public StatStoneG( string ExtraText ) : this( ExtraText, 0, 0, 0 )
		{
		}

		public StatStoneG( string ExtraText, int STR, int DEX, int INT ) : base( 0, 0 )
		{
			this.Closable = true;
			this.Disposable = false;
			this.Dragable = true;
			this.Resizable = false;
			int GumpStr = 0, GumpDex = 0, GumpInt = 0;
			string StrStr, DexStr, IntStr;
			if (STR != 0 || DEX != 0 || INT != 0)
			{
				GumpStr = STR;
				GumpDex = DEX;
				GumpInt = INT;
			}
			StrStr = (GumpStr > 100 ? @"!! Str" : @"Str");
			DexStr = (GumpDex > 100 ? @"!! Dex" : @"Dex");
			IntStr = (GumpInt > 100 ? @"!! Int" : @"Int");
			AddPage(0);
			AddBackground(8, 14, 185, 228, 5170);
			AddLabel(60, 38, 0, @"Stats");
			if (ExtraText.Length > 0)
			{
				AddLabel(30, 62, 0, ExtraText.Remove((ExtraText.Length > 14 ? 14 : ExtraText.Length)));
				AddLabel(30, 89, 0, ExtraText.Remove(0, (ExtraText.Length > 15 ? 15 : ExtraText.Length)));
			}
			AddLabel(30, 113, 0, StrStr);
			AddTextEntry(94, 113, 55, 18, 0, 2, GumpStr.ToString());
			AddLabel(30, 140, 0, DexStr);
			AddTextEntry(94, 140, 55, 18, 0, 1, GumpDex.ToString());
			AddLabel(30, 167, 0, IntStr);
			AddTextEntry(94, 167, 55, 18, 0, 0, GumpInt.ToString());
			AddButton(66, 192, 247, 248, 0, GumpButtonType.Reply, 0);
		}



		public override void OnResponse(NetState sender, RelayInfo info)
		{
			Mobile from = sender.Mobile;

			switch(info.ButtonID)
			{
				case 0:
				{
					TextRelay entry = info.GetTextEntry(0);
					int Intelligence = int.Parse(entry.Text.Trim());
					entry = info.GetTextEntry(1);
					int Dexterity = int.Parse(entry.Text.Trim());
					entry = info.GetTextEntry(2);
					int Strength = int.Parse(entry.Text.Trim());
                    int Total = Intelligence + Dexterity + Strength;
					if (Total != 225)
					{
						from.SendGump(new StatStoneG( "Total of stats must equal 225", Strength, Dexterity, Intelligence ));
					}
					else if (Intelligence > 100 || Dexterity > 100 || Strength > 100)
					{
						from.SendGump(new StatStoneG( "All stats must be below 100", Strength, Dexterity, Intelligence ));
					}
					else
					{
						from.RawStr = Strength;
						from.RawDex = Dexterity;
						from.RawInt = Intelligence;
					}
					break;
				}
			}
		}
	}
}
__________________
Chances are I'm bored, so I'll probably help you. If I'm really bored I might do a few scripts on request, but contact me by messenger if you want that.

Last edited by valarnin; 07-03-2008 at 02:50 PM. Reason: Forgot code tags
valarnin is offline   Reply With Quote
Old 07-03-2008, 03:03 PM   #9 (permalink)
Lurker
 
Join Date: Jul 2008
Posts: 7
Default

"That is not a valid command."

That happens whenever I type [ChangeStats
silverzx1 is offline   Reply With Quote
Old 07-03-2008, 04:20 PM   #10 (permalink)
Forum Novice
 
kat20's Avatar
 
Join Date: Nov 2007
Location: U.S.
Posts: 168
Send a message via MSN to kat20
Post

Quote:
Originally Posted by valarnin View Post
Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;

namespace Server.Gumps
{
	public class StatStoneG : Gump
	{
		public static void Initialize()
		{
			CommandSystem.Register("[ChangeStats",  AccessLevel.Player" , new CommandEventHandler(ChangeStats_OnCommand));
		}

		[Usage("[ChangeStats")]
		[Description("Makes a call to your custom gump.")]
		public static void ChangeStats_OnCommand(CommandEventArgs e)
		{
			Mobile caller = e.Mobile;

			if (caller.HasGump(typeof(StatStoneG)))
				caller.CloseGump(typeof(StatStoneG));
			caller.SendGump(new StatStoneG( "", caller.RawStr, caller.RawDex, caller.RawInt ));
		}

		public StatStoneG() : this( "", 0, 0, 0 )
		{
		}

		public StatStoneG( string ExtraText ) : this( ExtraText, 0, 0, 0 )
		{
		}

		public StatStoneG( string ExtraText, int STR, int DEX, int INT ) : base( 0, 0 )
		{
			this.Closable = true;
			this.Disposable = false;
			this.Dragable = true;
			this.Resizable = false;
			int GumpStr = 0, GumpDex = 0, GumpInt = 0;
			string StrStr, DexStr, IntStr;
			if (STR != 0 || DEX != 0 || INT != 0)
			{
				GumpStr = STR;
				GumpDex = DEX;
				GumpInt = INT;
			}
			StrStr = (GumpStr > 100 ? @"!! Str" : @"Str");
			DexStr = (GumpDex > 100 ? @"!! Dex" : @"Dex");
			IntStr = (GumpInt > 100 ? @"!! Int" : @"Int");
			AddPage(0);
			AddBackground(8, 14, 185, 228, 5170);
			AddLabel(60, 38, 0, @"Stats");
			if (ExtraText.Length > 0)
			{
				AddLabel(30, 62, 0, ExtraText.Remove((ExtraText.Length > 14 ? 14 : ExtraText.Length)));
				AddLabel(30, 89, 0, ExtraText.Remove(0, (ExtraText.Length > 15 ? 15 : ExtraText.Length)));
			}
			AddLabel(30, 113, 0, StrStr);
			AddTextEntry(94, 113, 55, 18, 0, 2, GumpStr.ToString());
			AddLabel(30, 140, 0, DexStr);
			AddTextEntry(94, 140, 55, 18, 0, 1, GumpDex.ToString());
			AddLabel(30, 167, 0, IntStr);
			AddTextEntry(94, 167, 55, 18, 0, 0, GumpInt.ToString());
			AddButton(66, 192, 247, 248, 0, GumpButtonType.Reply, 0);
		}



		public override void OnResponse(NetState sender, RelayInfo info)
		{
			Mobile from = sender.Mobile;

			switch(info.ButtonID)
			{
				case 0:
				{
					TextRelay entry = info.GetTextEntry(0);
					int Intelligence = int.Parse(entry.Text.Trim());
					entry = info.GetTextEntry(1);
					int Dexterity = int.Parse(entry.Text.Trim());
					entry = info.GetTextEntry(2);
					int Strength = int.Parse(entry.Text.Trim());
                    int Total = Intelligence + Dexterity + Strength;
					if (Total != 225)
					{
						from.SendGump(new StatStoneG( "Total of stats must equal 225", Strength, Dexterity, Intelligence ));
					}
					else if (Intelligence > 100 || Dexterity > 100 || Strength > 100)
					{
						from.SendGump(new StatStoneG( "All stats must be below 100", Strength, Dexterity, Intelligence ));
					}
					else
					{
						from.RawStr = Strength;
						from.RawDex = Dexterity;
						from.RawInt = Intelligence;
					}
					break;
				}
			}
		}
	}
}
Im guessing your using the admin account? Make a user account and then try or add another access level such as admin.
__________________
kat20 is offline   Reply With Quote
Old 07-03-2008, 06:00 PM   #11 (permalink)
Lurker
 
Join Date: Jul 2008
Posts: 7
Default

Tried & still doesn't work.
silverzx1 is offline   Reply With Quote
Old 07-03-2008, 11:09 PM   #12 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,777
Send a message via Yahoo to Lord_Greywolf
Default

("[ChangeStats"

have 1 extra thing in there you do not want

remove the [
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 07-23-2008, 06:30 AM   #13 (permalink)
Newbie
 
Join Date: Nov 2007
Location: http://snoxduo.synthasite.com/
Age: 17
Posts: 45
Send a message via MSN to shivanna
Default

This never was resolved and still doesn't work, can anyone see what the issue is?
shivanna is offline   Reply With Quote
Old 07-23-2008, 06:35 AM   #14 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 608
Default

greywolf gave the answer already:
Code:
CommandSystem.Register("[ChangeStats",  AccessLevel.Player" , new CommandEventHandler(ChangeStats_OnCommand));

to
Code:
CommandSystem.Register("ChangeStats",  AccessLevel.Player" , new CommandEventHandler(ChangeStats_OnCommand));
b0b01 is online now   Reply With Quote
Old 07-23-2008, 07:09 AM   #15 (permalink)
Newbie
 
Join Date: Nov 2007
Location: http://snoxduo.synthasite.com/
Age: 17
Posts: 45
Send a message via MSN to shivanna
Default

Like I already said, tried and doesn't work. The script doesn't cough up errors but just doesn't work in game.
shivanna is offline   Reply With Quote
Old 07-23-2008, 07:40 AM   #16 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 608
Default

I assume that you are the same erson as the first post and made a new account?


Anyway wht you have to do is debug your code and look where the error lies, you can for example check if strength has the correct value in onrepsonse etc by messaging it to your staff char.
b0b01 is online now   Reply With Quote
Old 07-23-2008, 02:19 PM   #17 (permalink)
Forum Expert
 
Ravenal's Avatar
 
Join Date: Oct 2003
Location: Spokane Valley, WA
Age: 24
Posts: 1,529
Default

Code:
CommandSystem.Register("ChangeStats",  AccessLevel.Player, new CommandEventHandler(ChangeStats_OnCommand));
make sure you don't got that " after AccessLevel.Player =) that may be whats happening.
__________________
Creator of Genesis :: genesisworlds.com
-- Genesis is the next replacement program for UO Landscaper & Dragon
Ravenal is offline   Reply With Quote
Old 07-23-2008, 04:55 PM   #18 (permalink)
Forum Novice
 
Join Date: Dec 2006
Location: Southern Utah
Age: 29
Posts: 941
Send a message via Yahoo to greywolf79
Default

If you do not mind the input of a script noob who is still learning... Instead of making the stone from scratch since you cannot seem to get it working - try searching for "Statball". I once downloaded it so I know it is out there somewhere... It might give you some new ideas and will give you a starting point for the stone...

GreyWolf.
greywolf79 is offline   Reply With Quote
Old 08-19-2008, 07:37 AM   #19 (permalink)
Newbie
 
Join Date: Nov 2007
Location: http://snoxduo.synthasite.com/
Age: 17
Posts: 45
Send a message via MSN to shivanna
Default

Well.. Has the fact I'm Pre-AoS got anything to do with preventing it.

Problem with skillballs/statballs are that they can't deduct stats or skill points.

The whole objective I'm trying to reach is to be able to allow players to be able to switch their skills and stats where ever they want without having to use more then one item.
shivanna is offline   Reply With Quote
Old 08-19-2008, 11:29 AM   #20 (permalink)
Forum Novice
 
Join Date: Dec 2006
Location: Southern Utah
Age: 29
Posts: 941
Send a message via Yahoo to greywolf79
Default

Have you thought about maybe modding the soul stone? It would probably make a good base, since it will remove the points (at least for skills - should be able to combine it with a skill feature too) and then maybe mix it with a skill/statball to give the points? Just thoughts... I am not a very good scripter yet and this over my head, but I just thought maybe it would work if you know what you are doing...

GreyWolf.
greywolf79 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5