Random NPC name generator

This is Random NPC Name Generator:


 * it will works only for 7 default races


 * it will works only for NPC no for PC


 * put it into creature's OnSpawn

//::///////////////////////////////////////////////

//:: Name Random Name OnSpawn Generator

//:: FileName bm_onspwnrndmnme

//:: Copyright GNU_PL

//:://////////////////////////////////////////////

/*

Random Name OnSpawn Generator

for 7 of playable races

Works only on NPC!



//:://////////////////////////////////////////////

//:: Created By: SpookyPl

//:: Created On: 21.09.2007, 12:27

//:://////////////////////////////////////////////

void main

{

int iRace = GetRacialType(OBJECT_SELF);

int iGender = GetGender(OBJECT_SELF);

string sRandomName, sRandomSurname, sNewName;

if (iRace == RACIAL_TYPE_HUMAN )

{

if (iGender == GENDER_FEMALE)

{

sRandomName = RandomName(NAME_FIRST_HUMAN_FEMALE);

}

if (iGender == GENDER_MALE)

{

sRandomName = RandomName(NAME_FIRST_HUMAN_MALE);

}

sRandomSurname = RandomName(NAME_LAST_HUMAN);

}

if (iRace == RACIAL_TYPE_DWARF)

{

if (iGender == GENDER_FEMALE)

{

sRandomName = RandomName(NAME_FIRST_DWARF_FEMALE);

}

if (iGender == GENDER_MALE)

{

sRandomName = RandomName(NAME_FIRST_DWARF_MALE);

}

sRandomSurname = RandomName(NAME_LAST_DWARF);

}

if (iRace == RACIAL_TYPE_ELF)

{

if (iGender == GENDER_FEMALE)

{

sRandomName = RandomName(NAME_FIRST_ELF_FEMALE);

}

if (iGender == GENDER_MALE)

{

sRandomName = RandomName(NAME_FIRST_ELF_MALE);

}

sRandomSurname = RandomName(NAME_LAST_ELF);

}

if (iRace == RACIAL_TYPE_GNOME)

{

if (iGender == GENDER_FEMALE)

{

sRandomName = RandomName(NAME_FIRST_GNOME_FEMALE);

}

if (iGender == GENDER_MALE)

{

sRandomName = RandomName(NAME_FIRST_GNOME_MALE);

}

sRandomSurname = RandomName(NAME_LAST_GNOME);

}

if (iRace == RACIAL_TYPE_HALFELF)

{

if (iGender == GENDER_FEMALE)

{

sRandomName = RandomName(NAME_FIRST_HALFELF_FEMALE);

}

if (iGender == GENDER_MALE)

{

sRandomName = RandomName(NAME_FIRST_HALFELF_MALE);

}

sRandomSurname = RandomName(NAME_LAST_HALFELF);

}

if (iRace == RACIAL_TYPE_HALFLING)

{

if (iGender == GENDER_FEMALE)

{

sRandomName = RandomName(NAME_FIRST_HALFLING_FEMALE);

}

if (iGender == GENDER_MALE)

{

sRandomName = RandomName(NAME_FIRST_HALFLING_MALE);

}

sRandomSurname = RandomName(NAME_LAST_HALFLING);

}

if (iRace == RACIAL_TYPE_HALFORC)

{

if (iGender == GENDER_FEMALE)

{

sRandomName = RandomName(NAME_FIRST_HALFORC_FEMALE);

}

if (iGender == GENDER_MALE)

{

sRandomName = RandomName(NAME_FIRST_HALFORC_MALE);

}

sRandomSurname = RandomName(NAME_LAST_HALFORC);

}

sNewName = sRandomName + " " + sRandomSurname;

SetName(OBJECT_SELF,sNewName);

}