Before anything you should first start fixing why the item level is 0. An item with item level 0 won't work because it won't be able to calculate attribute values, or even roll them.
@onTopic if someone wishes to move forward on this system I figured how to link it to shop.php on ZnoteAAC, took me a while to figure it and thanks to
@Itutorial I could finally achieve it.
First create a new table called "grado" or something, that holds the value of our item level.
For that just create a new row in znote_shop_orders with INT 11 and set their default value to 0.
View attachment 84312
Then just go to shop .php and there add an additional check using:
PHP:
if ($buy['grado']) {
mysql_insert("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`, `grado`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time', '". $buy['grado'] ."')");
} else {
mysql_insert("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time')"); }
Being in context you should use an
else if, because shop system already checks for other definitions. Again, if you feel struggled just pm.
Then we assign grado to our item when we trigger the !shop talkaction. We use our functions from the upgrade system corelib to achieve it with lua.
Go to your shop talkaction script (however you have it named)
First we set a local variable for "q_grado"
Lua:
local q_grado = result.getNumber(orderQuery, "grado")
Then we go for:
View attachment 84313
And we finally use the other kind of items (backpacks, etc) that doesn't have item level, as Miscellaneous items (so they can be added in the Miscellaneous tab).
We have to copy from -- ORDER TYPE 1 to the end, and set player:addItem like it does normally to create a new ORDER TYPE --8 that handles items without item level.
Hope it was clear enought, didn't do really good explaining it but if you know a little php or lua will surely get the point. Regards!