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

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2009, 11:28 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Cool NPC Armor Tint

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
...

Last edited by trevius; 05-16-2009 at 12:48 PM.. Reason: minor correction
Reply With Quote
  #2  
Old 05-15-2009, 11:35 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

Nice work! Thanks!
Reply With Quote
  #3  
Old 05-15-2009, 11:51 PM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Oh my god... That is so amazing to see. You and Trevius have really been knocking out some work in this area lately, but you especially have come out of nowhere with some amazing contributions! Great job!

(Excuse my exuberance, my alcohol tolerance is pretty low and it's a Friday night!)
Reply With Quote
  #4  
Old 05-15-2009, 11:56 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

A+ for the prety colors


-seriosly - can we TRY to Tint the non player models?
Reply With Quote
  #5  
Old 05-16-2009, 12:06 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

My presumption is that the tint will be visible on any NPC that can visibly wear a piece of armor added to its loot table.

Most likely this limits the feature to playable-race NPCs, but it's certainly possible SOE coded exceptions.
Reply With Quote
  #6  
Old 05-16-2009, 02:42 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

WOW! Seriously, Shendare, where did you come from? I know you are registered from a long time ago, but you really know your way around the emu code

That is some great stuff! Maybe tonight, I can get some work done on the illusion function to add in support for all facial features as well as armor tint. Once that is working, I should be able to get the #fixmob command changed to work for adjusting nearly any feature we could want on-the-fly. After that, the only other thing I would really like to get added at some point would be quest commands that could use the illusion function fully. I always thought it would be cool to have an NPC that had color changing armor that changed color once a second on a timer. You could simply have it add 10 to whatever color field every second and it would cycle through colors. Though, I think illusion makes the NPC kinda jump, so it might not be as cool as I imagine.

Thanks a ton for this Shendare! I will get it tested and put it on the SVN ASAP.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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 07:20 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