Started mass overhaul of quests and related components like small talk. Fixed some scripts. More fixes required.

This commit is contained in:
Filip Maj 2022-01-24 23:49:10 -05:00
parent df49eefadb
commit 2279ee7017
33 changed files with 1241 additions and 279 deletions

View file

@ -8,7 +8,7 @@ Fired when you try to abandon a quest
--]]
function onEventStarted(player, command, triggerName, questId)
function onEventStarted(player, command, eventType, eventName, questId)
player:AbandonQuest(questId);
player:EndEvent();

View file

@ -32,6 +32,7 @@ local npcLsHandlers = {
}
function onEventStarted(player, command, triggerName, npcLsId)
player:OnNpcLS(npcLsId);
if (npcLsHandlers[npcLsId] ~= nil) then
npcLsHandlers[npcLsId](player);

View file

@ -1,23 +1,30 @@
--[[
RequestQuestJournalCommand Script
Functions: None
Notes:
Fires when the player looks at a quest's journal entry and the map section. Check the quest sheet and quest_marker sheet
for valid entries for your quest.
--]]
function onEventStarted(player, actor, trigger, questId, mapCode)
quest = player:GetQuest(questId);
function onEventStarted(player, command, eventType, eventName, questId, mapCode)
local quest = player:GetQuest(questId);
if (quest == nil) then
player:EndEvent();
return;
end
if (mapCode == nil) then
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetPhase());
player:EndEvent();
else
player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId());
player:EndEvent();
if (quest ~= nil) then
if (mapCode == nil) then
-- Get Quest Journal Data
local journalInfo = quest:GetJournalInformation();
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetSequence(), unpack(journalInfo));
else
-- Get Quest Map Data
local mapMarkers = quest:GetJournalMapMarkerList();
player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId(), unpack(mapMarkers));
end
end
player:EndEvent();
end

View file

@ -52,7 +52,7 @@ teleportMenuToAetheryte = {
}
}
function onEventStarted(player, actor, triggerName, isTeleport)
function onEventStarted(player, actor, eventType, eventName, isTeleport)
local worldMaster = GetWorldMaster();

View file

@ -0,0 +1,21 @@
require("global");
properties = {
permissions = 0,
parameters = "s",
description = "Adds a quest by <id>.",
}
function onTrigger(player, argc, glId)
if player then
local glIdAsNumber = tonumber(glId);
if (glIdAsNumber == nil) then
player:AddQuest(glId);
else
player:AddQuest(glIdAsNumber);
end
else
print(sender.."unable to add guildleve, ensure player name is valid.");
end;
end;

View file

@ -0,0 +1,29 @@
require("global");
properties = {
permissions = 0,
parameters = "ssss",
description =
[[
Gets the info about the current target
]],
}
function onTrigger(player)
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[Info] ";
local targetActor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
if not targetActor then
player:SendMessage(messageID, sender, "No target selected");
return
end
player:SendMessage(messageID, sender, string.format("Position (XYZ-O): %.3f, %.3f, %.3f - %.3f", targetActor.positionX, targetActor.positionY, targetActor.positionZ, targetActor.rotation));
player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.actorId));
player:SendMessage(messageID, sender, string.format("Class ID: %d", targetActor:GetActorClassId()));
player:SendMessage(messageID, sender, string.format("Class Name: %s", targetActor.className));
end