1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-23 13:17:45 +00:00

Added Tug of the Whorl. Fixed up prereqs not working when using debug command. Fixed giveexp command. Added seq constants.

This commit is contained in:
Filip Maj 2022-02-23 23:10:11 -05:00
parent 5c49563790
commit 90115f7c83
11 changed files with 435 additions and 15 deletions

View file

@ -26,8 +26,8 @@ function onTrigger(player, argc, qty, name, lastName)
currency = 1000001;
qty = tonumber(qty) or 1;
location = INVENTORY_CURRENCY;
actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[0], 0);
print("ASDASDASDASDASD");
actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[1], 0);
player:DoBattleAction(0, 0, actionList);
else
print(sender.."unable to add experience, ensure player name is valid.");

View file

@ -0,0 +1,37 @@
require ("global")
require ("quests/man/man0l1")
function init()
return "/Director/Quest/QuestDirectorMan0l101";
end
function onCreateContentArea(players, director, contentArea, contentGroup)
sisipu = contentArea:SpawnActor(2290007, "sisipu", -8, 16.35, 6, 0.5);
mob1 = contentArea:SpawnActor(2205403, "mob1", -3.02+3, 17.35, 14.24, -2.81);
mob2 = contentArea:SpawnActor(2205403, "mob2", -3.02, 17.35, 14.24, -2.81);
mob3 = contentArea:SpawnActor(2205403, "mob3", -3.02-3, 17.35, 14.24, -2.81);
for _, player in pairs(players) do
contentGroup:AddMember(player);
end;
contentGroup:AddMember(director);
contentGroup:AddMember(yshtola);
contentGroup:AddMember(stahlmann);
contentGroup:AddMember(mob1);
contentGroup:AddMember(mob2);
contentGroup:AddMember(mob3);
end
function onEventStarted(player, director, triggerName)
local man0l1Quest = player:GetQuest("Man0l1");
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent604");
player:EndEvent();
end

View file

@ -159,6 +159,10 @@ QFLAG_PLATE = 2;
QFLAG_MAP = 3;
QFLAG_REWARD = 4;
-- SPECIAL SEQUENCE CONSTANTS
SEQ_ACCEPT = 65535;
SEQ_COMPLETE = 65534;
-- MUSIC
MUSIC_IMMEDIATE = 1;
MUSIC_CROSSFADE = 2;

View file

@ -49,7 +49,7 @@ function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == 65535) then
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(KINNISON, QFLAG_PLATE);
end

View file

@ -0,0 +1,181 @@
require ("global")
--[[
Quest Script
Name: The Tug of the Whorl
Code: Etc3l0
Id: 110653
Prereq: Level 5, Any Class
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to all the citizens.
SEQ_001 = 1; -- Return to Ginnade.
-- Actor Class Ids
GINNADE = 1000132;
ZONGGO = 1000057;
WHAHTOA = 1000475;
FERDILLAIX = 1000344;
FRAILOISE = 1000065;
ARNEGIS = 1000227;
-- Quest Markers
MRKR_ZONGGO = 11070001
MRKR_WHAHTOA = 11070002
MRKR_FERDILLAIX = 11070003
MRKR_FRAILOISE = 11070004
MRKR_ARNEGIS = 11070005
MRKR_GINNADE = 11070006
-- Quest Flags
FLAG_TALKED_ZONGGO = 0;
FLAG_TALKED_WHAHTOA = 1;
FLAG_TALKED_FERDILLAIX = 2;
FLAG_TALKED_FRAILOISE = 3;
FLAG_TALKED_ARNEGIS = 4;
-- Quest Counters
COUNTER_TALKED = 0;
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(GINNADE, QFLAG_NORM);
end
local data = quest:GetData();
if (sequence == SEQ_000) then
quest:SetENpc(GINNADE);
quest:SetENpc(ZONGGO, (not data:GetFlag(FLAG_TALKED_ZONGGO) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(WHAHTOA, (not data:GetFlag(FLAG_TALKED_WHAHTOA) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(FERDILLAIX, (not data:GetFlag(FLAG_TALKED_FERDILLAIX) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(FRAILOISE, (not data:GetFlag(FLAG_TALKED_FRAILOISE) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(ARNEGIS, (not data:GetFlag(FLAG_TALKED_ARNEGIS) and QFLAG_NORM or QFLAG_NONE));
elseif (sequence == SEQ_001) then
quest:SetENpc(GINNADE, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
local incCounter = false;
-- Offer the quest
if (npcClassId == GINNADE and not player:HasQuest(quest)) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventGinnadeStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
end
-- Quest Progress
local data = quest:GetData();
if (seq == SEQ_000) then
if (npcClassId == GINNADE) then
callClientFunction(player, "delegateEvent", player, quest, "followEvent005");
elseif (npcClassId == ZONGGO) then
if (not data:GetFlag(FLAG_TALKED_ZONGGO)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010");
data:SetFlag(FLAG_TALKED_ZONGGO);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent010");
end
elseif (npcClassId == WHAHTOA) then
if (not data:GetFlag(FLAG_TALKED_WHAHTOA)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020");
data:SetFlag(FLAG_TALKED_WHAHTOA);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent020");
end
elseif (npcClassId == FERDILLAIX) then
if (not data:GetFlag(FLAG_TALKED_FERDILLAIX)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent030");
data:SetFlag(FLAG_TALKED_FERDILLAIX);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent030");
end
elseif (npcClassId == FRAILOISE) then
if (not data:GetFlag(FLAG_TALKED_FRAILOISE)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent040");
data:SetFlag(FLAG_TALKED_FRAILOISE);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent040");
end
elseif (npcClassId == ARNEGIS) then
if (not data:GetFlag(FLAG_TALKED_ARNEGIS)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050");
data:SetFlag(FLAG_TALKED_ARNEGIS);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent050");
end
end
-- Increase objective counter & play relevant messages
if (incCounter == true) then
local counterAmount = data:IncCounter(COUNTER_TALKED);
attentionMessage(player, 51060, 0, counterAmount, 5); -- You have spoken with a Barracuda informant. (... of 5)
if (seq000_checkCondition(data)) then -- All informants spoken to
attentionMessage(player, 25225, quest.GetQuestId()); -- "The Tug of the Whorl" objectives complete!
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
quest:StartSequence(SEQ_001);
end
end
elseif (seq == SEQ_001) then
--Quest Complete
if (npcClassId == GINNADE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent060");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- Check if all informants are talked to
function seq000_checkCondition(data)
return (data:GetFlag(FLAG_TALKED_ZONGGO) and
data:GetFlag(FLAG_TALKED_WHAHTOA) and
data:GetFlag(FLAG_TALKED_FERDILLAIX) and
data:GetFlag(FLAG_TALKED_FRAILOISE) and
data:GetFlag(FLAG_TALKED_ARNEGIS));
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local data = quest:GetData();
local possibleMarkers = {};
if (sequence == SEQ_000) then
if (not data:GetFlag(FLAG_TALKED_ZONGGO)) then table.insert(possibleMarkers, MRKR_ZONGGO); end
if (not data:GetFlag(FLAG_TALKED_WHAHTOA)) then table.insert(possibleMarkers, MRKR_WHAHTOA); end
if (not data:GetFlag(FLAG_TALKED_FERDILLAIX)) then table.insert(possibleMarkers, MRKR_FERDILLAIX); end
if (not data:GetFlag(FLAG_TALKED_FRAILOISE)) then table.insert(possibleMarkers, MRKR_FRAILOISE); end
if (not data:GetFlag(FLAG_TALKED_ARNEGIS)) then table.insert(possibleMarkers, MRKR_ARNEGIS); end
elseif (sequence == SEQ_001) then
table.insert(possibleMarkers, MRKR_GINNADE);
end
return unpack(possibleMarkers)
end

View file

@ -27,10 +27,7 @@ ITEM_WELL_WORN_BAG = 11000224;
MRKR_PFARAHR = 11082001;
MRKR_VKOROLON = 11082002;
function onStart(player, quest)
-- processEventVKOROLONStart -- No means of properly accepting quests yet
quest:StartSequence(SEQ_000);
player:SendGameMessage(GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM, ITEM_WELL_WORN_BAG, 1);
end
@ -38,9 +35,11 @@ end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(VKOROLON, QFLAG_PLATE);
end
if (sequence == SEQ_000) then
quest:SetENpc(VKOROLON);
quest:SetENpc(PFARAHR, QFLAG_PLATE);
@ -54,6 +53,10 @@ function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_ACCEPT) then
callClientFunction(player, "delegateEvent", player, quest, "processEventVKOROLONStart");
end
if (sequence == SEQ_000) then
if (classId == VKOROLON) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1");

View file

@ -26,13 +26,14 @@ SEQ_055 = 55; -- Search lighthouse for corpse
SEQ_060 = 60; -- Talk to Sisipu
SEQ_065 = 65; -- Return to FSH Guild
SEQ_070 = 70; -- Contact Baderon on LS
SEQ_075 = 75; -- Go to the ARM and BSM Guilds.
SEQ_075 = 75; -- Go to the ARM and BSM Guilds. Talk to Bodenolf.
SEQ_080 = 80; -- Speak with H'naanza
SEQ_085 = 85; -- Speak with Bodenolf
SEQ_090 = 90; -- Contact Baderon on LS
SEQ_092 = 92; -- Return to Baderon.
-- Actor Class Ids
-- Echo in Adv Guild
YSHTOLA = 1000001;
CRAPULOUS_ADVENTURER = 1000075;
DUPLICITOUS_TRADER = 1000076;
@ -46,13 +47,16 @@ COCKAHOOP_COCKSWAIN = 1001643;
SENTENIOUS_SELLSWORD = 1001649;
SOLICITOUS_SELLSWORD = 1001650;
-- Sequence 003
BEARDEDROCK_AETHERYTE = 1280002;
-- Sequence 007
CHARLYS = 1000138;
ISANDOREL = 1000152;
MERLZIRN = 1000472;
MSK_TRIGGER = 1090001;
-- Echo in Mrd Guild
NERVOUS_BARRACUDA = 1000096;
INTIMIDATING_BARRACUDA = 1000097;
OVEREAGER_BARRACUDA = 1000107;
@ -65,8 +69,24 @@ ADVENTURER2 = 1000870;
ADVENTURER3 = 1000871;
ECHO_EXIT_TRIGGER = 1090003;
-- FSH Guild
NNMULIKA = 1000153;
SISIPU = 1000155;
ZEPHYR_TRIGGER = 1900001;
-- Echo in the Bsm Guild
TATTOOED_PIRATE = 1000111;
IOFA = 1000135;
BODENOLF = 1000144;
HNAANZA = 1000145;
MIMIDOA = 1000176;
JOELLAUT = 1000163;
WERNER = 1000247;
HIHINE = 1000267;
TRINNE = 1000268;
ECHO_EXIT_TRIGGER2 = 1090001;
-- Quest Markers
MRKR_HOB = 11000202;
-- Quest Data
CNTR_SEQ7_CUL = 1;
@ -140,6 +160,32 @@ function onStateChange(player, quest, sequence)
if (subseqCUL == 1 and subseqMRD == 4) then
player:SetNpcLS(1, 1);
end
elseif (sequence == SEQ_035) then
quest:SetENpc(NNMULIKA, QFLAG_PLATE);
elseif (sequence == SEQ_048) then
quest:SetENpc(BADERON);
quest:SetENpc(ZEPHYR_TRIGGER);
elseif (sequence == SEQ_075) then
quest:SetENpc(BODENOLF, QFLAG_PLATE);
elseif (sequence == SEQ_080) then
quest:SetENpc(HNAANZA, QFLAG_PLATE);
quest:SetENpc(TATTOOED_PIRATE);
quest:SetENpc(IOFA);
quest:SetENpc(BODENOLF);
quest:SetENpc(MIMIDOA);
quest:SetENpc(JOELLAUT);
quest:SetENpc(WERNER);
quest:SetENpc(HIHINE);
quest:SetENpc(TRINNE);
elseif (sequence == SEQ_085) then
quest:SetENpc(HNAANZA);
quest:SetENpc(TATTOOED_PIRATE);
quest:SetENpc(WERNER);
quest:SetENpc(HIHINE);
quest:SetENpc(TRINNE);
quest:SetENpc(ECHO_EXIT_TRIGGER2, QFLAG_MAP, false, true);
elseif (sequence == SEQ_092) then
quest:SetENpc(BADERON, QFLAG_REWARD);
end
end
@ -158,17 +204,68 @@ function onTalk(player, quest, npc)
elseif (sequence == SEQ_005) then
if (classId == BADERON) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent026");
quest:StartSequence(SEQ_006);
player:EndEvent();
quest:StartSequence(SEQ_006);
end
elseif (sequence == SEQ_006) then
if (classId == BADERON) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent027");
quest:StartSequence(SEQ_007);
player:EndEvent();
player:SendGameMessage(GetWorldMaster(), 25117, 0x20, 11000125); -- You obtain Baderon's Recommendation
quest:StartSequence(SEQ_007);
end
elseif (sequence == SEQ_007) then
seq007_onTalk(player, quest, npc, classId);
elseif (sequence == SEQ_035) then
if (classId == NNMULIKA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent602");
callClientFunction(player, "delegateEvent", player, quest, "processEvent602_2");
callClientFunction(player, "delegateEvent", player, quest, "processEvent602_3");
callClientFunction(player, "delegateEvent", player, quest, "processEvent604");
--quest:StartSequence(SEQ_040);
player:EndEvent();
end
elseif (sequence == SEQ_040) then
elseif (sequence == SEQ_048) then
if (classId == BADERON) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent602_3");
player:EndEvent();
elseif (classId == ZEPHYR_TRIGGER) then
local startDuty = callClientFunction(player, "delegateEvent", player, quest, "processEvent602_3");
if (startDuty) then
end
player:EndEvent();
end
elseif (sequence == SEQ_075) then
if (classId == BODENOLF) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630");
player:EndEvent();
quest:StartSequence(SEQ_080);
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 4, -504.985, 42.490, 433.712, 2.35);
end
elseif (sequence == SEQ_080) then
if (classId == HNAANZA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent632");
player:EndEvent();
quest:StartSequence(SEQ_085);
else
seq080_085_onTalk(player, quest, npc, classId);
end
elseif (sequence == SEQ_085) then
if (classId == HNAANZA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent632_2");
else
seq080_085_onTalk(player, quest, npc, classId);
end
elseif (sequence == SEQ_092) then
if (classId == BADERON) then
callClientFunction(player, "delegateEvent", player, quest, "processEventComplete");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 300, 1, 1, 2);
player:EndEvent();
player:CompleteQuest(quest);
return;
end
end
quest:UpdateENPCs();
@ -279,6 +376,27 @@ function seq007_onTalk(player, quest, npc, classId)
player:EndEvent();
end
function seq080_085_onTalk(player, quest, npc, classId)
if (classId == IOFA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630_2");
elseif (classId == TRINNE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630_3");
elseif (classId == HIHINE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630_4");
elseif (classId == MIMIDOA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630_5");
elseif (classId == WERNER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630_6");
elseif (classId == TATTOOED_PIRATE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630_7");
elseif (classId == JOELLAUT) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630_8");
elseif (classId == BODENOLF) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent630_9");
end
player:EndEvent();
end
function onPush(player, quest, npc)
local data = quest:GetData();
local sequence = quest:getSequence();
@ -298,9 +416,33 @@ function onPush(player, quest, npc)
quest:UpdateENPCs();
GetWorldManager():WarpToPublicArea(player);
end
elseif (sequence == SEQ_048) then
if (classId == ZEPHYR_TRIGGER) then
local result = callClientFunction(player, "delegateEvent", player, quest, "contentsJoinAskInBasaClass");
if (result == 1) then
startMan0l1Content(player, quest);
return;
end
end
elseif (sequence == SEQ_085) then
if (classId == ECHO_EXIT_TRIGGER2) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent635");
player:EndEvent();
quest:UpdateENPCs();
GetWorldManager():WarpToPublicArea(player);
end
end
end
function onEmote(player, quest, npc, emoteId)
local sequence = quest:getSequence();
if (sequence == SEQ_040) then
end
quest:UpdateENPCs();
end
function onNotice(player, quest, target)
local sequence = quest:getSequence();
@ -329,6 +471,25 @@ function onNpcLS(player, quest, npcLSId)
end
end
function startMan0l1Content(player, quest)
quest:StartSequence(SEQ_050);
local contentArea = player.CurrentArea:CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "Man0l101", "SimpleContent30002", "Quest/QuestDirectorMan0l101");
if (contentArea == nil) then
return;
end
local director = contentArea:GetContentDirector();
player:AddDirector(director);
director:StartDirector(false);
player:KickEvent(director, "noticeEvent", true);
player:SetLoginDirector(director);
GetWorldManager():DoZoneChangeContent(player, contentArea, -5, 16.35, 6, 0.5, 16);
end
function getJournalInformation(player, quest)
return 0, quest:GetData():GetCounter(CNTR_SEQ7_CUL) * 5, quest:GetData():GetCounter(CNTR_SEQ7_MRD) * 5;
end

View file

@ -1476,7 +1476,9 @@ namespace Meteor.Map.Actors
if (!isSilent)
{
SendGameMessage(Server.GetWorldManager().GetActor(), 25224, 0x20, (object)questScenario[freeSlot].GetQuestId()); // "<Quest> accepted."
WorldMaster worldMaster = Server.GetWorldManager().GetActor();
SendDataPacket("attention", worldMaster, "", 25224, (object)questScenario[freeSlot].GetQuestId()); // "<Quest> accepted."
SendGameMessage(worldMaster, 25224, 0x20, (object)questScenario[freeSlot].GetQuestId()); // "<Quest> accepted."
}
instance.OnAccept();

View file

@ -172,6 +172,14 @@ namespace Meteor.Map.Actors.QuestNS
CompletedQuestsBitfield.Set(questId - SCENARIO_START);
else
CompletedQuestsBitfield.Clear(questId - SCENARIO_START);
QuestGameData[] updated = Server.GetQuestGamedataByPrerequisite(questId);
foreach (var questData in updated)
{
if (flag)
PrereqBitfield.Set(questData.Id - SCENARIO_START);
else
PrereqBitfield.Clear(questData.Id - SCENARIO_START);
}
ComputeAvailable();
}
}

View file

@ -409,11 +409,11 @@ namespace Meteor.Map
private static void AddToList(object o, List<LuaParam> luaParams)
{
if (o is int)
if (o is int || o is short)
{
luaParams.Add(new LuaParam(0x0, (int)o));
}
else if (o is uint)
else if (o is uint || o is ushort)
{
luaParams.Add(new LuaParam(0x1, (uint)o));
}

View file

@ -933,6 +933,30 @@ namespace Meteor.Map
DoZoneChange(player, player.CurrentArea.ZoneId, null, 0, 15, x, y, z, rotation);
}
public void WarpToPosition(Player player, float x, float y, float z, float rotation)
{
//Remove player from currentZone if transfer else it's login
if (player.CurrentArea != null)
{
player.playerSession.LockUpdates(true);
player.CurrentArea.RemoveActorFromZone(player);
player.CurrentArea.AddActorToZone(player);
//Update player actor's properties;
player.positionX = x;
player.positionY = y;
player.positionZ = z;
player.rotation = rotation;
//Send packets
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.Id, 0x10));
player.playerSession.QueuePacket(player.CreateSpawnTeleportPacket(0));
player.playerSession.LockUpdates(false);
player.SendInstanceUpdate();
}
}
//Moves actor to new zone, and sends packets to spawn at the given coords.
public void DoZoneChangeContent(Player player, PrivateAreaContent contentArea, float spawnX, float spawnY, float spawnZ, float spawnRotation, ushort spawnType = SetActorPositionPacket.SPAWNTYPE_WARP_DUTY)
{