mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-10 06:24:38 +02:00
Added debug script for setting quest completion
This commit is contained in:
parent
c677479a03
commit
25f1b0fd95
3 changed files with 94 additions and 4 deletions
|
@ -1169,8 +1169,7 @@ namespace Meteor.Map.Actors
|
|||
|
||||
private void SendCompletedQuests(ushort from, ushort to)
|
||||
{
|
||||
Bitstream completed = questStateManager.GetCompletedBitstream();
|
||||
byte[] data = completed.GetSlice(from, to);
|
||||
byte[] data = questStateManager.GetCompletionSliceBytes(from, to);
|
||||
|
||||
SetActorPropetyPacket completedQuestWorkUpdate = new SetActorPropetyPacket(from, to, "playerWork/journal");
|
||||
completedQuestWorkUpdate.AddBitfield(Utils.MurmurHash2("playerWork.questScenarioComplete", 0), data);
|
||||
|
@ -1661,6 +1660,25 @@ namespace Meteor.Map.Actors
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool IsQuestCompleted(uint id)
|
||||
{
|
||||
return questStateManager.IsQuestComplete(id);
|
||||
}
|
||||
|
||||
public void SetQuestComplete(uint id, bool flag)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
Quest currentQuest = GetQuest(id);
|
||||
if (currentQuest != null)
|
||||
{
|
||||
CompleteQuest(currentQuest);
|
||||
return;
|
||||
}
|
||||
}
|
||||
questStateManager.ForceQuestCompleteFlag(id, flag);
|
||||
}
|
||||
|
||||
public Quest GetQuest(uint id)
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
|
|
|
@ -156,9 +156,23 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
return ActiveQuests.FindAll(quest => quest.IsQuestENPC(player, npc)).ToArray();
|
||||
}
|
||||
|
||||
public Bitstream GetCompletedBitstream()
|
||||
public byte[] GetCompletionSliceBytes(ushort from, ushort to)
|
||||
{
|
||||
return CompletedQuestsBitfield;
|
||||
return CompletedQuestsBitfield.GetSlice(from, to);
|
||||
}
|
||||
|
||||
public bool IsQuestComplete(uint questId)
|
||||
{
|
||||
return CompletedQuestsBitfield.Get(questId - SCENARIO_START);
|
||||
}
|
||||
|
||||
public void ForceQuestCompleteFlag(uint questId, bool flag)
|
||||
{
|
||||
if (flag)
|
||||
CompletedQuestsBitfield.Set(questId - SCENARIO_START);
|
||||
else
|
||||
CompletedQuestsBitfield.Clear(questId - SCENARIO_START);
|
||||
ComputeAvailable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue