mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
Merge branch 'inventory_refactor' into develop
# Conflicts: # FFXIVClassic Map Server/Database.cs # FFXIVClassic Map Server/FFXIVClassic Map Server.csproj # FFXIVClassic Map Server/WorldManager.cs # FFXIVClassic Map Server/actors/area/Area.cs # FFXIVClassic Map Server/actors/area/Zone.cs # FFXIVClassic Map Server/actors/chara/Character.cs # FFXIVClassic Map Server/actors/chara/npc/Npc.cs # FFXIVClassic Map Server/actors/chara/player/Inventory.cs # FFXIVClassic Map Server/actors/chara/player/Player.cs # FFXIVClassic Map Server/dataobjects/ZoneConnection.cs # FFXIVClassic Map Server/lua/LuaEngine.cs # FFXIVClassic Map Server/packets/send/Actor/AddActorPacket.cs # FFXIVClassic Map Server/packets/send/Actor/DeleteAllActorsPacket.cs # FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs # FFXIVClassic Map Server/packets/send/Actor/SetActorStatePacket.cs # FFXIVClassic Map Server/packets/send/Actor/SetActorStatusAllPacket.cs # FFXIVClassic Map Server/packets/send/Actor/SetActorStatusPacket.cs # FFXIVClassic Map Server/packets/send/Actor/_0x132Packet.cs # FFXIVClassic Map Server/packets/send/Actor/battle/BattleAction.cs # FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX10Packet.cs # FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX18Packet.cs # FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultX00Packet.cs # FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs # FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryRemoveX08Packet.cs # data/scripts/commands/gm/giveitem.lua
This commit is contained in:
commit
bcb609e4f6
202 changed files with 2713 additions and 1040 deletions
|
@ -12,19 +12,37 @@ namespace FFXIVClassic_Map_Server
|
|||
class LuaUtils
|
||||
{
|
||||
|
||||
public class Type7Param
|
||||
public class ItemRefParam
|
||||
{
|
||||
public uint actorId;
|
||||
public byte unknown;
|
||||
public byte slot;
|
||||
public byte inventoryType;
|
||||
public byte itemPackage;
|
||||
|
||||
public Type7Param(uint actorId, byte unknown, byte slot, byte inventoryType)
|
||||
public ItemRefParam(uint actorId, byte unknown, byte slot, byte itemPackage)
|
||||
{
|
||||
this.actorId = actorId;
|
||||
this.unknown = unknown;
|
||||
this.slot = slot;
|
||||
this.inventoryType = inventoryType;
|
||||
this.itemPackage = itemPackage;
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemOfferParam
|
||||
{
|
||||
public uint actorId;
|
||||
public ushort offerSlot;
|
||||
public ushort unknown1;
|
||||
public ushort seekSlot;
|
||||
public ushort unknown2;
|
||||
|
||||
public ItemOfferParam(uint actorId, ushort unknown1, ushort offerSlot, ushort seekSlot, ushort unknown2)
|
||||
{
|
||||
this.actorId = actorId;
|
||||
this.unknown1 = unknown1;
|
||||
this.offerSlot = offerSlot;
|
||||
this.seekSlot = seekSlot;
|
||||
this.unknown2 = unknown2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,13 +99,25 @@ namespace FFXIVClassic_Map_Server
|
|||
case 0x6: //Actor (By Id)
|
||||
value = Utils.SwapEndian(reader.ReadUInt32());
|
||||
break;
|
||||
case 0x7: //Weird one used for inventory
|
||||
uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32());
|
||||
byte type7Unknown = reader.ReadByte();
|
||||
byte type7Slot = reader.ReadByte();
|
||||
byte type7InventoryType = reader.ReadByte();
|
||||
value = new Type7Param(type7ActorId, type7Unknown, type7Slot, type7InventoryType);
|
||||
case 0x7: //Item Reference to Inventory Spot
|
||||
{
|
||||
uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32());
|
||||
byte type7Unknown = reader.ReadByte();
|
||||
byte type7Slot = reader.ReadByte();
|
||||
byte type7InventoryType = reader.ReadByte();
|
||||
value = new ItemRefParam(type7ActorId, type7Unknown, type7Slot, type7InventoryType);
|
||||
}
|
||||
break;
|
||||
case 0x8: //Used for offering
|
||||
{
|
||||
uint actorId = Utils.SwapEndian(reader.ReadUInt32());
|
||||
ushort unk1 = Utils.SwapEndian(reader.ReadUInt16());
|
||||
ushort offerSlot = Utils.SwapEndian(reader.ReadUInt16());
|
||||
ushort seekSlot = Utils.SwapEndian(reader.ReadUInt16());
|
||||
ushort unk2 = Utils.SwapEndian(reader.ReadUInt16());
|
||||
value = new ItemOfferParam(actorId, unk1, offerSlot, seekSlot, unk2);
|
||||
}
|
||||
break;
|
||||
case 0x9: //Two Longs (only storing first one)
|
||||
value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64()));
|
||||
break;
|
||||
|
@ -105,7 +135,13 @@ namespace FFXIVClassic_Map_Server
|
|||
if (isDone)
|
||||
break;
|
||||
|
||||
if (value != null)
|
||||
//Special case cause fuck Type8
|
||||
if (value != null && value is ItemOfferParam)
|
||||
{
|
||||
luaParams.Add(new LuaParam(code, value));
|
||||
luaParams.Add(new LuaParam(5, null));
|
||||
}
|
||||
else if (value != null)
|
||||
luaParams.Add(new LuaParam(code, value));
|
||||
else if (wasNil)
|
||||
luaParams.Add(new LuaParam(code, value));
|
||||
|
@ -152,11 +188,11 @@ namespace FFXIVClassic_Map_Server
|
|||
writer.Write((UInt32)Utils.SwapEndian((UInt32)l.value));
|
||||
break;
|
||||
case 0x7: //Weird one used for inventory
|
||||
Type7Param type7 = (Type7Param)l.value;
|
||||
ItemRefParam type7 = (ItemRefParam)l.value;
|
||||
writer.Write((UInt32)Utils.SwapEndian((UInt32)type7.actorId));
|
||||
writer.Write((Byte)type7.unknown);
|
||||
writer.Write((Byte)type7.slot);
|
||||
writer.Write((Byte)type7.inventoryType);
|
||||
writer.Write((Byte)type7.itemPackage);
|
||||
break;
|
||||
case 0x9: //Two Longs (only storing first one)
|
||||
writer.Write((UInt64)Utils.SwapEndian(((Type9Param)l.value).item1));
|
||||
|
@ -226,7 +262,7 @@ namespace FFXIVClassic_Map_Server
|
|||
byte type7Unknown = reader.ReadByte();
|
||||
byte type7Slot = reader.ReadByte();
|
||||
byte type7InventoryType = reader.ReadByte();
|
||||
value = new Type7Param(type7ActorId, type7Unknown, type7Slot, type7InventoryType);
|
||||
value = new ItemRefParam(type7ActorId, type7Unknown, type7Slot, type7InventoryType);
|
||||
break;
|
||||
case 0x9: //Two Longs (only storing first one)
|
||||
value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64()));
|
||||
|
@ -359,9 +395,13 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
luaParams.Add(new LuaParam(0x6, ((Actor)o).actorId));
|
||||
}
|
||||
else if (o is Type7Param)
|
||||
else if (o is ItemRefParam)
|
||||
{
|
||||
luaParams.Add(new LuaParam(0x7, (Type7Param)o));
|
||||
luaParams.Add(new LuaParam(0x7, (ItemRefParam)o));
|
||||
}
|
||||
else if (o is ItemOfferParam)
|
||||
{
|
||||
luaParams.Add(new LuaParam(0x8, (ItemOfferParam)o));
|
||||
}
|
||||
else if (o is Type9Param)
|
||||
{
|
||||
|
@ -416,16 +456,20 @@ namespace FFXIVClassic_Map_Server
|
|||
dumpString += String.Format("0x{0:X}", (uint)lParams[i].value);
|
||||
break;
|
||||
case 0x7: //Weird one used for inventory
|
||||
Type7Param type7Param = ((Type7Param)lParams[i].value);
|
||||
dumpString += String.Format("Type7 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X})", type7Param.actorId, type7Param.unknown, type7Param.slot, type7Param.inventoryType);
|
||||
ItemRefParam type7Param = ((ItemRefParam)lParams[i].value);
|
||||
dumpString += String.Format("Type7 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X})", type7Param.actorId, type7Param.unknown, type7Param.slot, type7Param.itemPackage);
|
||||
break;
|
||||
case 0xC: //Byte
|
||||
dumpString += String.Format("0x{0:X}", (byte)lParams[i].value);
|
||||
case 0x8: //Weird one used for inventory
|
||||
ItemOfferParam itemOfferParam = ((ItemOfferParam)lParams[i].value);
|
||||
dumpString += String.Format("Type8 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X}, 0x{4:X})", itemOfferParam.actorId, itemOfferParam.unknown1, itemOfferParam.offerSlot, itemOfferParam.seekSlot, itemOfferParam.unknown2);
|
||||
break;
|
||||
case 0x9: //Long (+ 8 bytes ignored)
|
||||
Type9Param type9Param = ((Type9Param)lParams[i].value);
|
||||
dumpString += String.Format("Type9 Param: (0x{0:X}, 0x{1:X})", type9Param.item1, type9Param.item2);
|
||||
break;
|
||||
case 0xC: //Byte
|
||||
dumpString += String.Format("0x{0:X}", (byte)lParams[i].value);
|
||||
break;
|
||||
case 0x1B: //Short?
|
||||
dumpString += String.Format("0x{0:X}", (ushort)lParams[i].value);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue