This system has not been fully tested. There may be bugs or exploits. If you decide to use this feature, test it first to make sure the results work as expected, and that the server doesn't crash.
This also performs a linear search on the entire item database using the ID ranges provided. If the ranges operate on the entire database, server performance could suffer.
If found as a gamble item, a search is performed on the item database (of the static ItemDef entries loaded from file). The search will attempt to query a list of items matching the search type and input criteria, returning a list of ItemDef IDs that match.
If the list has any results, a random ID is chosen from the list. The player will be given that item instead of the gamble template item that was purchased.
[ENTRY] | N/A | Begins a new entry. |
Name | String | Not used. Internal identification name. Max size is 19 characters. |
TriggerItemID | Integer | If an item is purchased from a vendor that matches this ItemDef mID, an item database search will be performed using the search type and input criteria below. |
SearchType | String | Must be one of these types:{linear, equip, query}
linear : Generate a list of potential items whos ItemDef mID ranges from MinID to MaxID (inclusive). Requires the MinID and MaxID properties. Both items must exist in the database.
|
MinID | Integer | Minimum ID to accept in a range of items. The item must exist. Corresponds to the ItemDef mID property. |
MaxID | Integer | Maximum ID to accept in a range of items. The item must exist. Corresponds to the ItemDef mID property. |
EquipType | Integer | Limits the search to only accept a particular equipment type. Corresponds to the ItemDef mEquipType property, which must be a numerical value from the EquipType table |
WeaponType | Integer | Limits the search to only accept a particular weapon type. Corresponds to the ItemDef mWeaponType property, which must be a numerical value from the WeaponType table. |
MinLevel | Integer | Limits the search to only accept items whos ItemDef mMinUseLevel value is equal or higher to this. |
MaxLevel | Integer | Limits the search to only accept items whos ItemDef mMinUseLevel value is equal or lower than this. |