mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 05:54:50 +02:00
Added completed quest sendback.
This commit is contained in:
parent
306f4ef346
commit
c677479a03
6 changed files with 35 additions and 24 deletions
|
@ -1170,7 +1170,6 @@ namespace Meteor.Map.Actors
|
|||
private void SendCompletedQuests(ushort from, ushort to)
|
||||
{
|
||||
Bitstream completed = questStateManager.GetCompletedBitstream();
|
||||
completed.SetAll(true);
|
||||
byte[] data = completed.GetSlice(from, to);
|
||||
|
||||
SetActorPropetyPacket completedQuestWorkUpdate = new SetActorPropetyPacket(from, to, "playerWork/journal");
|
||||
|
|
|
@ -34,7 +34,6 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
private ushort currentSequence;
|
||||
private QuestState questState = null;
|
||||
private QuestData data = null;
|
||||
private bool dataDirty = false;
|
||||
|
||||
// Creates a Static Quest for the StaticActors list.
|
||||
public Quest(uint actorID, string className, string classPath)
|
||||
|
@ -124,11 +123,11 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
|
||||
public void UpdateENPCs()
|
||||
{
|
||||
if (dataDirty)
|
||||
if (data.Dirty)
|
||||
{
|
||||
if (questState != null)
|
||||
questState.UpdateState();
|
||||
dataDirty = false;
|
||||
data.ClearDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,8 +198,7 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
if (currentSequence != SEQ_NOT_STARTED)
|
||||
owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25116, 0x20, (object)GetQuestId());
|
||||
|
||||
currentSequence = sequence;
|
||||
dataDirty = true;
|
||||
currentSequence = sequence;
|
||||
questState.UpdateState();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,8 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
private ushort counter2;
|
||||
private ushort counter3;
|
||||
private ushort counter4;
|
||||
private bool dataDirty = false;
|
||||
|
||||
public bool Dirty { get; private set; } = false;
|
||||
|
||||
public QuestData(Player owner, Quest parent, uint flags, ushort counter1, ushort counter2, ushort counter3, ushort counter4)
|
||||
{
|
||||
|
@ -46,7 +47,7 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
if (index >= 0 && index < 32)
|
||||
{
|
||||
flags |= (uint)(1 << index);
|
||||
dataDirty = true;
|
||||
Dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,13 +56,13 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
if (index >= 0 && index < 32)
|
||||
{
|
||||
flags &= (uint)~(1 << index);
|
||||
dataDirty = true;
|
||||
Dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort IncCounter(int num)
|
||||
{
|
||||
dataDirty = true;
|
||||
Dirty = true;
|
||||
|
||||
switch (num)
|
||||
{
|
||||
|
@ -79,13 +80,13 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
return counter4;
|
||||
}
|
||||
|
||||
dataDirty = false;
|
||||
Dirty = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ushort DecCounter(int num)
|
||||
{
|
||||
dataDirty = true;
|
||||
Dirty = true;
|
||||
|
||||
switch (num)
|
||||
{
|
||||
|
@ -103,13 +104,13 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
return counter4;
|
||||
}
|
||||
|
||||
dataDirty = false;
|
||||
Dirty = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void SetCounter(int num, ushort value)
|
||||
{
|
||||
dataDirty = true;
|
||||
Dirty = true;
|
||||
|
||||
switch (num)
|
||||
{
|
||||
|
@ -127,7 +128,7 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
return;
|
||||
}
|
||||
|
||||
dataDirty = false;
|
||||
Dirty = false;
|
||||
}
|
||||
|
||||
public bool GetFlag(int index)
|
||||
|
@ -159,6 +160,11 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
return 0;
|
||||
}
|
||||
|
||||
public void ClearDirty()
|
||||
{
|
||||
Dirty = false;
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
Database.UpdateQuest(owner, parent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue