Pavinski
Member
- Joined
- May 28, 2020
- Messages
- 30
- Reaction score
- 5
Hello,
I just started working with OTS and have a few questions regarding NPC's. I am using OTServBR-global, but my questions are more general.
Thank you in advance for the help!
I just started working with OTS and have a few questions regarding NPC's. I am using OTServBR-global, but my questions are more general.
- I see each NPC has a xml file with the NPC details and a lua file with its behavior. I also see there is a file that maps NPC name to a number (data/lib/tables/npc_spawn_list.lua) and a file that spawn the NPC's in a loop (data/globalevents/scripts/spawn/npcs_spawn.lua). However I am having trouble finding where the link from the NPC spawned to the NPC xml/lua files is. Can someone help me understand this?
- If I want multiple NPC's of the same "type" would I just add more NPC's to the npc_spawn_list.lua and give it the same name? Like for example if i want 2 Rashids in different positions would I just do someting like this:
- [671] = {name = "rashid", pos = {x=31887,y=33101,z=7}},
- [672] = {name = "rashid", pos = {x=35000,y=33000,z=7}},
- Can someone explain to me how NPC's like Yasir and Rashid change locations? I see in the code that they are created depending on the day of the week, but how does the game avoid duplicates? I did not see any "de-spawn" code, but I may have missed something. My first thought was it was done with the master position, but I could not back up that statement
- Any additional information on NPC's is also welcomed
Thank you in advance for the help!