mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-24 19:38:26 +02:00
Inventory.cs - GetItemQuantity() added
- AddItem functions to cast INV_ERROR to INT for LUA - Fixed unique item check. It was checking for Rare flag, not EX Scripts : Base - shop.lua : Functions for buying/selling from a variety of shop scripts Commands - EmoteStandardCommand.lua fixed not being able to use emotes when sitting - DiceCommand.lua fixed. No arguments sets default value of 100 as per the ingame description. Max value raised from 999 to 1000. GM Commands - speed.lua fixed when using single argument - nudge.lua fixed sanitizing. Made arguments reversible to allow !nudge up 10 & !nudge 10 up - giveitem.lua added inv_error handling. Need to do to rest of item commands at some point - givecurrency.lua changed to have you enter a regex'd name of item rather than item ID. Eg. "!givecurrency fire_crystal 10". Added inv_error handling to it. - warpplayer.lua added. Moves yourself to name of player, or moves first player to second player - warpid.lua added. For warping to the first instance of an actor's uniqueId the server comes across. - quest.lua added. For adding/adjusting quests for debugging them. Class Scripts - PopulaceBlackMarketeer.lua updated to utilize shop.lua - PopulaceShopSalesman.lua updated to utilize shop.lua - PopulaceCompanyShop.lua updated to utilize shop.lua - PopulaceCompanyBuffer.lua added and documented along with menu layout. Needs working status effect to finish. - PopulaceCompanyGLPublisher.lua added. Mostly documented, barely functional. - PopulaceCompanyGuide.lua added. Documented, fully functional. - PopulaceCompanyOfficer.lua added. Documented. Menus work. Needs GC rank table at some point for documenting GC ranks/seal caps. - PopulaceCompanySupply.lua added and mostly documented. Read-only basic menu flow, static LUA tables used to set it up, will need SQL tables at some point to replace them with. Some guesswork on what menus show since no video reference could be found. - PopulaceGuildShop.lua updated. Mostly documented. Read-only shop menus.
This commit is contained in:
parent
8ae4fbc045
commit
324ebab2d2
20 changed files with 1516 additions and 344 deletions
|
@ -94,7 +94,30 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||
return null;
|
||||
}
|
||||
|
||||
public INV_ERROR AddItem(uint itemId)
|
||||
|
||||
public int GetItemQuantity(uint itemId)
|
||||
{
|
||||
return GetItemQuantity(itemId, 1);
|
||||
}
|
||||
|
||||
public int GetItemQuantity(uint itemId, uint quality)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
for (int i = endOfListIndex - 1; i >= 0; i--)
|
||||
{
|
||||
InventoryItem item = list[i];
|
||||
|
||||
if (item.itemId == itemId && item.quality == quality)
|
||||
count += item.quantity;
|
||||
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
public int AddItem(uint itemId)
|
||||
{
|
||||
return AddItem(itemId, 1, 1);
|
||||
}
|
||||
|
@ -105,22 +128,22 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||
AddItem(itemId[i]);
|
||||
}
|
||||
|
||||
public INV_ERROR AddItem(uint itemId, int quantity)
|
||||
public int AddItem(uint itemId, int quantity)
|
||||
{
|
||||
return AddItem(itemId, quantity, 1);
|
||||
}
|
||||
|
||||
public INV_ERROR AddItem(uint itemId, int quantity, byte quality)
|
||||
public int AddItem(uint itemId, int quantity, byte quality)
|
||||
{
|
||||
if (!IsSpaceForAdd(itemId, quantity, quality))
|
||||
return INV_ERROR.INVENTORY_FULL;
|
||||
return (int)INV_ERROR.INVENTORY_FULL;
|
||||
|
||||
ItemData gItem = Server.GetItemGamedata(itemId);
|
||||
|
||||
if (gItem == null)
|
||||
{
|
||||
Program.Log.Error("Inventory.AddItem: unable to find item %u", itemId);
|
||||
return INV_ERROR.SYSTEM_ERROR;
|
||||
return (int)INV_ERROR.SYSTEM_ERROR;
|
||||
}
|
||||
|
||||
//Check if item id exists
|
||||
|
@ -146,8 +169,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||
}
|
||||
|
||||
//If it's unique, abort
|
||||
if (quantityCount > 0 && gItem.isExclusive)
|
||||
return INV_ERROR.ALREADY_HAS_UNIQUE;
|
||||
if (HasItem(itemId) && gItem.isRare)
|
||||
return (int)INV_ERROR.ALREADY_HAS_UNIQUE;
|
||||
|
||||
//New item that spilled over
|
||||
while (quantityCount > 0)
|
||||
|
@ -161,9 +184,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||
DoDatabaseAdd(addedItem);
|
||||
}
|
||||
|
||||
SendUpdatePackets();
|
||||
|
||||
return INV_ERROR.SUCCESS;
|
||||
SendUpdatePackets();
|
||||
|
||||
return (int)INV_ERROR.SUCCESS;
|
||||
}
|
||||
|
||||
public void RemoveItem(uint itemId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue