mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system
# Conflicts: # Data/scripts/player.lua - Resolved. Using theirs.
This commit is contained in:
commit
fac8f269e7
23
Data/scripts/commands/gm/menuman.lua
Normal file
23
Data/scripts/commands/gm/menuman.lua
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
require("global");
|
||||||
|
|
||||||
|
properties = {
|
||||||
|
permissions = 0,
|
||||||
|
parameters = "d",
|
||||||
|
description = "Spawns the menuman",
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTrigger(player, argc)
|
||||||
|
|
||||||
|
local pos = player:GetPos();
|
||||||
|
local x = pos[1];
|
||||||
|
local y = pos[2];
|
||||||
|
local z = pos[3];
|
||||||
|
local rot = pos[4];
|
||||||
|
|
||||||
|
local actor = player.CurrentArea:SpawnActor(9114437, "menuman", x, y, z, rot, 0, 0);
|
||||||
|
|
||||||
|
if (actor == nil) then
|
||||||
|
player:SendMessage(0x20, "", "This actor class id cannot be spawned.");
|
||||||
|
end
|
||||||
|
|
||||||
|
end;
|
@ -7,13 +7,13 @@ function onBeginLogin(player)
|
|||||||
if (player:GetPlayTime(false) == 0) then
|
if (player:GetPlayTime(false) == 0) then
|
||||||
initialTown = player:GetInitialTown();
|
initialTown = player:GetInitialTown();
|
||||||
if (initialTown == 1 and player:HasQuest(110001) == false) then
|
if (initialTown == 1 and player:HasQuest(110001) == false) then
|
||||||
--player:AddQuest(110001);
|
player:AddQuest(110001);
|
||||||
player:SetHomePoint(1280001);
|
player:SetHomePoint(1280001);
|
||||||
elseif (initialTown == 2 and player:HasQuest(110005) == false) then
|
elseif (initialTown == 2 and player:HasQuest(110005) == false) then
|
||||||
--player:AddQuest(110005);
|
--player:AddQuest(110005);
|
||||||
player:SetHomePoint(1280061);
|
player:SetHomePoint(1280061);
|
||||||
elseif (initialTown == 3 and player:HasQuest(110009) == false) then
|
elseif (initialTown == 3 and player:HasQuest(110009) == false) then
|
||||||
player:AddQuest(110009);
|
--player:AddQuest(110009);
|
||||||
player:SetHomePoint(1280031);
|
player:SetHomePoint(1280031);
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ function onBeginLogin(player)
|
|||||||
player.positionY = 10.35;
|
player.positionY = 10.35;
|
||||||
player.positionZ = -36.91;
|
player.positionZ = -36.91;
|
||||||
player.rotation = 0.025;
|
player.rotation = 0.025;
|
||||||
player:GetQuest(110001):ClearData();
|
player:GetQuest(110001):GetData():ClearData();
|
||||||
elseif (player:HasQuest(110005) == true and player.CurrentArea.ZoneId == 166) then
|
elseif (player:HasQuest(110005) == true and player.CurrentArea.ZoneId == 166) then
|
||||||
director = player.CurrentArea:CreateDirector("OpeningDirector", false);
|
director = player.CurrentArea:CreateDirector("OpeningDirector", false);
|
||||||
player:AddDirector(director);
|
player:AddDirector(director);
|
||||||
@ -43,8 +43,7 @@ function onBeginLogin(player)
|
|||||||
player.positionY = 4.21;
|
player.positionY = 4.21;
|
||||||
player.positionZ = -706.1074;
|
player.positionZ = -706.1074;
|
||||||
player.rotation = -1.26721;
|
player.rotation = -1.26721;
|
||||||
player:GetQuest(110005):ClearQuestData();
|
player:GetQuest(110005):GetData():ClearData();
|
||||||
player:GetQuest(110005):ClearQuestFlags();
|
|
||||||
elseif (player:HasQuest(110009) == true and player.CurrentArea.ZoneId == 184) then
|
elseif (player:HasQuest(110009) == true and player.CurrentArea.ZoneId == 184) then
|
||||||
director = player.CurrentArea:CreateDirector("OpeningDirector", false);
|
director = player.CurrentArea:CreateDirector("OpeningDirector", false);
|
||||||
player:AddDirector(director);
|
player:AddDirector(director);
|
||||||
@ -56,15 +55,7 @@ function onBeginLogin(player)
|
|||||||
player.positionY = 196.0;
|
player.positionY = 196.0;
|
||||||
player.positionZ = 133.6561;
|
player.positionZ = 133.6561;
|
||||||
player.rotation = -2.849384;
|
player.rotation = -2.849384;
|
||||||
player:GetQuest(110009):ClearData();
|
player:GetQuest(110009):GetData():ClearData();
|
||||||
|
|
||||||
elseif (player:HasQuest(110009) == true and player.CurrentArea.ZoneId == 175) then
|
|
||||||
director = player.CurrentArea:CreateDirector("OpeningDirector", false);
|
|
||||||
player:AddDirector(director);
|
|
||||||
director:StartDirector(true);
|
|
||||||
player:SetLoginDirector(director);
|
|
||||||
player:KickEvent(director, "noticeEvent", true);
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -65,12 +65,14 @@ end
|
|||||||
function onStateChange(player, quest, sequence)
|
function onStateChange(player, quest, sequence)
|
||||||
if (sequence == SEQ_000) then
|
if (sequence == SEQ_000) then
|
||||||
-- Setup states incase we loaded in.
|
-- Setup states incase we loaded in.
|
||||||
local rostnsthalFlag = quest:GetFlag(FLAG_SEQ000_MINITUT1) and QFLAG_NONE or QFLAG_PLATE;
|
local data = quest:GetData();
|
||||||
local vixenFlag = quest:GetFlag(FLAG_SEQ000_MINITUT2) and QFLAG_NONE or QFLAG_PLATE;
|
|
||||||
local babyfaceFlag = quest:GetFlag(FLAG_SEQ000_MINITUT3) and QFLAG_NONE or QFLAG_PLATE;
|
local rostnsthalFlag = data:GetFlag(FLAG_SEQ000_MINITUT1) and QFLAG_NONE or QFLAG_PLATE;
|
||||||
local rostnsthalCanPush = not quest:GetFlag(FLAG_SEQ000_MINITUT0);
|
local vixenFlag = data:GetFlag(FLAG_SEQ000_MINITUT2) and QFLAG_NONE or QFLAG_PLATE;
|
||||||
local exitCanPush = quest:GetFlags() == 0xF;
|
local babyfaceFlag = data:GetFlag(FLAG_SEQ000_MINITUT3) and QFLAG_NONE or QFLAG_PLATE;
|
||||||
local exitFlag = quest:GetFlags() == 0xF and QFLAG_MAP or QFLAG_NONE;
|
local rostnsthalCanPush = not data:GetFlag(FLAG_SEQ000_MINITUT0);
|
||||||
|
local exitCanPush = data:GetFlags() == 0xF;
|
||||||
|
local exitFlag = data:GetFlags() == 0xF and QFLAG_MAP or QFLAG_NONE;
|
||||||
|
|
||||||
quest:SetENpc(WELLTRAVELED_MERCHANT);
|
quest:SetENpc(WELLTRAVELED_MERCHANT);
|
||||||
quest:SetENpc(TIPSY_ADVENTURER);
|
quest:SetENpc(TIPSY_ADVENTURER);
|
||||||
@ -88,9 +90,10 @@ function onStateChange(player, quest, sequence)
|
|||||||
quest:SetENpc(GRINNING_ADVENTURER);
|
quest:SetENpc(GRINNING_ADVENTURER);
|
||||||
quest:SetENpc(ROSTNSTHAL, rostnsthalFlag, true, rostnsthalCanPush);
|
quest:SetENpc(ROSTNSTHAL, rostnsthalFlag, true, rostnsthalCanPush);
|
||||||
quest:SetENpc(EXIT_TRIGGER, exitFlag, false, exitCanPush);
|
quest:SetENpc(EXIT_TRIGGER, exitFlag, false, exitCanPush);
|
||||||
|
print(tostring(exitCanPush));
|
||||||
elseif (sequence == SEQ_005) then
|
elseif (sequence == SEQ_005) then
|
||||||
elseif (sequence == SEQ_010) then
|
elseif (sequence == SEQ_010) then
|
||||||
quest:SetENpc(HOB);
|
quest:SetENpc(HOB, QFLAG_PLATE);
|
||||||
quest:SetENpc(GERT);
|
quest:SetENpc(GERT);
|
||||||
quest:SetENpc(LORHZANT);
|
quest:SetENpc(LORHZANT);
|
||||||
quest:SetENpc(MUSCLEBOUND_DECKHAND);
|
quest:SetENpc(MUSCLEBOUND_DECKHAND);
|
||||||
@ -145,7 +148,6 @@ function onNotice(player, quest, target)
|
|||||||
local sequence = quest:getSequence();
|
local sequence = quest:getSequence();
|
||||||
|
|
||||||
if (sequence == SEQ_000) then
|
if (sequence == SEQ_000) then
|
||||||
quest:ClearData();
|
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal001withHQ");
|
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal001withHQ");
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -154,6 +156,8 @@ function onNotice(player, quest, target)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function seq000_onTalk(player, quest, npc, classId)
|
function seq000_onTalk(player, quest, npc, classId)
|
||||||
|
local data = quest:GetData();
|
||||||
|
|
||||||
if (classId == WELLTRAVELED_MERCHANT) then
|
if (classId == WELLTRAVELED_MERCHANT) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_4");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_4");
|
||||||
elseif (classId == TIPSY_ADVENTURER) then
|
elseif (classId == TIPSY_ADVENTURER) then
|
||||||
@ -163,9 +167,9 @@ function seq000_onTalk(player, quest, npc, classId)
|
|||||||
elseif (classId == ANXIOUS_ADVENTURER) then
|
elseif (classId == ANXIOUS_ADVENTURER) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_7");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_7");
|
||||||
elseif (classId == BABYFACED_ADVENTURER) then
|
elseif (classId == BABYFACED_ADVENTURER) then
|
||||||
if (not quest:GetFlag(FLAG_SEQ000_MINITUT3)) then
|
if (not data:GetFlag(FLAG_SEQ000_MINITUT3)) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini003");
|
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini003");
|
||||||
quest:SetFlag(FLAG_SEQ000_MINITUT3);
|
data:SetFlag(FLAG_SEQ000_MINITUT3);
|
||||||
else
|
else
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_8");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_8");
|
||||||
end
|
end
|
||||||
@ -178,9 +182,9 @@ function seq000_onTalk(player, quest, npc, classId)
|
|||||||
elseif (classId == ASTUTE_MERCHANT) then
|
elseif (classId == ASTUTE_MERCHANT) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_12");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_12");
|
||||||
elseif (classId == VOLUPTUOUS_VIXEN) then
|
elseif (classId == VOLUPTUOUS_VIXEN) then
|
||||||
if (not quest:GetFlag(FLAG_SEQ000_MINITUT2)) then
|
if (not data:GetFlag(FLAG_SEQ000_MINITUT2)) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini002");
|
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini002");
|
||||||
quest:SetFlag(FLAG_SEQ000_MINITUT2);
|
data:SetFlag(FLAG_SEQ000_MINITUT2);
|
||||||
else
|
else
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_13");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_13");
|
||||||
end
|
end
|
||||||
@ -194,13 +198,13 @@ function seq000_onTalk(player, quest, npc, classId)
|
|||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_17");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_17");
|
||||||
elseif (classId == ROSTNSTHAL) then
|
elseif (classId == ROSTNSTHAL) then
|
||||||
-- Handle the talk tutorial after the push one.
|
-- Handle the talk tutorial after the push one.
|
||||||
if (not quest:GetFlag(FLAG_SEQ000_MINITUT0)) then
|
if (not data:GetFlag(FLAG_SEQ000_MINITUT0)) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal003");
|
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal003");
|
||||||
quest:SetFlag(FLAG_SEQ000_MINITUT0);
|
data:SetFlag(FLAG_SEQ000_MINITUT0);
|
||||||
else
|
else
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini001");
|
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini001");
|
||||||
if (not quest:GetFlag(FLAG_SEQ000_MINITUT1)) then
|
if (not data:GetFlag(FLAG_SEQ000_MINITUT1)) then
|
||||||
quest:SetFlag(FLAG_SEQ000_MINITUT1);
|
data:SetFlag(FLAG_SEQ000_MINITUT1);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -209,6 +213,8 @@ function seq000_onTalk(player, quest, npc, classId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function seq010_onTalk(player, quest, npc, classId)
|
function seq010_onTalk(player, quest, npc, classId)
|
||||||
|
local data = quest:GetData();
|
||||||
|
|
||||||
if (classId == MUSCLEBOUND_DECKHAND) then
|
if (classId == MUSCLEBOUND_DECKHAND) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_2");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_2");
|
||||||
elseif (classId == PEARLYTOOTHED_PORTER) then
|
elseif (classId == PEARLYTOOTHED_PORTER) then
|
||||||
|
@ -86,6 +86,7 @@ function onFinish(player, quest)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function onStateChange(player, quest, sequence)
|
function onStateChange(player, quest, sequence)
|
||||||
|
local data = quest:GetData();
|
||||||
|
|
||||||
if (sequence == SEQ_000) then
|
if (sequence == SEQ_000) then
|
||||||
quest:SetENpc(YSHTOLA);
|
quest:SetENpc(YSHTOLA);
|
||||||
@ -107,8 +108,8 @@ function onStateChange(player, quest, sequence)
|
|||||||
elseif (sequence == SEQ_006) then
|
elseif (sequence == SEQ_006) then
|
||||||
quest:SetENpc(BADERON, QFLAG_PLATE);
|
quest:SetENpc(BADERON, QFLAG_PLATE);
|
||||||
elseif (sequence == SEQ_007) then
|
elseif (sequence == SEQ_007) then
|
||||||
local subseqCUL = quest:GetCounter(CNTR_SEQ7_CUL);
|
local subseqCUL = data:GetCounter(CNTR_SEQ7_CUL);
|
||||||
local subseqMRD = quest:GetCounter(CNTR_SEQ7_MRD);
|
local subseqMRD = data:GetCounter(CNTR_SEQ7_MRD);
|
||||||
|
|
||||||
-- Always active in this seqence
|
-- Always active in this seqence
|
||||||
quest:SetENpc(BADERON);
|
quest:SetENpc(BADERON);
|
||||||
@ -220,8 +221,9 @@ function seq000_onTalk(player, quest, npc, classId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function seq007_onTalk(player, quest, npc, classId)
|
function seq007_onTalk(player, quest, npc, classId)
|
||||||
local subseqCUL = quest:GetCounter(CNTR_SEQ7_CUL);
|
local data = quest:GetData();
|
||||||
local subseqMRD = quest:GetCounter(CNTR_SEQ7_MRD);
|
local subseqCUL = data:GetCounter(CNTR_SEQ7_CUL);
|
||||||
|
local subseqMRD = data:GetCounter(CNTR_SEQ7_MRD);
|
||||||
|
|
||||||
if (classId == BADERON) then
|
if (classId == BADERON) then
|
||||||
if (subseqCUL == 1) then
|
if (subseqCUL == 1) then
|
||||||
@ -234,7 +236,7 @@ function seq007_onTalk(player, quest, npc, classId)
|
|||||||
elseif (classId == CHARLYS) then
|
elseif (classId == CHARLYS) then
|
||||||
if (subseqCUL == 0) then
|
if (subseqCUL == 0) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent030");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent030");
|
||||||
quest:IncCounter(CNTR_SEQ7_CUL);
|
data:IncCounter(CNTR_SEQ7_CUL);
|
||||||
--give 1000g
|
--give 1000g
|
||||||
else
|
else
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent030_2");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent030_2");
|
||||||
@ -242,11 +244,11 @@ function seq007_onTalk(player, quest, npc, classId)
|
|||||||
elseif (classId == ISANDOREL) then
|
elseif (classId == ISANDOREL) then
|
||||||
if (subseqMRD == 2) then
|
if (subseqMRD == 2) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent050");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent050");
|
||||||
quest:IncCounter(CNTR_SEQ7_MRD);
|
data:IncCounter(CNTR_SEQ7_MRD);
|
||||||
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 3);
|
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 3);
|
||||||
elseif (subseqMRD == 0) then
|
elseif (subseqMRD == 0) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent035");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent035");
|
||||||
quest:IncCounter(CNTR_SEQ7_MRD);
|
data:IncCounter(CNTR_SEQ7_MRD);
|
||||||
elseif (subseqMRD == 1) then
|
elseif (subseqMRD == 1) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent035_2");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent035_2");
|
||||||
end
|
end
|
||||||
@ -278,19 +280,20 @@ function seq007_onTalk(player, quest, npc, classId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function onPush(player, quest, npc)
|
function onPush(player, quest, npc)
|
||||||
|
local data = quest:GetData();
|
||||||
local sequence = quest:getSequence();
|
local sequence = quest:getSequence();
|
||||||
local classId = npc:GetActorClassId();
|
local classId = npc:GetActorClassId();
|
||||||
|
|
||||||
if (sequence == SEQ_007) then
|
if (sequence == SEQ_007) then
|
||||||
if (classId == MSK_TRIGGER) then
|
if (classId == MSK_TRIGGER) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent040");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent040");
|
||||||
quest:IncCounter(CNTR_SEQ7_MRD);
|
data:IncCounter(CNTR_SEQ7_MRD);
|
||||||
player:EndEvent();
|
player:EndEvent();
|
||||||
quest:UpdateENPCs();
|
quest:UpdateENPCs();
|
||||||
GetWorldManager():DoZoneChange(player, 230, nil, 0, 15, -620.0, 29.476, -70.050, 0.791);
|
GetWorldManager():DoZoneChange(player, 230, nil, 0, 15, -620.0, 29.476, -70.050, 0.791);
|
||||||
elseif (classId == ECHO_EXIT_TRIGGER) then
|
elseif (classId == ECHO_EXIT_TRIGGER) then
|
||||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent060");
|
callClientFunction(player, "delegateEvent", player, quest, "processEvent060");
|
||||||
quest:IncCounter(CNTR_SEQ7_MRD);
|
data:IncCounter(CNTR_SEQ7_MRD);
|
||||||
player:EndEvent();
|
player:EndEvent();
|
||||||
quest:UpdateENPCs();
|
quest:UpdateENPCs();
|
||||||
GetWorldManager():WarpToPublicArea(player);
|
GetWorldManager():WarpToPublicArea(player);
|
||||||
@ -327,7 +330,7 @@ function onNpcLS(player, quest, npcLSId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function getJournalInformation(player, quest)
|
function getJournalInformation(player, quest)
|
||||||
return 0, quest:GetCounter(CNTR_SEQ7_CUL) * 5, quest:GetCounter(CNTR_SEQ7_MRD) * 5;
|
return 0, quest:GetData():GetCounter(CNTR_SEQ7_CUL) * 5, quest:GetData():GetCounter(CNTR_SEQ7_MRD) * 5;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ function onFinish(player, quest)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function onStateChange(player, quest, seqNum)
|
function onStateChange(player, quest, seqNum)
|
||||||
quest:ClearENpcs();
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function onTalk(player, quest, npc)
|
function onTalk(player, quest, npc)
|
||||||
|
@ -1487,17 +1487,18 @@ namespace Meteor.Map.Actors
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replace a quest with another quest in the player's quest state.
|
// Replace a quest with another quest in the player's quest state.
|
||||||
public void ReplaceQuest(Quest oldQuestInstance, Quest newQuestInstance)
|
public void ReplaceQuest(Quest oldQuestInstance, string questName)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < questScenario.Length; i++)
|
for (int i = 0; i < questScenario.Length; i++)
|
||||||
{
|
{
|
||||||
if (questScenario[i] != null && questScenario[i].Equals(oldQuestInstance))
|
if (questScenario[i] != null && questScenario[i].Equals(oldQuestInstance))
|
||||||
{
|
{
|
||||||
questScenario[i] = newQuestInstance;
|
|
||||||
playerWork.questScenario[i] = questScenario[i].Id;
|
|
||||||
SendQuestClientUpdate(i);
|
SendQuestClientUpdate(i);
|
||||||
oldQuestInstance.OnComplete();
|
oldQuestInstance.OnComplete();
|
||||||
questStateManager.UpdateQuestCompleted(oldQuestInstance);
|
questStateManager.UpdateQuestCompleted(oldQuestInstance);
|
||||||
|
Quest newQuestInstance = questStateManager.GetActiveQuest(((Quest)Server.GetStaticActors(questName)).GetQuestId());
|
||||||
|
questScenario[i] = newQuestInstance;
|
||||||
|
playerWork.questScenario[i] = questScenario[i].Id;
|
||||||
newQuestInstance.OnAccept();
|
newQuestInstance.OnAccept();
|
||||||
Database.SaveQuest(this, questScenario[i], i);
|
Database.SaveQuest(this, questScenario[i], i);
|
||||||
break;
|
break;
|
||||||
|
@ -58,6 +58,16 @@ namespace Meteor.Map.Actors.QuestNS
|
|||||||
questState.UpdateState();
|
questState.UpdateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Creates a Instance Quest that has been started with data.
|
||||||
|
public Quest(Player owner, Quest staticQuest, ushort sequence, uint flags, ushort counter1, ushort counter2, ushort counter3, ushort counter4) : this(staticQuest)
|
||||||
|
{
|
||||||
|
this.owner = owner;
|
||||||
|
currentSequence = sequence;
|
||||||
|
data = new QuestData(owner, this, flags, counter1, counter2, counter3, counter4);
|
||||||
|
questState = new QuestState(owner, this);
|
||||||
|
questState.UpdateState();
|
||||||
|
}
|
||||||
|
|
||||||
// Creates a Instance Quest that has not been started.
|
// Creates a Instance Quest that has not been started.
|
||||||
public Quest(Player owner, Quest staticQuest) : this(owner, staticQuest, SEQ_NOT_STARTED)
|
public Quest(Player owner, Quest staticQuest) : this(owner, staticQuest, SEQ_NOT_STARTED)
|
||||||
{ }
|
{ }
|
||||||
@ -98,10 +108,6 @@ namespace Meteor.Map.Actors.QuestNS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Quest Data
|
#region Quest Data
|
||||||
public void SetData(uint flags, ushort counter1, ushort counter2, ushort counter3, ushort counter4)
|
|
||||||
{
|
|
||||||
data = new QuestData(owner, this, flags, counter1, counter2, counter3, counter4);
|
|
||||||
}
|
|
||||||
|
|
||||||
public QuestData GetData()
|
public QuestData GetData()
|
||||||
{
|
{
|
||||||
|
@ -1235,10 +1235,8 @@ namespace Meteor.Map
|
|||||||
//ushort counter4 = reader.GetUInt16("counter4");
|
//ushort counter4 = reader.GetUInt16("counter4");
|
||||||
|
|
||||||
Quest baseQuest = (Quest) Server.GetStaticActors(questId);
|
Quest baseQuest = (Quest) Server.GetStaticActors(questId);
|
||||||
|
|
||||||
player.playerWork.questScenario[index] = questId;
|
player.playerWork.questScenario[index] = questId;
|
||||||
player.questScenario[index] = new Quest(player, baseQuest, sequence);
|
player.questScenario[index] = new Quest(player, baseQuest, sequence, flags, counter1, counter2, counter3, 0);
|
||||||
player.questScenario[index].SetData(flags, counter1, counter2, counter3, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user