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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Lineage 2 Interlude L2OFF Server Based on H5 Files   Are you looking to start your own Lineage 2 server? This is your chance! I’m selling a 100% functional server based on Official L2OFF H5 files, adapted to the Interlude version. Main Features: Based on official L2OFF H5 files, perfectly configured for Interlude. Includes the full source code, allowing you to fully customize the server to fit your needs. Fully working events, such as: TvT (Team vs. Team) CTF (Capture the Flag) Tons of custom content added, keeping the balance and original essence of the game. Why choose this project? The server is fully functional and optimized, ready to launch. You can test the server before purchasing, with access to a GM character to explore all features. Comes with everything you need to make your project a success, both technically and in terms of content. Interested? Feel free to contact me! If you need more information or would like to schedule a test, I’m happy to answer any questions.   Auto Create Accounts Client Test Server: DOWNLOAD   Price: 600 usd Source price: send pm. Discord: Guytis#6760 Skype: gustavoorellano@hotmail.com  
    • Website: https://l2aurum.com/  Discord: https://discord.gg/l2aurum   Hello Everyone,  finally, the moment has arrived: I'm launching my own server, L2Aurum!   L2Aurum x300 Closed Beta Test - Start: 17.02.2025  [20:00 GMT+2] Grand Opening 21.02.2025 [20:00 GMT+2]     Experience Rates: x300 Skill Points Rates: x300 Adena Drop: x300 Premium Accounts: x2 Drop Rates: x1 Spoil Rates: x1 Quest Rates: x1 Only one account per player, no dualboxing allowed. Everything is earned through gameplay, no pay-to-win mechanics. No server wipes—your progress is permanent. Fair play is a priority, with no room for corruption. All players are treated equally, no special favors.     Buffs slots: 26+4, all buffs in NPC and Scheme System. Custom Armors: Aurum Apella Armor Custom Weapons: Aurum Weapon Custom Accessories: +300 P.Def & M.Def Tattoos: Mage & Fighter & Custom Shirts Custom Jewels: New Grand Bosses Auto Farm is FREE for everyone. Status Noblesse: Barakiel. Player Spawn Protection: 10 seconds. Geodata e Panthodes: ENABLED. All Commands are visible in .menu. System 2 Bishop Per Party: ENABLED. Boss Protect - Anti-Zerg: ENABLED.     Siege Duration: 2 hours (120 minutes). Siege Period: Every 7 days. Castle Reward: 100E Per Castle. Available Castles: Rune Aden Giran Giran Siege: Every Friday 20:00 GMT +2. Aden Siege: Every Saturday 20:00 GMT +2. Rune Siege: Every Sunday 20:00 GMT +2. Main Clan: 40 Members max. Royal Clan: 12 Members max. Knight Clan: 7 Members max. Alliance: You can have only 1.     Epic Boss Valakas: Monday 22:30 (GMT+2) Zaken: Tuesday | Thursday 22:30 (GMT+2) Queen Ant: Monday | Wednesday 22:30 (GMT+2) Baium: Friday 22:30 (GMT+2) Antharas: Saturday 22:30 (GMT+2) Orfen: Tuesday | Thursday | Saturday 18:30 (GMT+2) Core: Monday | Wednesday | Friday | Sunday 18:30 (GMT+2)   Raid Boss  Flame Of Splendor Barakiel Last Hit: Every Day Respawn 3-4 hours Ember: Every Day Respawn 3-4 hours Lilith: Every Day Respawn 3-4 hours Anakim: Every Day Respawn 3-4 hours Queen Shyeed: Every Day Respawn 3-4 hours Golkonda: Every Day Respawn 3-4 hours Shuriel: Every Day Respawn 3-4 hours Varka's Hero Shadith: Every Day Respawn 3-4 hours Ketra's Hero Hekaton: Every Day Respawn 3-4 hours Varka's Mos: Every Day Respawn 3-4 hours Chief Horus: Every Day Respawn 3-4 hours Ketra's Tayer: Every Day Respawn 3-4 hours Chief Brakki: Every Day Respawn 3-4 hours Sailren: Every Day Respawn 02:00   🥳🥳🥳🥳 I would like to chat personally with all of you over on our Discord and discuss any suggestions or feedback you might have.      Website: https://l2aurum.com/  Discord: https://discord.gg/l2aurum
  • Topics

×
×
  • Create New...