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


  • Posts

    • @Darafamboos let him know that this is already shared
    • Selling for 35 us umodel that opens any ukx , utx and static meshes from samurai updat 542 protocol . Leave me a pm if needed. 
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • NEW HIDDENSTASH KEY SYSTEM INTRODUCED TO THE SITE   **Earn While You Spend - Introducing HS Cashback!**   Every purchase on our site now rewards you with **HS Keys cashback**   EVERY ONE WHO REGISTERS IN SITE UNTILL 15TH OF MAY GETS 2000 HS KEYS IN HES BALANE   Here's how it works:       **1 USD = 1000 HS Keys**   **Get 3% cashback** on every purchase   **Use your HS Keys to **save on your next order**   ---   ### ⚡ Why this is awesome   * Every order gives you value back   * Stack it with promos & HS usage   * Turn your spending into future discounts   ---   ### Example   Spend **$10** → Get **300 HS Keys** back   Spend **$50** → Get **1500 HS Keys** back   ---   ### Smart system (built for fairness)   * Cashback is rounded to keep things balanced   * Prevents abuse from tiny orders   * Rewards real buyers   ---   ### Start earning now   Every purchase = progress toward your next discount   Shop now and build your HS balance!   #cashback #gamingdeals #d2r #rewards #loyalty   Stay safe out there, heroes - and happy hunting! www.d2rhiddenstash.com     We just launched our new Affiliate Program — and it’s the easiest way to earn HS Keys.   Invite your friends using your personal link.   Example: If your friend spends $10 → you get 300 HS Keys No limits. No effort. Just share your link.   Get your referral link here: www.d2rhiddenstash.com/profile     Start earning today
    • It’s time for something new to rise. In a world filled with short-lived projects and empty promises, Emerge was created with a different vision — a vision built on experience, precision, and long-term commitment. This is not just another server launch. This is the beginning of something that is meant to last. 🌑 Eclipse x10 – A New Beginning Eclipse x10 is designed for players who seek more than just fast progression. It is built for those who value competition, balance, and a real Lineage II experience. From the very first day, every system has been carefully adjusted to provide a smooth and fair journey — where both solo players and clans can thrive. No shortcuts. No chaos. Only a structured and competitive world. ⚔️ What Awaits You • A balanced mid-rate environment (x10 core progression) • Stable and optimized gameplay • Fair systems with focus on long-term play • Competitive PvP and rewarding PvE • Active and dedicated administration • A project built with vision, not temporary hype 📊 Server Rates Basic: EXP/SP: x10 Adena: x5 Drop: x5 Spoil: x5 Secondary: Quests: x1 Seal Stones: x5 Life Stone Drop: x1 Enchant Scroll Drop: x1 Bosses: Raid Boss EXP/SP: x1 Raid Boss Drop: x1 Epic Boss EXP/SP: x1 Epic Boss Drop: x1 Enchant: Safe: +3 Max: +16 📅 Launch Information Grand Opening: 5 June 2026 The countdown has already begun. Clans are forming. Strategies are being prepared. The question is — will you be ready? 🔗 Join the Community Every strong server begins with a strong community. Be part of it from the very start. 💬 Discord: https://discord.gg/l2emerge 🌐 Website: https://www.l2emerge.com  
  • Topics

×
×
  • 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..