mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-20 19:57:46 +00:00
Fleshed out the quest actor and added a place to store the current active quest actors in the Player actor.
This commit is contained in:
parent
3162bedb17
commit
49a13effca
2 changed files with 74 additions and 4 deletions
|
@ -118,6 +118,10 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
private int lastPosition = 0;
|
||||
private int lastStep = 0;
|
||||
|
||||
//Quest Actors (MUST MATCH playerWork.questScenario/questGuildleve)
|
||||
public Quest[] questScenario = new Quest[16];
|
||||
public Quest[] questGuildleve = new Quest[8];
|
||||
|
||||
public PlayerWork playerWork = new PlayerWork();
|
||||
|
||||
public ConnectedPlayer playerSession;
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
using System;
|
||||
using FFXIVClassic_Lobby_Server.common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.Actors
|
||||
{
|
||||
class Quest : Actor
|
||||
{
|
||||
private int currentPhase = 0;
|
||||
private uint questFlags = 0;
|
||||
private Dictionary<string, Object> questData = new Dictionary<string, object>();
|
||||
|
||||
public Quest(uint actorID, string name)
|
||||
: base(actorID)
|
||||
|
@ -15,5 +16,70 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
actorName = name;
|
||||
}
|
||||
|
||||
public void InitQuestData(string dataName, object initialValue)
|
||||
{
|
||||
questData[dataName] = initialValue;
|
||||
}
|
||||
|
||||
public void UpdateQuestData(string dataName, object data)
|
||||
{
|
||||
if (questData.ContainsKey(dataName))
|
||||
questData[dataName] = data;
|
||||
|
||||
//Inform update
|
||||
}
|
||||
|
||||
public object GetQuestData(string dataName)
|
||||
{
|
||||
if (questData.ContainsKey(dataName))
|
||||
return questData[dataName];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public uint GetQuestId()
|
||||
{
|
||||
return actorId;
|
||||
}
|
||||
|
||||
public void SetQuestFlag(int bitIndex, bool value)
|
||||
{
|
||||
if (bitIndex >= 32)
|
||||
{
|
||||
Log.error(String.Format("Tried to access bit flag >= 32 for questId: {0}", actorId));
|
||||
return;
|
||||
}
|
||||
|
||||
int mask = 1 << bitIndex;
|
||||
|
||||
if (value)
|
||||
questFlags |= (uint)(1 << bitIndex);
|
||||
else
|
||||
questFlags &= (uint)~(1 << bitIndex);
|
||||
|
||||
//Inform update
|
||||
}
|
||||
|
||||
public bool GetQuestFlag(int bitIndex)
|
||||
{
|
||||
if (bitIndex >= 32)
|
||||
{
|
||||
Log.error(String.Format("Tried to access bit flag >= 32 for questId: {0}", actorId));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return (questFlags & (1 << bitIndex)) == 1;
|
||||
}
|
||||
|
||||
public int GetPhase()
|
||||
{
|
||||
return currentPhase;
|
||||
}
|
||||
|
||||
public void NextPhase()
|
||||
{
|
||||
currentPhase++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue