mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-08-04 08:41:58 +02:00
Merge branch 'develop'
# Conflicts: # FFXIVClassic Map Server/FFXIVClassic Map Server.csproj # FFXIVClassic Map Server/Server.cs # data/scripts/player.lua # scripts/zones/193/npcs/pplStd_11@0C100.lua
This commit is contained in:
commit
3d5fa45730
134 changed files with 1926 additions and 242 deletions
|
@ -35,7 +35,14 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
lParams = LuaUtils.createLuaParamList("/Area/PrivateArea/" + className, false, true, zoneName, privateAreaName, 0x9E, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false);
|
||||
|
||||
string path = className;
|
||||
|
||||
if (className.ToLower().Contains("content"))
|
||||
path = "Content/" + className;
|
||||
|
||||
lParams = LuaUtils.createLuaParamList("/Area/PrivateArea/" + path, false, true, zoneName, privateAreaName, 0x9E, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false);
|
||||
ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams).debugPrintSubPacket();
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
|
||||
|
|
|
@ -81,6 +81,11 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return SetActorIdleAnimationPacket.buildPacket(actorId, playerActorId, animationId);
|
||||
}
|
||||
|
||||
public void setQuestGraphic(Player player, int graphicNum)
|
||||
{
|
||||
player.queuePacket(SetActorQuestGraphicPacket.buildPacket(player.actorId, actorId, graphicNum));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using FFXIVClassic_Lobby_Server.common;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using FFXIVClassic_Map_Server.Actors.Chara;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
@ -20,6 +21,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
{
|
||||
private uint actorClassId;
|
||||
|
||||
public NpcWork npcWork = new NpcWork();
|
||||
|
||||
public Npc(uint id, string actorName, uint zoneId, float posX, float posY, float posZ, float rot, ushort actorState, uint animationId, uint displayNameId, string customDisplayName, string className)
|
||||
: base(id)
|
||||
{
|
||||
|
@ -38,6 +41,26 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
this.zoneId = zoneId;
|
||||
|
||||
loadNpcTemplate(id);
|
||||
|
||||
charaWork.battleSave.potencial = 1.0f;
|
||||
|
||||
charaWork.parameterSave.state_mainSkill[0] = 3;
|
||||
charaWork.parameterSave.state_mainSkill[2] = 3;
|
||||
charaWork.parameterSave.state_mainSkillLevel = 2;
|
||||
|
||||
charaWork.parameterSave.hp[0] = 500;
|
||||
charaWork.parameterSave.hpMax[0] = 500;
|
||||
charaWork.property[0] = 1;
|
||||
charaWork.property[1] = 1;
|
||||
|
||||
if (className.Equals("JellyfishScenarioLimsaLv00"))
|
||||
{
|
||||
charaWork.property[2] = 1;
|
||||
npcWork.hateType = 1;
|
||||
}
|
||||
|
||||
charaWork.property[3] = 1;
|
||||
charaWork.property[4] = 1;
|
||||
}
|
||||
|
||||
public SubPacket createAddActorPacket(uint playerActorId)
|
||||
|
@ -50,7 +73,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
List<LuaParam> lParams;
|
||||
|
||||
Player player = Server.GetWorldManager().GetPCInWorld(playerActorId);
|
||||
lParams = LuaEngine.doActorOnInstantiate(player, this);
|
||||
lParams = LuaEngine.doActorInstantiate(player, this);
|
||||
|
||||
if (lParams == null)
|
||||
{
|
||||
|
@ -80,6 +103,54 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return BasePacket.createPacket(subpackets, true, false);
|
||||
}
|
||||
|
||||
public override BasePacket getInitPackets(uint playerActorId)
|
||||
{
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this, playerActorId);
|
||||
|
||||
//Properties
|
||||
for (int i = 0; i < charaWork.property.Length; i++)
|
||||
{
|
||||
if (charaWork.property[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.property[{0}]", i));
|
||||
}
|
||||
|
||||
//Parameters
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.hp[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.hpMax[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.mp");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.mpMax");
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.tp");
|
||||
|
||||
if (charaWork.parameterSave.state_mainSkill[0] != 0)
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[0]");
|
||||
if (charaWork.parameterSave.state_mainSkill[1] != 0)
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[1]");
|
||||
if (charaWork.parameterSave.state_mainSkill[2] != 0)
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[2]");
|
||||
if (charaWork.parameterSave.state_mainSkill[3] != 0)
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[3]");
|
||||
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||
|
||||
//Status Times
|
||||
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
|
||||
{
|
||||
if (charaWork.statusShownTime[i] != 0xFFFFFFFF)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||
}
|
||||
|
||||
//General Parameters
|
||||
for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++)
|
||||
{
|
||||
if (charaWork.battleTemp.generalParameter[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||
}
|
||||
|
||||
propPacketUtil.addProperty("npcWork.hateType");
|
||||
|
||||
return BasePacket.createPacket(propPacketUtil.done(), true, false);
|
||||
}
|
||||
|
||||
public uint getActorClassId()
|
||||
{
|
||||
return actorClassId;
|
||||
|
|
|
@ -84,6 +84,15 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
45000, 47000, 50000, 53000, 56000, 59000, 62000, 65000, 68000, 71000, //Level <= 40
|
||||
74000, 78000, 81000, 85000, 89000, 92000, 96000, 100000, 100000, 110000}; //Level <= 50
|
||||
|
||||
//Event Related
|
||||
public uint currentEventOwner = 0;
|
||||
public string currentEventName = "";
|
||||
|
||||
public uint currentCommand = 0;
|
||||
public string currentCommandName = "";
|
||||
|
||||
public uint eventMenuId = 0;
|
||||
|
||||
//Player Info
|
||||
public uint[] timers = new uint[20];
|
||||
public ushort currentJob;
|
||||
|
@ -108,12 +117,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public bool hasGoobbue;
|
||||
public byte chocoboAppearance;
|
||||
public string chocoboName;
|
||||
public byte mountState = 0;
|
||||
|
||||
//Event Related
|
||||
public uint eventCurrentOwner = 0;
|
||||
public string eventCurrentStarter = "";
|
||||
public uint eventMenuId = 0;
|
||||
public byte mountState = 0;
|
||||
|
||||
public uint achievementPoints;
|
||||
|
||||
|
@ -125,7 +129,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public Quest[] questScenario = new Quest[16];
|
||||
public Quest[] questGuildleve = new Quest[8];
|
||||
|
||||
public Director currentDirector;// = new OpeningDirector(0x46080012);
|
||||
public Director currentDirector;
|
||||
|
||||
public PlayerWork playerWork = new PlayerWork();
|
||||
|
||||
|
@ -256,7 +260,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
if (isMyPlayer(playerActorId))
|
||||
{
|
||||
if (currentDirector != null)
|
||||
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, true, currentDirector, 0, false, timers, true);
|
||||
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, true, currentDirector, true, 0, false, timers, true);
|
||||
else
|
||||
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, false, true, 0, false, timers, true);
|
||||
}
|
||||
|
@ -472,12 +476,15 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
public void sendZoneInPackets(WorldManager world, ushort spawnType)
|
||||
{
|
||||
queuePacket(SetMapPacket.buildPacket(actorId, zone.regionId, zone.actorId));
|
||||
queuePacket(SetActorIsZoningPacket.buildPacket(actorId, actorId, false));
|
||||
queuePacket(_0x10Packet.buildPacket(actorId, 0xFF));
|
||||
queuePacket(SetMusicPacket.buildPacket(actorId, zone.bgmDay, 0x01));
|
||||
queuePacket(SetWeatherPacket.buildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR));
|
||||
|
||||
queuePacket(SetMapPacket.buildPacket(actorId, zone.regionId, zone.actorId));
|
||||
|
||||
queuePacket(getSpawnPackets(actorId, spawnType));
|
||||
//getSpawnPackets(actorId, spawnType).debugPrintPacket();
|
||||
getSpawnPackets(actorId, spawnType).debugPrintPacket();
|
||||
|
||||
#region grouptest
|
||||
//Retainers
|
||||
|
@ -511,6 +518,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
playerSession.queuePacket(getInitPackets(actorId));
|
||||
|
||||
|
||||
BasePacket areaMasterSpawn = zone.getSpawnPackets(actorId);
|
||||
BasePacket debugSpawn = world.GetDebugActor().getSpawnPackets(actorId);
|
||||
BasePacket worldMasterSpawn = world.GetActor().getSpawnPackets(actorId);
|
||||
|
@ -523,8 +531,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
playerSession.queuePacket(debugSpawn);
|
||||
if (directorSpawn != null)
|
||||
{
|
||||
directorSpawn.debugPrintPacket();
|
||||
currentDirector.getInitPackets(actorId).debugPrintPacket();
|
||||
//directorSpawn.debugPrintPacket();
|
||||
// currentDirector.getInitPackets(actorId).debugPrintPacket();
|
||||
queuePacket(directorSpawn);
|
||||
queuePacket(currentDirector.getInitPackets(actorId));
|
||||
//queuePacket(currentDirector.getSetEventStatusPackets(actorId));
|
||||
|
@ -591,6 +599,12 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
playerSession.queuePacket(packet, true, false);
|
||||
}
|
||||
|
||||
public void queuePackets(List<SubPacket> packets)
|
||||
{
|
||||
foreach (SubPacket subpacket in packets)
|
||||
playerSession.queuePacket(subpacket, true, false);
|
||||
}
|
||||
|
||||
public void broadcastPacket(SubPacket packet, bool sendToSelf)
|
||||
{
|
||||
if (sendToSelf)
|
||||
|
@ -953,6 +967,47 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public Equipment getEquipment()
|
||||
{
|
||||
return equipment;
|
||||
}
|
||||
|
||||
public byte getInitialTown()
|
||||
{
|
||||
return playerWork.initialTown;
|
||||
}
|
||||
|
||||
public int getFreeQuestSlot()
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
{
|
||||
if (questScenario[i] == null)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void addQuest(uint id)
|
||||
{
|
||||
Actor actor = Server.getStaticActors((0xA0F00000 | id));
|
||||
addQuest(actor.actorName);
|
||||
}
|
||||
|
||||
public void addQuest(string name)
|
||||
{
|
||||
Actor actor = Server.getStaticActors(name);
|
||||
|
||||
if (actor == null)
|
||||
return;
|
||||
|
||||
uint id = actor.actorId;
|
||||
|
||||
int freeSlot = getFreeQuestSlot();
|
||||
|
||||
if (freeSlot == -1)
|
||||
return;
|
||||
|
||||
playerWork.questScenario[freeSlot] = id;
|
||||
questScenario[freeSlot] = new Quest(this, playerWork.questScenario[freeSlot], name, null, 0);
|
||||
Database.saveQuest(this, questScenario[freeSlot]);
|
||||
}
|
||||
|
||||
public Quest getQuest(uint id)
|
||||
|
@ -966,6 +1021,28 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return null;
|
||||
}
|
||||
|
||||
public Quest getQuest(string name)
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
{
|
||||
if (questScenario[i] != null && questScenario[i].actorName.ToLower().Equals(name.ToLower()))
|
||||
return questScenario[i];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool hasQuest(string name)
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
{
|
||||
if (questScenario[i] != null && questScenario[i].actorName.ToLower().Equals(name.ToLower()))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool hasQuest(uint id)
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
|
@ -977,19 +1054,46 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return false;
|
||||
}
|
||||
|
||||
public void setDirector(string directorType)
|
||||
public int getQuestSlot(uint id)
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
{
|
||||
if (questScenario[i] != null && questScenario[i].actorId == (0xA0F00000 | id))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void setDirector(string directorType, bool sendPackets)
|
||||
{
|
||||
if (directorType.Equals("openingDirector"))
|
||||
{
|
||||
currentDirector = new OpeningDirector(0x46080012);
|
||||
currentDirector = new OpeningDirector(this, 0x46080012);
|
||||
}
|
||||
else if (directorType.Equals("QuestDirectorMan0l001"))
|
||||
{
|
||||
currentDirector = new QuestDirectorMan0l001(this, 0x46080012);
|
||||
}
|
||||
else if (directorType.Equals("QuestDirectorMan0g001"))
|
||||
{
|
||||
currentDirector = new QuestDirectorMan0g001(this, 0x46080012);
|
||||
}
|
||||
else if (directorType.Equals("QuestDirectorMan0u001"))
|
||||
{
|
||||
currentDirector = new QuestDirectorMan0u001(this, 0x46080012);
|
||||
}
|
||||
|
||||
if (sendPackets)
|
||||
{
|
||||
queuePacket(RemoveActorPacket.buildPacket(actorId, 0x46080012));
|
||||
queuePacket(currentDirector.getSpawnPackets(actorId));
|
||||
queuePacket(currentDirector.getInitPackets(actorId));
|
||||
//queuePacket(currentDirector.getSetEventStatusPackets(actorId));
|
||||
//currentDirector.getSpawnPackets(actorId).debugPrintPacket();
|
||||
//currentDirector.getInitPackets(actorId).debugPrintPacket();
|
||||
}
|
||||
|
||||
queuePacket(RemoveActorPacket.buildPacket(actorId, 0x46080012));
|
||||
queuePacket(currentDirector.getSpawnPackets(actorId));
|
||||
queuePacket(currentDirector.getInitPackets(actorId));
|
||||
// queuePacket(currentDirector.getSetEventStatusPackets(actorId));
|
||||
// currentDirector.getSpawnPackets(actorId).debugPrintPacket();
|
||||
// currentDirector.getInitPackets(actorId).debugPrintPacket();
|
||||
}
|
||||
|
||||
public Director getDirector()
|
||||
|
@ -1037,22 +1141,32 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public void runEventFunction(string functionName, params object[] parameters)
|
||||
{
|
||||
List<LuaParam> lParams = LuaUtils.createLuaParamList(parameters);
|
||||
SubPacket spacket = RunEventFunctionPacket.buildPacket(actorId, eventCurrentOwner, eventCurrentStarter, functionName, lParams);
|
||||
SubPacket spacket = RunEventFunctionPacket.buildPacket(actorId, currentEventOwner, currentEventName, functionName, lParams);
|
||||
spacket.debugPrintSubPacket();
|
||||
queuePacket(spacket);
|
||||
}
|
||||
|
||||
public void endEvent()
|
||||
{
|
||||
SubPacket p = EndEventPacket.buildPacket(actorId, eventCurrentOwner, eventCurrentStarter);
|
||||
SubPacket p = EndEventPacket.buildPacket(actorId, currentEventOwner, currentEventName);
|
||||
p.debugPrintSubPacket();
|
||||
queuePacket(p);
|
||||
|
||||
eventCurrentOwner = 0;
|
||||
eventCurrentStarter = "";
|
||||
currentEventOwner = 0;
|
||||
currentEventName = "";
|
||||
eventMenuId = 0;
|
||||
}
|
||||
|
||||
public void endCommand()
|
||||
{
|
||||
SubPacket p = EndEventPacket.buildPacket(actorId, currentCommand, currentCommandName);
|
||||
p.debugPrintSubPacket();
|
||||
queuePacket(p);
|
||||
|
||||
currentCommand = 0;
|
||||
currentCommandName = "";
|
||||
}
|
||||
|
||||
public void setCurrentMenuId(uint id)
|
||||
{
|
||||
eventMenuId = id;
|
||||
|
@ -1067,12 +1181,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
{
|
||||
|
||||
//Update Instance
|
||||
List<BasePacket> instanceUpdatePackets = playerSession.updateInstance(zone.getActorsAroundActor(this, 50));
|
||||
foreach (BasePacket bp in instanceUpdatePackets)
|
||||
{
|
||||
// bp.debugPrintPacket();
|
||||
queuePacket(bp);
|
||||
}
|
||||
playerSession.updateInstance(zone.getActorsAroundActor(this, 50));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -10,10 +11,12 @@ using System.Threading.Tasks;
|
|||
namespace FFXIVClassic_Map_Server.actors.director
|
||||
{
|
||||
class Director : Actor
|
||||
{
|
||||
public Director(uint id) : base(id)
|
||||
{
|
||||
{
|
||||
Player owner;
|
||||
|
||||
public Director(Player owner, uint id) : base(id)
|
||||
{
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public virtual BasePacket getSpawnPackets(uint playerActorId, uint spawnType)
|
||||
|
@ -37,5 +40,15 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||
return BasePacket.createPacket(initProperties.buildPacket(playerActorId, actorId), true, false);
|
||||
}
|
||||
|
||||
public void onTalked(Npc npc)
|
||||
{
|
||||
LuaEngine.doDirectorOnTalked(this, owner, npc);
|
||||
}
|
||||
|
||||
public void onCommand(Command command)
|
||||
{
|
||||
LuaEngine.doDirectorOnCommand(this, owner, command);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
|
@ -11,12 +12,15 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||
{
|
||||
class OpeningDirector : Director
|
||||
{
|
||||
public OpeningDirector(uint id) : base(id)
|
||||
public OpeningDirector(Player player, uint id) : base(player, id)
|
||||
{
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = "openingDire";
|
||||
this.customDisplayName = String.Format("openingDire_{0}_{1}", player.zone.zoneName, "04");
|
||||
|
||||
this.actorName = String.Format("openingDire_{0}_{1}@{2:x3}{3:x2}", player.zone.zoneName, "04", player.zoneId, 0);
|
||||
|
||||
this.actorName = this.actorName.Replace("Battle", "Btl");
|
||||
|
||||
this.actorName = "openingDire";
|
||||
this.className = "OpeningDirector";
|
||||
|
||||
this.eventConditions = new EventList();
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
{
|
||||
private uint weatherId;
|
||||
|
||||
public WeatherDirector(uint weatherId)
|
||||
: base(0x5FF80003)
|
||||
public WeatherDirector(Player player, uint weatherId)
|
||||
: base(player, 0x5FF80003)
|
||||
{
|
||||
this.weatherId = weatherId;
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.director
|
||||
{
|
||||
class QuestDirectorMan0g001 : Director
|
||||
{
|
||||
public QuestDirectorMan0g001(Player player, uint id)
|
||||
: base(player, id)
|
||||
{
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = "questDirect_fst0Btl03_01";
|
||||
|
||||
this.actorName = "questDirect_fst0Btl03_01@0A615";
|
||||
this.className = "QuestDirectorMan0g001";
|
||||
|
||||
this.eventConditions = new EventList();
|
||||
|
||||
List<EventList.NoticeEventCondition> noticeEventList = new List<EventList.NoticeEventCondition>();
|
||||
|
||||
noticeEventList.Add(new EventList.NoticeEventCondition("noticeEvent", 0xE, 0x0));
|
||||
noticeEventList.Add(new EventList.NoticeEventCondition("noticeRequest", 0x0, 0x1));
|
||||
|
||||
this.eventConditions.noticeEventConditions = noticeEventList;
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0g001", false, false, false, false, false, 0x753A);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.director
|
||||
{
|
||||
class QuestDirectorMan0l001 : Director
|
||||
{
|
||||
public QuestDirectorMan0l001(Player player, uint id)
|
||||
: base(player, id)
|
||||
{
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = "questDirect_ocn0Btl02_01";
|
||||
|
||||
this.actorName = "questDirect_ocn0Btl02_01@0C196";
|
||||
this.className = "QuestDirectorMan0l001";
|
||||
|
||||
this.eventConditions = new EventList();
|
||||
|
||||
List<EventList.NoticeEventCondition> noticeEventList = new List<EventList.NoticeEventCondition>();
|
||||
|
||||
noticeEventList.Add(new EventList.NoticeEventCondition("noticeEvent", 0xE, 0x0));
|
||||
noticeEventList.Add(new EventList.NoticeEventCondition("noticeRequest", 0x0, 0x1));
|
||||
|
||||
this.eventConditions.noticeEventConditions = noticeEventList;
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0l001", false, false, false, false, false, 0x7532);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.director
|
||||
{
|
||||
class QuestDirectorMan0u001 : Director
|
||||
{
|
||||
public QuestDirectorMan0u001(Player player, uint id)
|
||||
: base(player, id)
|
||||
{
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = "questDirect_wil0Btl01_01";
|
||||
|
||||
this.actorName = "questDirect_wil0Btl01_01@0A615";
|
||||
this.className = "QuestDirectorMan0u001";
|
||||
|
||||
this.eventConditions = new EventList();
|
||||
|
||||
List<EventList.NoticeEventCondition> noticeEventList = new List<EventList.NoticeEventCondition>();
|
||||
|
||||
noticeEventList.Add(new EventList.NoticeEventCondition("noticeEvent", 0xE, 0x0));
|
||||
noticeEventList.Add(new EventList.NoticeEventCondition("noticeRequest", 0x0, 0x1));
|
||||
|
||||
this.eventConditions.noticeEventConditions = noticeEventList;
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0u001", false, false, false, false, false, 0x757F);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
using FFXIVClassic_Lobby_Server.common;
|
||||
using FFXIVClassic_Lobby_Server;
|
||||
using FFXIVClassic_Lobby_Server.common;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -6,6 +8,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
{
|
||||
class Quest : Actor
|
||||
{
|
||||
private Player owner;
|
||||
private int currentPhase = 0;
|
||||
private uint questFlags = 0;
|
||||
private Dictionary<string, Object> questData = new Dictionary<string, object>();
|
||||
|
@ -13,17 +16,27 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public Quest(uint actorID, string name)
|
||||
: base(actorID)
|
||||
{
|
||||
actorName = name;
|
||||
actorName = name;
|
||||
}
|
||||
|
||||
public void InitQuestData(string dataName, object initialValue)
|
||||
public Quest(Player owner, uint actorID, string name, string questDataJson, uint questFlags)
|
||||
: base(actorID)
|
||||
{
|
||||
questData[dataName] = initialValue;
|
||||
}
|
||||
this.owner = owner;
|
||||
actorName = name;
|
||||
this.questFlags = questFlags;
|
||||
|
||||
public void UpdateQuestData(string dataName, object data)
|
||||
{
|
||||
if (questData.ContainsKey(dataName))
|
||||
if (questDataJson != null)
|
||||
this.questData = JsonConvert.DeserializeObject<Dictionary<string, Object>>(questDataJson);
|
||||
else
|
||||
questData = null;
|
||||
|
||||
if (questData == null)
|
||||
questData = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
public void SetQuestData(string dataName, object data)
|
||||
{
|
||||
questData[dataName] = data;
|
||||
|
||||
//Inform update
|
||||
|
@ -37,11 +50,21 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return null;
|
||||
}
|
||||
|
||||
public void ClearQuestData()
|
||||
{
|
||||
questData.Clear();
|
||||
}
|
||||
|
||||
public uint GetQuestId()
|
||||
{
|
||||
return actorId;
|
||||
}
|
||||
|
||||
public void ClearQuestFlags()
|
||||
{
|
||||
questFlags = 0;
|
||||
}
|
||||
|
||||
public void SetQuestFlag(int bitIndex, bool value)
|
||||
{
|
||||
if (bitIndex >= 32)
|
||||
|
@ -68,7 +91,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return false;
|
||||
}
|
||||
else
|
||||
return (questFlags & (1 << bitIndex)) == 1;
|
||||
return (questFlags & (1 << bitIndex)) == (1 << bitIndex);
|
||||
}
|
||||
|
||||
public int GetPhase()
|
||||
|
@ -81,5 +104,20 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
currentPhase++;
|
||||
}
|
||||
|
||||
public uint GetQuestFlags()
|
||||
{
|
||||
return questFlags;
|
||||
}
|
||||
|
||||
public string GetSerializedQuestData()
|
||||
{
|
||||
return JsonConvert.SerializeObject(questData, Formatting.Indented);
|
||||
}
|
||||
|
||||
public void SaveData()
|
||||
{
|
||||
Database.saveQuest(owner, this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue