# Conflicts:
#	FFXIVClassic Map Server/Database.cs
#	FFXIVClassic Map Server/WorldManager.cs
#	FFXIVClassic Map Server/actors/area/Area.cs
#	FFXIVClassic Map Server/actors/chara/player/Player.cs
This commit is contained in:
Tahir Akhlaq
2017-08-26 20:17:16 +01:00
68 changed files with 907 additions and 281 deletions

View File

@@ -75,10 +75,10 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
zone.pathCalls++;
zone.pathCallTime += sw.ElapsedMilliseconds;
if (path.Count == 1)
Program.Log.Info($"mypos: {owner.positionX} {owner.positionY} {owner.positionZ} | targetPos: {x} {y} {z} | step {stepSize} | maxPath {maxPath} | polyRadius {polyRadius}");
//if (path.Count == 1)
// Program.Log.Info($"mypos: {owner.positionX} {owner.positionY} {owner.positionZ} | targetPos: {x} {y} {z} | step {stepSize} | maxPath {maxPath} | polyRadius {polyRadius}");
Program.Log.Error("[{0}][{1}] Created {2} points in {3} milliseconds", owner.actorId, owner.actorName, path.Count, sw.ElapsedMilliseconds);
//Program.Log.Error("[{0}][{1}] Created {2} points in {3} milliseconds", owner.actorId, owner.actorName, path.Count, sw.ElapsedMilliseconds);
}
}
@@ -123,7 +123,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
{
path.Remove(point);
owner.OnPath(point);
Program.Log.Error($"{owner.actorName} arrived at point {point.X} {point.Y} {point.Z}");
//Program.Log.Error($"{owner.actorName} arrived at point {point.X} {point.Y} {point.Z}");
}
if (path.Count == 0 && owner.target != null)

View File

@@ -53,8 +53,8 @@ namespace FFXIVClassic_Map_Server.Actors
LoadNpcAppearance(actorClass.actorClassId);
this.classPath = actorClass.classPath;
className = classPath.Substring(classPath.LastIndexOf("/")+1);
className = actorClass.classPath.Substring(actorClass.classPath.LastIndexOf("/") + 1);
this.classPath = String.Format("{0}/{1}", actorClass.classPath.Substring(0, actorClass.classPath.LastIndexOf('/')).ToLower(), className);
charaWork.battleSave.potencial = 1.0f;

View File

@@ -46,14 +46,24 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
return null;
}
public InventoryItem GetItemById(ulong itemId)
public InventoryItem GetItemByUniqueId(ulong uniqueItemId)
{
foreach (InventoryItem item in list)
{
if (item.uniqueId == itemId)
{
if (item.uniqueId == uniqueItemId)
return item;
}
return null;
}
public InventoryItem GetItemByCatelogId(ulong catelogId)
{
foreach (InventoryItem item in list)
{
if (item.itemId == catelogId)
return item;
}
return null;
}
public void RefreshItem(InventoryItem item)
@@ -262,7 +272,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
}
public void RemoveItem(ulong itemDBId)
public void RemoveItemByUniqueId(ulong itemDBId)
{
ushort slot = 0;
InventoryItem toDelete = null;
@@ -304,7 +314,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
}
public void RemoveItem(ushort slot)
public void RemoveItemAtSlot(ushort slot)
{
if (slot >= list.Count)
return;

View File

@@ -1,5 +1,4 @@
using FFXIVClassic.Common;
using FFXIVClassic_Map_Server.actors.chara.player;
using FFXIVClassic_Map_Server.actors.director;
using FFXIVClassic_Map_Server.dataobjects;
@@ -8,6 +7,9 @@ using FFXIVClassic_Map_Server.lua;
using FFXIVClassic_Map_Server.packets.send;
using FFXIVClassic_Map_Server.packets.send.actor;
using FFXIVClassic_Map_Server.packets.send.events;
using FFXIVClassic_Map_Server.packets.send.actor.events;
using FFXIVClassic_Map_Server.packets.send.actor.inventory;
using FFXIVClassic_Map_Server.packets.send.events;
using FFXIVClassic_Map_Server.packets.send.player;
using FFXIVClassic_Map_Server.utils;
using System;
@@ -330,6 +332,7 @@ namespace FFXIVClassic_Map_Server.Actors
subpackets.Add(SetHasGoobbuePacket.BuildPacket(actorId, hasGoobbue));
subpackets.Add(SetAchievementPointsPacket.BuildPacket(actorId, achievementPoints));
subpackets.Add(Database.GetLatestAchievements(this));
subpackets.Add(Database.GetAchievementsPacket(this));
}
@@ -541,6 +544,7 @@ namespace FFXIVClassic_Map_Server.Actors
playerSession.QueuePacket(worldMasterSpawn);
//Inn Packets (Dream, Cutscenes, Armoire)
if (zone.isInn)
{
SetCutsceneBookPacket cutsceneBookPacket = new SetCutsceneBookPacket();
@@ -567,7 +571,6 @@ namespace FFXIVClassic_Map_Server.Actors
if (currentContentGroup != null)
currentContentGroup.SendGroupPackets(playerSession);
}
private void SendRemoveInventoryPackets(List<ushort> slots)
@@ -598,6 +601,7 @@ namespace FFXIVClassic_Map_Server.Actors
}
public void QueuePacket(SubPacket packet)
{
playerSession.QueuePacket(packet);
}
@@ -1006,6 +1010,7 @@ namespace FFXIVClassic_Map_Server.Actors
else
{
ItemData item = Server.GetItemGamedata(invItem.itemId);
if (item is EquipmentItem)
{
EquipmentItem eqItem = (EquipmentItem)item;
@@ -1040,7 +1045,6 @@ namespace FFXIVClassic_Map_Server.Actors
}
Database.SavePlayerAppearance(this);
BroadcastPacket(CreateAppearancePacket(), true);
}
@@ -1052,6 +1056,14 @@ namespace FFXIVClassic_Map_Server.Actors
return null;
}
public int GetCurrentGil()
{
if (GetInventory(Inventory.CURRENCY).HasItem(1000001))
return GetInventory(Inventory.CURRENCY).GetItemByCatelogId(1000001).quantity;
else
return 0;
}
public Actor GetActorInInstance(uint actorId)
{
foreach (Actor a in playerSession.actorInstanceList)
@@ -1565,7 +1577,7 @@ namespace FFXIVClassic_Map_Server.Actors
public void SendDataPacket(params object[] parameters)
{
List<LuaParam> lParams = LuaUtils.CreateLuaParamList(parameters);
SubPacket spacket = InfoRequestResponsePacket.BuildPacket(actorId, lParams);
SubPacket spacket = GenericDataPacket.BuildPacket(actorId, lParams);
spacket.DebugPrintSubPacket();
QueuePacket(spacket);
}
@@ -1719,6 +1731,19 @@ namespace FFXIVClassic_Map_Server.Actors
LuaEngine.GetInstance().CallLuaFunction(this, this, "OnUpdate", true, delta);
}
public void IssueChocobo(byte appearanceId, string nameResponse)
{
Database.IssuePlayerChocobo(this, appearanceId, nameResponse);
hasChocobo = true;
chocoboAppearance = appearanceId;
chocoboName = nameResponse;
}
public void ChangeChocoboAppearance(byte appearanceId)
{
Database.ChangePlayerChocoboAppearance(this, appearanceId);
chocoboAppearance = appearanceId;
}
public override void Update(DateTime tick)
{
aiContainer.Update(tick);