mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Added tutorial helper script.
This commit is contained in:
		
							
								
								
									
										54
									
								
								data/scripts/tutorial.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								data/scripts/tutorial.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
			
		||||
--[[
 | 
			
		||||
 | 
			
		||||
Tutorial constants and functions
 | 
			
		||||
 | 
			
		||||
--]]
 | 
			
		||||
 | 
			
		||||
--Controller Types
 | 
			
		||||
CONTROLLER_KEYBOARD = 1;
 | 
			
		||||
CONTROLLER_GAMEPAD = 2;
 | 
			
		||||
 | 
			
		||||
--Tutorial Widget Ids
 | 
			
		||||
 | 
			
		||||
TUTORIAL_CAMERA = 1;
 | 
			
		||||
TUTORIAL_MOVING = 2;
 | 
			
		||||
TUTORIAL_TARGETING_FRIENDLY = 3;
 | 
			
		||||
TUTORIAL_TALKING = 4;
 | 
			
		||||
TUTORIAL_MAINMENU = 5;
 | 
			
		||||
TUTORIAL_ACTIVEMODE = 6;
 | 
			
		||||
TUTORIAL_TARGETING_ENEMY = 7;
 | 
			
		||||
TUTORIAL_ENGAGECOMBAT = 8;
 | 
			
		||||
TUTORIAL_BATTLEACTIONS = 9;
 | 
			
		||||
TUTORIAL_CASTING = 10;
 | 
			
		||||
TUTORIAL_ACTIONS = 11;
 | 
			
		||||
TUTORIAL_TP = 12;
 | 
			
		||||
TUTORIAL_WEAPONSKILLS = 13;
 | 
			
		||||
TUTORIAL_NPCS = 14;
 | 
			
		||||
TUTORIAL_NPCLS  = 15;
 | 
			
		||||
TUTORIAL_JOURNAL = 16;
 | 
			
		||||
TUTORIAL_DEFEATENEMY = 18;
 | 
			
		||||
 | 
			
		||||
--Helper functions
 | 
			
		||||
 | 
			
		||||
function showTutorialSuccessWidget(player, textId)
 | 
			
		||||
	player:SendRequestedInfo(2, nil, nil, textId);
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function openTutorialWidget(player, controllerType, widgetId)
 | 
			
		||||
	--Default to keyboard if somethings fucky
 | 
			
		||||
	if (controllerType ~= CONTROLLER_GAMEPAD)
 | 
			
		||||
		controllerType = CONTROLLER_KEYBOARD;
 | 
			
		||||
	player:SendRequestedInfo(4, nil, nil, controllerType, widgetId);
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function closeTutorialWidget(player)
 | 
			
		||||
	player:SendRequestedInfo(5);
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function startTutorialMode(player)
 | 
			
		||||
	player:SendRequestedInfo(9);
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function endTutorialMode(player)
 | 
			
		||||
	player:SendRequestedInfo(7);
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user