KAs (Knowledge Areas) list and structure
Knowledge Area Types
Dialogues can either be build from:
- KAs defined in npc_triggers table. This one has full capabilities including up to 5 different responses, prerequisites, and audio files
OR
- in KA Scripts defined in quest_scripts table with quest == -1 . This one is a single answer
KA Structure and guidelines
Here is the overall sequence of how KAs should be defined in NPC , with higher priority at the top, and lower at the bottom. KAs are read starting from top and if an answer is not found, we search for the answer one level down.

General:
- general: used when everything else fails
- present in npc_triggers for the super common answers that require no knowledge.
- present in KA Script quest_scripts table ID 1125 for the general knowledge with one single answer. This should be knowledge that everyone knows, no matter his experience, social status, race, hometown, ... Usually those will be pretty dumb answers.
Areas:
- "<area>_basic" (example hydlaa_basic) containing:
- locations and POI (example temple, winch, fountain, ...)
- typical services: tavern, blacksmith, temple, merchants, ...
- <area>_important_people: all major NPC of the area with their approximate location
- (lower priority but nice to have) greetings/goodbye not really requires as anyway every NPC has its own specific one
- (are we specilizing cities by god? Is hydlaa really so polarized?) <area>_gods
NPC Specific
- npc_trigger or KA Script as needed, based on the type of answer required.
Existing KAs
random: There is a special KA on 20+ NPCs called "random", this seems to be used when NPC are thinking aloud and just randomly saying something. I don't remember how this is triggered.
Hydlaa:
|
Ojaveda:
|
OjaRoad:
|
Arena:
|
Gugrontid:
|
Amdeneir:
|
Eagle Bronze Doors:
|
Death Realm
|
Gods: | Races: | Magic: |
---|---|---|
|
|
|
- newbie (used by tutorial NPCs and few others, most answers are OOC)
- winch_info (seems to be used by some merchants, not very consistently)
- greeting_evil (used by Dark Wanderer and Nodramok)
- merchant (used by Lerok Dilechi, Jashoky Dakarn) SHOULD BE REMOVED
- lyeorire_fisk (is assigned to Archilaya Gurpleferd, seems to contain duplicates)
Proximity Guards:
- Proximity_Guard_Checks_Oja
- Proximity_Guard_Checks_Hydlaa
- Proximity_Guard_Checks_Gug
Pet KAs:
- Pet Groffel 1
- Pet Yulbar 1
- Pet Rivnak 1
- Pet Drifter 1
- Pet Serpent Gobble 1
- Pet Eagle Gobble 1
NPC name typos or specific NPC group:
- ash_brotherhood
- Vuudjehn Korthel (its actually linked correctly on the NPC) -> Vuddjehn Korthel
- Heedel Remains (its actually linked correctly on the NPC) -> Heedel's Remains
- Skull (its actually linked correctly on the NPC) -> Mr Skull
- Bread (its actually linked correctly on the NPC) -> Mr Bread
Tests:
- AndrewTestNPC
- AndrewTestNPC2
Useful queries
Find all the knowledge areas in the database not specific to NPCs, so the generic ones applicable to multiple NPCs:
select distinct(nka.area) from npc_knowledge_areas nka left join `characters` c on nka.area=CONCAT(c.name, " ",c.lastname) where c.name is null;
Find all KA defined in triggers that are not associated to any NPC (maybe we were working on those?):
select distinct(tr.area) from npc_triggers tr left join npc_knowledge_areas ka on tr.area=ka.area where ka.area is null;
Find all triggers without a response:
select * from npc_triggers tr left join npc_responses nr on tr.id = nr.trigger_id where nr.id is null;
Extract triggers and responses of one area:
select * from npc_triggers tr, npc_responses re where tr.id=re.trigger_id and tr.area ='hydlaa_townsperson'
Find all NPCs without master npc missing the general KA:
select id, name, lastname, npc_master_id from characters c1 where character_type =1 and id not in
(select id from characters c, npc_knowledge_areas nka where nka.player_id =c.id and nka.area='general' and c.character_type =1)
and (racegender_id<24 or racegender_id=40 or racegender_id=60 or racegender_id=35 or racegender_id=50 or racegender_id=70)
and npc_master_id=id;
Find all NPCs with base position in hydlaa area missing the hydlaa_basic KA
select id, name, lastname, npc_master_id from characters c1 where character_type =1 and id not in
(select id from characters c, npc_knowledge_areas nka where nka.player_id =c.id and nka.area='hydlaa_basic' and c.character_type =1)
and (racegender_id<23 or racegender_id=35 or racegender_id=50 or racegender_id=70)
and (loc_sector_id in (4,5,7,8,9,10,12,13,14,15,54,55,56,72,74) or (loc_sector_id>26 and loc_sector_id<53));