Spawner: Add initial specification
This commit is contained in:
		
							
								
								
									
										39
									
								
								spawner.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								spawner.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
-- Advanced NPC spawner by Zorman2000
 | 
			
		||||
-- The advanced spawner will contain functionality to spawn NPC correctly on
 | 
			
		||||
-- mg_villages building. The spawn node will be the mg_villages:plotmarker.
 | 
			
		||||
-- This node will be replaced with one that will perform the following functions:
 | 
			
		||||
-- 
 | 
			
		||||
--  - Scan the current building, check if it is of type:
 | 
			
		||||
--    - House
 | 
			
		||||
--    - Farm
 | 
			
		||||
--    - Hut
 | 
			
		||||
--    - NOTE: All other types are unsupported as-of now
 | 
			
		||||
--  - If it's from any of the above types, the spawner will proceed to scan the
 | 
			
		||||
--    the building and find out: 
 | 
			
		||||
--    - Number and positions of beds
 | 
			
		||||
--    - Number and positions of benches
 | 
			
		||||
--    - Number and positions of chests
 | 
			
		||||
--    - Position of furnaces
 | 
			
		||||
--    - Position of doors
 | 
			
		||||
--    - NOTE: Scanning will be implemented for first floors only in the first
 | 
			
		||||
--            version. It's expected to also include upper floors later.
 | 
			
		||||
--  - After that, it will store these information in the node's metadata.
 | 
			
		||||
--  - The spawner will analyze the information and will spawn (# of beds/2) or 1
 | 
			
		||||
--    NPC in that house. The NPCs will be spawned in intervals, for which the node
 | 
			
		||||
--    will create node timers for each NPC.
 | 
			
		||||
--  - When a NPC is spawned:
 | 
			
		||||
--    - The NPC will be given a schedule
 | 
			
		||||
--      - If in a farm, the NPC will have a "farmer schedule" with a 40% chance
 | 
			
		||||
--      - If in a house or hut, the NPC will have either a miner, woodcutter, cooker
 | 
			
		||||
--        or simple schedule with an equal chance each
 | 
			
		||||
--    - The NPC will be assigned a unique bed
 | 
			
		||||
--    - The NPC will know the location of one chest, one bench and one furnace
 | 
			
		||||
--    - A life timer for the NPC will be created (albeit a long one). Once the NPC's
 | 
			
		||||
--      timer is invoked, the NPC will be de-spawned (dies). The spawner should keep
 | 
			
		||||
--      track of these.
 | 
			
		||||
--  - If a NPC has died, the spawner will choose with 50% chance to spawn a new NPC.
 | 
			
		||||
--
 | 
			
		||||
-- This is the basic functionality expected for the spawner in version 1. Other things
 | 
			
		||||
-- such as scanning upper floors, spawning families of NPCs and creating relationships
 | 
			
		||||
-- among them, etc. will be for other versions.
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user