|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Lurker
Join Date: Jul 2008
Posts: 7
|
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. |
|
|
|
|
|
#2 (permalink) |
|
Newbie
|
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. |
|
|
|
|
|
#3 (permalink) |
|
Lurker
Join Date: Jul 2008
Posts: 7
|
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. |
|
|
|
|
|
#5 (permalink) |
|
Lurker
Join Date: Jul 2008
Posts: 7
|
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;
}
}
}
}
}
|
|
|
|
|
|
#6 (permalink) |
|
Newbie
|
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. |
|
|
|
|
|
#7 (permalink) |
|
Lurker
Join Date: Jul 2008
Posts: 7
|
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...
|
|
|
|
|
|
#8 (permalink) |
|
Newbie
|
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 |
|
|
|
|
|
#10 (permalink) | |
|
Forum Novice
|
Quote:
__________________
|
|
|
|
|
|
|
#12 (permalink) |
|
Forum Master
|
("[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 ..... :) |
|
|
|
|
|
#14 (permalink) |
|
Forum Novice
Join Date: Dec 2005
Posts: 608
|
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));
|
|
|
|
|
|
#16 (permalink) |
|
Forum Novice
Join Date: Dec 2005
Posts: 608
|
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. |
|
|
|
|
|
#17 (permalink) |
|
Forum Expert
Join Date: Oct 2003
Location: Spokane Valley, WA
Age: 24
Posts: 1,529
|
Code:
CommandSystem.Register("ChangeStats", AccessLevel.Player, new CommandEventHandler(ChangeStats_OnCommand));
__________________
Creator of Genesis :: genesisworlds.com -- Genesis is the next replacement program for UO Landscaper & Dragon |
|
|
|
|
|
#18 (permalink) |
|
Forum Novice
|
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. |
|
|
|
|
|
#19 (permalink) |
|
Newbie
|
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. |
|
|
|
|
|
#20 (permalink) |
|
Forum Novice
|
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|