Merge branch 'develop'

# Conflicts:
#	FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs
This commit is contained in:
Filip Maj 2016-03-30 20:18:28 -04:00
commit 8da3a6ff9c
37 changed files with 216 additions and 60 deletions

View file

@ -93,6 +93,22 @@ namespace FFXIVClassic_Map_Server.Actors
//return SetActorPositionPacket.buildPacket(actorId, playerActorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);
spawnedFirstTime = true;
spawnPacket.debugPrintSubPacket();
return spawnPacket;
}
public SubPacket createSpawnTeleportPacket(uint playerActorId, uint spawnType)
{
SubPacket spawnPacket;
spawnPacket = SetActorPositionPacket.buildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false);
//return SetActorPositionPacket.buildPacket(actorId, playerActorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);
spawnPacket.debugPrintSubPacket();
return spawnPacket;
}
@ -176,7 +192,7 @@ namespace FFXIVClassic_Map_Server.Actors
if (eventConditions.emoteEventConditions != null)
{
foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions)
subpackets.Add(SetEventStatus.buildPacket(playerActorId, actorId, 1, 1, condition.conditionName));
subpackets.Add(SetEventStatus.buildPacket(playerActorId, actorId, 1, 3, condition.conditionName));
}
if (eventConditions.pushWithCircleEventConditions != null)

View file

@ -18,7 +18,7 @@ namespace FFXIVClassic_Map_Server.actors
public class TalkEventCondition
{
public byte unknown1;
public byte unknown2;
public bool isDisabled = false;
public string conditionName;
}

View file

@ -49,7 +49,7 @@ namespace FFXIVClassic_Map_Server.Actors
{
List<LuaParam> lParams;
Player player = Server.getServer().GetWorldManager().GetPCInWorld(playerActorId);
Player player = Server.GetWorldManager().GetPCInWorld(playerActorId);
lParams = LuaEngine.doActorOnInstantiate(player, this);
if (lParams == null)

View file

@ -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;
@ -704,34 +708,34 @@ namespace FFXIVClassic_Map_Server.Actors
{
if (msgParams.Length == 0)
{
queuePacket(GameMessagePacket.buildPacket(Server.getServer().GetWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log));
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log));
}
else
queuePacket(GameMessagePacket.buildPacket(Server.getServer().GetWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log, LuaUtils.createLuaParamList(msgParams)));
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log, LuaUtils.createLuaParamList(msgParams)));
}
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, params object[] msgParams)
{
if (msgParams.Length == 0)
queuePacket(GameMessagePacket.buildPacket(Server.getServer().GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log));
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log));
else
queuePacket(GameMessagePacket.buildPacket(Server.getServer().GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log, LuaUtils.createLuaParamList(msgParams)));
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log, LuaUtils.createLuaParamList(msgParams)));
}
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, string customSender, params object[] msgParams)
{
if (msgParams.Length == 0)
queuePacket(GameMessagePacket.buildPacket(Server.getServer().GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log));
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log));
else
queuePacket(GameMessagePacket.buildPacket(Server.getServer().GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log, LuaUtils.createLuaParamList(msgParams)));
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log, LuaUtils.createLuaParamList(msgParams)));
}
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, uint displayId, params object[] msgParams)
{
if (msgParams.Length == 0)
queuePacket(GameMessagePacket.buildPacket(Server.getServer().GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log));
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log));
else
queuePacket(GameMessagePacket.buildPacket(Server.getServer().GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log, LuaUtils.createLuaParamList(msgParams)));
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log, LuaUtils.createLuaParamList(msgParams)));
}
public void broadcastWorldMessage(ushort worldMasterId, params object[] msgParams)
@ -920,7 +924,7 @@ namespace FFXIVClassic_Map_Server.Actors
Database.savePlayerAppearance(this);
broadcastPacket(createAppearancePacket(actorId), true);
}
}
public Inventory getInventory(ushort type)
{

View file

@ -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++;
}
}
}