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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-09-2008, 11:56 AM
LordKahel
Fire Beetle
 
Join Date: Sep 2007
Posts: 22
Default Adding a ATK field to npc_types

This is a simple fix to add a ATK field in the db and populate the atk value of a npc . There is a value ATK in npc but presently it always 0 (you see it with the #showstats command) and this value is used in the IntervalAC calculation for damage mitigation .


Here the required SQL for the db
Code:
ALTER TABLE npc_types ADD COLUMN `ATK` mediumint(8) unsigned NOT NULL default '0';

And then in the zonedb.cpp file . In the ZoneDatabase::GetNPCType (uint32 id) function.

change the code

Code:
			"npc_types.see_invis_undead,"
            "npc_types.lastname,"
			"npc_types.qglobal,"
			"npc_types.AC,"
            "npc_types.npc_aggro,"
			"npc_types.spawn_limit,"
			"npc_types.see_hide,"
			"npc_types.see_improved_hide";
      if (id == 0)
         MakeAnyLenString(&query,
            "%s FROM npc_types,spawn2 WHERE spawn2.zone='%s'"
            " AND npc_types.id=spawn2.id",
            basic_query, zone->GetShortName());
TO

Code:
			"npc_types.see_invis_undead,"
            "npc_types.lastname,"
			"npc_types.qglobal,"
			"npc_types.AC,"
            "npc_types.npc_aggro,"
			"npc_types.spawn_limit,"
			"npc_types.see_hide,"
			"npc_types.see_improved_hide,"
			"npc_types.ATK";
      if (id == 0)
         MakeAnyLenString(&query,
            "%s FROM npc_types,spawn2 WHERE spawn2.zone='%s'"
            " AND npc_types.id=spawn2.id",
            basic_query, zone->GetShortName());


And add the bold line in the following code:
Code:
				tmpNPCType->qglobal = atoi(row[r++])==0?false:true;	// qglobal
				tmpNPCType->AC = atoi(row[r++]);
				tmpNPCType->npc_aggro = atoi(row[r++])==0?false:true;
				tmpNPCType->spawn_limit = atoi(row[r++]);
				tmpNPCType->see_hide = atoi(row[r++])==0?false:true;
				tmpNPCType->see_improved_hide = atoi(row[r++])==0?false:true;
				tmpNPCType->ATK = atoi(row[r++]);

This will give you the possiblity of adding a atk value to npc and give them more chance of passing thru player mitigation.

--
Pyronis / Kahel
Dev Jest 3 Server
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 05:35 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