NPC ID DB Format vs NPC ID Lua Format
NPC ID DB Format vs NPC ID Lua Format
I'm trying to troubleshoot some items in Ru'Aun Gardens as none of the Blue teleport NPC's are working. Is there any way to map the NPC_List in the DB to the NPC ID requirements in the lua? It appears all the teleports are off along with the blue/yellow doors. I'd like to author a change, but can't due to whatever obfuscation is going on.
Thanks
Thanks
Re: NPC ID DB Format vs NPC ID Lua Format
mob and npc IDs tend to follow this format: lowest order 3 bytes are their "short id", next 3 bytes is the zoneid, and the highest 2 is usually just 1
for example, rune of release in lebros cavern is 215. to translate that, lebros cavern is zoneid 63, so convert both those to hex (so 0xD7 for the npc id, 0x3F for lebros cavern). then they're 3 bytes each, so 0D7 and 03F, and crunch them together to get 0x03F0D7. then, put that 1 on the front to get 0x103F0D7. then convert that back to decimal and we get 17035479, which is the long ID for rune of release in lebros cavern
npc_list USED to have the long id, and that one got changed to short ID and nothing else did. in my opinion, they should all be short ID, but meh.. effort~
for example, rune of release in lebros cavern is 215. to translate that, lebros cavern is zoneid 63, so convert both those to hex (so 0xD7 for the npc id, 0x3F for lebros cavern). then they're 3 bytes each, so 0D7 and 03F, and crunch them together to get 0x03F0D7. then, put that 1 on the front to get 0x103F0D7. then convert that back to decimal and we get 17035479, which is the long ID for rune of release in lebros cavern
npc_list USED to have the long id, and that one got changed to short ID and nothing else did. in my opinion, they should all be short ID, but meh.. effort~
Re: NPC ID DB Format vs NPC ID Lua Format
Thanks for the information. I've been tearing out my hair trying to fix the sky blue teleports on my test server. Is there any way to look up the specific portal ID's as well? Neither zone.lua or pincerstone.lua is well commented.kjLotus wrote:mob and npc IDs tend to follow this format: lowest order 3 bytes are their "short id", next 3 bytes is the zoneid, and the highest 2 is usually just 1
for example, rune of release in lebros cavern is 215. to translate that, lebros cavern is zoneid 63, so convert both those to hex (so 0xD7 for the npc id, 0x3F for lebros cavern). then they're 3 bytes each, so 0D7 and 03F, and crunch them together to get 0x03F0D7. then, put that 1 on the front to get 0x103F0D7. then convert that back to decimal and we get 17035479, which is the long ID for rune of release in lebros cavern
npc_list USED to have the long id, and that one got changed to short ID and nothing else did. in my opinion, they should all be short ID, but meh.. effort~
Re: NPC ID DB Format vs NPC ID Lua Format
use POLUtils to get the entity list for a zone
Re: NPC ID DB Format vs NPC ID Lua Format
So, I've found the issue. Jut one last question, is there any way I can get the specific event ID's mapped? e.g. in zone.lua for the area, the portals call on stepping in the region player:startEvent(0x000A);etc.
Is there a listing of those for each zone?
Is there a listing of those for each zone?
Re: NPC ID DB Format vs NPC ID Lua Format
https://wiki.dspt.info/index.php/Event_IDs MIGHT have them (it checks them all based by which NPCs are referenced in each cutscene, but not every cutscene references any NPCs)
if it's not in there, you just have to guess or capture it from a retail server
if it's not in there, you just have to guess or capture it from a retail server
Re: NPC ID DB Format vs NPC ID Lua Format
kjLotus wrote:https://wiki.dspt.info/index.php/Event_IDs MIGHT have them (it checks them all based by which NPCs are referenced in each cutscene, but not every cutscene references any NPCs)
if it's not in there, you just have to guess or capture it from a retail server
Time to guess then. I've already found the first one. Not referenced at all in event_ID's.
Is it going to be worthwhile to comment the code for everyone? Is it common practice?
Re: NPC ID DB Format vs NPC ID Lua Format
i dunno, i usually don't really comment anything unless it's really out there (pretty easy to see what's going on just by reading it, especially with scripts)
Re: NPC ID DB Format vs NPC ID Lua Format
I've updated and posted the commits to github. Added in some comments to make it easier to debug in the future.kjLotus wrote:i dunno, i usually don't really comment anything unless it's really out there (pretty easy to see what's going on just by reading it, especially with scripts)
Thanks for the help.
Re: NPC ID DB Format vs NPC ID Lua Format
Since this is a related question, figured i'd ask here.
how does the npc look work?
For example i'm trying to add an npc who's id I found and easily converted to shortid, but i'm having a lil bit of a hard time trying to figure out how to make her look like shes supposed to,
what is the breakdown of this?
0x0000D20800000000000000000000000000000000
how does the npc look work?
For example i'm trying to add an npc who's id I found and easily converted to shortid, but i'm having a lil bit of a hard time trying to figure out how to make her look like shes supposed to,
what is the breakdown of this?
0x0000D20800000000000000000000000000000000