mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-20 09:35:56 +02:00
Added director code to player class and actor namespace.
This commit is contained in:
parent
49a13effca
commit
9c28e966f7
7 changed files with 165 additions and 2 deletions
|
@ -27,6 +27,13 @@ namespace FFXIVClassic_Map_Server.actors
|
|||
public byte unknown1;
|
||||
public byte unknown2;
|
||||
public string conditionName;
|
||||
|
||||
public NoticeEventCondition(string name, byte unk1, byte unk2)
|
||||
{
|
||||
conditionName = name;
|
||||
unknown1 = unk1;
|
||||
unknown2 = unk2;
|
||||
}
|
||||
}
|
||||
|
||||
public class EmoteEventCondition
|
||||
|
|
|
@ -3,6 +3,7 @@ using FFXIVClassic_Lobby_Server.common;
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.actors.area;
|
||||
using FFXIVClassic_Map_Server.actors.chara.player;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
|
@ -122,6 +123,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public Quest[] questScenario = new Quest[16];
|
||||
public Quest[] questGuildleve = new Quest[8];
|
||||
|
||||
public Director currentDirector;
|
||||
|
||||
public PlayerWork playerWork = new PlayerWork();
|
||||
|
||||
public ConnectedPlayer playerSession;
|
||||
|
@ -518,10 +521,18 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
BasePacket areaMasterSpawn = zone.getSpawnPackets(actorId);
|
||||
BasePacket debugSpawn = world.GetDebugActor().getSpawnPackets(actorId);
|
||||
BasePacket worldMasterSpawn = world.GetActor().getSpawnPackets(actorId);
|
||||
BasePacket directorSpawn = null;
|
||||
|
||||
if (currentDirector != null)
|
||||
directorSpawn = currentDirector.getSpawnPackets(actorId);
|
||||
|
||||
playerSession.queuePacket(areaMasterSpawn);
|
||||
playerSession.queuePacket(debugSpawn);
|
||||
playerSession.queuePacket(worldMasterSpawn);
|
||||
|
||||
// if (directorSpawn != null)
|
||||
// queuePacket(directorSpawn);
|
||||
|
||||
#region hardcode
|
||||
BasePacket reply10 = new BasePacket("./packets/login/login10.bin"); //Item Storage, Inn Door created
|
||||
BasePacket reply11 = new BasePacket("./packets/login/login11.bin"); //NPC Create ??? Final init
|
||||
|
@ -950,6 +961,44 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return equipment;
|
||||
}
|
||||
|
||||
public Quest getQuest(uint id)
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
{
|
||||
if (questScenario[i] != null && questScenario[i].actorId == (0xA0F00000 | id))
|
||||
return questScenario[i];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool hasQuest(uint id)
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
{
|
||||
if (questScenario[i] != null && questScenario[i].actorId == (0xA0F00000 | id))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setDirector(string directorType)
|
||||
{
|
||||
if (directorType.Equals("openingDirector"))
|
||||
{
|
||||
currentDirector = new OpeningDirector(0x5FF80004);
|
||||
}
|
||||
|
||||
queuePacket(RemoveActorPacket.buildPacket(actorId, 0x5FF80004));
|
||||
queuePacket(currentDirector.getSpawnPackets(actorId));
|
||||
}
|
||||
|
||||
public Director getDirector()
|
||||
{
|
||||
return currentDirector;
|
||||
}
|
||||
|
||||
public void examinePlayer(Actor examinee)
|
||||
{
|
||||
Player toBeExamined;
|
||||
|
@ -971,6 +1020,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
queuePacket(spacket);
|
||||
}
|
||||
|
||||
public void kickEvent(Actor actor, string conditionName, params object[] parameters)
|
||||
{
|
||||
List<LuaParam> lParams = LuaUtils.createLuaParamList(parameters);
|
||||
SubPacket spacket = KickEventPacket.buildPacket(actorId, actor.actorId, conditionName, lParams);
|
||||
spacket.debugPrintSubPacket();
|
||||
queuePacket(spacket);
|
||||
}
|
||||
|
||||
public void runEventFunction(string functionName, params object[] parameters)
|
||||
{
|
||||
List<LuaParam> lParams = LuaUtils.createLuaParamList(parameters);
|
||||
|
|
17
FFXIVClassic Map Server/actors/director/Director.cs
Normal file
17
FFXIVClassic Map Server/actors/director/Director.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using FFXIVClassic_Map_Server.Actors;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.director
|
||||
{
|
||||
class Director : Actor
|
||||
{
|
||||
public Director(uint id) : base(id)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
39
FFXIVClassic Map Server/actors/director/OpeningDirector.cs
Normal file
39
FFXIVClassic Map Server/actors/director/OpeningDirector.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
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 OpeningDirector : Director
|
||||
{
|
||||
public OpeningDirector(uint id) : base(id)
|
||||
{
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = "openingDire_ocn0Btl02_0h";
|
||||
|
||||
this.actorName = "openingDire_ocn0Btl02_0h@0C100";
|
||||
this.className = "OpeningDirector";
|
||||
|
||||
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/OpeningDirector", false, false, false, false, 0x13881);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
@ -10,12 +11,12 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace FFXIVClassic_Map_Server.Actors
|
||||
{
|
||||
class WeatherDirector : Actor
|
||||
class WeatherDirector : Director
|
||||
{
|
||||
private uint weatherId;
|
||||
|
||||
public WeatherDirector(uint weatherId)
|
||||
: base(0x5FF80002)
|
||||
: base(0x5FF80003)
|
||||
{
|
||||
this.weatherId = weatherId;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue