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; } |
I may be a begginner at C++ but I think ur missing an open { for that very last } drawde
|
All {..} are fine. None missing.
|
Quote:
Quote:
|
yea my bad, wasnt paying enough attention sorry
|
Goner
very cute, just add a blank entry for the last suffix so you can have pets like goner and zoner.
bill |
nm, i see now, we can even have good old Gann at our side (nameless joke, not funny)
bill |
All times are GMT -4. The time now is 07:58 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.