2016-04-18 13:33:31 -04:00
|
|
|
require("/quests/man/man0l0")
|
|
|
|
|
|
|
|
function init(npc)
|
2016-06-15 04:41:15 +01:00
|
|
|
return "/Chara/Npc/Populace/PopulaceTutorial", false, false, false, false, false, npc:GetActorClassId(), false, false, 0, 1, "TEST";
|
2016-03-12 02:54:03 -05:00
|
|
|
end
|
|
|
|
|
2016-04-18 13:33:31 -04:00
|
|
|
function onSpawn(player, npc)
|
|
|
|
|
2016-06-15 03:41:23 +01:00
|
|
|
man0l0Quest = player:GetQuest("Man0l0");
|
2016-04-18 13:33:31 -04:00
|
|
|
|
|
|
|
if (man0l0Quest ~= nil) then
|
|
|
|
if (man0l0Quest:GetQuestFlag(MAN0L0_FLAG_MINITUT_DONE1) == false) then
|
2016-06-15 03:41:23 +01:00
|
|
|
npc:SetQuestGraphic(player, 0x2);
|
2016-04-18 13:33:31 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
if (man0l0Quest:GetQuestFlag(MAN0L0_FLAG_TUTORIAL3_DONE) == true) then
|
2016-06-15 03:41:23 +01:00
|
|
|
player:SetEventStatus(npc, "pushDefault", false, 0x2);
|
2016-04-18 13:33:31 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2016-04-01 23:32:52 -04:00
|
|
|
|
2016-04-18 13:33:31 -04:00
|
|
|
function onEventStarted(player, npc, triggerName)
|
2016-04-01 23:32:52 -04:00
|
|
|
|
2016-06-15 03:41:23 +01:00
|
|
|
man0l0Quest = player:GetQuest("Man0l0");
|
2016-04-18 13:33:31 -04:00
|
|
|
|
|
|
|
if (man0l0Quest ~= nil) then
|
2016-04-01 23:32:52 -04:00
|
|
|
|
2016-04-18 13:33:31 -04:00
|
|
|
if (triggerName == "pushDefault") then
|
2016-06-15 03:41:23 +01:00
|
|
|
player:RunEventFunction("delegateEvent", player, man0l0Quest, "processTtrNomal002", nil, nil, nil);
|
2016-04-18 13:33:31 -04:00
|
|
|
elseif (triggerName == "talkDefault") then
|
|
|
|
--Is doing talk tutorial?
|
|
|
|
if (man0l0Quest:GetQuestFlag(MAN0L0_FLAG_TUTORIAL3_DONE) == false) then
|
2016-06-15 03:41:23 +01:00
|
|
|
player:SetEventStatus(npc, "pushDefault", false, 0x2);
|
|
|
|
player:RunEventFunction("delegateEvent", player, man0l0Quest, "processTtrNomal003", nil, nil, nil);
|
2016-04-18 13:33:31 -04:00
|
|
|
man0l0Quest:SetQuestFlag(MAN0L0_FLAG_TUTORIAL3_DONE, true);
|
2016-06-15 03:41:23 +01:00
|
|
|
npc:SetQuestGraphic(player, 0x2);
|
2016-04-18 13:33:31 -04:00
|
|
|
man0l0Quest:SaveData();
|
|
|
|
|
2016-06-15 03:41:23 +01:00
|
|
|
player:GetDirector():OnTalked(npc);
|
2016-04-18 13:33:31 -04:00
|
|
|
--Was he talked to for the mini tutorial?
|
|
|
|
else
|
2016-06-15 03:41:23 +01:00
|
|
|
player:RunEventFunction("delegateEvent", player, man0l0Quest, "processTtrMini001", nil, nil, nil);
|
2016-04-18 13:33:31 -04:00
|
|
|
|
|
|
|
if (man0l0Quest:GetQuestFlag(MAN0L0_FLAG_MINITUT_DONE1) == false) then
|
2016-06-15 03:41:23 +01:00
|
|
|
npc:SetQuestGraphic(player, 0x0);
|
2016-04-18 13:33:31 -04:00
|
|
|
man0l0Quest:SetQuestFlag(MAN0L0_FLAG_MINITUT_DONE1, true);
|
|
|
|
man0l0Quest:SaveData();
|
|
|
|
|
2016-06-15 03:41:23 +01:00
|
|
|
player:GetDirector():OnTalked(npc);
|
2016-04-18 13:33:31 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
2016-06-15 03:41:23 +01:00
|
|
|
player:EndEvent();
|
2016-04-18 13:33:31 -04:00
|
|
|
end
|
|
|
|
else
|
2016-06-15 03:41:23 +01:00
|
|
|
player:EndEvent(); --Should not be here w.o this quest
|
2016-04-18 13:33:31 -04:00
|
|
|
end
|
2016-03-12 02:54:03 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
function onEventUpdate(player, npc)
|
2016-06-15 03:41:23 +01:00
|
|
|
player:EndEvent();
|
2016-03-12 02:54:03 -05:00
|
|
|
end
|