Mercenaries now spawn as the same Gender and Size of the Merchant they are purchased from.

Mercenaries now spawn with randomized facial features when purchased.
Setting a lastname for NPCs will now override any hard coded lastname (such as GM Trainers).
This commit is contained in:
Trevius
2014-12-01 19:54:01 -06:00
parent cbadd8bde1
commit 24ea7a0d45
13 changed files with 549 additions and 540 deletions
+3 -182
View File
@@ -4985,189 +4985,10 @@ void command_randomfeatures(Client *c, const Seperator *sep)
c->Message(0,"Error: This command requires a target");
else
{
uint16 Race = target->GetRace();
if (Race <= 12 || Race == 128 || Race == 130 || Race == 330 || Race == 522) {
uint8 Gender = target->GetGender();
uint8 Texture = 0xFF;
uint8 HelmTexture = 0xFF;
uint8 HairColor = 0xFF;
uint8 BeardColor = 0xFF;
uint8 EyeColor1 = 0xFF;
uint8 EyeColor2 = 0xFF;
uint8 HairStyle = 0xFF;
uint8 LuclinFace = 0xFF;
uint8 Beard = 0xFF;
uint32 DrakkinHeritage = 0xFFFFFFFF;
uint32 DrakkinTattoo = 0xFFFFFFFF;
uint32 DrakkinDetails = 0xFFFFFFFF;
// Set some common feature settings
EyeColor1 = MakeRandomInt(0, 9);
EyeColor2 = MakeRandomInt(0, 9);
LuclinFace = MakeRandomInt(0, 7);
// Adjust all settings based on the min and max for each feature of each race and gender
switch (Race)
{
case 1: // Human
HairColor = MakeRandomInt(0, 19);
if (Gender == 0) {
BeardColor = HairColor;
HairStyle = MakeRandomInt(0, 3);
Beard = MakeRandomInt(0, 5);
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
}
break;
case 2: // Barbarian
HairColor = MakeRandomInt(0, 19);
LuclinFace = MakeRandomInt(0, 87);
if (Gender == 0) {
BeardColor = HairColor;
HairStyle = MakeRandomInt(0, 3);
Beard = MakeRandomInt(0, 5);
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
}
break;
case 3: // Erudite
if (Gender == 0) {
BeardColor = MakeRandomInt(0, 19);
Beard = MakeRandomInt(0, 5);
LuclinFace = MakeRandomInt(0, 57);
}
if (Gender == 1) {
LuclinFace = MakeRandomInt(0, 87);
}
break;
case 4: // WoodElf
HairColor = MakeRandomInt(0, 19);
if (Gender == 0) {
HairStyle = MakeRandomInt(0, 3);
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
}
break;
case 5: // HighElf
HairColor = MakeRandomInt(0, 14);
if (Gender == 0) {
HairStyle = MakeRandomInt(0, 3);
LuclinFace = MakeRandomInt(0, 37);
BeardColor = HairColor;
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
}
break;
case 6: // DarkElf
HairColor = MakeRandomInt(13, 18);
if (Gender == 0) {
HairStyle = MakeRandomInt(0, 3);
LuclinFace = MakeRandomInt(0, 37);
BeardColor = HairColor;
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
}
break;
case 7: // HalfElf
HairColor = MakeRandomInt(0, 19);
if (Gender == 0) {
HairStyle = MakeRandomInt(0, 3);
LuclinFace = MakeRandomInt(0, 37);
BeardColor = HairColor;
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
}
break;
case 8: // Dwarf
HairColor = MakeRandomInt(0, 19);
BeardColor = HairColor;
if (Gender == 0) {
HairStyle = MakeRandomInt(0, 3);
Beard = MakeRandomInt(0, 5);
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
LuclinFace = MakeRandomInt(0, 17);
}
break;
case 9: // Troll
EyeColor1 = MakeRandomInt(0, 10);
EyeColor2 = MakeRandomInt(0, 10);
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 3);
HairColor = MakeRandomInt(0, 23);
}
break;
case 10: // Ogre
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 3);
HairColor = MakeRandomInt(0, 23);
}
break;
case 11: // Halfling
HairColor = MakeRandomInt(0, 19);
if (Gender == 0) {
BeardColor = HairColor;
HairStyle = MakeRandomInt(0, 3);
Beard = MakeRandomInt(0, 5);
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
}
break;
case 12: // Gnome
HairColor = MakeRandomInt(0, 24);
if (Gender == 0) {
BeardColor = HairColor;
HairStyle = MakeRandomInt(0, 3);
Beard = MakeRandomInt(0, 5);
}
if (Gender == 1) {
HairStyle = MakeRandomInt(0, 2);
}
break;
case 128: // Iksar
case 130: // VahShir
break;
case 330: // Froglok
LuclinFace = MakeRandomInt(0, 9);
case 522: // Drakkin
HairColor = MakeRandomInt(0, 3);
BeardColor = HairColor;
EyeColor1 = MakeRandomInt(0, 11);
EyeColor2 = MakeRandomInt(0, 11);
LuclinFace = MakeRandomInt(0, 6);
DrakkinHeritage = MakeRandomInt(0, 6);
DrakkinTattoo = MakeRandomInt(0, 7);
DrakkinDetails = MakeRandomInt(0, 7);
if (Gender == 0) {
Beard = MakeRandomInt(0, 12);
HairStyle = MakeRandomInt(0, 8);
}
if (Gender == 1) {
Beard = MakeRandomInt(0, 3);
HairStyle = MakeRandomInt(0, 7);
}
break;
default:
break;
}
target->SendIllusionPacket(Race, Gender, Texture, HelmTexture, HairColor, BeardColor,
EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF,
DrakkinHeritage, DrakkinTattoo, DrakkinDetails);
c->Message(0,"NPC Features Randomized");
}
if (target->RandomizeFeatures())
c->Message(0,"Features Randomized");
else
c->Message(0,"This command requires a Playable Race as the Target");
c->Message(0,"This command requires a Playable Race as the target");
}
}