2017-03-17 17:20:03 -04:00
|
|
|
--[[
|
|
|
|
|
|
|
|
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)
|
2017-03-19 12:35:21 -04:00
|
|
|
player:SendDataPacket(2, nil, nil, textId);
|
2017-03-17 17:20:03 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
function openTutorialWidget(player, controllerType, widgetId)
|
|
|
|
--Default to keyboard if somethings fucky
|
2017-03-19 11:40:41 -04:00
|
|
|
if (controllerType ~= CONTROLLER_GAMEPAD) then
|
2017-03-17 17:20:03 -04:00
|
|
|
controllerType = CONTROLLER_KEYBOARD;
|
2017-03-19 11:40:41 -04:00
|
|
|
end
|
2017-03-19 12:35:21 -04:00
|
|
|
player:SendDataPacket(4, nil, nil, controllerType, widgetId);
|
2017-03-17 17:20:03 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
function closeTutorialWidget(player)
|
2017-03-19 12:35:21 -04:00
|
|
|
player:SendDataPacket(5);
|
2017-03-17 17:20:03 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
function startTutorialMode(player)
|
2017-03-19 12:35:21 -04:00
|
|
|
player:SendDataPacket(9);
|
2017-03-17 17:20:03 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
function endTutorialMode(player)
|
2017-03-19 12:35:21 -04:00
|
|
|
player:SendDataPacket(7);
|
2017-03-17 17:20:03 -04:00
|
|
|
end
|