# UOX3 Script Engine

### API and Event handling

### Race Related Functions

GetRaceCount
Prototype |
    int GetRaceCount();
Purpose | Counts all Races available on the Server.
Example of Usage | Could be used for a RaceSelector using a Gump...
    for (var i = 0; i < GetRaceCount(); i++) {
    	if (IsPlayerRace(i)) {
          		// Display the race on the gump
          	}
    }

IsRaceWeakToWeather
Prototype |
    bool IsRaceWeakToWeather( race, weatherType );
Purpose | Returns true if race is weak to weatherType. The list of weather types are: 0 - Light 1 - Rain 2 - Cold 3 - Heat 4 - Lightning 5 - Snow
Example of Usage |
    if( IsRaceWeakToWeather( GetRace( pTalking ), 0 ) )

    {

    	TextMessage( pTalkingTo, "I call forth the power of heaven!" );

    	// TO DO: Change light level brighter here

    }

RaceRequiresBeard
Prototype |
    bool RaceRequiresBeard( raceID );
Purpose | Returns true if raceID requires a beard
Example of Usage |
    if( RaceRequiresBeard( GetRace( pTalking ) ) )

    {

    	TextMessage( pTalkingTo, "Oh, I wish I could be like you, just for the beard!" );

    }

RaceRequiresNoBeard
Prototype |
    bool RaceRequiresNoBeard( raceID );
Purpose | Returns true if the race requires the person has no beard.
Example of Usage |
    if( RaceRequiresNoBeard( GetRace( pTalking ) ) )

    {

    	TextMessage( pTalkingTo, "Oh dear, I don't want to give up my beard" );

    }

CanRaceWearArmour
Prototype |
    bool CanRaceWearArmour( raceID, tItem );
Purpose | Returns true if the race raceID can equip the item tItem.
Example of Usage |
    if( CanRaceWearArmour( GetRace( pTalking ), someItem )

    {

    	TextMessage( pTalking, "Whoo hoo, I can wear it" );

    }

GetRaceSkillAdjustment
Prototype |
    signed char GetRaceSkillAdjustment( raceID, skillNum );
Purpose | Returns the % increase that raceID gets for skillNum.
Example of Usage |
    if( GetRaceSkillAdjustment( GetRace( pTalking ), 32 ) > 10 )

    {

    	TextMessage( pTalkingTo, "Wow, that's a big increase in spirit speak you get there" );

    }

IsValidRaceHairColour
Prototype |
    bool IsValidRaceHairColour( raceID, tColour );
Purpose | Returns true if the hair colour is valid for raceID.
Example of Usage |
    if( IsValidRaceHairColour( GetRace( pTalking ), 1 ) )

    {

    	TextMessage( pTalkingTo, "awww, you can't have black hair?" );

    }

IsValidRaceSkinColour
Prototype |
    bool IsValidRaceSkinColour( raceID, tColour );
Purpose | Returns true if the skin colour is valid for raceID.
Example of Usage |
    if( IsValidRaceSkinColour( GetRace( pTalking ), 1 ) )

    {

    	TextMessage( pTalkingTo, "awww, you can't have black skin?" );

    }

IsValidRaceBeardColour
Prototype |
    bool IsValidRaceBeardColour( raceID, tColour );
Purpose | Returns true if the beard colour is valid for raceID.
Example of Usage |
    if( IsValidRaceBeardColour( GetRace( pTalking ), 1 ) )

    {

    	TextMessage( pTalkingTo, "awww, my beard couldn't be black?" );

    }

RaceCompare
Prototype |
    char RaceCompare( srcChar, trgChar );
Purpose | Returns the relationship between the races of the 2 characters. If it's 0, then they're neutral. If it's bigger than 0 and less than 100, then they're allies. If it's less than 0 and greater than -100, then it's an enemy.
Example of Usage |
    if( RaceCompare( pTalkingTo, pTalking ) < 0 )

    {

    	TextMessage( pTalkingTo, "Oh my god, get away from me!" );

    }

RaceCompareByRace
Prototype |
    char RaceCompareByRace( srcRace, trgRace );
Purpose | Returns the relationship of the two races. If it's 0, then they're neutral. If it's greater than 0 and less than 100, then they're allies. If it's less than 0 and greater than -100, then they're enemies.
Example of Usage |
    if( RaceCompareByRace( GetRace( pTalkingTo ), GetRace( pTalking ) ) < 0 )

    {

    	TextMessage( pTalkingTo, "Oh my god, get away from me!" );

    }

RaceGate
Prototype |
    void RaceGate( socket, character, raceID );
Purpose | Sets the characters race.
Example of Usage |
    RaceGate( mSock, mChar, newRace );

©Copyright 2000-2001 WWW.UOX3.NET (Daniel Stratton/Matthew Randall)