|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Novice
Join Date: Jun 2005
Age: 39
Posts: 114
|
Is there a way to keep test center and N0T have players be able to set their skills.. Ie. "set magery 120". I would like to keep it so it fills new player bankboxes but not be able to set their skills.
|
|
|
|
|
|
#2 (permalink) | ||
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
Quote:
__________________
Quote:
Just a Simple Staff Tool You can leave me messages. Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else." |
||
|
|
|
|
|
#3 (permalink) | |
|
Account Terminated
|
Quote:
|
|
|
|
|
|
|
#4 (permalink) | |
|
Forum Novice
Join Date: Jun 2005
Age: 39
Posts: 114
|
Quote:
Greystars Idea sounds like a good one too, I just wanna explore both options on my test server before i decide which to go with. Thanks to both of you! |
|
|
|
|
|
|
#5 (permalink) | |
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
if you decide to go my route you can edit the TestCenter.cs file its located in the test center folder in the Scripts/Misc/Test Center/
being the only file in there its hard to miss. Adding an accesslevel check to the set command wouldnt be that difficult. So if thats the method you want to take post in this thread and I'll tell you what might work. Code:
private static void EventSink_Speech( SpeechEventArgs args )
{
if ( !args.Handled )
{
Mobile from = args.Mobile;
if( Insensitive.StartsWith( args.Speech, "set" ) && from.AccessLevel > AccessLevel.Player )
{
string[] split = args.Speech.Split( ' ' );
if ( split.Length == 3 )
{
try
{
string name = split[1];
double value = Convert.ToDouble( split[2] );
if ( Insensitive.Equals( name, "str" ) )
ChangeStrength( from, (int)value );
else if ( Insensitive.Equals( name, "dex" ) )
ChangeDexterity( from, (int)value );
else if ( Insensitive.Equals( name, "int" ) )
ChangeIntelligence( from, (int)value );
else
ChangeSkill( from, name, value );
}
catch
{
}
}
}
else if( Insensitive.Equals( args.Speech, "help" ) )
{
args.Mobile.SendGump( new TCHelpGump() );
args.Handled = true;
}
}
}
__________________
Quote:
Just a Simple Staff Tool You can leave me messages. Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else." |
|
|
|
|
|
|
#6 (permalink) | |
|
Forum Novice
Join Date: Jun 2005
Age: 39
Posts: 114
|
Quote:
![]() |
|
|
|
|
|
|
#7 (permalink) | |
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
we all do what we can and I figured since I did this aready once before myself when I was testing things I figured if someone wants to have test center active but not allow players to change there stats/skills I might as well share what I knew. now if it doesnt work straight out of the box, then I'll help fix the errors I may cause.
__________________
Quote:
Just a Simple Staff Tool You can leave me messages. Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else." |
|
|
|
|
|
|
#9 (permalink) |
|
Master of the Internet
Join Date: Oct 2005
Age: 45
Posts: 6,283
|
If you want players to be able to change their own stats and use staff commands (I HIGHLY recommend NOT doing this), remove the accesslevel checks completely.
__________________
Why is it that I'm never as smart as I thought I was yesterday? My vast knowledge is only surpassed by my infinite ignorance. <TheOutkastDev> i might have to hire an assassin to killl mal so that i can jump in front of the bullet and piss on him |
|
|
|
|
|
#10 (permalink) |
|
Forum Newbie
Join Date: Nov 2006
Age: 20
Posts: 9
|
testcenter.cs:
Code:
private static void EventSink_Speech( SpeechEventArgs args )
{
if ( !args.Handled )
{
Mobile from = args.Mobile;
if( Insensitive.StartsWith( args.Speech, "set" )&& from.AccessLevel > AccessLevel.Player )
{
string[] split = args.Speech.Split( ' ' );
if ( split.Length == 3 )
{
try
{
string name = split[1];
double value = Convert.ToDouble( split[2] );
if ( Insensitive.Equals( name, "str" ) )
ChangeStrength( from, (int)value );
else if ( Insensitive.Equals( name, "dex" ) )
ChangeDexterity( from, (int)value );
else if ( Insensitive.Equals( name, "int" ) )
ChangeIntelligence( from, (int)value );
else
ChangeSkill( from, name, value );
}
catch
{
}
}
}
else if( Insensitive.Equals( args.Speech, "help" ) )
{
args.Mobile.SendGump( new TCHelpGump() );
args.Handled = true;
}
}
}
private static void ChangeStrength( Mobile from, int value )
{
if ( value < 10 || value > 125 )
{
from.SendLocalizedMessage( 1005628 ); // Stats range between 10 and 125.
}
else
{
if ( (value + from.RawDex + from.RawInt) > from.StatCap )
{
from.SendLocalizedMessage( 1005629 ); // You can not exceed the stat cap. Try setting another stat lower first.
}
else
{
from.RawStr = value;
from.SendLocalizedMessage( 1005630 ); // Your stats have been adjusted.
}
}
}
private static void ChangeDexterity( Mobile from, int value )
{
if ( value < 10 || value > 125 )
{
from.SendLocalizedMessage( 1005628 ); // Stats range between 10 and 125.
}
else
{
if ( (from.RawStr + value + from.RawInt) > from.StatCap )
{
from.SendLocalizedMessage( 1005629 ); // You can not exceed the stat cap. Try setting another stat lower first.
}
else
{
from.RawDex = value;
from.SendLocalizedMessage( 1005630 ); // Your stats have been adjusted.
}
}
}
private static void ChangeIntelligence( Mobile from, int value )
{
if ( value < 10 || value > 125 )
{
from.SendLocalizedMessage( 1005628 ); // Stats range between 10 and 125.
}
else
{
if ( (from.RawStr + from.RawDex + value) > from.StatCap )
{
from.SendLocalizedMessage( 1005629 ); // You can not exceed the stat cap. Try setting another stat lower first.
}
else
{
from.RawInt = value;
from.SendLocalizedMessage( 1005630 ); // Your stats have been adjusted.
}
}
}
private static void ChangeSkill( Mobile from, string name, double value )
{
SkillName index;
try
{
index = (SkillName)Enum.Parse( typeof( SkillName ), name, true );
}
catch
{
from.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
return;
}
if ( ( !Core.SE && (int)index > 51 ) || ( !Core.AOS && (int)index > 48 ) )
{
from.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
return;
}
Skill skill = from.Skills[index];
if ( skill != null )
{
if ( value < 0 || value > skill.Cap )
{
from.SendMessage( String.Format( "Your skill in {0} is capped at {1:F1}.", skill.Info.Name, skill.Cap ) );
}
else
{
int newFixedPoint = (int)(value * 10.0);
int oldFixedPoint = skill.BaseFixedPoint;
if ( ((skill.Owner.Total - oldFixedPoint) + newFixedPoint) > skill.Owner.Cap )
{
from.SendMessage( "You can not exceed the skill cap. Try setting another skill lower first." );
}
else
{
skill.BaseFixedPoint = newFixedPoint;
}
}
}
else
{
from.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
}
}
with this (in red) functioning they they couldn't exceed caps, right?this is what i want ~sorry for my english |
|
|
|
|
|
#11 (permalink) |
|
Master of the Internet
Join Date: Oct 2005
Age: 45
Posts: 6,283
|
If you want them to be able to exceed the statcap, you will have to change the statcap. However, there is a bug in RC1 that causes the ObeyCap to not work, but this has been fixed in the SVN version.
__________________
Why is it that I'm never as smart as I thought I was yesterday? My vast knowledge is only surpassed by my infinite ignorance. <TheOutkastDev> i might have to hire an assassin to killl mal so that i can jump in front of the bullet and piss on him |
|
|
|
|
|
#12 (permalink) |
|
Forum Newbie
Join Date: Nov 2006
Age: 20
Posts: 9
|
Ok, I must have expressed myself badly. I don’t want the players to have the staff’s commands (changing the acesslevels). What I want is to allow the players to do adjustments is their stats and skills, but respecting the skillcap and the statcap, using commands such [ChangeStrenght, [ChangeIntelligence, [ChangeDexterity and [Changeskill.
can you help me? ~bad english, sry ![]() |
|
|
|
|
|
#13 (permalink) |
|
Master of the Internet
Join Date: Oct 2005
Age: 45
Posts: 6,283
|
Well, if those commands are already built in, your method that checks the accesslevel that you posted will not allow players to do that as the access level has to be higher than player (from.AccessLevel > AccessLevel.Player). Try this instead:
Code:
from.AccessLevel >= AccessLevel.Player
__________________
Why is it that I'm never as smart as I thought I was yesterday? My vast knowledge is only surpassed by my infinite ignorance. <TheOutkastDev> i might have to hire an assassin to killl mal so that i can jump in front of the bullet and piss on him |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|