Fixed broken KickEvent. Cleaned up Retainers to use the ItemPacakageUpdate packet. Fixed db references for retainer inventory.

This commit is contained in:
Filip Maj
2017-12-17 15:25:42 -05:00
parent 08dfd22bfa
commit 611140568e
4 changed files with 26 additions and 34 deletions

View File

@@ -18,7 +18,6 @@ namespace FFXIVClassic_Map_Server.actors.chara.npc
private uint retainerId;
private Player ownerPlayer;
private Dictionary<ushort, Inventory> inventories = new Dictionary<ushort, Inventory>();
public Retainer(uint retainerId, ActorClass actorClass, Player player, float posX, float posY, float posZ, float rot)
: base(0, actorClass, "myretainer", player.GetZone(), posX, posY, posZ, rot, 0, 0, null)
@@ -27,33 +26,16 @@ namespace FFXIVClassic_Map_Server.actors.chara.npc
this.ownerPlayer = player;
this.actorName = String.Format("_rtnre{0:x7}", actorId);
inventories[Inventory.NORMAL] = new Inventory(this, MAXSIZE_INVENTORY_NORMAL, Inventory.NORMAL);
inventories[Inventory.CURRENCY_CRYSTALS] = new Inventory(this, MAXSIZE_INVENTORY_CURRANCY, Inventory.CURRENCY_CRYSTALS);
inventories[Inventory.BAZAAR] = new Inventory(this, MAXSIZE_INVENTORY_BAZAAR, Inventory.BAZAAR);
itemPackages[Inventory.NORMAL] = new Inventory(this, MAXSIZE_INVENTORY_NORMAL, Inventory.NORMAL);
itemPackages[Inventory.CURRENCY_CRYSTALS] = new Inventory(this, MAXSIZE_INVENTORY_CURRANCY, Inventory.CURRENCY_CRYSTALS);
itemPackages[Inventory.BAZAAR] = new Inventory(this, MAXSIZE_INVENTORY_BAZAAR, Inventory.BAZAAR);
inventories[Inventory.NORMAL].InitList(Database.GetInventory(this, Inventory.NORMAL));
inventories[Inventory.CURRENCY_CRYSTALS].InitList(Database.GetInventory(this, Inventory.CURRENCY_CRYSTALS));
inventories[Inventory.BAZAAR].InitList(Database.GetInventory(this, Inventory.BAZAAR));
itemPackages[Inventory.NORMAL].InitList(Database.GetInventory(this, Inventory.NORMAL));
itemPackages[Inventory.CURRENCY_CRYSTALS].InitList(Database.GetInventory(this, Inventory.CURRENCY_CRYSTALS));
itemPackages[Inventory.BAZAAR].InitList(Database.GetInventory(this, Inventory.BAZAAR));
}
public Inventory GetInventory(ushort type)
{
if (inventories.ContainsKey(type))
return inventories[type];
else
return null;
}
public void SendFullRetainerInventory(Player player)
{
player.QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId));
inventories[Inventory.NORMAL].SendFullInventory(player);
inventories[Inventory.CURRENCY_CRYSTALS].SendFullInventory(player);
inventories[Inventory.BAZAAR].SendFullInventory(player);
player.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId));
}
public uint getRetainerId()
public uint GetRetainerId()
{
return retainerId;
}

View File

@@ -1694,7 +1694,7 @@ namespace FFXIVClassic_Map_Server.Actors
runningEvents.Pop();
List<LuaParam> lParams = LuaUtils.CreateLuaParamList(parameters);
SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, 0x75dc1, conditionName, lParams);
SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, 0x75dc1705, conditionName, lParams);
spacket.DebugPrintSubPacket();
QueuePacket(spacket);
}
@@ -1885,6 +1885,11 @@ namespace FFXIVClassic_Map_Server.Actors
}
}
public Retainer GetSpawnedRetainer()
{
return currentSpawnedRetainer;
}
public void StartTradeTransaction(Player otherPlayer)
{
myOfferings = new Inventory(this, 4, Inventory.TRADE, true);