Thread: Guards
View Single Post
  #15  
Old 11-23-2004, 07:49 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

ok, heres the quick rundown of how this should work, since nobody here has it right yet... NPC aggro is completely seperate from player faction hits now.

step 1:
the npc_aggro field MUST be set to 1 for any NPC which might possibly aggro another NPC (but setting all NPCs to 1 will cause major CPU problems for you...)

step 2:
let us assume we have two npcs... A and B
A has an npc_faction_id of 1, B has an npc_faction_id of 2
npc_faction #1 has primary faction #7
npc_faction #2 has primnary faction #93
of note: npc_faction ids are not related to primary faction ids... primary faction ids are referencing entries in the faction_list table.

in order to make A attack B on sight, npc_faction_entires must have this entry in it:
| npc_faction_id | faction_id | value | npc_value |
+-------------+------------+-------+-----------+
| 1 | 93 | ?? | -1 |
+-------------+------------+-------+-----------+
where the value of ?? is unrelated to NPC aggro (it is the player hit with faction 2 from killing A)

likewise if you wanted B to also attack A, you would add:
| npc_faction_id | faction_id | value | npc_value |
+-------------+------------+-------+-----------+
| 2 | 93 | ?? | -1 |
+-------------+------------+-------+-----------+

the npc_value is the important thing, A needs an entry for each other faction which they will KOS and that entry should have a negative npc_value


also assist works in the same way... if you want npc C to assist B, where C is on npc_faction 3 (with primary faction 87), you need an entry like (note the positive value of npc_value):
| npc_faction_id | faction_id | value | npc_value |
+-------------+------------+-------+-----------+
| 3 | 93 | ?? | 1 |
+-------------+------------+-------+-----------+
Reply With Quote