Thread: Using Grail
View Single Post
06-02-16, 07:58 PM   #10
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
Originally Posted by Oniya View Post
So, at the end Npc Id's will stay or? Not sure what exactly the goal. Will be great if there will be explicitly npc ID's for more easy mapping and making connections \ search. And also will be great if there will be some flag saying is it npc actually or item \ object (or maybe there is already one?)
What will be going away initially if it pasts testing is the use of the NPC Name ID from most entries (all except for objects). Basically Grail was trying to be sneaky in maintaining only a set of unique NPC names, and mapping from the NPC to the name used. This would have one name entry for Thrall, and tons of NPC entries that pointed to it. However, the npcId still will remain.

The "npcId" that Grail uses mostly maps to the NPC IDs Blizzard uses. So, 102700 really maps to Meryl Felstorm. However, Grail will still have alias NPC IDs for a while. This is because an NPC can appear in more than one place (usually after an event has happened), yet Blizzard still uses the same NPC ID. In this case, Grail uses alias NPC IDs where there is an A: code associated with that NPC that indicates the real NPC ID Blizzard uses. This is done because Grail wants to be accurate as to where an NPC is at any time. There are other plans to have smart NPC locations that have their own prerequisites. Usually alias NPC IDs are just the NPC ID + 500,000.

Object npcIds are the normal OBJECT IDs + 1,000,000 so 1000033 is really OBJECT 33 - Locked Chest.

Item npcIds are the normal ITEM IDs + 100,000,000 so 100001307 is really ITEM 1307 - Gold Pickup Schedule.

Assuming testing goes well there will be a version of Grail with some convenience routines to get the name of an "NPC": NPCName(npcId), ItemName(itemId), and ObjectName(objectId). You can use the Blizzard values in each of them, or the Grail values in the NPCName one. These should return all NPC and Item names, and only the Object names that Grail knows (as they cannot be gotten from the runtime in an arbitrary fashion).
  Reply With Quote