mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
mass replaced all methods to pascal case
This commit is contained in:
@@ -55,30 +55,30 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
charaWork.statusShownTime[i] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
public SubPacket createAppearancePacket(uint playerActorId)
|
||||
public SubPacket CreateAppearancePacket(uint playerActorId)
|
||||
{
|
||||
SetActorAppearancePacket setappearance = new SetActorAppearancePacket(modelId, appearanceIds);
|
||||
return setappearance.buildPacket(actorId, playerActorId);
|
||||
return setappearance.BuildPacket(actorId, playerActorId);
|
||||
}
|
||||
|
||||
public SubPacket createInitStatusPacket(uint playerActorId)
|
||||
public SubPacket CreateInitStatusPacket(uint playerActorId)
|
||||
{
|
||||
return (SetActorStatusAllPacket.buildPacket(actorId, playerActorId, charaWork.status));
|
||||
return (SetActorStatusAllPacket.BuildPacket(actorId, playerActorId, charaWork.status));
|
||||
}
|
||||
|
||||
public SubPacket createSetActorIconPacket(uint playerActorId)
|
||||
public SubPacket CreateSetActorIconPacket(uint playerActorId)
|
||||
{
|
||||
return SetActorIconPacket.buildPacket(actorId, playerActorId, currentActorIcon);
|
||||
return SetActorIconPacket.BuildPacket(actorId, playerActorId, currentActorIcon);
|
||||
}
|
||||
|
||||
public SubPacket createIdleAnimationPacket(uint playerActorId)
|
||||
public SubPacket CreateIdleAnimationPacket(uint playerActorId)
|
||||
{
|
||||
return SetActorIdleAnimationPacket.buildPacket(actorId, playerActorId, animationId);
|
||||
return SetActorIdleAnimationPacket.BuildPacket(actorId, playerActorId, animationId);
|
||||
}
|
||||
|
||||
public void setQuestGraphic(Player player, int graphicNum)
|
||||
public void SetQuestGraphic(Player player, int graphicNum)
|
||||
{
|
||||
player.queuePacket(SetActorQuestGraphicPacket.buildPacket(player.actorId, actorId, graphicNum));
|
||||
player.QueuePacket(SetActorQuestGraphicPacket.BuildPacket(player.actorId, actorId, graphicNum));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
|
||||
this.zoneId = zoneId;
|
||||
|
||||
loadNpcTemplate(id);
|
||||
LoadNpcTemplate(id);
|
||||
|
||||
charaWork.battleSave.potencial = 1.0f;
|
||||
|
||||
@@ -58,47 +58,47 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
charaWork.property[4] = 1;
|
||||
}
|
||||
|
||||
public SubPacket createAddActorPacket(uint playerActorId)
|
||||
public SubPacket CreateAddActorPacket(uint playerActorId)
|
||||
{
|
||||
return AddActorPacket.buildPacket(actorId, playerActorId, 8);
|
||||
return AddActorPacket.BuildPacket(actorId, playerActorId, 8);
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
|
||||
Player player = Server.GetWorldManager().GetPCInWorld(playerActorId);
|
||||
lParams = LuaEngine.doActorInstantiate(player, this);
|
||||
lParams = LuaEngine.DoActorInstantiate(player, this);
|
||||
|
||||
if (lParams == null)
|
||||
{
|
||||
className = "PopulaceStandard";
|
||||
lParams = LuaUtils.createLuaParamList("/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, 0xF47F6, false, false, 0, 1, "TEST");
|
||||
lParams = LuaUtils.CreateLuaParamList("/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, 0xF47F6, false, false, 0, 1, "TEST");
|
||||
}
|
||||
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
|
||||
public override BasePacket getSpawnPackets(uint playerActorId, uint spawnType)
|
||||
public override BasePacket GetSpawnPackets(uint playerActorId, uint spawnType)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(createAddActorPacket(playerActorId));
|
||||
subpackets.AddRange(getEventConditionPackets(playerActorId));
|
||||
subpackets.Add(createSpeedPacket(playerActorId));
|
||||
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x0));
|
||||
subpackets.Add(createAppearancePacket(playerActorId));
|
||||
subpackets.Add(createNamePacket(playerActorId));
|
||||
subpackets.Add(createStatePacket(playerActorId));
|
||||
subpackets.Add(createIdleAnimationPacket(playerActorId));
|
||||
subpackets.Add(createInitStatusPacket(playerActorId));
|
||||
subpackets.Add(createSetActorIconPacket(playerActorId));
|
||||
subpackets.Add(createIsZoneingPacket(playerActorId));
|
||||
subpackets.Add(createScriptBindPacket(playerActorId));
|
||||
subpackets.Add(CreateAddActorPacket(playerActorId));
|
||||
subpackets.AddRange(GetEventConditionPackets(playerActorId));
|
||||
subpackets.Add(CreateSpeedPacket(playerActorId));
|
||||
subpackets.Add(CreateSpawnPositonPacket(playerActorId, 0x0));
|
||||
subpackets.Add(CreateAppearancePacket(playerActorId));
|
||||
subpackets.Add(CreateNamePacket(playerActorId));
|
||||
subpackets.Add(CreateStatePacket(playerActorId));
|
||||
subpackets.Add(CreateIdleAnimationPacket(playerActorId));
|
||||
subpackets.Add(CreateInitStatusPacket(playerActorId));
|
||||
subpackets.Add(CreateSetActorIconPacket(playerActorId));
|
||||
subpackets.Add(CreateIsZoneingPacket(playerActorId));
|
||||
subpackets.Add(CreateScriptBindPacket(playerActorId));
|
||||
|
||||
return BasePacket.createPacket(subpackets, true, false);
|
||||
return BasePacket.CreatePacket(subpackets, true, false);
|
||||
}
|
||||
|
||||
public override BasePacket getInitPackets(uint playerActorId)
|
||||
public override BasePacket GetInitPackets(uint playerActorId)
|
||||
{
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this, playerActorId);
|
||||
|
||||
@@ -106,52 +106,52 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
for (int i = 0; i < charaWork.property.Length; i++)
|
||||
{
|
||||
if (charaWork.property[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.property[{0}]", i));
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.property[{0}]", i));
|
||||
}
|
||||
|
||||
//Parameters
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.hp[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.hpMax[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.mp");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.mpMax");
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.tp");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.hp[0]");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.hpMax[0]");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.mp");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.mpMax");
|
||||
propPacketUtil.AddProperty("charaWork.parameterTemp.tp");
|
||||
|
||||
if (charaWork.parameterSave.state_mainSkill[0] != 0)
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[0]");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[0]");
|
||||
if (charaWork.parameterSave.state_mainSkill[1] != 0)
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[1]");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[1]");
|
||||
if (charaWork.parameterSave.state_mainSkill[2] != 0)
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[2]");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[2]");
|
||||
if (charaWork.parameterSave.state_mainSkill[3] != 0)
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[3]");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[3]");
|
||||
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||
|
||||
//Status Times
|
||||
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
|
||||
{
|
||||
if (charaWork.statusShownTime[i] != 0xFFFFFFFF)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||
}
|
||||
|
||||
//General Parameters
|
||||
for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++)
|
||||
{
|
||||
if (charaWork.battleTemp.generalParameter[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||
}
|
||||
|
||||
propPacketUtil.addProperty("npcWork.hateType");
|
||||
propPacketUtil.AddProperty("npcWork.hateType");
|
||||
|
||||
return BasePacket.createPacket(propPacketUtil.done(), true, false);
|
||||
return BasePacket.CreatePacket(propPacketUtil.Done(), true, false);
|
||||
}
|
||||
|
||||
public uint getActorClassId()
|
||||
public uint GetActorClassId()
|
||||
{
|
||||
return actorClassId;
|
||||
}
|
||||
|
||||
public void loadNpcTemplate(uint id)
|
||||
public void LoadNpcTemplate(uint id)
|
||||
{
|
||||
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
||||
{
|
||||
@@ -216,7 +216,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
modelId = reader.GetUInt32(0);
|
||||
appearanceIds[Character.SIZE] = reader.GetUInt32(1);
|
||||
appearanceIds[Character.COLORINFO] = (uint)(reader.GetUInt32(16) | (reader.GetUInt32(15) << 10) | (reader.GetUInt32(17) << 20)); //17 - Skin Color, 16 - Hair Color, 18 - Eye Color
|
||||
appearanceIds[Character.FACEINFO] = PrimitiveConversion.ToUInt32(CharacterUtils.getFaceInfo(reader.GetByte(6), reader.GetByte(7), reader.GetByte(5), reader.GetByte(14), reader.GetByte(13), reader.GetByte(12), reader.GetByte(11), reader.GetByte(10), reader.GetByte(9), reader.GetByte(8)));
|
||||
appearanceIds[Character.FACEINFO] = PrimitiveConversion.ToUInt32(CharacterUtils.GetFaceInfo(reader.GetByte(6), reader.GetByte(7), reader.GetByte(5), reader.GetByte(14), reader.GetByte(13), reader.GetByte(12), reader.GetByte(11), reader.GetByte(10), reader.GetByte(9), reader.GetByte(8)));
|
||||
appearanceIds[Character.HIGHLIGHT_HAIR] = (uint)(reader.GetUInt32(3) | reader.GetUInt32(2) << 10); //5- Hair Highlight, 4 - Hair Style
|
||||
appearanceIds[Character.VOICE] = reader.GetUInt32(17);
|
||||
appearanceIds[Character.MAINHAND] = reader.GetUInt32(19);
|
||||
@@ -247,7 +247,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
}
|
||||
}
|
||||
|
||||
public void loadEventConditions(string eventConditions)
|
||||
public void LoadEventConditions(string eventConditions)
|
||||
{
|
||||
EventList conditions = JsonConvert.DeserializeObject<EventList>(eventConditions);
|
||||
this.eventConditions = conditions;
|
||||
|
@@ -64,40 +64,40 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
}
|
||||
}
|
||||
|
||||
toPlayer.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, toPlayer.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER));
|
||||
toPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, toPlayer.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER));
|
||||
int currentIndex = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (items.Count - currentIndex >= 16)
|
||||
toPlayer.queuePacket(InventoryListX16Packet.buildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex));
|
||||
toPlayer.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex));
|
||||
else if (items.Count - currentIndex > 1)
|
||||
toPlayer.queuePacket(InventoryListX08Packet.buildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex));
|
||||
toPlayer.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex));
|
||||
else if (items.Count - currentIndex == 1)
|
||||
{
|
||||
toPlayer.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, toPlayer.actorId, items[currentIndex]));
|
||||
toPlayer.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, toPlayer.actorId, items[currentIndex]));
|
||||
currentIndex++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
toPlayer.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId, toPlayer.actorId));
|
||||
toPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId, toPlayer.actorId));
|
||||
}
|
||||
|
||||
public void SendFullEquipment(bool doClear)
|
||||
public void SendFullEquipment(bool DoClear)
|
||||
{
|
||||
List<ushort> slotsToUpdate = new List<ushort>();
|
||||
for (ushort i = 0; i < list.Length; i++)
|
||||
{
|
||||
if (list[i] == null && doClear)
|
||||
if (list[i] == null && DoClear)
|
||||
slotsToUpdate.Add(0);
|
||||
else if (list[i] != null)
|
||||
slotsToUpdate.Add(i);
|
||||
}
|
||||
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
SendEquipmentPackets(slotsToUpdate);
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void SetEquipment(ushort[] slots, ushort[] itemSlots)
|
||||
@@ -107,18 +107,18 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
for (int i = 0; i < slots.Length; i++)
|
||||
{
|
||||
InventoryItem item = normalInventory.getItemBySlot(itemSlots[i]);
|
||||
InventoryItem item = normalInventory.GetItemBySlot(itemSlots[i]);
|
||||
|
||||
if (item == null)
|
||||
continue;
|
||||
|
||||
Database.equipItem(owner, slots[i], item.uniqueId);
|
||||
list[slots[i]] = normalInventory.getItemBySlot(itemSlots[i]);
|
||||
Database.EquipItem(owner, slots[i], item.uniqueId);
|
||||
list[slots[i]] = normalInventory.GetItemBySlot(itemSlots[i]);
|
||||
}
|
||||
|
||||
owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
|
||||
SendFullEquipment(false);
|
||||
owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void SetEquipment(InventoryItem[] toEquip)
|
||||
@@ -134,7 +134,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
public void Equip(ushort slot, ushort invSlot)
|
||||
{
|
||||
InventoryItem item = normalInventory.getItemBySlot(invSlot);
|
||||
InventoryItem item = normalInventory.GetItemBySlot(invSlot);
|
||||
|
||||
if (item == null)
|
||||
return;
|
||||
@@ -148,20 +148,20 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
return;
|
||||
|
||||
if (writeToDB)
|
||||
Database.equipItem(owner, slot, item.uniqueId);
|
||||
Database.EquipItem(owner, slot, item.uniqueId);
|
||||
|
||||
owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
|
||||
|
||||
if (list[slot] != null)
|
||||
normalInventory.RefreshItem(list[slot], item);
|
||||
else
|
||||
normalInventory.RefreshItem(item);
|
||||
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
SendEquipmentPackets(slot, item);
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
|
||||
owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
|
||||
list[slot] = item;
|
||||
}
|
||||
@@ -177,17 +177,17 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
return;
|
||||
|
||||
if (writeToDB)
|
||||
Database.unequipItem(owner, slot);
|
||||
Database.UnequipItem(owner, slot);
|
||||
|
||||
owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
|
||||
|
||||
normalInventory.RefreshItem(list[slot]);
|
||||
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
SendEquipmentPackets(slot, null);
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
|
||||
owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
|
||||
list[slot] = null;
|
||||
}
|
||||
@@ -195,9 +195,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
private void SendEquipmentPackets(ushort equipSlot, InventoryItem item)
|
||||
{
|
||||
if (item == null)
|
||||
owner.queuePacket(InventoryRemoveX01Packet.buildPacket(owner.actorId, equipSlot));
|
||||
owner.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, equipSlot));
|
||||
else
|
||||
owner.queuePacket(EquipmentListX01Packet.buildPacket(owner.actorId, equipSlot, item.slot));
|
||||
owner.QueuePacket(EquipmentListX01Packet.BuildPacket(owner.actorId, equipSlot, item.slot));
|
||||
}
|
||||
|
||||
private void SendEquipmentPackets(List<ushort> slotsToUpdate)
|
||||
@@ -208,16 +208,16 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
while (true)
|
||||
{
|
||||
if (slotsToUpdate.Count - currentIndex >= 64)
|
||||
owner.queuePacket(EquipmentListX64Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
|
||||
owner.QueuePacket(EquipmentListX64Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
|
||||
else if (slotsToUpdate.Count - currentIndex >= 32)
|
||||
owner.queuePacket(EquipmentListX32Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
|
||||
owner.QueuePacket(EquipmentListX32Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
|
||||
else if (slotsToUpdate.Count - currentIndex >= 16)
|
||||
owner.queuePacket(EquipmentListX16Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
|
||||
owner.QueuePacket(EquipmentListX16Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
|
||||
else if (slotsToUpdate.Count - currentIndex > 1)
|
||||
owner.queuePacket(EquipmentListX08Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
|
||||
owner.QueuePacket(EquipmentListX08Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
|
||||
else if (slotsToUpdate.Count - currentIndex == 1)
|
||||
{
|
||||
owner.queuePacket(EquipmentListX01Packet.buildPacket(owner.actorId, slotsToUpdate[currentIndex], list[slotsToUpdate[currentIndex]].slot));
|
||||
owner.QueuePacket(EquipmentListX01Packet.BuildPacket(owner.actorId, slotsToUpdate[currentIndex], list[slotsToUpdate[currentIndex]].slot));
|
||||
currentIndex++;
|
||||
}
|
||||
else
|
||||
|
@@ -33,12 +33,12 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
}
|
||||
|
||||
#region Inventory Management
|
||||
public void initList(List<InventoryItem> itemsFromDB)
|
||||
public void InitList(List<InventoryItem> itemsFromDB)
|
||||
{
|
||||
list = itemsFromDB;
|
||||
}
|
||||
|
||||
public InventoryItem getItemBySlot(ushort slot)
|
||||
public InventoryItem GetItemBySlot(ushort slot)
|
||||
{
|
||||
if (slot < list.Count)
|
||||
return list[slot];
|
||||
@@ -46,7 +46,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
return null;
|
||||
}
|
||||
|
||||
public InventoryItem getItemById(ulong itemId)
|
||||
public InventoryItem GetItemById(ulong itemId)
|
||||
{
|
||||
foreach (InventoryItem item in list)
|
||||
{
|
||||
@@ -58,41 +58,41 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
public void RefreshItem(InventoryItem item)
|
||||
{
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
sendInventoryPackets(item);
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
SendInventoryPackets(item);
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void RefreshItem(params InventoryItem[] items)
|
||||
{
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
sendInventoryPackets(items.ToList());
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
SendInventoryPackets(items.ToList());
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void RefreshItem(List<InventoryItem> items)
|
||||
{
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
sendInventoryPackets(items);
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
SendInventoryPackets(items);
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void addItem(uint itemId)
|
||||
public void AddItem(uint itemId)
|
||||
{
|
||||
addItem(itemId, 1, 1);
|
||||
AddItem(itemId, 1, 1);
|
||||
}
|
||||
|
||||
public void addItem(uint itemId, int quantity)
|
||||
public void AddItem(uint itemId, int quantity)
|
||||
{
|
||||
addItem(itemId, quantity, 1);
|
||||
AddItem(itemId, quantity, 1);
|
||||
}
|
||||
|
||||
public void addItem(uint itemId, int quantity, byte quality)
|
||||
public void AddItem(uint itemId, int quantity, byte quality)
|
||||
{
|
||||
if (!isSpaceForAdd(itemId, quantity))
|
||||
if (!IsSpaceForAdd(itemId, quantity))
|
||||
return;
|
||||
|
||||
Item gItem = Server.getItemGamedata(itemId);
|
||||
Item gItem = Server.GetItemGamedata(itemId);
|
||||
List<ushort> slotsToUpdate = new List<ushort>();
|
||||
List<SubPacket> addItemPackets = new List<SubPacket>();
|
||||
|
||||
@@ -121,73 +121,73 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
// return ITEMERROR_FULL;
|
||||
|
||||
//Update lists and db
|
||||
owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId));
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
|
||||
//These had their quantities changed
|
||||
//These had their quantities Changed
|
||||
foreach (ushort slot in slotsToUpdate)
|
||||
{
|
||||
Database.setQuantity(owner, slot, inventoryCode, list[slot].quantity);
|
||||
Database.SetQuantity(owner, slot, inventoryCode, list[slot].quantity);
|
||||
|
||||
if (inventoryCode != CURRENCY && inventoryCode != KEYITEMS)
|
||||
sendInventoryPackets(list[slot]);
|
||||
SendInventoryPackets(list[slot]);
|
||||
}
|
||||
|
||||
//New item that spilled over
|
||||
while (quantityCount > 0)
|
||||
{
|
||||
InventoryItem addedItem = Database.addItem(owner, itemId, Math.Min(quantityCount, gItem.maxStack), quality, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode);
|
||||
InventoryItem addedItem = Database.AddItem(owner, itemId, Math.Min(quantityCount, gItem.maxStack), quality, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode);
|
||||
|
||||
|
||||
list.Add(addedItem);
|
||||
|
||||
if (inventoryCode != CURRENCY && inventoryCode != KEYITEMS)
|
||||
sendInventoryPackets(addedItem);
|
||||
SendInventoryPackets(addedItem);
|
||||
|
||||
quantityCount -= gItem.maxStack;
|
||||
}
|
||||
|
||||
if (inventoryCode == CURRENCY || inventoryCode == KEYITEMS)
|
||||
sendFullInventory();
|
||||
SendFullInventory();
|
||||
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void addItem(uint[] itemId)
|
||||
public void AddItem(uint[] itemId)
|
||||
{
|
||||
if (!isSpaceForAdd(itemId[0], itemId.Length))
|
||||
if (!IsSpaceForAdd(itemId[0], itemId.Length))
|
||||
return;
|
||||
|
||||
//Update lists and db
|
||||
owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId));
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
|
||||
int startPos = list.Count;
|
||||
|
||||
//New item that spilled over
|
||||
for (int i = 0; i < itemId.Length; i++)
|
||||
{
|
||||
Item gItem = Server.getItemGamedata(itemId[i]);
|
||||
InventoryItem addedItem = Database.addItem(owner, itemId[i], 1, (byte)1, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode);
|
||||
Item gItem = Server.GetItemGamedata(itemId[i]);
|
||||
InventoryItem addedItem = Database.AddItem(owner, itemId[i], 1, (byte)1, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode);
|
||||
list.Add(addedItem);
|
||||
}
|
||||
|
||||
sendInventoryPackets(startPos);
|
||||
SendInventoryPackets(startPos);
|
||||
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void removeItem(uint itemId, int quantity)
|
||||
public void RemoveItem(uint itemId, int quantity)
|
||||
{
|
||||
if (!hasItem(itemId, quantity))
|
||||
if (!HasItem(itemId, quantity))
|
||||
return;
|
||||
|
||||
List<ushort> slotsToUpdate = new List<ushort>();
|
||||
List<InventoryItem> itemsToRemove = new List<InventoryItem>();
|
||||
List<ushort> slotsToRemove = new List<ushort>();
|
||||
List<SubPacket> addItemPackets = new List<SubPacket>();
|
||||
List<SubPacket> AddItemPackets = new List<SubPacket>();
|
||||
|
||||
//Remove as we go along
|
||||
int quantityCount = quantity;
|
||||
@@ -220,13 +220,13 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
for (int i = 0; i < slotsToUpdate.Count; i++)
|
||||
{
|
||||
Database.setQuantity(owner, slotsToUpdate[i], inventoryCode, list[slotsToUpdate[i]].quantity);
|
||||
Database.SetQuantity(owner, slotsToUpdate[i], inventoryCode, list[slotsToUpdate[i]].quantity);
|
||||
}
|
||||
|
||||
int oldListSize = list.Count;
|
||||
for (int i = 0; i < itemsToRemove.Count; i++)
|
||||
{
|
||||
Database.removeItem(owner, itemsToRemove[i].uniqueId, inventoryCode);
|
||||
Database.RemoveItem(owner, itemsToRemove[i].uniqueId, inventoryCode);
|
||||
list.Remove(itemsToRemove[i]);
|
||||
}
|
||||
|
||||
@@ -241,21 +241,21 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
slotsToRemove.Add((ushort)i);
|
||||
}
|
||||
|
||||
owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId));
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
|
||||
sendInventoryPackets(lowestSlot);
|
||||
sendInventoryRemovePackets(slotsToRemove);
|
||||
SendInventoryPackets(lowestSlot);
|
||||
SendInventoryRemovePackets(slotsToRemove);
|
||||
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
|
||||
if (inventoryCode == NORMAL)
|
||||
owner.getEquipment().SendFullEquipment(false);
|
||||
owner.GetEquipment().SendFullEquipment(false);
|
||||
|
||||
owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void removeItem(ulong itemDBId)
|
||||
public void RemoveItem(ulong itemDBId)
|
||||
{
|
||||
ushort slot = 0;
|
||||
InventoryItem toDelete = null;
|
||||
@@ -274,104 +274,104 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
int oldListSize = list.Count;
|
||||
list.RemoveAt(slot);
|
||||
Database.removeItem(owner, itemDBId, inventoryCode);
|
||||
Database.RemoveItem(owner, itemDBId, inventoryCode);
|
||||
|
||||
//Realign slots
|
||||
for (int i = slot; i < list.Count; i++)
|
||||
list[i].slot = (ushort)i;
|
||||
|
||||
owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId));
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
|
||||
sendInventoryPackets(slot);
|
||||
sendInventoryRemovePackets(slot);
|
||||
SendInventoryPackets(slot);
|
||||
SendInventoryRemovePackets(slot);
|
||||
if (slot != oldListSize - 1)
|
||||
sendInventoryRemovePackets((ushort)(oldListSize - 1));
|
||||
SendInventoryRemovePackets((ushort)(oldListSize - 1));
|
||||
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
|
||||
if (inventoryCode == NORMAL)
|
||||
owner.getEquipment().SendFullEquipment(false);
|
||||
owner.GetEquipment().SendFullEquipment(false);
|
||||
|
||||
owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
|
||||
}
|
||||
|
||||
public void removeItem(ushort slot)
|
||||
public void RemoveItem(ushort slot)
|
||||
{
|
||||
if (slot >= list.Count)
|
||||
return;
|
||||
|
||||
int oldListSize = list.Count;
|
||||
list.RemoveAt((int)slot);
|
||||
Database.removeItem(owner, slot, inventoryCode);
|
||||
Database.RemoveItem(owner, slot, inventoryCode);
|
||||
|
||||
//Realign slots
|
||||
for (int i = slot; i < list.Count; i++)
|
||||
list[i].slot = (ushort)i;
|
||||
|
||||
owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId));
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
|
||||
sendInventoryPackets(slot);
|
||||
sendInventoryRemovePackets(slot);
|
||||
SendInventoryPackets(slot);
|
||||
SendInventoryRemovePackets(slot);
|
||||
if (slot != oldListSize - 1)
|
||||
sendInventoryRemovePackets((ushort)(oldListSize - 1));
|
||||
SendInventoryRemovePackets((ushort)(oldListSize - 1));
|
||||
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
|
||||
if (inventoryCode == NORMAL)
|
||||
owner.getEquipment().SendFullEquipment(false);
|
||||
owner.GetEquipment().SendFullEquipment(false);
|
||||
|
||||
owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void changeDurability(uint slot, uint durabilityChange)
|
||||
public void ChangeDurability(uint slot, uint durabilityChange)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void changeSpiritBind(uint slot, uint spiritBindChange)
|
||||
public void ChangeSpiritBind(uint slot, uint spiritBindChange)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void changeMateria(uint slot, byte materiaSlot, byte materiaId)
|
||||
public void ChangeMateria(uint slot, byte materiaSlot, byte materiaId)
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Packet Functions
|
||||
public void sendFullInventory()
|
||||
public void SendFullInventory()
|
||||
{
|
||||
owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
sendInventoryPackets(0);
|
||||
owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));
|
||||
owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
|
||||
SendInventoryPackets(0);
|
||||
owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
private void sendInventoryPackets(InventoryItem item)
|
||||
private void SendInventoryPackets(InventoryItem item)
|
||||
{
|
||||
owner.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, item));
|
||||
owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, item));
|
||||
}
|
||||
|
||||
private void sendInventoryPackets(List<InventoryItem> items)
|
||||
private void SendInventoryPackets(List<InventoryItem> items)
|
||||
{
|
||||
int currentIndex = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (items.Count - currentIndex >= 64)
|
||||
owner.queuePacket(InventoryListX64Packet.buildPacket(owner.actorId, items, ref currentIndex));
|
||||
owner.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex));
|
||||
else if (items.Count - currentIndex >= 32)
|
||||
owner.queuePacket(InventoryListX32Packet.buildPacket(owner.actorId, items, ref currentIndex));
|
||||
owner.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex));
|
||||
else if (items.Count - currentIndex >= 16)
|
||||
owner.queuePacket(InventoryListX16Packet.buildPacket(owner.actorId, items, ref currentIndex));
|
||||
owner.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex));
|
||||
else if (items.Count - currentIndex > 1)
|
||||
owner.queuePacket(InventoryListX08Packet.buildPacket(owner.actorId, items, ref currentIndex));
|
||||
owner.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex));
|
||||
else if (items.Count - currentIndex == 1)
|
||||
{
|
||||
owner.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, items[currentIndex]));
|
||||
owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex]));
|
||||
currentIndex++;
|
||||
}
|
||||
else
|
||||
@@ -380,23 +380,23 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
}
|
||||
|
||||
private void sendInventoryPackets(int startOffset)
|
||||
private void SendInventoryPackets(int startOffset)
|
||||
{
|
||||
int currentIndex = startOffset;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (list.Count - currentIndex >= 64)
|
||||
owner.queuePacket(InventoryListX64Packet.buildPacket(owner.actorId, list, ref currentIndex));
|
||||
owner.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, list, ref currentIndex));
|
||||
else if (list.Count - currentIndex >= 32)
|
||||
owner.queuePacket(InventoryListX32Packet.buildPacket(owner.actorId, list, ref currentIndex));
|
||||
owner.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, list, ref currentIndex));
|
||||
else if (list.Count - currentIndex >= 16)
|
||||
owner.queuePacket(InventoryListX16Packet.buildPacket(owner.actorId, list, ref currentIndex));
|
||||
owner.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, list, ref currentIndex));
|
||||
else if (list.Count - currentIndex > 1)
|
||||
owner.queuePacket(InventoryListX08Packet.buildPacket(owner.actorId, list, ref currentIndex));
|
||||
owner.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, list, ref currentIndex));
|
||||
else if (list.Count - currentIndex == 1)
|
||||
{
|
||||
owner.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, list[currentIndex]));
|
||||
owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, list[currentIndex]));
|
||||
currentIndex++;
|
||||
}
|
||||
else
|
||||
@@ -405,28 +405,28 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
}
|
||||
|
||||
private void sendInventoryRemovePackets(ushort index)
|
||||
private void SendInventoryRemovePackets(ushort index)
|
||||
{
|
||||
owner.queuePacket(InventoryRemoveX01Packet.buildPacket(owner.actorId, index));
|
||||
owner.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, index));
|
||||
}
|
||||
|
||||
private void sendInventoryRemovePackets(List<ushort> indexes)
|
||||
private void SendInventoryRemovePackets(List<ushort> indexes)
|
||||
{
|
||||
int currentIndex = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (indexes.Count - currentIndex >= 64)
|
||||
owner.queuePacket(InventoryRemoveX64Packet.buildPacket(owner.actorId, indexes, ref currentIndex));
|
||||
owner.QueuePacket(InventoryRemoveX64Packet.BuildPacket(owner.actorId, indexes, ref currentIndex));
|
||||
else if (indexes.Count - currentIndex >= 32)
|
||||
owner.queuePacket(InventoryRemoveX32Packet.buildPacket(owner.actorId, indexes, ref currentIndex));
|
||||
owner.QueuePacket(InventoryRemoveX32Packet.BuildPacket(owner.actorId, indexes, ref currentIndex));
|
||||
else if (indexes.Count - currentIndex >= 16)
|
||||
owner.queuePacket(InventoryRemoveX16Packet.buildPacket(owner.actorId, indexes, ref currentIndex));
|
||||
owner.QueuePacket(InventoryRemoveX16Packet.BuildPacket(owner.actorId, indexes, ref currentIndex));
|
||||
else if (indexes.Count - currentIndex > 1)
|
||||
owner.queuePacket(InventoryRemoveX08Packet.buildPacket(owner.actorId, indexes, ref currentIndex));
|
||||
owner.QueuePacket(InventoryRemoveX08Packet.BuildPacket(owner.actorId, indexes, ref currentIndex));
|
||||
else if (indexes.Count - currentIndex == 1)
|
||||
{
|
||||
owner.queuePacket(InventoryRemoveX01Packet.buildPacket(owner.actorId, indexes[currentIndex]));
|
||||
owner.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, indexes[currentIndex]));
|
||||
currentIndex++;
|
||||
}
|
||||
else
|
||||
@@ -439,18 +439,18 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
#region Inventory Utils
|
||||
|
||||
public bool isFull()
|
||||
public bool IsFull()
|
||||
{
|
||||
return list.Count >= inventoryCapacity;
|
||||
}
|
||||
|
||||
public bool isSpaceForAdd(uint itemId, int quantity)
|
||||
public bool IsSpaceForAdd(uint itemId, int quantity)
|
||||
{
|
||||
int quantityCount = quantity;
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
InventoryItem item = list[i];
|
||||
Item gItem = Server.getItemGamedata(item.itemId);
|
||||
Item gItem = Server.GetItemGamedata(item.itemId);
|
||||
if (item.itemId == itemId && item.quantity < gItem.maxStack)
|
||||
{
|
||||
quantityCount -= (gItem.maxStack - item.quantity);
|
||||
@@ -459,15 +459,15 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
}
|
||||
}
|
||||
|
||||
return quantityCount <= 0 || (quantityCount > 0 && !isFull());
|
||||
return quantityCount <= 0 || (quantityCount > 0 && !IsFull());
|
||||
}
|
||||
|
||||
public bool hasItem(uint itemId)
|
||||
public bool HasItem(uint itemId)
|
||||
{
|
||||
return hasItem(itemId, 1);
|
||||
return HasItem(itemId, 1);
|
||||
}
|
||||
|
||||
public bool hasItem(uint itemId, int minQuantity)
|
||||
public bool HasItem(uint itemId, int minQuantity)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
@@ -483,7 +483,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getNextEmptySlot()
|
||||
public int GetNextEmptySlot()
|
||||
{
|
||||
return list.Count == 0 ? 0 : list.Count();
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user