NPC Armor tint, working perfectly in SoF and Titanium both.
Happy unbirthday, Trev. :P
Required SQL:
Code:
ALTER TABLE `peq`.`npc_types` ADD COLUMN `armortint_red` TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER `drakkin_details`,
ADD COLUMN `armortint_green` TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER `armortint_red`,
ADD COLUMN `armortint_blue` TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER `armortint_green`;
If red, green, and blue are all zero (the default), regular tint for any worn armor pieces (if any) is applied to the NPC.
If any of the values is nonzero, the tint is applied to all armor pieces on the NPC.
If you absolutely want to give your NPC totally black armor (making it basically impossible to see any detail), just give a blue value of 1 (out of 255). That'll be visually indistinguishable from total black.
Of course, I'm pretty certain tinting is only available on playable-race NPCs.
I was quite pleased to find that even "naked" NPCs have the tint applied to the cloth armor pieces!
Required code changes:
zonedump.h - Line 87
Code:
...
int32 drakkin_details;
+ int32 armor_tint;
// int8 aa_title; ////not loaded from DB
int32 min_dmg;
...
zonedb.cpp - Line 1180
Code:
...
"npc_types.drakkin_details,"
+ "npc_types.armortint_red,"
+ "npc_types.armortint_green,"
+ "npc_types.armortint_blue,"
"npc_types.see_invis,"
...
zonedb.cpp - Line 1268
Code:
...
tmpNPCType->drakkin_details = atoi(row[r++]);
+ tmpNPCType->armor_tint = (atoi(row[r++]) & 0xFF);
+ tmpNPCType->armor_tint |= (atoi(row[r++]) & 0xFF) << 8;
+ tmpNPCType->armor_tint |= (atoi(row[r++]) & 0xFF) << 16;
+ tmpNPCType->armor_tint |= (tmpNPCType->armor_tint) ? (0xFF << 24) : 0;
tmpNPCType->see_invis = atoi(row[r++])==0?false:true; // Mongrel: Set see_invis flag
...
mob.h - Line 371
Code:
...
int32 in_drakkin_details,
+ int32 in_armor_tint,
int8 in_aa_title,
...
mob.h - Line 1115
Code:
...
int32 drakkin_details;
+ int32 armor_tint;
int8 aa_title;
...
mob.cpp - Line 88
Code:
...
int32 in_drakkin_details,
+ int32 in_armor_tint,
int8 in_aa_title,
...
mob.cpp - Line 186
Code:
...
drakkin_details = in_drakkin_details;
+ armor_tint = in_armor_tint;
attack_speed= 0;
...
mob.cpp - Line 773
Code:
...
for(i = 0; i < MAX_MATERIALS; i++)
{
ns->spawn.equipment[i] = GetEquipmentMaterial(i);
+ if (armor_tint)
+ {
+ ns->spawn.colors[i].color = armor_tint;
+ }
+ else
+ {
ns->spawn.colors[i].color = GetEquipmentColor(i);
+ }
}
...
npc.cpp - Line 96
Code:
...
d->drakkin_details,
+ d->armor_tint,
0,
...
PlayerCorpse.cpp - Line 139
Code:
...
- 0,0,0,0,0,0,0,0,0,0,0xff,0,0,0,0,0,0,0),
+ 0,0,0,0,0,0,0,0,0,0,0,0xff,0,0,0,0,0,0,0),
...
PlayerCorpse.cpp - Line 225
Code:
...
client->GetPP().drakkin_details,
+ 0,
0xff, // aa title
...
PlayerCorpse.cpp - Line 342
Code:
...
- 0,0,0,0,0,0,0,0,0,0,0xff,
+ 0,0,0,0,0,0,0,0,0,0,0,0xff,
...
client.cpp - Line 130
Code:
...
0, // Drakkin Details
+ 0, // Armor Tint
0xff, // AA Title
...
beacon.cpp - Line 48
Code:
...
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
...