Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-27-2003, 01:30 AM
Drawde
Dragon
 
Join Date: Jan 2002
Posts: 521
Default Code snippet for truly random pet names

I noticed that pet names were actually selected from a hard-coded list, so I thought it might be worth adding a random name generator. I haven't tested this snippet, but it should work. I'm not sure the list of syllables is 100% complete, someone with more experience of pet classes in EQ will probably know!

(edit: added blank final syllable as suggested)

const char* Mob::GetRandPetName() {
char* petreturn = 0;
char namesyl1[10][6] = {
"Ga","Ge","Go","Gi","Ja","Jo","Je","Ji","Ka","Ke", "Ko","Ki","La","Le","Lo","Li","Va","Ve","Vo","Xa", "Xe","Xo","Za","Ze","Zo"
};
char namesyl2[10][6] = {
"b","ban","bar","bek","bob","k","n","nar","nan","n ek","r","ran","rar","rek","s","sar","sek","sob",
};
char namesyl3[4][6] = {
"ab","er","n","tik",""
};

sprintf(petreturn,"%s%s%s",namesyl1[rand() % 77],namesyl2[rand() % 77],namesyl3[rand() % 4]);

// printf("Using %s\n", petreturn);
return petreturn;
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:25 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3