1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-20 19:57:46 +00:00

- man0g0 - Majority of the work ported from the old quest system. Still polish to be had and fringe cases to deal with (especially relogging)

- man0g1 - Initial privateArea mostly scripted.
- SimpleContent30010 - Fixed Yda/Papalymo Id being backwards, added Active states to match retail
- QuestDirectorMan0g001-  Updated to play itself out (this is a mess to wrap my head around).  Mostly sorta kinda working on both DoW & DoM tutorials.  End cutscene on DoW not firing currently, will fix later.
This commit is contained in:
CuriousJorge 2022-02-24 22:24:08 -05:00
parent 682ddd9cae
commit a87244d13b
5 changed files with 582 additions and 164 deletions

View file

@ -1,79 +1,34 @@
require ("global")
require ("modifiers")
function onCreate(starterPlayer, contentArea, director) function onCreate(starterPlayer, contentArea, director)
--papalymo = contentArea:SpawnActor(2290005, "papalymo", 365.89, 4.0943, -706.72, -0.718);
--yda = contentArea:SpawnActor(2290006, "yda", 365.266, 4.122, -700.73, 1.5659);
--mob1 = contentArea:SpawnActor(2201407, "mob1", 374.427, 4.4, -698.711, -1.942); papalymo = contentArea:SpawnActor(2290005, "papalymo", 365.89, 4.0943, -706.72, -0.718);
--mob2 = contentArea:SpawnActor(2201407, "mob2", 375.377, 4.4, -700.247, -1.992); yda = contentArea:SpawnActor(2290006, "yda", 365.266, 4.122, -700.73, 1.5659);
--mob3 = contentArea:SpawnActor(2201407, "mob3", 375.125, 4.4, -703.591, -1.54);
yda = GetWorldManager().SpawnBattleNpcById(6, contentArea); mob1 = contentArea:SpawnActor(2201407, "mob1", 374.427, 4.4, -698.711, -1.942);
papalymo = GetWorldManager().SpawnBattleNpcById(7, contentArea); mob2 = contentArea:SpawnActor(2201407, "mob2", 375.377, 4.4, -700.247, -1.992);
--yda:ChangeState(2); mob3 = contentArea:SpawnActor(2201407, "mob3", 375.125, 4.4, -703.591, -1.54);
mob1 = GetWorldManager().SpawnBattleNpcById(3, contentArea);
mob2 = GetWorldManager().SpawnBattleNpcById(4, contentArea); openingStoper = contentArea:SpawnActor(1090384, "openingstoper", 356.09, 3.74, -701.62, -1.41);
mob3 = GetWorldManager().SpawnBattleNpcById(5, contentArea);
starterPlayer.currentParty:AddMember(papalymo.Id); yda:ChangeState(2);
starterPlayer.currentParty:AddMember(yda.Id); mob1:ChangeState(2);
starterPlayer:SetMod(modifiersGlobal.MinimumHpLock, 1); mob2:ChangeState(2);
mob3:ChangeState(2);
openingStoper = contentArea:SpawnActor(1090384, "openingstoper", 356.09, 3.74, -701.62, -1.41);
director:AddMember(starterPlayer);
director:AddMember(starterPlayer);
director:AddMember(director); director:AddMember(director);
director:AddMember(papalymo); director:AddMember(yda);
director:AddMember(yda); director:AddMember(papalymo);
director:AddMember(mob1); director:AddMember(mob1);
director:AddMember(mob2); director:AddMember(mob2);
director:AddMember(mob3); director:AddMember(mob3);
director:StartContentGroup();
--director:StartContentGroup();
end end
function onDestroy() function onDestroy()
end end
function onUpdate(tick, area)
if area then
local players = area:GetPlayers()
local mobs = area:GetMonsters()
local allies = area:GetAllies()
local resumeChecks = true
for player in players do
if player then
local exitLoop = false
if allies then
for i = 0, #allies - 1 do
if allies[i] then
if not allies[i]:IsEngaged() then
if player:IsEngaged() and player.target then
allies[i].neutral = false
allies[i].isAutoAttackEnabled = true
allies[i]:SetMod(modifiersGlobal.Speed, 8)
allyGlobal.EngageTarget(allies[i], player.target)
exitLoop = true
break
-- todo: support scripted paths
elseif allies[i]:GetSpeed() > 0 then
end
end
end
end
end
if exitLoop then
resumeChecks = false
break
end
end
end
if not resumeChecks then
return
end
end
end

View file

@ -1,9 +1,8 @@
require ("global") require ("global")
require ("tutorial") require ("tutorial")
require ("modifiers")
require ("quests/man/man0g0") require ("quests/man/man0g0")
--processTtrBtl001: Active Mode Tutorial --processTtrBtl001: Active Mode Tutorial - DoW only
--processTtrBtl002: Targetting Tutorial (After active mode done) --processTtrBtl002: Targetting Tutorial (After active mode done)
function init() function init()
@ -11,90 +10,106 @@ function init()
end end
function onCreateContentArea(players, director, contentArea, contentGroup) function onCreateContentArea(players, director, contentArea, contentGroup)
director:StartContentGroup();
papalymo = contentArea:SpawnActor(2290005, "papalymo", 365.89, 4.0943, -706.72, -0.718);
yda = contentArea:SpawnActor(2290006, "yda", 365.266, 4.122, -700.73, 1.5659);
mob1 = contentArea:SpawnActor(2201407, "mob1", 374.427, 4.4, -698.711, -1.942);
mob2 = contentArea:SpawnActor(2201407, "mob2", 375.377, 4.4, -700.247, -1.992);
mob3 = contentArea:SpawnActor(2201407, "mob3", 375.125, 4.4, -703.591, -1.54);
openingStoper = contentArea:SpawnActor(1090384, "openingstoper", 356.09, 3.74, -701.62, -1.41);
for _, player in pairs(players) do
contentGroup:AddMember(player);
end;
contentGroup:AddMember(director);
contentGroup:AddMember(yda);
contentGroup:AddMember(papalymo);
contentGroup:AddMember(mob1);
contentGroup:AddMember(mob2);
contentGroup:AddMember(mob3);
end end
function onEventStarted(player, actor, triggerName) function onEventStarted(player, actor, triggerName)
man0g0Quest = player:GetQuest("Man0g0"); man0g0Quest = player:GetQuest("Man0g0");
player:SetMod(modifiersGlobal.MinimumHpLock, 1);
player:SendMessage(0x20, "", "Starting");
startTutorialMode(player); startTutorialMode(player);
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrBtl001", nil, nil, nil);
player:EndEvent();
player:SendMessage(0x20, "", "Waiting for player active");
waitForSignal("playerActive");
player:SendMessage(0x20, "", "player active");
wait(1); --If this isn't here, the scripts bugs out. TODO: Find a better alternative.
kickEventContinue(player, actor, "noticeEvent", "noticeEvent");
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrBtl002", nil, nil, nil);
player:SendMessage(0x20, "", "processTtrBtl002 called");
player:EndEvent();
--Combat portion of tutorial --Combat portion of tutorial
if player:IsDiscipleOfWar() then if player:IsDiscipleOfWar() then
player:SendMessage(0x20, "", "Is DoW");
waitForSignal("playerAttack"); callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrBtl001");
player:EndEvent();
waitForSignal("playerActive");
wait(1); --If this isn't here, the scripts bugs out. TODO: Find a better alternative.
kickEventContinue(player, actor, "noticeEvent", "noticeEvent");
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrBtl002", nil, nil, nil);
player:EndEvent();
--waitForSignal("playerAttack");
closeTutorialWidget(player); closeTutorialWidget(player);
showTutorialSuccessWidget(player, 9055); --Open TutorialSuccessWidget for attacking enemy showTutorialSuccessWidget(player, 9055); --Open TutorialSuccessWidget for attacking enemy
openTutorialWidget(player, CONTROLLER_KEYBOARD, TUTORIAL_TP); openTutorialWidget(player, CONTROLLER_KEYBOARD, TUTORIAL_TP);
waitForSignal("tpOver1000");
player:SetMod(modifiersGlobal.MinimumTpLock, 1000); wait(3);
closeTutorialWidget(player); closeTutorialWidget(player);
openTutorialWidget(player, CONTROLLER_KEYBOARD, TUTORIAL_WEAPONSKILLS); openTutorialWidget(player, CONTROLLER_KEYBOARD, TUTORIAL_WEAPONSKILLS);
waitForSignal("weaponskillUsed"); --waitForSignal("weaponskillUsed");
player:SetMod(modifiersGlobal.MinimumTpLock, 0); wait(3);
--player:SetMod(modifiersGlobal.MinimumTpLock, 0);
closeTutorialWidget(player); closeTutorialWidget(player);
showTutorialSuccessWidget(player, 9065); --Open TutorialSuccessWidget for weapon skill showTutorialSuccessWidget(player, 9065); --Open TutorialSuccessWidget for weapon skill
elseif player:IsDiscipleOfMagic() then elseif player:IsDiscipleOfMagic() then
player:SendMessage(0x20, "", "Is DoM");
openTutorialWidget(player, CONTROLLER_KEYBOARD, TUTORIAL_CASTING); callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrBtlMagic001");
waitForSignal("spellUsed"); player:EndEvent();
closeTutorialWidget(player); wait(1);
kickEventContinue(player, actor, "noticeEvent", "noticeEvent");
closeTutorialWidget(player);
player:SendMessage(0x20, "", "Sending success");
showTutorialSuccessWidget(player, 9050); --Open TutorialSuccessWidget for magic skill
wait(1)
openTutorialWidget(player, CONTROLLER_KEYBOARD, TUTORIAL_DEFEATENEMY);
wait(3);
closeTutorialWidget(player);
--waitForSignal("spellUsed"); 9050
elseif player:IsDiscipleOfHand() then elseif player:IsDiscipleOfHand() then
waitForSignal("abilityUsed"); --waitForSignal("abilityUsed");
elseif player:IsDiscipleOfLand() then elseif player:IsDiscipleOfLand() then
waitForSignal("abilityUsed"); --waitForSignal("abilityUsed");
end end
player:SendMessage(0x20, "", "Waiting for mobkill1"); wait(3);
waitForSignal("mobkill"); --Should be wait for mobkill
player:SendMessage(0x20, "", "Waiting for mobkill2");
waitForSignal("mobkill");
player:SendMessage(0x20, "", "Waiting for mobkill3");
waitForSignal("mobkill");
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
player:SetMod(modifiersGlobal.MinimumHpLock, 0);
player:SendMessage(0x20, "", "Sending data packet 'attention'");
player:SendDataPacket("attention", worldMaster, "", 51073, 2); player:SendDataPacket("attention", worldMaster, "", 51073, 2);
wait(5); wait(7);
player:SendMessage(0x20, "", "Disengaging");
player:Disengage(0x0000);
wait(5);
player:SendMessage(0x20, "", "NextPhase(10)");
man0g0Quest:NextPhase(10);
wait(5);
player:SendMessage(0x20, "", "ProcessEvent020_1");
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processEvent020_1", nil, nil, nil);
wait(5);
player:SendMessage(0x20, "", "Changing music");
player:ChangeMusic(7); player:ChangeMusic(7);
wait(5); player:ChangeState(0);
--kickEventContinue(player, actor, "noticeEvent", "noticeEvent");
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processEvent020_1");
man0g0Quest:StartSequence(10);
player:SendMessage(0x20, "", "Kick notice event"); player:EndEvent();
kickEventContinue(player, actor, "noticeEvent", "noticeEvent"); player.CurrentArea:ContentFinished();
wait(5); GetWorldManager():DoZoneChange(player, 155, "PrivateAreaMasterPast", 1, 15, 175.38, -1.21, -1156.51, -2.1);
player:EndEvent();
player:SendMessage(0x20, "", "ContentFinished"); end
player.CurrentArea:ContentFinished();
wait(5); --[[
player:SendMessage(0x20, "", "Remove from party");
player:RemoveFromCurrentPartyAndCleanup();
--player:EndEvent();
--GetWorldManager():DoZoneChange(player, 155, "PrivateAreaMasterPast", 1, 15, 175.38, -1.21, -1156.51, -2.1);
--[[
IF DoW: IF DoW:
OpenWidget (TP) OpenWidget (TP)
IF TP REACHED: IF TP REACHED:
@ -105,36 +120,4 @@ function onEventStarted(player, actor, triggerName)
CloseWidget CloseWidget
ELSE MAGIC: ELSE MAGIC:
OpenWidget (DEFEAT ENEMY) OpenWidget (DEFEAT ENEMY)
]] --]]
player:EndEvent();
wait(5);
player:SendMessage(0x20, "", "Zone change");
GetWorldManager():DoZoneChange(player, 155, "PrivateAreaMasterPast", 1, 15, 175.38, -1.21, -1156.51, -2.1);
end
function onUpdate(deltaTime, area)
end
function onTalkEvent(player, npc)
end
function onPushEvent(player, npc)
end
function onCommandEvent(player, command)
end
function onEventUpdate(player, npc)
end
function onCommand(player, command)
end
function main(director, contentGroup)
onCreateContentArea(director:GetPlayerMembers(), director, director.CurrentArea, contentGroup);
end;

View file

@ -49,7 +49,7 @@ local defaultTalkFst = {
[1001709] = "defaultTalkWithFryswyde_001", -- Fryswyde (Gridania: Adv. Guild) [1001709] = "defaultTalkWithFryswyde_001", -- Fryswyde (Gridania: Adv. Guild)
[1001710] = "defaultTalkWithWillielmus_001", -- Willielmus (Gridania: Adv. Guild) [1001710] = "defaultTalkWithWillielmus_001", -- Willielmus (Gridania: Adv. Guild)
[1001951] = "defaultTalkWithAnselm_001", -- Anselm (Gridania: Adv. Guild) [1001951] = "defaultTalkWithAnselm_001", -- Anselm (Gridania: Adv. Guild)
[1002091] = [1002091] = "",
[1500055] = "defaultTalkWithLionnellais_001", -- Lionnellais (Gridania: Adv. Guild) - Will not fire, not PplStd. Pre-airship dialog? [1500055] = "defaultTalkWithLionnellais_001", -- Lionnellais (Gridania: Adv. Guild) - Will not fire, not PplStd. Pre-airship dialog?
[1500056] = "defaultTalkWithHida_001", -- Hida (Gridania: Adv. Guild) - Will not fire, not PplStd. Pre-airship dialog? [1500056] = "defaultTalkWithHida_001", -- Hida (Gridania: Adv. Guild) - Will not fire, not PplStd. Pre-airship dialog?
--[1500334] = "", -- Serpent Private Hill (Gridania: Adv. Guild) Company Warp NPC - Will not fire, not PplStd. --[1500334] = "", -- Serpent Private Hill (Gridania: Adv. Guild) Company Warp NPC - Will not fire, not PplStd.

View file

@ -1,3 +1,312 @@
--Quest Flags require("global");
MAN0L0_FLAG_STARTED_TALK_TUT = 0;
MAN0G0_FLAG_MINITUT_DONE1 = 1; --[[
Quest Script
Name: Sundered Skies
Code: Man0g0
Id: 110005
Prereq: None (Given on chara creation)
Notes:
]]
--[[
SEQS
[@IF($E4($E8(1),0), 
[@SHEET(xtx/journalxtxFst,177,1)]
,)]
[@IF($E4($E8(1),5), 
[@SHEET(xtx/journalxtxFst,178,1)]
,)]
[@IF($E4($E8(1),10), 
[@SHEET(xtx/journalxtxFst,179,1)]
,)]
qItem
[@IF($E0($E8(1),10),
[@SHEET(xtx/itemName,11000088,5)][@CR]
,)]
--]]
-- Sequence Numbers
SEQ_000 = 0; -- Intro with Yda & Papalymo
SEQ_005 = 5; -- Combat tutorial
SEQ_010 = 10; -- Gridania section
-- Actor Class Ids
YDA = 1000009;
PAPALYMO = 1000010;
FARRIMOND = 1000017;
CECILIA = 1000683;
SWETHYNA = 1000680;
TKEBBE = 1000876;
LONSYGG = 1000951;
GUILD_ENTRANCE = 1099046;
BLOCKER1 = 1099047;
-- Non-interactive NPCs
GUILD_ANENE = 1000427;
GUILD_SYLBERT = 1000428; -- No source
GUILD_HONGA_VUNGA = 1000429;
GUILD_NONCO_MENANCO = 1000430;
GUILD_LTANDHAA = 1000431;
GUILD_POFUFU = 1000432;
GUILD_ODILIE = 1000434; -- No source
GUILD_BASEWIN = 1000435; -- No source
GUILD_SEIKFRAE = 1000436; -- No source
GUILD_EDASSHYM = 1000437;
GUILD_TIERNEY = 1000456;
GUILD_GONTRANT = 1000457;
GUILD_VKOROLON = 1000458;
GUILD_EMONI = 1001183;
GUILD_GYLES = 1001184;
GUILD_PENELOPE = 1700001; -- No source
-- PrivateAreaMasterPast 1
-- Quest Markers
MRKR_LONSYGG = 11000501; -- Obsolete. Pre-1.19 location for this npc
MRKR_YDA = 11000502;
MRKR_PAPALYMO = 11000503;
MRKR_GUILD = 11000504;
-- Quest Flags
FLAG_SEQ000_MINITUT0 = 0; -- Talked to YDA
FLAG_SEQ000_MINITUT1 = 1; -- Talked to PAPALYMO
FLAG_SEQ000_MINITUT2 = 2; -- Talked to YDA again
FLAG_SEQ010_TKEBBE = 0; -- Talked to T'kebbe (optional)
--[[
processEvent000_0
processEvent000_1
processEvent000_2
processEvent000_3
processEvent000_4
processEvent010_1
processEvent020_1
processEvent020_2
processEvent020_3
processEvent020_4
processEvent020_5
processEvent020_6
processTtrNomal001withHQ -- Intro CS
processTtrNomal001
processTtrNomal002(arg1)
processTtrNomal003(arg1)
processTtrMini001 -- Unused
processTtrMini002 -- Unused
processTtrMini003
processTtrAfterBtl001
processTtrBtl001(arg1)
processTtrBtlMagic001(arg1)
processTtrBtl002(arg1)
processTtrBtl003
processTtrBlkNml001 - Aims at 1600102 Lonsygg
processTtrBlkNml002
processTtrBtl004
processInformDialogAsQuest
--]]
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_000) then
-- Setup states incase we loaded in.
local data = quest:GetData();
local ydaCanPush = (not data:GetFlag(FLAG_SEQ000_MINITUT0));
local ydaFlag = QFLAG_PLATE;
if (not data:GetFlag(FLAG_SEQ000_MINITUT0)) or (data:GetFlag(FLAG_SEQ000_MINITUT1)) then
ydaFlag = QFLAG_PLATE;
else
ydaFlag = QFLAG_NONE;
end
local papalymoFlag = ((not data:GetFlag(FLAG_SEQ000_MINITUT1)) and data:GetFlag(FLAG_SEQ000_MINITUT0) and QFLAG_PLATE or QFLAG_NONE);
--SetENpc(classId, byte flagType=0,isTalkEnabled, isPushEnabled, isEmoteEnabled, isSpawned)
quest:SetENpc(YDA, ydaFlag, true, ydaCanPush);
quest:SetENpc(PAPALYMO, papalymoFlag);
elseif (sequence == SEQ_010) then
local data = quest:GetData();
local tkebbeTalk = (not data:GetFlag(FLAG_SEQ010_TKEBBE) and QFLAG_PLATE or QFLAG_NONE);
quest:SetENpc(FARRIMOND);
quest:SetENpc(CECILIA);
quest:SetENpc(SWETHYNA);
quest:SetENpc(TKEBBE, tkebbeTalk);
quest:SetENpc(LONSYGG);
quest:SetENpc(BLOCKER1, QFLAG_NONE, false, true);
quest:setENpc(GUILD_ENTRANCE, QFLAG_MAP, false, true);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_000) then
seq000_onTalk(player, quest, npc, classId);
elseif (sequence == SEQ_010) then
seq010_onTalk(player, quest, npc, classId);
end
quest:UpdateENPCs();
end
function onPush(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
local data = quest:GetData();
if (sequence == SEQ_000) then
if (classId == YDA) then
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal002");
player:EndEvent();
end
elseif (sequence == SEQ_010) then
if (classId == BLOCKER1) then
callClientFunction(player, "delegateEvent", player, quest, "processTtrBlkNml001");
GetWorldManager():DoPlayerMoveInZone(player, 109.966, 7.559, -1206.117, -2.7916, 0x11)
player:EndEvent();
elseif (classId == GUILD_ENTRANCE) then
player:ReplaceQuest(quest, "Man0g1")
return;
end
end
quest:UpdateENPCs();
end
function onNotice(player, quest, target)
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal001withHQ");
--callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal001"); -- On relog pre-combat
--callClientFunction(player, "delegateEvent", player, quest, "processTtrAfterBtl001"); -- On relog post-combat
player:EndEvent();
quest:UpdateENPCs();
end
function seq000_onTalk(player, quest, npc, classId)
local data = quest:GetData();
if (classId == YDA) then
if (not data:GetFlag(FLAG_SEQ000_MINITUT0)) then -- If Talk tutorial
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal003");
data:SetFlag(FLAG_SEQ000_MINITUT0); -- Disable Yda's PushEvent and set up Papalymo
elseif (data:GetFlag(FLAG_SEQ000_MINITUT1)) then -- If Talked to after Papaylmo
doContentArea(player, quest, npc); -- Set up Combat Tutorial
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_3");
end
elseif (classId == PAPALYMO) then
if (data:GetFlag(FLAG_SEQ000_MINITUT0)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_2");
data:SetFlag(FLAG_SEQ000_MINITUT1);
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_2");
end
end
player:EndEvent();
end
function seq010_onTalk(player, quest, npc, classId)
local data = quest:GetData();
if (classId == SWETHYNA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_2");
elseif (classId == CECILIA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_3");
elseif (classId == FARRIMOND) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_4");
elseif (classId == TKEBBE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_5");
data:SetFlag(FLAG_SEQ010_TKEBBE);
elseif (classId == LONSYGG) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_6");
end
player:EndEvent();
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local possibleMarkers = {};
local data = quest:GetData();
if (sequence == SEQ_000) then
if (not data:GetFlag(FLAG_SEQ000_MINITUT0)) or (data:GetFlag(FLAG_SEQ000_MINITUT1)) then
table.insert(possibleMarkers, MRKR_YDA);
end
if (data:GetFlag(FLAG_SEQ000_MINITUT0)) and (not data:GetFlag(FLAG_SEQ000_MINITUT1)) then
table.insert(possibleMarkers, MRKR_PAPALYMO);
end
elseif (sequence == SEQ_010) then
table.insert(possibleMarkers, MRKR_GUILD);
end
return unpack(possibleMarkers)
end
function doContentArea(player, quest, npc)
quest:GetData():ClearData();
quest:StartSequence(SEQ_005);
contentArea = player.CurrentArea:CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0g01", "SimpleContent30010", "Quest/QuestDirectorMan0g001");
if (contentArea == nil) then
return;
end
director = contentArea:GetContentDirector();
player:AddDirector(director);
director:StartDirector(false);
player:KickEvent(director, "noticeEvent", true);
player:SetLoginDirector(director);
GetWorldManager():DoZoneChangeContent(player, contentArea, 362.4087, 4, -703.8168, 1.5419, 16);
return;
end

View file

@ -0,0 +1,171 @@
require("global");
--[[
Quest Script
Name: Souls Gone Wild
Code: Man0g1
Id: 110006
Prereq: Sundered Skies (Man0g0 - 110005)
Notes:
]]
-- Sequence Numbers
SEQ_000 = 0;
-- Actor Class Ids
MIOUNNE = 1000230;
VKOROLON = 1000458;
WISPILY_WHISKERED_WOODWORKER = 1000562;
AMIABLE_ADVENTURER = 1001057;
MOROSE_MERCHANT = 1001058;
NARROW_EYED_ADVENTURER = 1001059;
BEAMING_ADVENTURER = 1001062;
WELL_BUNDLED_ADVENTURER = 1001060;
UNCONCERNED_PASSERBY = 1001648; -- I don't think this was used?
-- Quest Markers
MRKR_MIOUNNE = 11000601;
-- Quest Items
ITEM_VELODYNA_COSMOS = 0; -- Seq_000 : 2nd journal arg. >=5 doesn't have.
-- Quest Flags
FLAG_SEQ000 = 0;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
-- Immediately move to the Adventurer's Guild private area
callClientFunction(player, "delegateEvent", player, quest, "processEvent100");
GetWorldManager():DoZoneChange(player, 155, "PrivateAreaMasterPast", 2, 15, 67.034, 4, -1205.6497, -1.074);
player:endEvent();
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_000) then
-- Setup states incase we loaded in.
--SetENpc(classId, byte flagType=0,isTalkEnabled, isPushEnabled, isEmoteEnabled, isSpawned)
quest:SetENpc(MIOUNNE, QFLAG_PLATE);
-- quest:SetENpc(VKOROLON);
quest:SetENpc(WISPILY_WHISKERED_WOODWORKER);
quest:SetENpc(AMIABLE_ADVENTURER);
quest:SetENpc(MOROSE_MERCHANT);
quest:SetENpc(NARROW_EYED_ADVENTURER);
quest:SetENpc(BEAMING_ADVENTURER);
quest:SetENpc(WELL_BUNDLED_ADVENTURER);
quest:SetENpc(UNCONCERNED_PASSERBY);
elseif (sequence == SEQ_005) then
quest:SetENpc(MIOUNNE);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_000) then
seq000_onTalk(player, quest, npc, classId);
elseif (sequence == SEQ_005) then
seq005_onTalk(player, quest, npc, classId);
end
quest:UpdateENPCs();
end
function onPush(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
player:SendMessage(0x20, "", "Sequence: "..sequence.." Class Id: "..classId);
if (sequence == SEQ_000) then
elseif (sequence == SEQ_010) then
end
quest:UpdateENPCs();
end
function onNotice(player, quest, target)
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_1"); -- Describes what an Instance is
player:EndEvent();
quest:UpdateENPCs();
end
function seq000_onTalk(player, quest, npc, classId)
if (classId == MOMODI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010");
player:EndEvent();
quest:StartSequence(SEQ_005);
GetWorldManager():DoZoneChange(player, 175, nil, 0, 15, player.positionX, player.positionY, player.positionZ, player.rotation);
return;
elseif (classId == BEAMING_ADVENTURER) then
callClientFunction (player, "delegateEvent", player, quest, "processEvent100_6");
elseif (classId == AMIABLE_ADVENTURER) then
callClientFunction (player, "delegateEvent", player, quest, "processEvent100_3");
elseif (classId == MOROSE_MERCHANT) then
callClientFunction (player, "delegateEvent", player, quest, "processEvent100_2");
elseif (classId == NARROW_EYED_ADVENTURER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent100_7");
elseif (classId == UNCONCERNED_PASSERBY) then
callClientFunction(player, "delegateEvent", player, quest, "processTtrBlkNml001"); --"processEvent100_9");
elseif (classId == VKOROLON) then
callClientFunction(player, "delegateEvent", player, quest, "defaultTalkWithVkorolon_001");
elseif (classId == WELL_BUNDLED_ADVENTURER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent100_4");
elseif (classId == WISPILY_WHISKERED_WOODWORKER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent100_8");
elseif (classId == MIOUNNE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent110");
player:EndEvent();
quest:StartSequence(SEQ_005);
GetWorldManager():DoZoneChange(player, 155, nil, 0, 15, player.positionX, player.positionY, player.positionZ, player.rotation);
end
player:EndEvent();
end
function seq005_onTalk(player, quest, npc, classId)
if (classId == MOMODI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010_2");
end
player:EndEvent();
end
function getJournalInformation(player, quest)
return 0, ITEM_VELODYNA_COSMOS, ITEM_COLISEUM_PASS;
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local possibleMarkers = {};
if (sequence == SEQ_000) then
table.insert(possibleMarkers, MRKR_MIOUNNE);
elseif (sequence == SEQ_010) then
end
return unpack(possibleMarkers)
end