mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Quests + Minor fixes
MarketEntrance - Adjusted events parameter so it works again Warp - Added shortcut for switching between a given town's zones so I can stop having to look up the right zone id Weather - Added shortcut for weather ids to +8000 to the value if the're within a certain range. DftSea - Inn NPC check etc5u0 - Used a constant in place of a value, updated a constant's name. etc5l0 - Fully scripted. etc5u1 - Mostly scripted. Requires Dream handling and privArea + NPC placement. etc5g1 - Mostly scripted. Requires Dream handling and privArea + NPC placement.
This commit is contained in:
parent
e94c037fb5
commit
b34f214e67
@ -84,7 +84,7 @@ city = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function onEventStarted(player, npc, triggerName)
|
function onEventStarted(player, npc, eventType, eventName)
|
||||||
|
|
||||||
local npcCity = city[npc:GetActorClassId()] or 1;
|
local npcCity = city[npc:GetActorClassId()] or 1;
|
||||||
local wardPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese
|
local wardPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese
|
||||||
@ -98,7 +98,7 @@ function onEventStarted(player, npc, triggerName)
|
|||||||
|
|
||||||
local worldMaster = GetWorldMaster();
|
local worldMaster = GetWorldMaster();
|
||||||
local pos = player:GetPos();
|
local pos = player:GetPos();
|
||||||
local currZone = pos[4];
|
local currZone = pos[5];
|
||||||
|
|
||||||
if (currZone == 133 or currZone == 230 or currZone == 155 or currZone == 206 or currZone == 175 or currZone == 209) then
|
if (currZone == 133 or currZone == 230 or currZone == 155 or currZone == 206 or currZone == 175 or currZone == 209) then
|
||||||
exitPlaceName = 0; -- If in city, hide city menu option
|
exitPlaceName = 0; -- If in city, hide city menu option
|
||||||
|
@ -62,6 +62,27 @@ function onTrigger(player, argc, p1, p2, p3, p4, privateArea, privateAreaType, n
|
|||||||
worldManager:DoZoneChange(player, zone, privateArea, tonumber(privateAreaType), 0x02, x, y, z, 0.00);
|
worldManager:DoZoneChange(player, zone, privateArea, tonumber(privateAreaType), 0x02, x, y, z, 0.00);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
elseif (argc == 1) then -- Switch city zone
|
||||||
|
|
||||||
|
local commands = { ["SWITCH"] = 1, ["S"] = 1, ["FLIP"] = 1, ["F"] = 1, ["TOWN"] = 1};
|
||||||
|
|
||||||
|
if (commands[string.upper(p1)]) then
|
||||||
|
local zones = {
|
||||||
|
[133] = {133, 230},
|
||||||
|
[155] = {155, 206},
|
||||||
|
[175] = {175, 209},
|
||||||
|
[206] = {206, 155},
|
||||||
|
[209] = {209, 175},
|
||||||
|
[230] = {230, 133}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player_zone == zones[player_zone][1]) then
|
||||||
|
worldManager:DoZoneChange(player, zones[player_zone][2], "", 0, 0x02, player_x, player_y, player_z, player_rot);
|
||||||
|
player:SendMessage(messageID, sender, string.format("setting coordinates X:%d Y:%d Z:%d to new zone (%d) private area:%s", player_x, player_y, player_z, zones[player_zone][2], privateArea or "unspecified"));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
player:SendMessage(messageID, sender, "Unknown parameters! Usage: "..properties.description);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
player:SendMessage(messageID, sender, "Unknown parameters! Usage: "..properties.description);
|
player:SendMessage(messageID, sender, "Unknown parameters! Usage: "..properties.description);
|
||||||
end;
|
end;
|
||||||
|
@ -21,6 +21,12 @@ function onTrigger(player, argc, weather, updateTime, zonewide)
|
|||||||
weather = tonumber(weather) or 0;
|
weather = tonumber(weather) or 0;
|
||||||
updateTime = tonumber(updateTime) or 0;
|
updateTime = tonumber(updateTime) or 0;
|
||||||
zonewide = tonumber(zonewide) or 0;
|
zonewide = tonumber(zonewide) or 0;
|
||||||
|
|
||||||
|
if (weather > 0 and weather < 82) then
|
||||||
|
weather = weather + 8000;
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
message = string.format("changed weather to %u ", weather);
|
message = string.format("changed weather to %u ", weather);
|
||||||
|
|
||||||
if zonewide ~= 0 then
|
if zonewide ~= 0 then
|
||||||
|
@ -59,7 +59,7 @@ local defaultTalkSea = {
|
|||||||
[1000164] = "defaultTalkWithFaucillien_001", -- Faucillien (Limsa Upper Decks: FSH Guild) - Will not fire, not PplStd
|
[1000164] = "defaultTalkWithFaucillien_001", -- Faucillien (Limsa Upper Decks: FSH Guild) - Will not fire, not PplStd
|
||||||
[1000165] = "defaultTalkWithLouviaune_001", -- Louviaune (Limsa Upper Decks: FSH Guild) - Will not fire, not PplStd
|
[1000165] = "defaultTalkWithLouviaune_001", -- Louviaune (Limsa Upper Decks: FSH Guild) - Will not fire, not PplStd
|
||||||
[1000166] = "defaultTalkWithUrsulie_001", -- Ursulie (Limsa Upper Decks: Adv. Guild) - Will not fire, not PplStd. Retainer NPC
|
[1000166] = "defaultTalkWithUrsulie_001", -- Ursulie (Limsa Upper Decks: Adv. Guild) - Will not fire, not PplStd. Retainer NPC
|
||||||
[1000167] = "defaultTalkWithInn_Desk", -- Mytesyn (Limsa Upper Decks: Adv. Guild) defaultTalkWithMytesyn_001 (Pre-Inn dialog.)
|
[1000167] = "defaultTalkWithMytesyn_001", -- Mytesyn (Limsa Upper Decks: Adv. Guild) defaultTalkWithInn_Desk - used when Inn unlocked
|
||||||
[1000168] = "defaultTalkWithPrudentia_001", -- Prudentia (Limsa Upper Decks: CUL Guild)
|
[1000168] = "defaultTalkWithPrudentia_001", -- Prudentia (Limsa Upper Decks: CUL Guild)
|
||||||
[1000169] = "defaultTalkWithPulmia_001", -- Pulmia (Limsa Upper Decks: CUL Guild)
|
[1000169] = "defaultTalkWithPulmia_001", -- Pulmia (Limsa Upper Decks: CUL Guild)
|
||||||
[1000170] = "defaultTalkWithRsushmo_001", -- R'sushmo (Limsa Upper Decks: CUL Guild)
|
[1000170] = "defaultTalkWithRsushmo_001", -- R'sushmo (Limsa Upper Decks: CUL Guild)
|
||||||
@ -260,7 +260,11 @@ function onTalk(player, quest, npc, eventName)
|
|||||||
local clientFunc = defaultTalkSea[npcId];
|
local clientFunc = defaultTalkSea[npcId];
|
||||||
|
|
||||||
if (npcId == 1000167) then -- Mytesyn - Inn NPC
|
if (npcId == 1000167) then -- Mytesyn - Inn NPC
|
||||||
defaultTalkWithInn(player, quest, clientFunc);
|
if (player:IsQuestCompleted(110838)) then -- "The Ink Thief" completed.
|
||||||
|
defaultTalkWithInn(player, quest, "defaultTalkWithInn_Desk");
|
||||||
|
else
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
|
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
|
||||||
end
|
end
|
||||||
|
182
Data/scripts/quests/etc/etc5g1.lua
Normal file
182
Data/scripts/quests/etc/etc5g1.lua
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
require("global");
|
||||||
|
|
||||||
|
--[[
|
||||||
|
|
||||||
|
Quest Script
|
||||||
|
|
||||||
|
Name: In Plain Sight
|
||||||
|
Code: Etc5g1
|
||||||
|
Id: 110829
|
||||||
|
Prereq: Level 15. Etc5u1 (The Usual Suspect) completed.
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
]]
|
||||||
|
|
||||||
|
-- Sequence Numbers
|
||||||
|
SEQ_000 = 0;
|
||||||
|
SEQ_010 = 10;
|
||||||
|
|
||||||
|
-- Actor Class Ids
|
||||||
|
OTOPA_POTTOPA = 1000864;
|
||||||
|
VKOROLON = 1000458;
|
||||||
|
NICOLIAUX = 1000409;
|
||||||
|
POWLE = 1000238;
|
||||||
|
AUNILLIE = 1000410;
|
||||||
|
GAUWYN_THE_GANNET = 1002065;
|
||||||
|
HILDIBRAND = 1002067;
|
||||||
|
NASHU_MHAKARACCA = 1001996;
|
||||||
|
PRIVATE_AREA_ENTRANCE = 0;
|
||||||
|
PRIVATE_AREA_EXIT = 0;
|
||||||
|
|
||||||
|
-- DefaultTalk NPCs?
|
||||||
|
SANSA = 1000239;
|
||||||
|
ELYN = 1000411;
|
||||||
|
RYD = 1000412;
|
||||||
|
|
||||||
|
-- Quest Markers
|
||||||
|
MRKR_ACORN_ORCHARD = 11082101;
|
||||||
|
MRKR_NICOLIAUX = 11082102;
|
||||||
|
MRKR_VKOROLON = 11082103;
|
||||||
|
|
||||||
|
|
||||||
|
function onStart(player, quest)
|
||||||
|
quest:StartSequence(SEQ_000);
|
||||||
|
end
|
||||||
|
|
||||||
|
function onFinish(player, quest)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function onStateChange(player, quest, sequence)
|
||||||
|
if (sequence == SEQ_ACCEPT) then
|
||||||
|
quest:SetENpc(OTOPA_POTTOPA, QFLAG_NORM); -- TO-DO: Check player inventory for quest-specific item before flagging?
|
||||||
|
quest:SetENpc(VKOROLON, QFLAG_NORM); -- Always shows despite interaction
|
||||||
|
end
|
||||||
|
|
||||||
|
if (sequence == SEQ_000) then
|
||||||
|
quest:SetENpc(VKOROLON);
|
||||||
|
quest:SetENpc(NICOLIAUX, QFLAG_NORM);
|
||||||
|
quest:SetENpc(POWLE);
|
||||||
|
quest:SetENpc(AUNILLIE);
|
||||||
|
quest:SetENpc(GAUWYN_THE_GANNET);
|
||||||
|
quest:SetENpc(HILDIBRAND);
|
||||||
|
quest:SetENpc(NASHU_MHAKARACCA);
|
||||||
|
quest:SetENPC(PRIVATE_AREA_ENTRANCE, QFLAG_MAP, false, true)
|
||||||
|
quest:SetENpc(PRIVATE_AREA_EXIT, QFLAG_NONE, false, true);
|
||||||
|
|
||||||
|
elseif (sequence == SEQ_010) then
|
||||||
|
quest:SetENpc(VKOROLON, QFLAG_REWARD);
|
||||||
|
quest:SetENpc(NICOLIAUX);
|
||||||
|
quest:SetENpc(POWLE);
|
||||||
|
quest:SetENpc(AUNILLIE);
|
||||||
|
quest:SetENpc(GAUWYN_THE_GANNET);
|
||||||
|
quest:SetENpc(HILDIBRAND);
|
||||||
|
quest:SetENpc(NASHU_MHAKARACCA);
|
||||||
|
quest:SetENpc(PRIVATE_AREA_EXIT, QFLAG_NONE, false, true);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onTalk(player, quest, npc)
|
||||||
|
local sequence = quest:getSequence();
|
||||||
|
local classId = npc:GetActorClassId();
|
||||||
|
|
||||||
|
if (sequence == SEQ_ACCEPT) then
|
||||||
|
if (classId == OTOPA_POTTOPA) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart");
|
||||||
|
giveWantedItem(player);
|
||||||
|
elseif (classId == VKOROLON) then
|
||||||
|
-- This retail accurate. No dialog functions called.
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 2075);
|
||||||
|
end
|
||||||
|
|
||||||
|
elseif (sequence == SEQ_000) then
|
||||||
|
if (classId == VKOROLON) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1"); -- This is a guess.
|
||||||
|
elseif (classId == NICOLIAUX) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010")
|
||||||
|
attentionMessage(player, 25225, quest.GetQuestId()); -- objectives complete!
|
||||||
|
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
|
||||||
|
quest:StartSequence(SEQ_010);
|
||||||
|
elseif (classId == GAUWYN_THE_GANNET) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_2");
|
||||||
|
elseif (classId == HILDIBRAND) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_3");
|
||||||
|
elseif (classId == NASHU_MHAKARACCA) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_4");
|
||||||
|
elseif (classId == AUNILLIE) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_5"); -- This is a guess.
|
||||||
|
elseif (classId == POWLE) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_6"); -- This is a guess.
|
||||||
|
|
||||||
|
end
|
||||||
|
elseif (sequence == SEQ_010) then
|
||||||
|
if (classId == VKOROLON) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 500, 1, 1);
|
||||||
|
player:CompleteQuest(quest);
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 1070); -- Log out in The Mizzenmast Inn w/ item.
|
||||||
|
elseif (classId == NICOLIAUX) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1") -- This is a guess.
|
||||||
|
elseif (classId == GAUWYN_THE_GANNET) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_2");
|
||||||
|
elseif (classId == HILDIBRAND) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_3");
|
||||||
|
elseif (classId == NASHU_MHAKARACCA) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_4");
|
||||||
|
elseif (classId == AUNILLIE) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_5"); -- This is a guess.
|
||||||
|
elseif (classId == POWLE) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_6"); -- This is a guess.
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
player:EndEvent()
|
||||||
|
quest:UpdateENPCs();
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function onPush(player, quest, npc)
|
||||||
|
local npcClassId = npc.GetActorClassId();
|
||||||
|
|
||||||
|
player:EndEvent();
|
||||||
|
if (npcClassId == PRIVATE_AREA_ENTRANCE) then
|
||||||
|
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 9999);
|
||||||
|
elseif (npcClassId == PRIVATE_AREA_EXIT) then
|
||||||
|
GetWorldManager():WarpToPublicArea(player);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getJournalInformation(player, quest)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function getJournalMapMarkerList(player, quest)
|
||||||
|
local sequence = quest:getSequence();
|
||||||
|
|
||||||
|
if (sequence == SEQ_000) then
|
||||||
|
return MRKR_ACORN_ORCHARD; -- TO-DO: Check for private area and use MRKR_NICOLIAUX in place of this
|
||||||
|
elseif (sequence == SEQ_010) then
|
||||||
|
return MRKR_VKOROLON;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function giveWantedItem(player)
|
||||||
|
|
||||||
|
local invCheck = player:getItemPackage(INVENTORY_NORMAL):addItem(ITEM_WANTED_GAUWYN, 1, 1);
|
||||||
|
|
||||||
|
if (invCheck == INV_ERROR_FULL) then
|
||||||
|
-- Your inventory is full.
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 60022, MESSAGE_TYPE_SYSTEM_ERROR);
|
||||||
|
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
|
||||||
|
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 40279, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
|
||||||
|
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
|
||||||
|
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", "[DEBUG] Server Error on adding item.");
|
||||||
|
elseif (invCheck == INV_ERROR_SUCCESS) then
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 3071); -- Log out in The Hourglass w/ item.
|
||||||
|
end
|
||||||
|
end
|
104
Data/scripts/quests/etc/etc5l0.lua
Normal file
104
Data/scripts/quests/etc/etc5l0.lua
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
require("global");
|
||||||
|
|
||||||
|
--[[
|
||||||
|
|
||||||
|
Quest Script
|
||||||
|
|
||||||
|
Name: The Ink Thief
|
||||||
|
Code: Etc5l0
|
||||||
|
Id: 110838
|
||||||
|
Prereq: Level 1 on any class. Second MSQ completed. (110002 Man0l1 / 110006 Man0g1 / 110010 Man0u1)
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
]]
|
||||||
|
|
||||||
|
-- Sequence Numbers
|
||||||
|
SEQ_000 = 0; -- Talk to Sweetnix.
|
||||||
|
SEQ_001 = 1; -- Return to Mytesyn.
|
||||||
|
|
||||||
|
-- Actor Class Ids
|
||||||
|
MYTESYN = 1000167;
|
||||||
|
SWEETNIX = 1001573;
|
||||||
|
|
||||||
|
-- Quest Item
|
||||||
|
ITEM_INKWELL = 11000223;
|
||||||
|
|
||||||
|
-- Quest Markers
|
||||||
|
MRKR_SWEETNIX = 11072001;
|
||||||
|
MRKR_MYTESYN = 11072002;
|
||||||
|
|
||||||
|
|
||||||
|
function onStart(player, quest)
|
||||||
|
quest:StartSequence(SEQ_000);
|
||||||
|
end
|
||||||
|
|
||||||
|
function onFinish(player, quest)
|
||||||
|
end
|
||||||
|
|
||||||
|
function onStateChange(player, quest, sequence)
|
||||||
|
if (sequence == SEQ_ACCEPT) then
|
||||||
|
quest:SetENpc(MYTESYN, QFLAG_NORM);
|
||||||
|
end
|
||||||
|
|
||||||
|
if (sequence == SEQ_000) then
|
||||||
|
quest:SetENpc(MYTESYN);
|
||||||
|
quest:SetENpc(SWEETNIX, QFLAG_NORM);
|
||||||
|
elseif (sequence == SEQ_001) then
|
||||||
|
quest:SetENpc(MYTESYN, QFLAG_REWARD);
|
||||||
|
quest:SetENpc(SWEETNIX);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onTalk(player, quest, npc)
|
||||||
|
local sequence = quest:getSequence();
|
||||||
|
local npcClassId = npc:GetActorClassId();
|
||||||
|
|
||||||
|
if (sequence == SEQ_ACCEPT) then
|
||||||
|
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventMYTESYNStart");
|
||||||
|
if (questAccepted == 1) then
|
||||||
|
player:AcceptQuest(quest);
|
||||||
|
end
|
||||||
|
player:EndEvent();
|
||||||
|
return;
|
||||||
|
elseif (sequence == SEQ_000) then
|
||||||
|
if (npcClassId == MYTESYN) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1");
|
||||||
|
elseif (npcClassId == SWEETNIX) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010");
|
||||||
|
attentionMessage(player, 25246, ITEM_INKWELL, 1);
|
||||||
|
attentionMessage(player, 25225, quest:GetQuestId());
|
||||||
|
quest:StartSequence(SEQ_001);
|
||||||
|
end
|
||||||
|
|
||||||
|
elseif (sequence == SEQ_001) then
|
||||||
|
if (npcClassId == MYTESYN) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200,1 ,1)
|
||||||
|
player:CompleteQuest(quest);
|
||||||
|
elseif (npcClassId == SWEETNIX) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
player:EndEvent()
|
||||||
|
quest:UpdateENPCs();
|
||||||
|
end
|
||||||
|
|
||||||
|
function getJournalInformation(player, quest)
|
||||||
|
local sequence = quest:getSequence();
|
||||||
|
if (sequence == SEQ_001) then
|
||||||
|
return ITEM_INKWELL;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function getJournalMapMarkerList(player, quest)
|
||||||
|
local sequence = quest:getSequence();
|
||||||
|
|
||||||
|
if (sequence == SEQ_000) then
|
||||||
|
return MRKR_SWEETNIX;
|
||||||
|
elseif (sequence == SEQ_001) then
|
||||||
|
return MRKR_MYTESYN;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -35,11 +35,11 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function onStateChange(player, quest, sequence)
|
function onStateChange(player, quest, sequence)
|
||||||
if (sequence == 65535) then
|
if (sequence == SEQ_ACCEPT) then
|
||||||
quest:SetENpc(OTOPA_POTTOPA, QFLAG_PLATE);
|
quest:SetENpc(OTOPA_POTTOPA, QFLAG_NORM);
|
||||||
elseif (sequence == SEQ_000) then
|
elseif (sequence == SEQ_000) then
|
||||||
quest:SetENpc(OTOPA_POTTOPA);
|
quest:SetENpc(OTOPA_POTTOPA);
|
||||||
quest:SetENpc(JUDITHE, QFLAG_PLATE);
|
quest:SetENpc(JUDITHE, QFLAG_NORM);
|
||||||
elseif (sequence == SEQ_001) then
|
elseif (sequence == SEQ_001) then
|
||||||
quest:SetENpc(OTOPA_POTTOPA, QFLAG_REWARD);
|
quest:SetENpc(OTOPA_POTTOPA, QFLAG_REWARD);
|
||||||
quest:SetENpc(JUDITHE);
|
quest:SetENpc(JUDITHE);
|
||||||
@ -50,7 +50,7 @@ function onTalk(player, quest, npc)
|
|||||||
local sequence = quest:getSequence();
|
local sequence = quest:getSequence();
|
||||||
local classId = npc:GetActorClassId();
|
local classId = npc:GetActorClassId();
|
||||||
|
|
||||||
if (sequence == 65535) then
|
if (sequence == SEQ_ACCEPT) then
|
||||||
if (classId == OTOPA_POTTOPA) then
|
if (classId == OTOPA_POTTOPA) then
|
||||||
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart");
|
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart");
|
||||||
|
|
||||||
|
164
Data/scripts/quests/etc/etc5u1.lua
Normal file
164
Data/scripts/quests/etc/etc5u1.lua
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
require("global");
|
||||||
|
|
||||||
|
--[[
|
||||||
|
|
||||||
|
Quest Script
|
||||||
|
|
||||||
|
Name: The Usual Suspect
|
||||||
|
Code: Etc5u1
|
||||||
|
Id: 110849
|
||||||
|
Prereq: Level 15. [110828 Etc5g0 / 110838 Etc5l0 / 110848 Etc5u0]
|
||||||
|
Notes: Rewards 500 exp
|
||||||
|
|
||||||
|
]]
|
||||||
|
|
||||||
|
-- Sequence Numbers
|
||||||
|
SEQ_000 = 0;
|
||||||
|
SEQ_010 = 10;
|
||||||
|
|
||||||
|
-- Actor Class Ids
|
||||||
|
OTOPA_POTTOPA = 1000864;
|
||||||
|
GAUWYN_THE_GANNET = 1002065;
|
||||||
|
HILDIBRAND = 1001995;
|
||||||
|
NASHU_MHAKARACCA = 1001996;
|
||||||
|
PRIVATE_AREA_ENTRANCE = 0;
|
||||||
|
PRIVATE_AREA_EXIT = 0;
|
||||||
|
|
||||||
|
-- DefaultTalk NPCs?
|
||||||
|
UBOKHN = 1000668;
|
||||||
|
VANNES = 1001464;
|
||||||
|
XDHILOGO = 1001466;
|
||||||
|
DARIUSTEL = 1001467;
|
||||||
|
GUENCEN = 1001468;
|
||||||
|
|
||||||
|
-- Quest Items
|
||||||
|
ITEM_WANTED_GAUWYN = 10011243;
|
||||||
|
|
||||||
|
-- Quest Markers
|
||||||
|
MRKR_COLISEUM = 11092101;
|
||||||
|
MRKR_GAUWYN = 11092102;
|
||||||
|
MRKR_OTOPA_POTTOPA = 11092103;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function onStart(player, quest)
|
||||||
|
quest:StartSequence(SEQ_000);
|
||||||
|
end
|
||||||
|
|
||||||
|
function onFinish(player, quest)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function onStateChange(player, quest, sequence)
|
||||||
|
if (sequence == SEQ_ACCEPT) then
|
||||||
|
quest:SetENpc(OTOPA_POTTOPA, QFLAG_NORM); -- TO-DO: Check player inventory for quest-specific item before flagging?
|
||||||
|
end
|
||||||
|
|
||||||
|
if (sequence == SEQ_000) then
|
||||||
|
quest:SetENpc(OTOPA_POTTOPA);
|
||||||
|
quest:SetENpc(GAUWYN_THE_GANNET, QFLAG_NORM);
|
||||||
|
quest:SetENpc(HILDIBRAND);
|
||||||
|
quest:SetENpc(NASHU_MHAKARACCA);
|
||||||
|
quest:SetENPC(PRIVATE_AREA_ENTRANCE, QFLAG_MAP, false, true)
|
||||||
|
quest:SetENpc(PRIVATE_AREA_EXIT, QFLAG_NONE, false, true);
|
||||||
|
elseif (sequence == SEQ_010) then
|
||||||
|
quest:SetENpc(OTOPA_POTTOPA, QFLAG_REWARD);
|
||||||
|
quest:SetENpc(GAUWYN_THE_GANNET);
|
||||||
|
quest:SetENpc(HILDIBRAND);
|
||||||
|
quest:SetENpc(NASHU_MHAKARACCA);
|
||||||
|
quest:SetENpc(PRIVATE_AREA_EXIT, QFLAG_NONE, false, true);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onTalk(player, quest, npc)
|
||||||
|
local sequence = quest:getSequence();
|
||||||
|
local classId = npc:GetActorClassId();
|
||||||
|
|
||||||
|
if (sequence == SEQ_ACCEPT) then
|
||||||
|
if (classId == OTOPA_POTTOPA) then
|
||||||
|
-- TO-DO: Add inventory check here?
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart");
|
||||||
|
giveWantedItem(player);
|
||||||
|
--processEventOTOPAPOTTOPAStart_2
|
||||||
|
end
|
||||||
|
|
||||||
|
elseif (sequence == SEQ_000) then
|
||||||
|
if (classId == OTOPA_POTTOPA) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1");
|
||||||
|
elseif (classId == GAUWYN_THE_GANNET) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010");
|
||||||
|
attentionMessage(player, 25225, quest.GetQuestId()); -- objectives complete!
|
||||||
|
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
|
||||||
|
quest:StartSequence(SEQ_010);
|
||||||
|
elseif (classId == HILDIBRAND) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
|
||||||
|
elseif (classId == NASHU_MHAKARACCA) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_2");
|
||||||
|
end
|
||||||
|
|
||||||
|
elseif (sequence == SEQ_010) then
|
||||||
|
if (classId == HILDIBRAND) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
|
||||||
|
elseif (classId == NASHU_MHAKARACCA) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_2");
|
||||||
|
elseif (classId == GAUWYN_THE_GANNET) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_3");
|
||||||
|
elseif (classId == OTOPA_POTTOPA) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 500, 1, 1);
|
||||||
|
player:CompleteQuest(quest);
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 2075); -- Log out in The Roost w/ item.
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
player:EndEvent()
|
||||||
|
quest:UpdateENPCs();
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function onPush(player, quest, npc)
|
||||||
|
local npcClassId = npc.GetActorClassId();
|
||||||
|
|
||||||
|
player:EndEvent();
|
||||||
|
if (npcClassId == PRIVATE_AREA_ENTRANCE) then
|
||||||
|
-- TO-DO: Needs spawn coordinates + Private Area arranged
|
||||||
|
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 9999);
|
||||||
|
elseif (npcClassId == PRIVATE_AREA_EXIT) then
|
||||||
|
GetWorldManager():WarpToPublicArea(player);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getJournalInformation(player, quest)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function getJournalMapMarkerList(player, quest)
|
||||||
|
local sequence = quest:getSequence();
|
||||||
|
|
||||||
|
if (sequence == SEQ_000) then
|
||||||
|
return MRKR_COLISEUM -- TO-DO: Add a check for that specific private area and have it return MRKR_GAUWYN?
|
||||||
|
elseif (sequence == SEQ_010) then
|
||||||
|
return MRKR_OTOPA_POTTOPA
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function giveWantedItem(player)
|
||||||
|
|
||||||
|
local invCheck = player:getItemPackage(INVENTORY_NORMAL):addItem(ITEM_WANTED_GAUWYN, 1, 1);
|
||||||
|
|
||||||
|
if (invCheck == INV_ERROR_FULL) then
|
||||||
|
-- Your inventory is full.
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 60022, MESSAGE_TYPE_SYSTEM_ERROR);
|
||||||
|
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
|
||||||
|
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 40279, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
|
||||||
|
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
|
||||||
|
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", "[DEBUG] Server Error on adding item.");
|
||||||
|
elseif (invCheck == INV_ERROR_SUCCESS) then
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
|
||||||
|
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 3071); -- Log out in The Hourglass w/ item.
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user