|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) | |
|
Newbie
Join Date: Jun 2006
Age: 26
Posts: 12
|
hi everyone, i did a custom race editing RaceDefinition.cs, and i added the Drow Race.
I also created 3 gates for switching races, HumanGate, ElvenGate and DrowishGate... the compiler as no problem with human and elven ones, but it says: Quote:
here's my racedefinition.cs (only the part after the elven race) Code:
...
private class Drow : Race
{
private static int[] m_SkinHues = new int[]
{
0x381, 0x382, 0x383, 0x389, 0x3E5, 0x3E6, 0x4DE, 0x51D, 0x76B
};
private static int[] m_HairHues = new int[]
{
0x034, 0x035, 0x036, 0x037, 0x038, 0x039, 0x058, 0x08E,
0x08F, 0x090, 0x091, 0x092, 0x101, 0x159, 0x15A, 0x15B,
0x15C, 0x15D, 0x15E, 0x128, 0x12F, 0x1BD, 0x1E4, 0x1F3,
0x207, 0x211, 0x239, 0x251, 0x26C, 0x2C3, 0x2C9, 0x31D,
0x31E, 0x31F, 0x320, 0x321, 0x322, 0x323, 0x324, 0x325,
0x326, 0x369, 0x386, 0x387, 0x388, 0x389, 0x38A, 0x59D,
0x6B8, 0x725, 0x853
};
public Drow( int raceID, int raceIndex )
: base( raceID, raceIndex, "Drow", "Drow", 605, 606, 607, 608, Expansion.ML )
{
}
public override bool ValidateHair( bool female, int itemID )
{
if( itemID == 0 )
return true;
if( (female && (itemID == 0x2FCD || itemID == 0x2FBF)) || (!female && (itemID == 0x2FCC || itemID == 0x2FD0)) )
return false;
if( itemID >= 0x2FBF && itemID <= 0x2FC2 )
return true;
if( itemID >= 0x2FCC && itemID <= 0x2FD1 )
return true;
return false;
}
public override int RandomHair( bool female ) //Random hair doesn't include baldness
{
switch( Utility.Random( 8 ) )
{
case 0: return 0x2FC0; //Long Feather
case 1: return 0x2FC1; //Short
case 2: return 0x2FC2; //Mullet
case 3: return 0x2FCE; //Knob
case 4: return 0x2FCF; //Braided
case 5: return 0x2FD1; //Spiked
case 6: return (female ? 0x2FCC : 0x2FBF); //Flower or Mid-long
default: return (female ? 0x2FD0 : 0x2FCD); //Bun or Long
}
}
public override bool ValidateFacialHair( bool female, int itemID )
{
return (itemID == 0);
}
public override int RandomFacialHair( bool female )
{
return 0;
}
public override int ClipSkinHue( int hue )
{
for( int i = 0; i < m_SkinHues.Length; i++ )
if( m_SkinHues[i] == hue )
return hue;
return m_SkinHues[0];
}
public override int RandomSkinHue()
{
return m_SkinHues[Utility.Random( m_SkinHues.Length )] | 0x8000;
}
public override int ClipHairHue( int hue )
{
for( int i = 0; i < m_HairHues.Length; i++ )
if( m_HairHues[i] == hue )
return hue;
return m_HairHues[0];
}
public override int RandomHairHue()
{
return m_HairHues[Utility.Random( m_HairHues.Length )];
}
}
}
}
Code:
using System;
namespace Server.Items
{
public class DrowGate : Item
{
[Constructable]
public DrowGate() : base(0xF6C)
{
Movable = false;
Light = LightType.Circle300;
Hue = 0x0BF;
Name = "Drow Race Gate";
}
public DrowGate(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int) 0);
}
public override bool OnMoveOver( Mobile m )
{
m.SendMessage( "Ora sei un Drow" ); // You're now a Drow
m.Race = Race.Drow;
m.Hue = Utility.RandomList ( 0x381, 0x382, 0x383, 0x389, 0x3E5, 0x3E6, 0x4DE, 0x51D, 0x76B );
return false; //Changed this to false
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
Last edited by alex92; 05-08-2008 at 03:49 PM. |
|
|
|
|
|
|
#2 (permalink) |
|
Forum Novice
|
From Race.cs (core file):
Code:
public static Race Human { get { return m_Races[0]; } }
public static Race Elf { get { return m_Races[1]; } }
|
|
|
|
|
|
#3 (permalink) | |
|
Newbie
Join Date: Jun 2006
Age: 26
Posts: 12
|
Quote:
but in game "[set race drow" works as well, it's only when i try to change the race from scripts... |
|
|
|
|
|
|
#5 (permalink) | |
|
Newbie
Join Date: Jun 2006
Age: 26
Posts: 12
|
Quote:
please, don't kill me ![]() |
|
|
|
|
|
|
#6 (permalink) |
|
Forum Novice
|
You need RunUO source files. After downloading make changes in Race.cs and recompile .exe file. This thread can help you
|
|
|
|
|
|
#7 (permalink) |
|
Newbie
Join Date: Jun 2006
Age: 26
Posts: 12
|
ok, thank you both
![]() p.s. after Code:
public static Race Human { get { return m_Races[0]; } }
public static Race Elf { get { return m_Races[1]; } }
Code:
public static Race Drow { get { return m_Races[2]; } }
Code:
public static Race Drow { get { return m_Races[32]; } }
Last edited by alex92; 05-08-2008 at 05:34 PM. |
|
|
|
|
|
#11 (permalink) | |
|
Forum Expert
|
Quote:
if (m_From.Race == Race.Races[32]) m_From.RemoveItem(tool); |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|