Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-05-2009, 02:45 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default New Rule: Flagging Hostile NPCs

Some server admins might like this idea and some might not, but I figured it was worth putting out there as an option.

When exploring areas with multiple factions, some of which may be hostile, it can be stressful to need to manually con each and every NPC you come across to see whether it's on a hostile faction or not.

I have created a rule that, when activated, changes the title of any hostile NPC to "(Hostile)" when sending NPC spawns to the client, causing it to appear beneath the name of the NPC.

I would have preferred to be able to make the name a different color, but it looks like this will have to do.



Required SQL:
Code:
INSERT INTO rule_values VALUES (1, 'World:FlagHostileNPCs', 'true', 'If true, hostile NPCs show (Hostile) beneath their name');
File - ruletypes.h (Line 105)
Code:
...
  RULE_INT ( World, SoFStartZoneID, -1 ) //Sets the Starting Zone for SoF Clients separate from Titanium Clients (-1 is disabled)
+ RULE_BOOL ( World, FlagHostileNPCs, false) // Shendare: If true, displays (Hostile) under names of hostile NPCs
RULE_CATEGORY_END()
...
File - mob.cpp (Line 813) - Mob::FillSpawnStruct()
Code:
...
    memset(ns->spawn.set_to_0xFF, 0xFF, sizeof(ns->spawn.set_to_0xFF));

+   switch ((ForWho && RuleB(World, FlagHostileNPCs)) ? ForWho->GetReverseFactionCon(this) : 0)
+   {
+     case FACTION_THREATENLY:
+     case FACTION_SCOWLS:
+       memcpy_s(ns->spawn.lastName, sizeof(ns->spawn.lastName), "Hostile", 8);
+       break;
+   }
  }
...
Reply With Quote
 


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 06:19 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