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.

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 01-27-2003, 09:43 AM
O6scured
Sarnak
 
Join Date: May 2002
Posts: 62
Default

I may be a begginner at C++ but I think ur missing an open { for that very last } drawde
__________________
Obscured Reality
Server Op
Reply With Quote
  #3  
Old 01-27-2003, 10:15 AM
fnemo's Avatar
fnemo
Discordant
 
Join Date: Dec 2002
Posts: 354
Default

All {..} are fine. None missing.
__________________
Nemo
Administrator and coder for the World Alkora Server
Reply With Quote
  #4  
Old 01-27-2003, 10:16 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

Quote:
const char* Mob::GetRandPetName() {
Quote:
return petreturn;
}
__________________
Lethal Encounter
Reply With Quote
  #5  
Old 01-27-2003, 10:22 AM
O6scured
Sarnak
 
Join Date: May 2002
Posts: 62
Default

yea my bad, wasnt paying enough attention sorry
__________________
Obscured Reality
Server Op
Reply With Quote
  #6  
Old 01-31-2003, 07:50 AM
bbbill_42
Fire Beetle
 
Join Date: Jan 2003
Posts: 9
Default Goner

very cute, just add a blank entry for the last suffix so you can have pets like goner and zoner.

bill
Reply With Quote
  #7  
Old 01-31-2003, 12:22 PM
bbbill_42
Fire Beetle
 
Join Date: Jan 2003
Posts: 9
Default

nm, i see now, we can even have good old Gann at our side (nameless joke, not funny)

bill
Reply With Quote
Reply


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 02:53 PM.


 

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