RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Help with race stone errors plz

As requested, I updated the race stone at begining of post and here is my dovplayermobile.

dovplayermobile.cs
[code:1]
using System;
using System.IO;
using System.Collections;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;
using Server.Multis;
using Server.Engines.Help;
using Server.Network;
using Server.Mobiles;

namespace Server.Mobiles
{
public enum RaceType
{
None, WildElf, GreyElf, ArcticElf, MountainDwarf, DrowElf, DarkDwarf, HillDwarf, Orc, Centaur
}

public class dovPlayerMobile : PlayerMobile
{
private RaceType m_Race = RaceType.None;
private int m_StrCap = 200;
private int m_DexCap = 200;
private int m_IntCap = 200;
private bool m_InfraVision = false;

public dovPlayerMobile()
{
}

public dovPlayerMobile( Serial s ) : base( s )
{
}

[CommandProperty( AccessLevel.GameMaster )]
public RaceType Race
{
get{ return m_Race; }
set{ m_Race = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int StrCap
{
get{ return m_StrCap; }
set{ m_StrCap = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int DexCap
{
get{ return m_DexCap; }
set{ m_DexCap = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int IntCap
{
get{ return m_IntCap; }
set{ m_IntCap = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool InfraVision
{
get{ return m_InfraVision; }
set{ m_InfraVision = value; }
}

public override void OnAfterResurrect()
{
RaceType race = this.Race;

// race switch here
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)2 );//version

// version 2
writer.Write( (bool)m_InfraVision );

//version 1
writer.Write( (int)m_Race );
writer.Write( (int)m_StrCap );
writer.Write( (int)m_DexCap );
writer.Write( (int)m_IntCap );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch( version )
{
case 2:
m_InfraVision = (bool)reader.ReadBool();
goto case 1;
case 1:
m_Race = (RaceType)reader.ReadInt();
m_StrCap = (int)reader.ReadInt();
m_DexCap = (int)reader.ReadInt();
m_IntCap = (int)reader.ReadInt();
goto case 0;
case 0:
break;
}
}
}
}
[/code:1]
 
these are the crash reports for each race,

Server Crash Report "Wild Elf"
===================

Operating System: Microsoft Windows 98
.NET Framework: 1.1.4322.573
Time: 10/16/2003 8:17:14 PM
Mobiles: 2194
Items: 70231
Clients:
- Count: 1
+ 000.000.000.000: (account = Tunirus) (mobile = 0x892 'test')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Items.RaceGump.WildElfInit(Mobile from)
at Server.Items.RaceGump.OnResponse(NetState sender, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)

Server Crash Report "drowelf"
===================

Operating System: Microsoft Windows 98
.NET Framework: 1.1.4322.573
Time: 10/16/2003 8:21:07 PM
Mobiles: 2194
Items: 70231
Clients:
- Count: 1
+ 000.000.000.000: (account = Tunirus) (mobile = 0x892 'joe')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Items.RaceGump.DrowElfInit(Mobile from)
at Server.Items.RaceGump.OnResponse(NetState sender, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)

Server Crash Report
===================

Operating System: Microsoft Windows 98
.NET Framework: 1.1.4322.573
Time: 10/16/2003 8:23:12 PM
Mobiles: 2194
Items: 70231
Clients:
- Count: 1
+ 000.000.000.000: (account = Tunirus) (mobile = 0x892 'jack')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Items.RaceGump.OrcInit(Mobile from)
at Server.Items.RaceGump.OnResponse(NetState sender, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 

Tru

Knight
question:
male of female character being used?
I had an issue with adding hair to females of 2 races crashed my shard
 
Ok i found the problem i think, seems those races were missing the beard code for males, so now i ask, is there a way to remove the beard code safely so elves and females don't have beards?
 
where should this be added at? i have tried it in

[code:1]
case 1:
{
if ( mp.Beard == null )
from.Beard.Delete();

WildElfInit(from);
break;
}
[/code:1]

this didn't work, so tried it here

[code:1]
if ( mp.Hair == null )
{
mp.AddItem( new LongHair());
mp.Hair.Hue = 1125;
}
if ( mp.Beard == null )
from.Beard.Delete();
{
mp.AddItem( new ShortBeard() );
mp.Beard.Hue = 1125;
}
if (mp.Female)
{
mp.Hair.Hue = 1125;
mp.Name += ", the Wild Elf";

}
else
{
mp.Hair.Hue = 1125;
mp.Beard.Hue = 1125;
[/code:1]

no luck with this one either both crashed the game
 

Tru

Knight
grasshopper73 said:
where should this be added at? i have tried it in

[code:1]
case 1:
{
if ( mp.Beard == null )
from.Beard.Delete();

WildElfInit(from);
break;
}
[/code:1]

this didn't work, so tried it here

[code:1]
if ( mp.Hair == null )
{
mp.AddItem( new LongHair());
mp.Hair.Hue = 1125;
}
if ( mp.Beard == null )
from.Beard.Delete();
{
mp.AddItem( new ShortBeard() );
mp.Beard.Hue = 1125;
}
if (mp.Female)
{
mp.Hair.Hue = 1125;
mp.Name += ", the Wild Elf";

}
else
{
mp.Hair.Hue = 1125;
mp.Beard.Hue = 1125;
[/code:1]

no luck with this one either both crashed the game

id be surprised if this one didnt crash your shard (if it compiled)
[code:1]if ( mp.Beard == null )
from.Beard.Delete();[/code:1]
what your saying there is if there is no beard delete it

im kinda confused with this statement
Ok i found the problem i think, seems those races were missing the beard code for males, so now i ask, is there a way to remove the beard code safely so elves and females don't have beards?
If its already missing why would you want to remove it

heres how its done in the racestone.cs I have

[code:1]case 4:
{
//Elves shouldnt have beard..
if (from.Beard != null)
from.Beard.Delete();

ElfInit(from);
break;
}[/code:1]
I think instead of is null (ie ==) you want isnt null (ie !=)
 
the races were crashing cause they lacked this code
[code:1]
if ( mp.Beard == null )
{
mp.AddItem( new ShortBeard() );
mp.Beard.Hue = 1125;
[/code:1]

but i don't want elves, orc or females to have beards

I tried the
[code:1]
//Elves shouldnt have beard..
if (from.Beard != null)
from.Beard.Delete();
[/code:1]
didn't do anything chars still have beards
 

Tru

Knight
you put it in the Init case statements?
ie
[code:1]case 3:
{
if (from.Beard != null)
from.Beard.Delete();
if (from.Hair != null)
from.Hair.Delete();

OrcInit(from);
break;
}

case 4:
{
//Elves shouldnt have beard..
if (from.Beard != null)
from.Beard.Delete();

ElfInit(from);
break;
}[/code:1]
 
Ok the race stone seems to be working just fine on my test shard short of sending players to locations that are not in feluca, I wish to says a VERY greatful THANKS to everyone that has helped me, I will not forget your help, I was even able to get the stone to add racial weapons in their packs !!

Thanks agian !!
 
Note I removed the beard from all none Dwarf races, and added racial weapons to their packs, only problem i have now is they do not get teleported to the right locations they end up in dark places when going somewhere not in felucca.



RaceStone.cs
[code:1]
using System;
using Server;
using Server.Mobiles;
using Server.Items;
using Server.Gumps;
using Server.Network;

namespace Server.Items
{
public class RaceStone : Item
{
[Constructable]
public RaceStone() : base( 0xED4 )
{
Movable = false;
Name = "Race Stone";
Hue = 33;
}

public override void OnDoubleClick( Mobile from )
{
from.SendGump(new RaceGump(from, RacePage.Info) );
}

public RaceStone( Serial serial ) : base ( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}

public enum RacePage
{
Info,
WildElf,
GreyElf,
ArcticElf,
MountainDwarf,
DrowElf,
DarkDwarf,
HillDwarf,
Orc,
}

public class RaceGump : Gump
{
private Mobile m_From;
private RacePage m_Page;

private const int Blanco = 0xFFFFFF;
private const int Azul = 0x8080FF;

public void AddPageButton( int x, int y, int buttonID, string text, RacePage page, params RacePage[] subpage )
{
bool seleccionado = ( m_Page == page );

for ( int i = 0; !seleccionado && i < subpage.Length; ++i )
seleccionado = ( m_Page == subpage );

AddButton( x, y - 1, seleccionado ? 4006 : 4005, 4007, buttonID, GumpButtonType.Reply, 0 );
AddHtml( x + 35, y, 200, 20, Color( text, seleccionado ? Azul : Blanco ), false, false );
}

public void AddButtonLabeled( int x, int y, int buttonID, string text )
{
AddButton( x, y - 1, 4005, 4007, buttonID, GumpButtonType.Reply, 0 );
AddHtml( x + 35, y, 240, 20, Color( text, Blanco ), false, false );
}

public int GetButtonID( int type, int index )
{
return 1 + (index * 15) + type;
}

public string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
}

public RaceGump ( Mobile from, RacePage page) : base ( 40, 45 )
{
from.CloseGump( typeof( RaceGump ) );

m_From = from;
m_Page = page;
Closable = true;
Dragable = false;
from.Frozen = true;

AddPage( 0 );
AddBackground( 0, 0, 531, 360, 5054 );
AddAlphaRegion( 10, 10, 511, 340 );


AddImageTiled( 11, 37, 149, 19, 0x52 );
AddImageTiled( 11, 37, 148, 18, 0xBBC );
AddLabel( 35, 37, 0, "Choose Your Race" ); // choose your race

AddImageTiled( 11, 11, 509, 21, 0x52 );
AddImageTiled( 11, 11, 507, 19, 0xBBC );
AddLabel( 165, 11, 0, "Race Selection Menu" ); // Race selection menu


AddImageTiled( 10, 32, 511, 5, 5058 );
AddImageTiled( 10, 287, 511, 5, 5058 );
AddImageTiled( 160, 37, 5, 250, 5058 );

AddPageButton( 40, 75, GetButtonID( 0, 0 ), "Initial Page", RacePage.Info ); //Initial Page
AddPageButton( 40, 110, GetButtonID( 0, 1 ), "Wild Elf", RacePage.WildElf); // WildElf
AddPageButton( 40, 135, GetButtonID( 0, 2 ), "Grey Elf", RacePage.GreyElf); // GreyElf
AddPageButton( 40, 160, GetButtonID( 0, 3 ), "Arctic Elf", RacePage.ArcticElf); // ArcticElf
AddPageButton( 40, 185, GetButtonID( 0, 4 ), "Mountain Dwarf", RacePage.MountainDwarf); // MountainDwarf
AddPageButton( 40, 210, GetButtonID( 0, 5 ), "Drow Elf", RacePage.DrowElf); // DrowElf
AddPageButton( 40, 235, GetButtonID( 0, 6 ), "Dark Dwarf", RacePage.DarkDwarf); // DarkDwarf
AddPageButton( 40, 260, GetButtonID( 0, 7 ), "Hill Dwarf", RacePage.HillDwarf); // HillDwarf
AddPageButton( 40, 285, GetButtonID( 0, 8 ), "Orc", RacePage.Orc); // Orc

switch ( page )
{
case RacePage.Info:
{
AddHtml( 172, 40, 337, 245, String.Format("Welcome to the Land of Tunirus Race Stone. Please select your race from the menu provided.\n"), true, true );
break;
}
case RacePage.WildElf:
{
AddHtml( 172, 40, 337, 245, String.Format("<center>* The Wild Elf *</center>\nThe Wild Elves live in the large forests all over the land. Wild elves generally are stronger and bigger than their civilized cousins and dislike the hustle and bustle of the big cities, preferring the quiet atmosphere of their forests. The Wild Elves almost perished during the Great Rendering and now call the lands of Malas their home. The most famous Wild Elf is Amalas, who led the wild elves away from the council of Kirish' Da, thus separating from their Grey Elf cousins.\n"), true, true ); // Wild Elf Description
AddPageButton( 50, 317, GetButtonID( 1, 0 ), "Back To Main Menu", RacePage.Info); // Back to Main Menu
AddButtonLabeled( 300, 317, GetButtonID( 1, 1 ), "I Want To Be A Wild Elf" ); // I want to be a Wild Elf
break;
}

case RacePage.GreyElf:
{
AddHtml( 172, 40, 337, 245, String.Format("<center>* The Grey Elf *</center>\nGrey Elves are slighter than most humans, as well as being shorter and more fragile. The grey elves were brought into the world by the Gods of Good, and they enjoy natural beauty and live long lives, allowing things to take their course. Grey elves live to be 1200 years old, though they generally leave the world before this time.\n\nThe grey elf race is inherently magical, shaping natural elements of the world to their will and keeping things in balance. Grey elves possess a high level of dexterity as well as infravision, the ability to see infrared outlines of creatures in the dark. Tunirus Grey Elves are haughty creatures, considering themselves superior to the lesser races.\n\nThey consider themselves to be the purest elves-in fact they fought the War of Sorrow because of it. Ga'lith, the traditional elvenhome, went to war with the Valihann Empire to preserve their purity and to root out the half-elves born through illicit unions of elves and humans. After the war, the elven nation split, and those choosing to remain in Ga'lith became even more set in their ways. The Grey Elves are ruled by the Speaker of the Waves, who lives in the capitol, Lakeshire. Famous Grey Elves are Galyrion, Laril Keladon, Alhana Starlight and Anar Vithril the Lightbringer.\n"), true, true ); // Wild Elf Description
AddPageButton( 50, 317, GetButtonID( 1, 0 ), "Back To Main Menu", RacePage.Info); // Back to Main Menu
AddButtonLabeled( 300, 317, GetButtonID( 1, 2 ), "I Want To Be A Grey Elf" ); // I want to be a Grey Elf
break;
}

case RacePage.ArcticElf:
{
AddHtml( 172, 40, 337, 245, String.Format("<center>* The Arctic Elf *</center>\nThe Arctic Elves live in the frozen regions all over the land. Arctic elves generally are stronger and bigger than their cousins and dislike the warmth and greenery of the rest of the land, preferring the quiet atmosphere of their glaciers. The Arctic Elves almost perished during the Great Rendering and now call all the arctic lands of Tunirus their home. The most famous Arctic Elf is Blanir, who led the arctic elves to safety during the Great Renering, thus separating them from their Elvish cousins.\n\nFor Elven build see Elves.\n\n"), true, true ); // Arctic Elf Description
AddPageButton( 50, 317, GetButtonID( 1, 0 ), "Back To Main Menu", RacePage.Info); // Back to Main Menu
AddButtonLabeled( 300, 317, GetButtonID( 1, 3 ), "I Want To Be A Arctic Elf" ); // I want to be a Arctic Elf
break;
}

case RacePage.MountainDwarf:
{
AddHtml( 172, 40, 337, 245, String.Format("<center>* The Mountain Dwarf *</center>\nMountain Dwarves are shorter and stockier than humans or elves, but as such they are more solid than either of the taller races. Mountain Dwarves live in underground dwellings for the most part, preferring to spend their days mining precious metals or shaping stone and metal to their will. They are exceptional blacksmiths and craftsmen. Mountain Dwarves live to be about 350 years old.\n\nThe most important feature of any dwarf is his beard. Even dwarven women have whiskers, but the men are able to grow a full beard, of which they are intensely proud. The only dwarf to shave his beard was Damak Hammerfell, the dwarven hero, who shaved it to show his shame in killing his countrymen during the BloodyAxe War. In addition, dwarves have infravision, the ability to sense direction, depth and slope underground and are incredibly resistant to magic, distrusting its properties almost entirely.\n\nLike the elves, the dwarves experienced a split in their unity when some of the dwarves who preferred to live outside left the underground dwellings for the freedom of the exterior. These dwarves came to be known as the Ragers, or Hill Dwarves. The remaining clans of Mountain Dwarves are known as the Hammerfell, Hammerhand, Fireforge, Mastersmith, Stonemason, , GreatAxe and IronFist. \n"), true, true ); // Mountain Dwarf Description
AddPageButton( 50, 317, GetButtonID( 1, 0 ), "Back To The Main Menu", RacePage.Info); // Back to Main Menu
AddButtonLabeled( 300, 317, GetButtonID( 1, 4 ), "I Want To Be A Mountain Dwarf"); // I want to be a Mountain Dwarf
break;
}

case RacePage.DrowElf:
{
AddHtml( 172, 40, 337, 245, String.Format("<center>* The Drow Elf*</center>\nThis nationality of elf was created by the evil Goddess Taimat following the War of Sorrow. These 'Dark' elves left the light in an effort to get away from the rigidity of their cousins; however they have become rigid over time as well. The Drow Elves are basically an underworld elf. They are evil & chaotic in nature and can be murderous and vindictive if you get on their bad side. They are the darkside of the elven species. The Drow are ruled by the Valsharess d' Oloth. The most famous and notable of Drow Elves are the likes of Kalmak, Linmir, Giltanis, and Pakela\n "), true, true ); // Drow Elf Description
AddPageButton( 50, 317, GetButtonID( 1, 0 ), "Back ToMain Menu", RacePage.Info); // Back to Main Menu
AddButtonLabeled( 300, 317, GetButtonID( 1, 5 ), "I Want To Be A Drow Elf" ); // I want to be a Drow Elf
break;
}


case RacePage.DarkDwarf:
{
AddHtml( 172, 40, 337, 245, String.Format("<center>* The Dark Dwarf *</center>\nDark Dwarves are shorter and thinner than their Dwarven cousins, but as such they are still more solid than either of the taller races. Dark Dwarves live very deep in the mountains preferring underground dwellings for the most part, preferring to spend their days plotting the demise of their closest cousins the Mountain Dwarves. They feel it is the Mountain Dwarves fault that the Gods punished them for their part in the BloodAxe War by placing them deep within the mountains to where even Mountain Dwarves dare not venture.They are exceptional warriors and poisoners. Dark Dwarves live to be about 230 years old.\n\nThe most important item of any dark dwarf is his weapon. Even dark dwarven women have weapons hidden upon the persons, but the men carry several battle tested weapons at once, of which they are intensely proud. In addition, dwarves have infravision, the ability to sense direction, depth and slope underground and are incredibly resistant to magic, distrusting its properties almost entirely.\n\nLike the elves, the dwarves experienced a split in their unity when some of the dwarves who preferred to move to the outside, or to stay inside continuing to live in underground dwellings for the safety and convienence, yet some dwell very deep as they pay for their treachory in the BloodAxe War. These dwarves came to be known as the Ugars, or Dark Dwarves. The remaining clans of Dark Dwarves are known as the Steelfist, Rustblade, ColdAxe, Firebrand, Greatsmith, Bloodhammer and Darkhand.\n "), true, true ); // Dark Dwarf Description
AddPageButton( 50, 317, GetButtonID( 1, 0 ), "Back ToMain Menu", RacePage.Info); // Back to Main Menu
AddButtonLabeled( 300, 317, GetButtonID( 1, 6 ), "I Want To Be A Dark Dwarf" ); // I want to be a Dark Dwarf
break;
}

case RacePage.HillDwarf:
{
AddHtml( 172, 40, 337, 245, String.Format("<center>* The Hill Dwarf *</center>\nHill Dwarves are taller and stockier than the Mountain Dwarves yet still shorter then humans or elves, but as such they are still more solid than either of the taller races. Hill Dwarves live in small villages in the foot hills of mountains for the most part, preferring to spend their days deal in precious metals or shaping stone, wood, and metal to their will. They are exceptional metalsmiths and craftsmen. Hill Dwarves live to be about 360 years old.\n\nThe most important feature of any dwarf is his beard. Even dwarven women have whiskers, but the men are able to grow a full beard, of which they are intensely proud. The only dwarf to shave his beard was Damak Hammerfell, the dwarven hero, who shaved it to show his shame in killing his countrymen during the BloodyAxe War. In addition, dwarves have infravision, the ability to sense direction, depth and slope underground and are incredibly resistant to magic, distrusting its properties almost entirely.\n\nLike the elves, the dwarves experienced a split in their unity when some of the dwarves who preferred to stay inside continuing to live in underground dwellings for the safety and convienence. These dwarves came to be known as the Kelgers, or Mountain Dwarves. The remaining clans of Hill Dwarves are known as the Hammerfist, Swifthand, StoneAxe, FireStoke, Chiselhand, Feldstone and Ironsmith. \n "), true, true ); // Hill Dwarf Description
AddPageButton( 50, 317, GetButtonID( 1, 0 ), "Back To The Main Menu", RacePage.Info); // Back to Main Menu
AddButtonLabeled( 300, 317, GetButtonID( 1, 7 ), "I Want To Be A Hill Dwarf" ); // I want to be a Hill Dwarf
break;
}

case RacePage.Orc:
{
AddHtml( 172, 40, 337, 245, String.Format("<center>* The Orc *</center>\nHill Dwarves are taller and stockier than the Mountain Dwarves yet still shorter then humans or elves, but as such they are still more solid than either of the taller races. Hill Dwarves live in small villages in the foot hills of mountains for the most part, preferring to spend their days deal in precious metals or shaping stone, wood, and metal to their will. They are exceptional metalsmiths and craftsmen. Hill Dwarves live to be about 360 years old.\n\nThe most important feature of any dwarf is his beard. Even dwarven women have whiskers, but the men are able to grow a full beard, of which they are intensely proud. The only dwarf to shave his beard was Damak Hammerfell, the dwarven hero, who shaved it to show his shame in killing his countrymen during the BloodyAxe War. In addition, dwarves have infravision, the ability to sense direction, depth and slope underground and are incredibly resistant to magic, distrusting its properties almost entirely.\n\nLike the elves, the dwarves experienced a split in their unity when some of the dwarves who preferred to stay inside continuing to live in underground dwellings for the safety and convienence. These dwarves came to be known as the Kelgers, or Mountain Dwarves. The remaining clans of Hill Dwarves are known as the Hammerfist, Swifthand, StoneAxe, FireStoke, Chiselhand, Feldstone and Ironsmith. \n "), true, true ); // Orc Description
AddPageButton( 50, 317, GetButtonID( 1, 0 ), "Back To The Main Menu", RacePage.Info); // Back to Main Menu
AddButtonLabeled( 300, 317, GetButtonID( 1, 8 ), "I Want To Be An Orc" ); // I want to be an Orc
break;
}
}

}

public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
int val = info.ButtonID - 1;

if ( val < 0 )
return;

Mobile from = m_From;
from.Frozen = false;

int type = val % 15;
int index = val / 15;

switch ( type )
{
case 0:
{
RacePage page;

switch ( index )
{
case 0: page = RacePage.Info; break;
case 1: page = RacePage.WildElf; break;
case 2: page = RacePage.GreyElf; break;
case 3: page = RacePage.ArcticElf; break;
case 4: page = RacePage.MountainDwarf; break;
case 5: page = RacePage.DrowElf; break;
case 6: page = RacePage.DarkDwarf; break;
case 7: page = RacePage.HillDwarf; break;
case 8: page = RacePage.Orc; break;
default: return;
}

from.SendGump( new RaceGump( from, page) );
break;
}

case 1:
{
switch ( index )
{
case 0:
{
from.SendGump( new RaceGump( from, RacePage.Info) );
break;
}

case 1:
{

WildElfInit(from);
break;
}

case 2:
{

GreyElfInit(from);
break;
}

case 3:
{


ArcticElfInit(from);
break;
}

case 4:
{
MountainDwarfInit(from);
break;
}

case 5:
{


DrowElfInit(from);
break;
}

case 6:
{
DarkDwarfInit(from);
break;
}

case 7:
{
HillDwarfInit(from);
break;
}

case 8:
{


OrcInit(from);
break;
}

}
break;
}

}

}

private void WildElfInit(Mobile from)
{
dovPlayerMobile mp = ((dovPlayerMobile )from );


mp.Hue = 1027;
if ( mp.Hair == null )
{
mp.AddItem( new LongHair() );
mp.Hair.Hue = 1125;
}

if (mp.Female)
{
mp.Hair.Hue = 1126;
mp.Name += ", the Wild Elf";
mp.AddToBackpack(new ElvishBow());
}
else
{
mp.Hair.Hue = 1125;
mp.Name += ", the Wild Elf";
mp.AddToBackpack(new ElvishBow());
}

//SKILLS//
//mp.Skills[SkillName.Anatomy].Cap = 120.0;
//mp.Skills[SkillName.ArmsLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalTaming].Cap = 120.0;
//mp.Skills[SkillName.Begging].Cap = 120.0;
//mp.Skills[SkillName.DetectHidden].Cap = 120.0;
//mp.Skills[SkillName.Discordance].Cap = 120.0;
//mp.Skills[SkillName.EvalInt].Cap = 120.0;
//mp.Skills[SkillName.Forensics].Cap = 120.0;
//mp.Skills[SkillName.Hiding].Cap = 120.0;
//mp.Skills[SkillName.ItemID].Cap = 120.0;
//mp.Skills[SkillName.Meditation].Cap = 120.0;
//mp.Skills[SkillName.Peacemaking].Cap = 120.0;
//mp.Skills[SkillName.Poisoning].Cap = 120.0;
//mp.Skills[SkillName.Provocation].Cap = 120.0;
//mp.Skills[SkillName.RemoveTrap].Cap = 120.0;
//mp.Skills[SkillName.SpiritSpeak].Cap = 120.0;
//mp.Skills[SkillName.Stealing].Cap = 120.0;
//mp.Skills[SkillName.Stealth].Cap = 120.0;
//mp.Skills[SkillName.TasteID].Cap = 120.0;
//mp.Skills[SkillName.Tracking].Cap = 120.0;
//mp.Skills[SkillName.Camping].Cap = 120.0;
//mp.Skills[SkillName.Cooking].Cap = 120.0;
//mp.Skills[SkillName.Fishing].Cap = 120.0;
//mp.Skills[SkillName.Healing].Cap = 120.0;
//mp.Skills[SkillName.Herding].Cap = 120.0;
//mp.Skills[SkillName.Lockpicking].Cap = 120.0;
//mp.Skills[SkillName.Lumberjacking].Cap = 120.0;
//mp.Skills[SkillName.Musicianship].Cap = 120.0;
//mp.Skills[SkillName.Snooping].Cap = 120.0;
//mp.Skills[SkillName.Veterinary].Cap = 120.0;
//mp.Skills[SkillName.Blacksmith].Cap = 120.0;
//mp.Skills[SkillName.Fletching].Cap = 120.0;
//mp.Skills[SkillName.Carpentry].Cap = 120.0;
//mp.Skills[SkillName.Alchemy].Cap = 120.0;
//mp.Skills[SkillName.Inscribe].Cap = 120.0;
//mp.Skills[SkillName.Cartography].Cap = 120.0;
//mp.Skills[SkillName.Tinkering].Cap = 120.0;
//mp.Skills[SkillName.Tailoring].Cap = 120.0;
//mp.Skills[SkillName.Archery].Cap = 120.0;
//mp.Skills[SkillName.Fencing].Cap = 120.0;
//mp.Skills[SkillName.Macing].Cap = 120.0;
//mp.Skills[SkillName.Magery].Cap = 120.0;
//mp.Skills[SkillName.Parry].Cap = 120.0;
//mp.Skills[SkillName.Swords].Cap = 120.0;
//mp.Skills[SkillName.Tactics].Cap = 120.0;
//mp.Skills[SkillName.Wrestling].Cap = 120.0;
//mp.Skills[SkillName.MagicResist].Cap = 120.0;
//mp.Skills[SkillName.Mining].Cap = 120.0;
//mp.Skills[SkillName.Chivalry].Cap = 120.0;
//mp.Skills[SkillName.Necromancy].Cap = 120.0;
//mp.Skills[SkillName.Focus].Cap = 120.0;

//VerifySkills( from );

//stats//
mp.Str += 50;
mp.Dex += 40;
mp.Int += 15;
mp.StrCap = 100;
mp.DexCap = 100;
mp.IntCap = 100;


mp.Race = RaceType.WildElf;
mp.PlaySound( 0x4E );
mp.Location = new Point3D( 1255, 966, -15 );
mp.SendMessage("You are now a Wild Elf");
}

private void GreyElfInit(Mobile from)
{
dovPlayerMobile mp = ((dovPlayerMobile )from );

mp.Hue = 1801;
if ( mp.Hair == null )
{
mp.AddItem( new LongHair() );
mp.Hair.Hue = 1117;
}



if (mp.Female)
{
mp.Hair.Hue = 1117;

mp.Name += ", the Grey Elf";
mp.AddToBackpack(new ElvishBow());
}
else
{
mp.Hair.Hue = 1117;
mp.Name += ", the Grey Elf";
mp.AddToBackpack(new ElvishBow());
}
//SKILLS//
//mp.Skills[SkillName.Anatomy].Cap = 120.0;
//mp.Skills[SkillName.ArmsLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalTaming].Cap = 120.0;
//mp.Skills[SkillName.Begging].Cap = 120.0;
//mp.Skills[SkillName.DetectHidden].Cap = 120.0;
//mp.Skills[SkillName.Discordance].Cap = 120.0;
//mp.Skills[SkillName.EvalInt].Cap = 120.0;
//mp.Skills[SkillName.Forensics].Cap = 120.0;
//mp.Skills[SkillName.Hiding].Cap = 120.0;
//mp.Skills[SkillName.ItemID].Cap = 120.0;
//mp.Skills[SkillName.Meditation].Cap = 120.0;
//mp.Skills[SkillName.Peacemaking].Cap = 120.0;
//mp.Skills[SkillName.Poisoning].Cap = 120.0;
//mp.Skills[SkillName.Provocation].Cap = 120.0;
//mp.Skills[SkillName.RemoveTrap].Cap = 120.0;
//mp.Skills[SkillName.SpiritSpeak].Cap = 120.0;
//mp.Skills[SkillName.Stealing].Cap = 120.0;
//mp.Skills[SkillName.Stealth].Cap = 120.0;
//mp.Skills[SkillName.TasteID].Cap = 120.0;
//mp.Skills[SkillName.Tracking].Cap = 120.0;
//mp.Skills[SkillName.Camping].Cap = 120.0;
//mp.Skills[SkillName.Cooking].Cap = 120.0;
//mp.Skills[SkillName.Fishing].Cap = 120.0;
//mp.Skills[SkillName.Healing].Cap = 120.0;
//mp.Skills[SkillName.Herding].Cap = 120.0;
//mp.Skills[SkillName.Lockpicking].Cap = 120.0;
//mp.Skills[SkillName.Lumberjacking].Cap = 120.0;
//mp.Skills[SkillName.Musicianship].Cap = 120.0;
//mp.Skills[SkillName.Snooping].Cap = 120.0;
//mp.Skills[SkillName.Veterinary].Cap = 120.0;
//mp.Skills[SkillName.Blacksmith].Cap = 120.0;
//mp.Skills[SkillName.Fletching].Cap = 120.0;
//mp.Skills[SkillName.Carpentry].Cap = 120.0;
//mp.Skills[SkillName.Alchemy].Cap = 120.0;
//mp.Skills[SkillName.Inscribe].Cap = 120.0;
//mp.Skills[SkillName.Cartography].Cap = 120.0;
//mp.Skills[SkillName.Tinkering].Cap = 120.0;
//mp.Skills[SkillName.Tailoring].Cap = 120.0;
//mp.Skills[SkillName.Archery].Cap = 120.0;
//mp.Skills[SkillName.Fencing].Cap = 120.0;
//mp.Skills[SkillName.Macing].Cap = 120.0;
//mp.Skills[SkillName.Magery].Cap = 120.0;
//mp.Skills[SkillName.Parry].Cap = 120.0;
//mp.Skills[SkillName.Swords].Cap = 120.0;
//mp.Skills[SkillName.Tactics].Cap = 120.0;
//mp.Skills[SkillName.Wrestling].Cap = 120.0;
//mp.Skills[SkillName.MagicResist].Cap = 120.0;
//mp.Skills[SkillName.Mining].Cap = 120.0;
//mp.Skills[SkillName.Chivalry].Cap = 120.0;
//mp.Skills[SkillName.Necromancy].Cap = 120.0;
//mp.Skills[SkillName.Focus].Cap = 120.0;

//VerifySkills( from );

//stats//
mp.Str += 45;
mp.Dex += 35;
mp.Int += 5;
mp.StrCap = 100;
mp.DexCap = 100;
mp.IntCap = 100;

mp.Race = RaceType.GreyElf;
mp.PlaySound( 0x4E );
mp.Location = new Point3D( 1201, 1134, -25 );
mp.SendMessage("You are now a Grey Elf");
}

private void ArcticElfInit(Mobile from)
{
dovPlayerMobile mp = ((dovPlayerMobile )from );

mp.Hue = 1337;
if ( mp.Hair == null )
{
mp.AddItem( new LongHair() );
mp.Hair.Hue = 1109;
}



if (mp.Female)
{
mp.Hair.Hue = 1110;
mp.Name += ", the Arctic Elf";
mp.AddToBackpack(new ElvishBow());
}
else
{
mp.Hair.Hue = 1110;
mp.Name += ", the Arctic Elf";
mp.AddToBackpack(new ElvishBow());
}
//SKILLS//
//mp.Skills[SkillName.Anatomy].Cap = 120.0;
//mp.Skills[SkillName.ArmsLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalTaming].Cap = 120.0;
//mp.Skills[SkillName.Begging].Cap = 120.0;
//mp.Skills[SkillName.DetectHidden].Cap = 120.0;
//mp.Skills[SkillName.Discordance].Cap = 120.0;
//mp.Skills[SkillName.EvalInt].Cap = 120.0;
//mp.Skills[SkillName.Forensics].Cap = 120.0;
//mp.Skills[SkillName.Hiding].Cap = 120.0;
//mp.Skills[SkillName.ItemID].Cap = 120.0;
//mp.Skills[SkillName.Meditation].Cap = 120.0;
//mp.Skills[SkillName.Peacemaking].Cap = 120.0;
//mp.Skills[SkillName.Poisoning].Cap = 120.0;
//mp.Skills[SkillName.Provocation].Cap = 120.0;
//mp.Skills[SkillName.RemoveTrap].Cap = 120.0;
//mp.Skills[SkillName.SpiritSpeak].Cap = 120.0;
//mp.Skills[SkillName.Stealing].Cap = 120.0;
//mp.Skills[SkillName.Stealth].Cap = 120.0;
//mp.Skills[SkillName.TasteID].Cap = 120.0;
//mp.Skills[SkillName.Tracking].Cap = 120.0;
//mp.Skills[SkillName.Camping].Cap = 120.0;
//mp.Skills[SkillName.Cooking].Cap = 120.0;
//mp.Skills[SkillName.Fishing].Cap = 120.0;
//mp.Skills[SkillName.Healing].Cap = 120.0;
//mp.Skills[SkillName.Herding].Cap = 120.0;
//mp.Skills[SkillName.Lockpicking].Cap = 120.0;
//mp.Skills[SkillName.Lumberjacking].Cap = 120.0;
//mp.Skills[SkillName.Musicianship].Cap = 120.0;
//mp.Skills[SkillName.Snooping].Cap = 120.0;
//mp.Skills[SkillName.Veterinary].Cap = 120.0;
//mp.Skills[SkillName.Blacksmith].Cap = 120.0;
//mp.Skills[SkillName.Fletching].Cap = 120.0;
//mp.Skills[SkillName.Carpentry].Cap = 120.0;
//mp.Skills[SkillName.Alchemy].Cap = 120.0;
//mp.Skills[SkillName.Inscribe].Cap = 120.0;
//mp.Skills[SkillName.Cartography].Cap = 120.0;
//mp.Skills[SkillName.Tinkering].Cap = 120.0;
//mp.Skills[SkillName.Tailoring].Cap = 120.0;
//mp.Skills[SkillName.Archery].Cap = 120.0;
//mp.Skills[SkillName.Fencing].Cap = 120.0;
//mp.Skills[SkillName.Macing].Cap = 120.0;
//mp.Skills[SkillName.Magery].Cap = 120.0;
//mp.Skills[SkillName.Parry].Cap = 120.0;
//mp.Skills[SkillName.Swords].Cap = 120.0;
//mp.Skills[SkillName.Tactics].Cap = 120.0;
//mp.Skills[SkillName.Wrestling].Cap = 120.0;
//mp.Skills[SkillName.MagicResist].Cap = 120.0;
//mp.Skills[SkillName.Mining].Cap = 120.0;
//mp.Skills[SkillName.Chivalry].Cap = 120.0;
//mp.Skills[SkillName.Necromancy].Cap = 120.0;
//mp.Skills[SkillName.Focus].Cap = 120.0;

//VerifySkills( from );

//stats//
mp.Str += 45;
mp.Dex += 50;
mp.Int += 5;
mp.StrCap = 100;
mp.DexCap = 100;
mp.IntCap = 100;

mp.Race = RaceType.ArcticElf;
mp.PlaySound( 0x4E );
mp.Location = new Point3D( 4206, 612, 0 );
mp.SendMessage("You are now a Arctic Elf");
}


private void MountainDwarfInit(Mobile from)
{
dovPlayerMobile mp = ((dovPlayerMobile )from );

mp.Hue = 1740;
if ( mp.Hair == null )
{
mp.AddItem( new LongHair() );
mp.Hair.Hue = 1046;
}

if ( mp.Beard == null )
{
mp.AddItem( new MediumLongBeard() );
mp.Beard.Hue = 1046;
}

if (mp.Female)
{
mp.Hair.Hue = 1046;
mp.Beard.Hue = 1046;
mp.Name += ", the Mountain Dwarf";
mp.AddToBackpack(new DwarvenAxe());
}
else
{
mp.Hair.Hue = 1046;
mp.Beard.Hue = 1046;
mp.Name += ", the Mountain Dwarf";
mp.AddToBackpack(new DwarvenAxe());
}
//SKILLS//
//mp.Skills[SkillName.Anatomy].Cap = 120.0;
//mp.Skills[SkillName.ArmsLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalTaming].Cap = 120.0;
//mp.Skills[SkillName.Begging].Cap = 120.0;
//mp.Skills[SkillName.DetectHidden].Cap = 120.0;
//mp.Skills[SkillName.Discordance].Cap = 120.0;
//mp.Skills[SkillName.EvalInt].Cap = 120.0;
//mp.Skills[SkillName.Forensics].Cap = 120.0;
//mp.Skills[SkillName.Hiding].Cap = 120.0;
//mp.Skills[SkillName.ItemID].Cap = 120.0;
//mp.Skills[SkillName.Meditation].Cap = 120.0;
//mp.Skills[SkillName.Peacemaking].Cap = 120.0;
//mp.Skills[SkillName.Poisoning].Cap = 120.0;
//mp.Skills[SkillName.Provocation].Cap = 120.0;
//mp.Skills[SkillName.RemoveTrap].Cap = 120.0;
//mp.Skills[SkillName.SpiritSpeak].Cap = 120.0;
//mp.Skills[SkillName.Stealing].Cap = 120.0;
//mp.Skills[SkillName.Stealth].Cap = 120.0;
//mp.Skills[SkillName.TasteID].Cap = 120.0;
//mp.Skills[SkillName.Tracking].Cap = 120.0;
//mp.Skills[SkillName.Camping].Cap = 120.0;
//mp.Skills[SkillName.Cooking].Cap = 120.0;
//mp.Skills[SkillName.Fishing].Cap = 120.0;
//mp.Skills[SkillName.Healing].Cap = 120.0;
//mp.Skills[SkillName.Herding].Cap = 120.0;
//mp.Skills[SkillName.Lockpicking].Cap = 120.0;
//mp.Skills[SkillName.Lumberjacking].Cap = 120.0;
//mp.Skills[SkillName.Musicianship].Cap = 120.0;
//mp.Skills[SkillName.Snooping].Cap = 120.0;
//mp.Skills[SkillName.Veterinary].Cap = 120.0;
//mp.Skills[SkillName.Blacksmith].Cap = 120.0;
//mp.Skills[SkillName.Fletching].Cap = 120.0;
//mp.Skills[SkillName.Carpentry].Cap = 120.0;
//mp.Skills[SkillName.Alchemy].Cap = 120.0;
//mp.Skills[SkillName.Inscribe].Cap = 120.0;
//mp.Skills[SkillName.Cartography].Cap = 120.0;
//mp.Skills[SkillName.Tinkering].Cap = 120.0;
//mp.Skills[SkillName.Tailoring].Cap = 120.0;
//mp.Skills[SkillName.Archery].Cap = 120.0;
//mp.Skills[SkillName.Fencing].Cap = 120.0;
//mp.Skills[SkillName.Macing].Cap = 120.0;
//mp.Skills[SkillName.Magery].Cap = 120.0;
//mp.Skills[SkillName.Parry].Cap = 120.0;
//mp.Skills[SkillName.Swords].Cap = 120.0;
//mp.Skills[SkillName.Tactics].Cap = 120.0;
//mp.Skills[SkillName.Wrestling].Cap = 120.0;
//mp.Skills[SkillName.MagicResist].Cap = 120.0;
//mp.Skills[SkillName.Mining].Cap = 120.0;
//mp.Skills[SkillName.Chivalry].Cap = 120.0;
//mp.Skills[SkillName.Necromancy].Cap = 120.0;
//mp.Skills[SkillName.Focus].Cap = 120.0;

//VerifySkills( from );


//stats//
mp.Str += 85;
mp.Dex += 45;
mp.Int += 5;
mp.StrCap = 100;
mp.DexCap = 100;
mp.IntCap = 100;


mp.Race = RaceType.MountainDwarf;
mp.PlaySound( 0x4E );
mp.Location = new Point3D( 976, 507, -80 );
mp.SendMessage("You are now a Mountain Dwarf");
}


private void DrowElfInit(Mobile from)
{
dovPlayerMobile mp = ((dovPlayerMobile )from );

mp.Hue = 1908;

if ( mp.Hair == null )
{
mp.AddItem( new LongHair() );
mp.Hair.Hue = 1153;
}

if (mp.Female)
{
mp.Hair.Hue = 1153;
mp.Name += ", the Drow Elf";
mp.AddToBackpack(new ElvishBow());
}
else
{
mp.Hair.Hue = 1153;
mp.Name += ", the Drow Elf";
mp.AddToBackpack(new ElvishBow());
}
//SKILLS//
//mp.Skills[SkillName.Anatomy].Cap = 120.0;
//mp.Skills[SkillName.ArmsLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalTaming].Cap = 120.0;
//mp.Skills[SkillName.Begging].Cap = 120.0;
//mp.Skills[SkillName.DetectHidden].Cap = 120.0;
//mp.Skills[SkillName.Discordance].Cap = 120.0;
//mp.Skills[SkillName.EvalInt].Cap = 120.0;
//mp.Skills[SkillName.Forensics].Cap = 120.0;
//mp.Skills[SkillName.Hiding].Cap = 120.0;
//mp.Skills[SkillName.ItemID].Cap = 120.0;
//mp.Skills[SkillName.Meditation].Cap = 120.0;
//mp.Skills[SkillName.Peacemaking].Cap = 120.0;
//mp.Skills[SkillName.Poisoning].Cap = 120.0;
//mp.Skills[SkillName.Provocation].Cap = 120.0;
//mp.Skills[SkillName.RemoveTrap].Cap = 120.0;
//mp.Skills[SkillName.SpiritSpeak].Cap = 120.0;
//mp.Skills[SkillName.Stealing].Cap = 120.0;
//mp.Skills[SkillName.Stealth].Cap = 120.0;
//mp.Skills[SkillName.TasteID].Cap = 120.0;
//mp.Skills[SkillName.Tracking].Cap = 120.0;
//mp.Skills[SkillName.Camping].Cap = 120.0;
//mp.Skills[SkillName.Cooking].Cap = 120.0;
//mp.Skills[SkillName.Fishing].Cap = 120.0;
//mp.Skills[SkillName.Healing].Cap = 120.0;
//mp.Skills[SkillName.Herding].Cap = 120.0;
//mp.Skills[SkillName.Lockpicking].Cap = 120.0;
//mp.Skills[SkillName.Lumberjacking].Cap = 120.0;
//mp.Skills[SkillName.Musicianship].Cap = 120.0;
//mp.Skills[SkillName.Snooping].Cap = 120.0;
//mp.Skills[SkillName.Veterinary].Cap = 120.0;
//mp.Skills[SkillName.Blacksmith].Cap = 120.0;
//mp.Skills[SkillName.Fletching].Cap = 120.0;
//mp.Skills[SkillName.Carpentry].Cap = 120.0;
//mp.Skills[SkillName.Alchemy].Cap = 120.0;
//mp.Skills[SkillName.Inscribe].Cap = 120.0;
//mp.Skills[SkillName.Cartography].Cap = 120.0;
//mp.Skills[SkillName.Tinkering].Cap = 120.0;
//mp.Skills[SkillName.Tailoring].Cap = 120.0;
//mp.Skills[SkillName.Archery].Cap = 120.0;
//mp.Skills[SkillName.Fencing].Cap = 120.0;
//mp.Skills[SkillName.Macing].Cap = 120.0;
//mp.Skills[SkillName.Magery].Cap = 120.0;
//mp.Skills[SkillName.Parry].Cap = 120.0;
//mp.Skills[SkillName.Swords].Cap = 120.0;
//mp.Skills[SkillName.Tactics].Cap = 120.0;
//mp.Skills[SkillName.Wrestling].Cap = 120.0;
//mp.Skills[SkillName.MagicResist].Cap = 120.0;
//mp.Skills[SkillName.Mining].Cap = 120.0;
//mp.Skills[SkillName.Chivalry].Cap = 120.0;
//mp.Skills[SkillName.Necromancy].Cap = 120.0;
//mp.Skills[SkillName.Focus].Cap = 120.0;

//VerifySkills( from );


//stats//
mp.Str += 50;
mp.Dex += 60;
mp.Int += 15;
mp.StrCap = 100;
mp.DexCap = 100;
mp.IntCap = 100;

mp.Race = RaceType.DrowElf;
mp.PlaySound( 0x4E );
mp.Location = new Point3D( 2039, 1316, -84 );
mp.SendMessage("You are now a Drow Elf.");
}

private void DarkDwarfInit(Mobile from)
{
dovPlayerMobile mp = ((dovPlayerMobile )from );

mp.Hue = 992;

if ( mp.Hair == null )
{
mp.AddItem( new PonyTail() );
mp.Hair.Hue = 1337;
}

if ( mp.Beard == null )
{
mp.AddItem( new MediumLongBeard() );
mp.Beard.Hue = 1337;
}

if (mp.Female)
{
mp.Hair.Hue = 1337;
mp.Beard.Hue = 1337;
mp.Name += ", the Dark Dwarf";
mp.AddToBackpack(new DwarvenAxe());
}
else
{
mp.Hair.Hue = 1337;
mp.Beard.Hue = 1337;
mp.Name += ", the Dark Dwarf";
mp.AddToBackpack(new DwarvenAxe());
}
//SKILLS//
//mp.Skills[SkillName.Anatomy].Cap = 120.0;
//mp.Skills[SkillName.ArmsLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalTaming].Cap = 120.0;
//mp.Skills[SkillName.Begging].Cap = 120.0;
//mp.Skills[SkillName.DetectHidden].Cap = 120.0;
//mp.Skills[SkillName.Discordance].Cap = 120.0;
//mp.Skills[SkillName.EvalInt].Cap = 120.0;
//mp.Skills[SkillName.Forensics].Cap = 120.0;
//mp.Skills[SkillName.Hiding].Cap = 120.0;
//mp.Skills[SkillName.ItemID].Cap = 120.0;
//mp.Skills[SkillName.Meditation].Cap = 120.0;
//mp.Skills[SkillName.Peacemaking].Cap = 120.0;
//mp.Skills[SkillName.Poisoning].Cap = 120.0;
//mp.Skills[SkillName.Provocation].Cap = 120.0;
//mp.Skills[SkillName.RemoveTrap].Cap = 120.0;
//mp.Skills[SkillName.SpiritSpeak].Cap = 120.0;
//mp.Skills[SkillName.Stealing].Cap = 120.0;
//mp.Skills[SkillName.Stealth].Cap = 120.0;
//mp.Skills[SkillName.TasteID].Cap = 120.0;
//mp.Skills[SkillName.Tracking].Cap = 120.0;
//mp.Skills[SkillName.Camping].Cap = 120.0;
//mp.Skills[SkillName.Cooking].Cap = 120.0;
//mp.Skills[SkillName.Fishing].Cap = 120.0;
//mp.Skills[SkillName.Healing].Cap = 120.0;
//mp.Skills[SkillName.Herding].Cap = 120.0;
//mp.Skills[SkillName.Lockpicking].Cap = 120.0;
//mp.Skills[SkillName.Lumberjacking].Cap = 120.0;
//mp.Skills[SkillName.Musicianship].Cap = 120.0;
//mp.Skills[SkillName.Snooping].Cap = 120.0;
//mp.Skills[SkillName.Veterinary].Cap = 120.0;
//mp.Skills[SkillName.Blacksmith].Cap = 120.0;
//mp.Skills[SkillName.Fletching].Cap = 120.0;
//mp.Skills[SkillName.Carpentry].Cap = 120.0;
//mp.Skills[SkillName.Alchemy].Cap = 120.0;
//mp.Skills[SkillName.Inscribe].Cap = 120.0;
//mp.Skills[SkillName.Cartography].Cap = 120.0;
//mp.Skills[SkillName.Tinkering].Cap = 120.0;
//mp.Skills[SkillName.Tailoring].Cap = 120.0;
//mp.Skills[SkillName.Archery].Cap = 120.0;
//mp.Skills[SkillName.Fencing].Cap = 120.0;
//mp.Skills[SkillName.Macing].Cap = 120.0;
//mp.Skills[SkillName.Magery].Cap = 120.0;
//mp.Skills[SkillName.Parry].Cap = 120.0;
//mp.Skills[SkillName.Swords].Cap = 120.0;
//mp.Skills[SkillName.Tactics].Cap = 120.0;
//mp.Skills[SkillName.Wrestling].Cap = 120.0;
//mp.Skills[SkillName.MagicResist].Cap = 120.0;
//mp.Skills[SkillName.Mining].Cap = 120.0;
//mp.Skills[SkillName.Chivalry].Cap = 120.0;
//mp.Skills[SkillName.Necromancy].Cap = 120.0;
//mp.Skills[SkillName.Focus].Cap = 120.0;

//VerifySkills( from );


//stats//
mp.Str += 75;
mp.Dex += 35;
mp.Int += 5;
mp.StrCap = 100;
mp.DexCap = 100;
mp.IntCap = 100;

mp.Race = RaceType.DarkDwarf;
mp.PlaySound( 0x4E );
mp.Location = new Point3D( 651, 1302, -58 );
mp.SendMessage("You are now a Dark Dwarf.");
}

private void HillDwarfInit(Mobile from)
{
dovPlayerMobile mp = ((dovPlayerMobile )from );

mp.Hue = 33824;

if ( mp.Hair == null )
{
mp.AddItem( new LongHair() );
mp.Hair.Hue = 1134;
}
if (mp.Female)
{
mp.Hair.Hue = 1134;
mp.Name += ", the Hill Dwarf";
mp.AddToBackpack(new DwarvenAxe());
}
else
{
mp.Hair.Hue = 1134;
mp.Beard.Hue = 1134;
mp.Name += ", the Hill Dwarf";
mp.AddToBackpack(new DwarvenAxe());
}
//SKILLS//
//mp.Skills[SkillName.Anatomy].Cap = 120.0;
//mp.Skills[SkillName.ArmsLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalTaming].Cap = 120.0;
//mp.Skills[SkillName.Begging].Cap = 120.0;
//mp.Skills[SkillName.DetectHidden].Cap = 120.0;
//mp.Skills[SkillName.Discordance].Cap = 120.0;
//mp.Skills[SkillName.EvalInt].Cap = 120.0;
//mp.Skills[SkillName.Forensics].Cap = 120.0;
//mp.Skills[SkillName.Hiding].Cap = 120.0;
//mp.Skills[SkillName.ItemID].Cap = 120.0;
//mp.Skills[SkillName.Meditation].Cap = 120.0;
//mp.Skills[SkillName.Peacemaking].Cap = 120.0;
//mp.Skills[SkillName.Poisoning].Cap = 120.0;
//mp.Skills[SkillName.Provocation].Cap = 120.0;
//mp.Skills[SkillName.RemoveTrap].Cap = 120.0;
//mp.Skills[SkillName.SpiritSpeak].Cap = 120.0;
//mp.Skills[SkillName.Stealing].Cap = 120.0;
//mp.Skills[SkillName.Stealth].Cap = 120.0;
//mp.Skills[SkillName.TasteID].Cap = 120.0;
//mp.Skills[SkillName.Tracking].Cap = 120.0;
//mp.Skills[SkillName.Camping].Cap = 120.0;
//mp.Skills[SkillName.Cooking].Cap = 120.0;
//mp.Skills[SkillName.Fishing].Cap = 120.0;
//mp.Skills[SkillName.Healing].Cap = 120.0;
//mp.Skills[SkillName.Herding].Cap = 120.0;
//mp.Skills[SkillName.Lockpicking].Cap = 120.0;
//mp.Skills[SkillName.Lumberjacking].Cap = 120.0;
//mp.Skills[SkillName.Musicianship].Cap = 120.0;
//mp.Skills[SkillName.Snooping].Cap = 120.0;
//mp.Skills[SkillName.Veterinary].Cap = 120.0;
//mp.Skills[SkillName.Blacksmith].Cap = 120.0;
//mp.Skills[SkillName.Fletching].Cap = 120.0;
//mp.Skills[SkillName.Carpentry].Cap = 120.0;
//mp.Skills[SkillName.Alchemy].Cap = 120.0;
//mp.Skills[SkillName.Inscribe].Cap = 120.0;
//mp.Skills[SkillName.Cartography].Cap = 120.0;
//mp.Skills[SkillName.Tinkering].Cap = 120.0;
//mp.Skills[SkillName.Tailoring].Cap = 120.0;
//mp.Skills[SkillName.Archery].Cap = 120.0;
//mp.Skills[SkillName.Fencing].Cap = 120.0;
//mp.Skills[SkillName.Macing].Cap = 120.0;
//mp.Skills[SkillName.Magery].Cap = 120.0;
//mp.Skills[SkillName.Parry].Cap = 120.0;
//mp.Skills[SkillName.Swords].Cap = 120.0;
//mp.Skills[SkillName.Tactics].Cap = 120.0;
//mp.Skills[SkillName.Wrestling].Cap = 120.0;
//mp.Skills[SkillName.MagicResist].Cap = 120.0;
//mp.Skills[SkillName.Mining].Cap = 120.0;
//mp.Skills[SkillName.Chivalry].Cap = 120.0;
//mp.Skills[SkillName.Necromancy].Cap = 120.0;
//mp.Skills[SkillName.Focus].Cap = 120.0;

//VerifySkills( from );


//stats//
mp.Str += 80;
mp.Dex += 55;
mp.Int += 3;
mp.StrCap = 100;
mp.DexCap = 100;
mp.IntCap = 100;

mp.Race = RaceType.HillDwarf;
mp.PlaySound( 0x4E );
mp.Location = new Point3D( 544, 465, -63 );
mp.SendMessage("You are now a Hill Dwarf.");
}

private void OrcInit(Mobile from)
{
dovPlayerMobile mp = ((dovPlayerMobile )from );

mp.Hue = 1441;

if ( mp.Hair == null )
{
mp.AddItem( new LongHair() );
mp.Hair.Hue = 1134;
}

if (mp.Female)
{
mp.Hair.Hue = 1134;
mp.Name += ", the Orc";
mp.AddToBackpack(new OrcishBlade());
}
else
{
mp.Hair.Hue = 1134;
mp.Name += ", the Orc";
mp.AddToBackpack(new OrcishBlade());
}
//SKILLS//
//mp.Skills[SkillName.Anatomy].Cap = 120.0;
//mp.Skills[SkillName.ArmsLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalLore].Cap = 120.0;
//mp.Skills[SkillName.AnimalTaming].Cap = 120.0;
//mp.Skills[SkillName.Begging].Cap = 120.0;
//mp.Skills[SkillName.DetectHidden].Cap = 120.0;
//mp.Skills[SkillName.Discordance].Cap = 120.0;
//mp.Skills[SkillName.EvalInt].Cap = 120.0;
//mp.Skills[SkillName.Forensics].Cap = 120.0;
//mp.Skills[SkillName.Hiding].Cap = 120.0;
//mp.Skills[SkillName.ItemID].Cap = 120.0;
//mp.Skills[SkillName.Meditation].Cap = 120.0;
//mp.Skills[SkillName.Peacemaking].Cap = 120.0;
//mp.Skills[SkillName.Poisoning].Cap = 120.0;
//mp.Skills[SkillName.Provocation].Cap = 120.0;
//mp.Skills[SkillName.RemoveTrap].Cap = 120.0;
//mp.Skills[SkillName.SpiritSpeak].Cap = 120.0;
//mp.Skills[SkillName.Stealing].Cap = 120.0;
//mp.Skills[SkillName.Stealth].Cap = 120.0;
//mp.Skills[SkillName.TasteID].Cap = 120.0;
//mp.Skills[SkillName.Tracking].Cap = 120.0;
//mp.Skills[SkillName.Camping].Cap = 120.0;
//mp.Skills[SkillName.Cooking].Cap = 120.0;
//mp.Skills[SkillName.Fishing].Cap = 120.0;
//mp.Skills[SkillName.Healing].Cap = 120.0;
//mp.Skills[SkillName.Herding].Cap = 120.0;
//mp.Skills[SkillName.Lockpicking].Cap = 120.0;
//mp.Skills[SkillName.Lumberjacking].Cap = 120.0;
//mp.Skills[SkillName.Musicianship].Cap = 120.0;
//mp.Skills[SkillName.Snooping].Cap = 120.0;
//mp.Skills[SkillName.Veterinary].Cap = 120.0;
//mp.Skills[SkillName.Blacksmith].Cap = 120.0;
//mp.Skills[SkillName.Fletching].Cap = 120.0;
//mp.Skills[SkillName.Carpentry].Cap = 120.0;
//mp.Skills[SkillName.Alchemy].Cap = 120.0;
//mp.Skills[SkillName.Inscribe].Cap = 120.0;
//mp.Skills[SkillName.Cartography].Cap = 120.0;
//mp.Skills[SkillName.Tinkering].Cap = 120.0;
//mp.Skills[SkillName.Tailoring].Cap = 120.0;
//mp.Skills[SkillName.Archery].Cap = 120.0;
//mp.Skills[SkillName.Fencing].Cap = 120.0;
//mp.Skills[SkillName.Macing].Cap = 120.0;
//mp.Skills[SkillName.Magery].Cap = 120.0;
//mp.Skills[SkillName.Parry].Cap = 120.0;
//mp.Skills[SkillName.Swords].Cap = 120.0;
//mp.Skills[SkillName.Tactics].Cap = 120.0;
//mp.Skills[SkillName.Wrestling].Cap = 120.0;
//mp.Skills[SkillName.MagicResist].Cap = 120.0;
//mp.Skills[SkillName.Mining].Cap = 120.0;
//mp.Skills[SkillName.Chivalry].Cap = 120.0;
//mp.Skills[SkillName.Necromancy].Cap = 120.0;
//mp.Skills[SkillName.Focus].Cap = 120.0;

//VerifySkills( from );


//stats//
mp.Str += 65;
mp.Dex += 50;
mp.Int += 1;
mp.StrCap = 100;
mp.DexCap = 100;
mp.IntCap = 100;


mp.Race = RaceType.Orc;
mp.PlaySound( 0x4E );
mp.Location = new Point3D( 2171, 1331, 0 );
mp.SendMessage("You are now an Orc.");
}


private void VerifySkills( Mobile m )
{
for ( int i = 0; i < 52; ++i )
{
if ( m.Skills.Base > m.Skills.Cap )
m.Skills.Base = m.Skills.Cap;
}
return;
}
}
}
[/code:1]


dovplayermobile.cs
[code:1]
using System;
using System.IO;
using System.Collections;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;
using Server.Multis;
using Server.Engines.Help;
using Server.Network;
using Server.Mobiles;

namespace Server.Mobiles
{
public enum RaceType
{
None, WildElf, GreyElf, ArcticElf, MountainDwarf, DrowElf, DarkDwarf, HillDwarf, Orc, Centaur
}

public class dovPlayerMobile : PlayerMobile
{
private RaceType m_Race = RaceType.None;
private int m_StrCap = 200;
private int m_DexCap = 200;
private int m_IntCap = 200;
private bool m_InfraVision = false;

public dovPlayerMobile()
{
}

public dovPlayerMobile( Serial s ) : base( s )
{
}

[CommandProperty( AccessLevel.GameMaster )]
public RaceType Race
{
get{ return m_Race; }
set{ m_Race = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int StrCap
{
get{ return m_StrCap; }
set{ m_StrCap = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int DexCap
{
get{ return m_DexCap; }
set{ m_DexCap = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int IntCap
{
get{ return m_IntCap; }
set{ m_IntCap = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool InfraVision
{
get{ return m_InfraVision; }
set{ m_InfraVision = value; }
}

public override void OnAfterResurrect()
{
RaceType race = this.Race;

// race switch here
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)2 );//version

// version 2
writer.Write( (bool)m_InfraVision );

//version 1
writer.Write( (int)m_Race );
writer.Write( (int)m_StrCap );
writer.Write( (int)m_DexCap );
writer.Write( (int)m_IntCap );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch( version )
{
case 2:
m_InfraVision = (bool)reader.ReadBool();
goto case 1;
case 1:
m_Race = (RaceType)reader.ReadInt();
m_StrCap = (int)reader.ReadInt();
m_DexCap = (int)reader.ReadInt();
m_IntCap = (int)reader.ReadInt();
goto case 0;
case 0:
break;
}
}
}
}
[/code:1]
 
Next

SkillCheck.cs
[code:1]
using System;
using Server;
using Server.Mobiles;

namespace Server.Misc
{
public class SkillCheck
{
private const bool AntiMacroCode = true; //Change this to false to disable anti-macro code

public static TimeSpan AntiMacroExpire = TimeSpan.FromMinutes( 5.0 ); //How long do we remember targets/locations?
public const int Allowance = 3; //How many times may we use the same location/target for gain
private const int LocationSize = 5; //The size of eeach location, make this smaller so players dont have to move as far
private static bool[] UseAntiMacro = new bool[]
{
// true if this skill uses the anti-macro code, false if it does not
false,// Alchemy = 0,
true,// Anatomy = 1,
true,// AnimalLore = 2,
true,// ItemID = 3,
true,// ArmsLore = 4,
false,// Parry = 5,
true,// Begging = 6,
false,// Blacksmith = 7,
false,// Fletching = 8,
true,// Peacemaking = 9,
true,// Camping = 10,
false,// Carpentry = 11,
false,// Cartography = 12,
false,// Cooking = 13,
true,// DetectHidden = 14,
true,// Discordance = 15,
true,// EvalInt = 16,
true,// Healing = 17,
true,// Fishing = 18,
true,// Forensics = 19,
true,// Herding = 20,
true,// Hiding = 21,
true,// Provocation = 22,
false,// Inscribe = 23,
true,// Lockpicking = 24,
true,// Magery = 25,
true,// MagicResist = 26,
false,// Tactics = 27,
true,// Snooping = 28,
true,// Musicianship = 29,
true,// Poisoning = 30,
false,// Archery = 31,
true,// SpiritSpeak = 32,
true,// Stealing = 33,
false,// Tailoring = 34,
true,// AnimalTaming = 35,
true,// TasteID = 36,
false,// Tinkering = 37,
true,// Tracking = 38,
true,// Veterinary = 39,
false,// Swords = 40,
false,// Macing = 41,
false,// Fencing = 42,
false,// Wrestling = 43,
true,// Lumberjacking = 44,
true,// Mining = 45,
true,// Meditation = 46,
true,// Stealth = 47,
true,// RemoveTrap = 48,
true,// Necromancy = 49,
false,// Focus = 50,
true,// Chivalry = 51
};

public static void Initialize()
{
Mobile.SkillCheckLocationHandler = new SkillCheckLocationHandler( Mobile_SkillCheckLocation );
Mobile.SkillCheckDirectLocationHandler = new SkillCheckDirectLocationHandler( Mobile_SkillCheckDirectLocation );

Mobile.SkillCheckTargetHandler = new SkillCheckTargetHandler( Mobile_SkillCheckTarget );
Mobile.SkillCheckDirectTargetHandler = new SkillCheckDirectTargetHandler( Mobile_SkillCheckDirectTarget );
}

public static bool Mobile_SkillCheckLocation( Mobile from, SkillName skillName, double minSkill, double maxSkill )
{
Skill skill = from.Skills[skillName];

if ( skill == null )
return false;

double value = skill.Value;

if ( value < minSkill )
return false; // Too difficult
else if ( value >= maxSkill )
return true; // No challenge

double chance = (value - minSkill) / (maxSkill - minSkill);

Point2D loc = new Point2D( from.Location.X / LocationSize, from.Location.Y / LocationSize );
return CheckSkill( from, skill, loc, chance );
}

public static bool Mobile_SkillCheckDirectLocation( Mobile from, SkillName skillName, double chance )
{
Skill skill = from.Skills[skillName];

if ( skill == null )
return false;

if ( chance < 0.0 )
return false; // Too difficult
else if ( chance >= 1.0 )
return true; // No challenge

Point2D loc = new Point2D( from.Location.X / LocationSize, from.Location.Y / LocationSize );
return CheckSkill( from, skill, loc, chance );
}

public static bool CheckSkill( Mobile from, Skill skill, object amObj, double chance )
{
if ( from.Skills.Cap == 0 )
return false;

bool success = ( chance >= Utility.RandomDouble() );
double gc = (double)(from.Skills.Cap - from.Skills.Total) / from.Skills.Cap;
gc += ( skill.Cap - skill.Base ) / skill.Cap;
gc /= 2;

gc += ( 1.0 - chance ) * ( success ? 0.5 : 0.2 );
gc /= 2;

gc *= skill.Info.GainFactor;

if ( gc < 0.01 )
gc = 0.01;

if ( from.Alive && ( ( gc >= Utility.RandomDouble() && AllowGain( from, skill, amObj ) ) || skill.Base < 10.0 ) )
Gain( from, skill );

return success;
}

public static bool Mobile_SkillCheckTarget( Mobile from, SkillName skillName, object target, double minSkill, double maxSkill )
{
Skill skill = from.Skills[skillName];

if ( skill == null )
return false;

double value = skill.Value;

if ( value < minSkill )
return false; // Too difficult
else if ( value >= maxSkill )
return true; // No challenge

double chance = (value - minSkill) / (maxSkill - minSkill);

return CheckSkill( from, skill, target, chance );
}

public static bool Mobile_SkillCheckDirectTarget( Mobile from, SkillName skillName, object target, double chance )
{
Skill skill = from.Skills[skillName];

if ( skill == null )
return false;

if ( chance < 0.0 )
return false; // Too difficult
else if ( chance >= 1.0 )
return true; // No challenge

return CheckSkill( from, skill, target, chance );
}

private static bool AllowGain( Mobile from, Skill skill, object obj )
{
if ( from is PlayerMobile && AntiMacroCode && UseAntiMacro[skill.Info.SkillID] )
return ((PlayerMobile)from).AntiMacroCheck( skill, obj );
else
return true;
}

public enum Stat { Str, Dex, Int }

public static void Gain( Mobile from, Skill skill )
{
if ( skill.Base < skill.Cap && skill.Lock == SkillLock.Up )
{
int toGain = 1;

if ( skill.Base <= 10.0 )
toGain = Utility.Random( 4 ) + 1;

Skills skills = from.Skills;

if ( ( skills.Total / skills.Cap ) >= Utility.RandomDouble() )//( skills.Total >= skills.Cap )
{
for ( int i = 0; i < skills.Length; ++i )
{
Skill toLower = skills;

if ( toLower != skill && toLower.Lock == SkillLock.Down && toLower.BaseFixedPoint >= toGain )
{
toLower.BaseFixedPoint -= toGain;
break;
}
}
}

if ( (skills.Total + toGain) <= skills.Cap )
{
skill.BaseFixedPoint += toGain;
}
}

if ( skill.Lock == SkillLock.Up )
{
SkillInfo info = skill.Info;

if ( from.StrLock == StatLockType.Up && (info.StrGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Str );
else if ( from.DexLock == StatLockType.Up && (info.DexGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Dex );
else if ( from.IntLock == StatLockType.Up && (info.IntGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Int );
}
}

public static bool CanLower( Mobile from, Stat stat )
{
switch ( stat )
{
case Stat.Str: return ( from.StrLock == StatLockType.Down && from.RawStr > 10 );
case Stat.Dex: return ( from.DexLock == StatLockType.Down && from.RawDex > 10 );
case Stat.Int: return ( from.IntLock == StatLockType.Down && from.RawInt > 10 );
}

return false;
}

public static bool CanRaise( Mobile from, Stat stat )
{
if ( from.RawStatTotal >= from.StatCap )
return false;

dovPlayerMobile pm = from as dovPlayerMobile;

switch ( stat )
{
case Stat.Str: return ( from.StrLock == StatLockType.Up && from.RawStr < ( (from is dovPlayerMobile) ? pm.StrCap : 125 ) );
case Stat.Dex: return ( from.DexLock == StatLockType.Up && from.RawDex < ( (from is dovPlayerMobile) ? pm.DexCap : 125 ) );
case Stat.Int: return ( from.IntLock == StatLockType.Up && from.RawInt < ( (from is dovPlayerMobile) ? pm.IntCap : 125 ) );
}

return false;
}

public static void IncreaseStat( Mobile from, Stat stat, bool atrophy )
{
atrophy = atrophy || (from.RawStatTotal >= from.StatCap);

switch ( stat )
{
case Stat.Str:
{
if ( atrophy )
{
if ( CanLower( from, Stat.Dex ) && (from.RawDex < from.RawInt || !CanLower( from, Stat.Int )) )
--from.RawDex;
else if ( CanLower( from, Stat.Int ) )
--from.RawInt;
}

if ( CanRaise( from, Stat.Str ) )
++from.RawStr;

break;
}
case Stat.Dex:
{
if ( atrophy )
{
if ( CanLower( from, Stat.Str ) && (from.RawStr < from.RawInt || !CanLower( from, Stat.Int )) )
--from.RawStr;
else if ( CanLower( from, Stat.Int ) )
--from.RawInt;
}

if ( CanRaise( from, Stat.Dex ) )
++from.RawDex;

break;
}
case Stat.Int:
{
if ( atrophy )
{
if ( CanLower( from, Stat.Str ) && (from.RawStr < from.RawDex || !CanLower( from, Stat.Dex )) )
--from.RawStr;
else if ( CanLower( from, Stat.Dex ) )
--from.RawDex;
}

if ( CanRaise( from, Stat.Int ) )
++from.RawInt;

break;
}
}
}

private static TimeSpan m_StatGainDelay = TimeSpan.FromMinutes( 15.0 );

public static void GainStat( Mobile from, Stat stat )
{
if ( (from.LastStatGain + m_StatGainDelay) >= DateTime.Now )
return;

from.LastStatGain = DateTime.Now;

bool atrophy = ( (from.RawStatTotal / (double)from.StatCap) >= Utility.RandomDouble() );

IncreaseStat( from, stat, atrophy );
}
}
}
[/code:1]
 
last


LoginStats.cs
[code:1]
using System;
using Server.Network;
using Server.Gumps;
using Server.Accounting;
using Server.Mobiles;

namespace Server.Misc
{
public class LoginStats
{
public static void Initialize()
{
// Register our event handler
EventSink.Login += new LoginEventHandler( EventSink_Login );
}

private static void EventSink_Login( LoginEventArgs args )
{
int userCount = NetState.Instances.Count;
int itemCount = World.Items.Count;
int mobileCount = World.Mobiles.Count;
int spellCount = Spells.SpellRegistry.Count;

Mobile m = args.Mobile;
dovPlayerMobile pm = args.Mobile as dovPlayerMobile;
RaceType race = pm.Race;

switch( race )
{
case RaceType.Centaur:
pm.BodyMod = 101; break;

}

if ( pm.InfraVision )
{
m.LightLevel = 25;
m.Send( new Network.GlobalLightLevel( (int)m.Region.LightLevel( m, LightCycle.Level ) ) );
m.Send( new Network.PersonalLightLevel( m ) );
}

m.SendMessage( "Welcome, {0}! There {1} currently {2} user{3} online, with {4} item{5} and {6} mobile{7} in the world.",
args.Mobile.Name,
userCount == 1 ? "is" : "are",
userCount, userCount == 1 ? "" : "s",
itemCount, itemCount == 1 ? "" : "s",
mobileCount, mobileCount == 1 ? "" : "s" );
}
}
}
[/code:1][/code][/quote]
 

Tru

Knight
about your starting locations
what map do you start them on in the charactercreation.cs?
 
Top