Jump to content

Recommended Posts

Posted (edited)

Credits: Myself (YulRun)

Thought I'd share this, as I was looking for one and none available. This can definitely be refined and can add a lot more sorting Params, but this will server as a great starting place for anyone looking.

Ideally you want to set this up to a button to call the Sort() function in InventoryWnd.uc.

At the top with your other global variables add:

Spoiler


var Array<ItemInfo> AssetList;
var Array<ItemInfo> WeaponList;
var Array<ItemInfo> ArmorList;
var Array<ItemInfo> AccesaryList;
var Array<ItemInfo> EtcItemList;
var Array<ItemInfo> BlessEnchantAmList;
var Array<ItemInfo> BlessEnchantWpList;
var Array<ItemInfo> EnchantAmList;
var Array<ItemInfo> EnchantWpList;
var Array<ItemInfo> PotionList;
var Array<ItemInfo> ElixirList;
var Array<ItemInfo> ArrowList;
var Array<ItemInfo> RecipeList;
var Array<ItemInfo> SpellbookList;
var Array<ItemInfo> CrystalList;
var Array<ItemInfo> ScrollList;
var Array<ItemInfo> MaterialList;
var Array<ItemInfo> SoulshotList;
var Array<ItemInfo> SpiritshotList;
var Array<ItemInfo> BlessedSpiritshotList;

 


Functions to add at the at the bottom of the Script:

Spoiler


// Interlude Sort Function - YulRun
function Sort()
{
	// Initialize
	SaveItemOrder();
	LoadItemOrder();
	
	// Organizes Inventory into Sub Lists
	CreateSortSubLists();
	
	// If Possible, will sort sublists by Quality
	SortSubListsByQuality();
	
	// Arranges Inventory list by the Sub Lists
	SortBySublist();
	
	// Calls to order the items by the Inventory List
	OrderItem();
}

function CreateSortSubLists()
{
	local ItemInfo itemInfo;
	local int checkOrderIndex;
	local int itemType;
	local int itemSubType;
	local int numAsset;
	local int numWeapon;
	local int numArmor;
	local int numAccessary;
	local int numEtcItem;
	local int numBlessEnchantAm;
	local int numBlessEnchantWp;
	local int numEnchantAm;
	local int numEnchantWp;
	local int numPotion;
	local int numArrow;
	local int numRecipe;
	local int numSpellbook;
	local int numCrystal;
	local int numScrolls;
	local int numMaterials;
	local int numSoulshot;
	local int numSpiritshot;
	local int numBlessedSpiritshot;
	
	numAsset = 0;
	numWeapon = 0;
	numArmor = 0;
	numAccessary = 0;
	numPotion = 0;
	numEtcItem = 0;
	numBlessEnchantAm = 0;
	numBlessEnchantWp = 0;
	numEnchantAm = 0;
	numEnchantWp = 0;
	numPotion = 0;
	numArrow = 0;
	numRecipe = 0;
	numSpellbook = 0;
	numCrystal = 0;
	numScrolls = 0;
	numMaterials = 0;
	numSoulshot = 0;
	numSpiritshot = 0;
	numBlessedSpiritshot = 0;
	
	
	for (checkOrderIndex = 0; checkOrderIndex < m_itemOrder.Length; checkOrderIndex++)
	{
		m_invenItem.GetItem(checkOrderIndex, itemInfo);
		itemType = itemInfo.ItemType;
		itemSubType = itemInfo.ItemSubType;
		
		// Checking Subtypes Debug
		log("Index: " $ checkOrderIndex $ " - " $ itemInfo.name $ " - ItemType: " $ itemType $ " - SubType: " $ itemSubType);
		
		// Fill Categories
		switch (itemType)
		{
			// Asset (Adena etc)
			case 4:
				AssetList[numAsset] = itemInfo;
				numAsset++;
			break;
			// Weapon
			case 0:
				WeaponList[numWeapon] = itemInfo;
				numWeapon++;
			break;
			// Armor
			case 1:
				ArmorList[numArmor] = itemInfo;
				numArmor++;
			break;
			// Accessory (Jewels, hats etc)
			case 2:
				AccesaryList[numAccessary] = itemInfo;
				numAccessary++;
			break;
			// Etc Subtype
			case 5:
				switch (itemSubType)
				{				
					// Spellbooks, Enchants, etc
					case 0:
						if (Left(itemInfo.name,10) == "Spellbook:" || Left(itemInfo.name,7) == "Amulet:" )
						{
							SpellbookList[numSpellbook] = itemInfo;
							numSpellbook++;
						}
						if (Left(itemInfo.name,8) == "Crystal:")
						{
							CrystalList[numCrystal] = itemInfo;
							numCrystal++;
						}
						if (Left(itemInfo.name,25) == "Blessed Scroll: Enchant W")
						{
							BlessEnchantWpList[numBlessEnchantWp] = itemInfo;
							numBlessEnchantWp++;
						}
						if (Left(itemInfo.name,25) == "Blessed Scroll: Enchant A")
						{
							BlessEnchantAmList[numBlessEnchantAm] = itemInfo;
							numBlessEnchantAm++;
						}
						if (Left(itemInfo.name,17) == "Scroll: Enchant W")
						{
							EnchantWpList[numEnchantWp] = itemInfo;
							numEnchantWp++;
						}
						if (Left(itemInfo.name,17) == "Scroll: Enchant A")
						{
							EnchantAmList[numEnchantAm] = itemInfo;
							numEnchantAm++;
						}
						if (Left(itemInfo.name,9) == "Soulshot:" || Left(itemInfo.name,8) == "Beast So" )
						{
							SoulshotList[numSoulshot] = itemInfo;
							numSoulshot++;
						}
						if (Left(itemInfo.name,11) == "Spiritshot:" || Left(itemInfo.name,8) == "Beast Sp" )
						{
							SpiritshotList[numSpiritshot] = itemInfo;
							numSpiritshot++;
						}
						if (Left(itemInfo.name,10) == "Blessed Sp" || Left(itemInfo.name,9) == "Blessed B" )
						{
							BlessedSpiritshotList[numBlessedSpiritshot] = itemInfo;
							numBlessedSpiritshot++;
						}
					break;
					// Scrolls (Not Enchants, Soe Etc)
					case 1:
						ScrollList[numScrolls] = itemInfo;
						numScrolls++;
					break;
					// Arrow (Confirmed)
					case 2:
						ArrowList[numArrow] = itemInfo;
						numArrow++;
					break;
					// Potion (Confirmed)
					case 3:
						PotionList[numPotion] = itemInfo;
						numPotion++;
					break;
					// Recipe (Confirmed)
					case 5:
						RecipeList[numRecipe] = itemInfo;
						numRecipe++;
					break;
					// Materials
					case 6:
						MaterialList[numMaterials] = itemInfo;
						numMaterials++;
					break;
					default:
						EtcItemList[numEtcItem] = itemInfo;
						numEtcItem++;
					break;
				}
			break;
			// Anything Missed
			default:
				EtcItemList[numEtcItem] = itemInfo;
				numEtcItem++;
			break;
		}
	}
}

function SortSubListsByQuality()
{
	local int newIndex, newIndexD, newIndexC, newIndexB, newIndexA, newIndexS, tempIndex, beastIndex;
	local Array<ItemInfo> newList, newListD, newListC, newListB, newListA, newListS, arrayToReference, beastList;
	
	newIndex = 0;
	
	// Blessed Weapons
	arrayToReference = BlessEnchantWpList;
	for(tempIndex = 0; tempIndex < arrayToreference.Length; tempIndex++)
	{
		if (Right(arrayToreference[tempIndex].name,2) == "D)")
		{
			newListD[newIndexD] = arrayToreference[tempIndex];
			newIndexD++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "C)")
		{
			newListC[newIndexC] = arrayToreference[tempIndex];
			newIndexC++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "B)")
		{
			newListB[newIndexB] = arrayToreference[tempIndex];
			newIndexB++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "A)")
		{
			newListA[newIndexA] = arrayToreference[tempIndex];
			newIndexA++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "S)")
		{
			newListS[newIndexS] = arrayToreference[tempIndex];
			newIndexS++;
		}
	}
	for(tempIndex = 0; tempIndex < newListD.Length; tempIndex++)
	{
		newList[newIndex] = newListD[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListC.Length; tempIndex++)
	{
		newList[newIndex] = newListC[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListB.Length; tempIndex++)
	{
		newList[newIndex] = newListB[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListA.Length; tempIndex++)
	{
		newList[newIndex] = newListA[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListS.Length; tempIndex++)
	{
		newList[newIndex] = newListS[tempIndex];
		newIndex++;
	}
	// Push List
	BlessEnchantWpList = newList;
	
	// Reset Lists & Indexes
	newList.Length = 0;
	newListD.Length = 0;
	newListC.Length = 0;
	newListB.Length = 0;
	newListA.Length = 0;
	newListS.Length = 0;
	newIndex = 0;
	newIndexD = 0;
	newIndexC = 0;
	newIndexB = 0;
	newIndexA = 0;
	newIndexS = 0;
	
	// Blessed Armors
	arrayToReference = BlessEnchantAmList;
	for(tempIndex = 0; tempIndex < arrayToreference.Length; tempIndex++)
	{
		if (Right(arrayToreference[tempIndex].name,2) == "D)")
		{
			newListD[newIndexD] = arrayToreference[tempIndex];
			newIndexD++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "C)")
		{
			newListC[newIndexC] = arrayToreference[tempIndex];
			newIndexC++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "B)")
		{
			newListB[newIndexB] = arrayToreference[tempIndex];
			newIndexB++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "A)")
		{
			newListA[newIndexA] = arrayToreference[tempIndex];
			newIndexA++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "S)")
		{
			newListS[newIndexS] = arrayToreference[tempIndex];
			newIndexS++;
		}
	}
	for(tempIndex = 0; tempIndex < newListD.Length; tempIndex++)
	{
		newList[newIndex] = newListD[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListC.Length; tempIndex++)
	{
		newList[newIndex] = newListC[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListB.Length; tempIndex++)
	{
		newList[newIndex] = newListB[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListA.Length; tempIndex++)
	{
		newList[newIndex] = newListA[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListS.Length; tempIndex++)
	{
		newList[newIndex] = newListS[tempIndex];
		newIndex++;
	}
	// Push List
	BlessEnchantAmList = newList;
	
	// Reset Lists & Indexes
	newList.Length = 0;
	newListD.Length = 0;
	newListC.Length = 0;
	newListB.Length = 0;
	newListA.Length = 0;
	newListS.Length = 0;
	newIndex = 0;
	newIndexD = 0;
	newIndexC = 0;
	newIndexB = 0;
	newIndexA = 0;
	newIndexS = 0;
	
	// Enchant Weapon
	arrayToReference = EnchantWpList;
	for(tempIndex = 0; tempIndex < arrayToreference.Length; tempIndex++)
	{
		if (Right(arrayToreference[tempIndex].name,2) == "D)")
		{
			newListD[newIndexD] = arrayToreference[tempIndex];
			newIndexD++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "C)")
		{
			newListC[newIndexC] = arrayToreference[tempIndex];
			newIndexC++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "B)")
		{
			newListB[newIndexB] = arrayToreference[tempIndex];
			newIndexB++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "A)")
		{
			newListA[newIndexA] = arrayToreference[tempIndex];
			newIndexA++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "S)")
		{
			newListS[newIndexS] = arrayToreference[tempIndex];
			newIndexS++;
		}
	}
	for(tempIndex = 0; tempIndex < newListD.Length; tempIndex++)
	{
		newList[newIndex] = newListD[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListC.Length; tempIndex++)
	{
		newList[newIndex] = newListC[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListB.Length; tempIndex++)
	{
		newList[newIndex] = newListB[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListA.Length; tempIndex++)
	{
		newList[newIndex] = newListA[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListS.Length; tempIndex++)
	{
		newList[newIndex] = newListS[tempIndex];
		newIndex++;
	}
	// Push List
	EnchantWpList = newList;
	
	// Reset Lists & Indexes
	newList.Length = 0;
	newListD.Length = 0;
	newListC.Length = 0;
	newListB.Length = 0;
	newListA.Length = 0;
	newListS.Length = 0;
	newIndex = 0;
	newIndexD = 0;
	newIndexC = 0;
	newIndexB = 0;
	newIndexA = 0;
	newIndexS = 0;
	
	// Enchant Armor
	arrayToReference = EnchantAmList;
	for(tempIndex = 0; tempIndex < arrayToreference.Length; tempIndex++)
	{
		if (Right(arrayToreference[tempIndex].name,2) == "D)")
		{
			newListD[newIndexD] = arrayToreference[tempIndex];
			newIndexD++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "C)")
		{
			newListC[newIndexC] = arrayToreference[tempIndex];
			newIndexC++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "B)")
		{
			newListB[newIndexB] = arrayToreference[tempIndex];
			newIndexB++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "A)")
		{
			newListA[newIndexA] = arrayToreference[tempIndex];
			newIndexA++;
		}
		if (Right(arrayToreference[tempIndex].name,2) == "S)")
		{
			newListS[newIndexS] = arrayToreference[tempIndex];
			newIndexS++;
		}
	}
	for(tempIndex = 0; tempIndex < newListD.Length; tempIndex++)
	{
		newList[newIndex] = newListD[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListC.Length; tempIndex++)
	{
		newList[newIndex] = newListC[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListB.Length; tempIndex++)
	{
		newList[newIndex] = newListB[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListA.Length; tempIndex++)
	{
		newList[newIndex] = newListA[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListS.Length; tempIndex++)
	{
		newList[newIndex] = newListS[tempIndex];
		newIndex++;
	}
	// Push List
	EnchantAmList = newList;
	
	// Reset Lists & Indexes
	newList.Length = 0;
	newListD.Length = 0;
	newListC.Length = 0;
	newListB.Length = 0;
	newListA.Length = 0;
	newListS.Length = 0;
	newIndex = 0;
	newIndexD = 0;
	newIndexC = 0;
	newIndexB = 0;
	newIndexA = 0;
	newIndexS = 0;
	
	// Crystals
	arrayToReference = CrystalList;
	for(tempIndex = 0; tempIndex < arrayToreference.Length; tempIndex++)
	{
		if (Right(arrayToreference[tempIndex].name,7) == "D-Grade")
		{
			newListD[newIndexD] = arrayToreference[tempIndex];
			newIndexD++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "C-Grade")
		{
			newListC[newIndexC] = arrayToreference[tempIndex];
			newIndexC++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "B-Grade")
		{
			newListB[newIndexB] = arrayToreference[tempIndex];
			newIndexB++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "A-Grade")
		{
			newListA[newIndexA] = arrayToreference[tempIndex];
			newIndexA++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "S-Grade")
		{
			newListS[newIndexS] = arrayToreference[tempIndex];
			newIndexS++;
		}
	}
	for(tempIndex = 0; tempIndex < newListD.Length; tempIndex++)
	{
		newList[newIndex] = newListD[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListC.Length; tempIndex++)
	{
		newList[newIndex] = newListC[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListB.Length; tempIndex++)
	{
		newList[newIndex] = newListB[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListA.Length; tempIndex++)
	{
		newList[newIndex] = newListA[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListS.Length; tempIndex++)
	{
		newList[newIndex] = newListS[tempIndex];
		newIndex++;
	}
	// Push List
	CrystalList = newList;
	
	// Reset Lists & Indexes
	newList.Length = 0;
	newListD.Length = 0;
	newListC.Length = 0;
	newListB.Length = 0;
	newListA.Length = 0;
	newListS.Length = 0;
	newIndex = 0;
	newIndexD = 0;
	newIndexC = 0;
	newIndexB = 0;
	newIndexA = 0;
	newIndexS = 0;
	
	// Soulshot
	arrayToReference = SoulshotList;
	for(tempIndex = 0; tempIndex < arrayToreference.Length; tempIndex++)
	{
		if (Right(arrayToreference[tempIndex].name,7) == "D-grade")
		{
			newListD[newIndexD] = arrayToreference[tempIndex];
			newIndexD++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "C-grade")
		{
			newListC[newIndexC] = arrayToreference[tempIndex];
			newIndexC++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "B-grade")
		{
			newListB[newIndexB] = arrayToreference[tempIndex];
			newIndexB++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "A-grade")
		{
			newListA[newIndexA] = arrayToreference[tempIndex];
			newIndexA++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "S-grade")
		{
			newListS[newIndexS] = arrayToreference[tempIndex];
			newIndexS++;
		}
		if(Left(arrayToreference[tempIndex].name,3) == "Bea")
		{
			beastList[beastIndex] = arrayToreference[tempIndex];
			beastIndex++;
		}
	}
	for(tempIndex = 0; tempIndex < newListD.Length; tempIndex++)
	{
		newList[newIndex] = newListD[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListC.Length; tempIndex++)
	{
		newList[newIndex] = newListC[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListB.Length; tempIndex++)
	{
		newList[newIndex] = newListB[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListA.Length; tempIndex++)
	{
		newList[newIndex] = newListA[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListS.Length; tempIndex++)
	{
		newList[newIndex] = newListS[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < beastList.Length; tempIndex++)
	{
		newList[newIndex] = beastList[tempIndex];
		newIndex++;
	}
	// Push List
	SoulshotList = newList;
	
	// Reset Lists & Indexes
	newList.Length = 0;
	newListD.Length = 0;
	newListC.Length = 0;
	newListB.Length = 0;
	newListA.Length = 0;
	newListS.Length = 0;
	beastList.Length = 0;
	newIndex = 0;
	newIndexD = 0;
	newIndexC = 0;
	newIndexB = 0;
	newIndexA = 0;
	newIndexS = 0;
	beastIndex = 0;
	
	// Spiritshot
	arrayToReference = SpiritshotList;
	for(tempIndex = 0; tempIndex < arrayToreference.Length; tempIndex++)
	{
		if (Right(arrayToreference[tempIndex].name,7) == "D-grade")
		{
			newListD[newIndexD] = arrayToreference[tempIndex];
			newIndexD++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "C-grade")
		{
			newListC[newIndexC] = arrayToreference[tempIndex];
			newIndexC++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "B-grade")
		{
			newListB[newIndexB] = arrayToreference[tempIndex];
			newIndexB++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "A-grade")
		{
			newListA[newIndexA] = arrayToreference[tempIndex];
			newIndexA++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "S-grade")
		{
			newListS[newIndexS] = arrayToreference[tempIndex];
			newIndexS++;
		}
		if(Left(arrayToreference[tempIndex].name,3) == "Bea")
		{
			beastList[beastIndex] = arrayToreference[tempIndex];
			beastIndex++;
		}
	}
	for(tempIndex = 0; tempIndex < newListD.Length; tempIndex++)
	{
		newList[newIndex] = newListD[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListC.Length; tempIndex++)
	{
		newList[newIndex] = newListC[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListB.Length; tempIndex++)
	{
		newList[newIndex] = newListB[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListA.Length; tempIndex++)
	{
		newList[newIndex] = newListA[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListS.Length; tempIndex++)
	{
		newList[newIndex] = newListS[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < beastList.Length; tempIndex++)
	{
		newList[newIndex] = beastList[tempIndex];
		newIndex++;
	}
	// Push List
	SpiritshotList = newList;
	
	// Reset Lists & Indexes
	newList.Length = 0;
	newListD.Length = 0;
	newListC.Length = 0;
	newListB.Length = 0;
	newListA.Length = 0;
	newListS.Length = 0;
	beastList.Length = 0;
	newIndex = 0;
	newIndexD = 0;
	newIndexC = 0;
	newIndexB = 0;
	newIndexA = 0;
	newIndexS = 0;
	beastIndex = 0;
	
	// Blessed Spiritshot
	arrayToReference = BlessedSpiritshotList;
	for(tempIndex = 0; tempIndex < arrayToreference.Length; tempIndex++)
	{
		if (Right(arrayToreference[tempIndex].name,7) == "D-Grade")
		{
			newListD[newIndexD] = arrayToreference[tempIndex];
			newIndexD++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "C-Grade")
		{
			newListC[newIndexC] = arrayToreference[tempIndex];
			newIndexC++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "B-Grade")
		{
			newListB[newIndexB] = arrayToreference[tempIndex];
			newIndexB++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "A-Grade")
		{
			newListA[newIndexA] = arrayToreference[tempIndex];
			newIndexA++;
		}
		if (Right(arrayToreference[tempIndex].name,7) == "S-Grade")
		{
			newListS[newIndexS] = arrayToreference[tempIndex];
			newIndexS++;
		}
		if(Left(arrayToreference[tempIndex].name,11) == "Blessed Bea")
		{
			beastList[beastIndex] = arrayToreference[tempIndex];
			beastIndex++;
		}
	}
	for(tempIndex = 0; tempIndex < newListD.Length; tempIndex++)
	{
		newList[newIndex] = newListD[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListC.Length; tempIndex++)
	{
		newList[newIndex] = newListC[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListB.Length; tempIndex++)
	{
		newList[newIndex] = newListB[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListA.Length; tempIndex++)
	{
		newList[newIndex] = newListA[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < newListS.Length; tempIndex++)
	{
		newList[newIndex] = newListS[tempIndex];
		newIndex++;
	}
	for(tempIndex = 0; tempIndex < beastList.Length; tempIndex++)
	{
		newList[newIndex] = beastList[tempIndex];
		newIndex++;
	}
	// Push List
	BlessedSpiritshotList = newList;
	
	// Reset Lists & Indexes
	newList.Length = 0;
	newListD.Length = 0;
	newListC.Length = 0;
	newListB.Length = 0;
	newListA.Length = 0;
	newListS.Length = 0;
	beastList.Length = 0;
	newIndex = 0;
	newIndexD = 0;
	newIndexC = 0;
	newIndexB = 0;
	newIndexA = 0;
	newIndexS = 0;
	beastIndex = 0;
}

function SortBySublist()
{
	local int tempIndex, newIndex;
	
	// Sort List based on Category
	newIndex = 0;
	
	// Add Asset (Adena etc)
	for (tempIndex = 0; tempIndex < AssetList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = AssetList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Crystals
	for (tempIndex = 0; tempIndex < CrystalList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = CrystalList[tempIndex].ClassID;
		newIndex++;
	}

	// Add Weapons
	for (tempIndex = 0; tempIndex < WeaponList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = WeaponList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Armor
	for (tempIndex = 0; tempIndex < ArmorList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = ArmorList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Accesary
	for (tempIndex = 0; tempIndex < AccesaryList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = AccesaryList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Soulshot
	for (tempIndex = 0; tempIndex < SoulshotList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = SoulshotList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Spiritshot
	for (tempIndex = 0; tempIndex < SpiritshotList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = SpiritshotList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add BlessedSpiritshot
	for (tempIndex = 0; tempIndex < BlessedSpiritshotList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = BlessedSpiritshotList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Potion
	for (tempIndex = 0; tempIndex < PotionList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = PotionList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Scrolls
	for (tempIndex = 0; tempIndex < ScrollList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = ScrollList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Blessed Weapon
	for (tempIndex = 0; tempIndex < BlessEnchantWpList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = BlessEnchantWpList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Blessed Armor
	for (tempIndex = 0; tempIndex < BlessEnchantAmList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = BlessEnchantAmList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Enchant Weapon
	for (tempIndex = 0; tempIndex < EnchantWpList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = EnchantWpList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Enchant Armor
	for (tempIndex = 0; tempIndex < EnchantAmList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = EnchantAmList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Spellbooks
	for (tempIndex = 0; tempIndex < SpellbookList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = SpellbookList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Recipe
	for (tempIndex = 0; tempIndex < RecipeList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = RecipeList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Materials
	for (tempIndex = 0; tempIndex < MaterialList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = MaterialList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Arrow
	for (tempIndex = 0; tempIndex < ArrowList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = ArrowList[tempIndex].ClassID;
		newIndex++;
	}
	
	// Add Rest
	for (tempIndex = 0; tempIndex < EtcItemList.length; tempIndex++)
	{
		m_itemOrder[newIndex] = EtcItemList[tempIndex].ClassID;
		newIndex++;
	}
}

 


Cheers,
YulRun

Edited by iRmaxCheater
  • Like 3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..