Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- patch creator
- -- XXXXsXXXXXXXXXXXlXXXXXXXXXXXpXXXXXXXXX1XXXXXXXXXXXXX3XXXXXXaXXXXXXXtXXXXXXXX4XXXXXXXX2XXXXXXXX0XXXXXXXX
- -- X Created by slp13at420 of ac-web for BlackWolfsDen.dyndns-free.com X
- -- XXXXXXXXXXXXXXXXXXXXXXXXgXXXXXXXXrXXXXXXXXXXXuXXXXXXXXXXXXXXXXXXXXXXXmXXXXXXXXXXbXXXXXXXXXXXXoXXXXXXXXX
- -- use for extracting large blocks of data and write to file format
- -- so user can add entries to patch file easier than 1 entry at a time.
- -- this can extract the whole sqlDB into a file format (ready for patch) THIS IS BASED on YOUR CUSTOMIZED DB entries
- local Command = ".createitempatch"
- local Start = 60000 -- lowest starting item id of your custom items you added
- local End = 180000 -- highest item id of your custom items
- function Itempatchcreator(event, pPlayer, msg)
- if (msg == Command) then
- local EntryID = Start
- local File = io.open("scripts/ADMIN/Item.txt", "w")
- File:write("long,long,long,long,long,long,long,long,\n")
- repeat
- local XClassID = WorldDBQuery("SELECT `class` FROM world.items WHERE `entry` = '"..EntryID.."' LIMIT 1;");
- local ClassID = XClassID:GetColumn(0):GetLong()
- local XSubclassID = WorldDBQuery("SELECT `subclass` FROM world.items WHERE `entry` = '"..EntryID.."' LIMIT 1;")
- local SubclassID = XSubclassID:GetColumn(0):GetLong()
- local XField4ID = WorldDBQuery("SELECT `field4` FROM world.items WHERE `entry` = '"..EntryID.."' LIMIT 1;");
- local Field4ID = XField4ID:GetColumn(0):GetLong()
- local XQualityID = WorldDBQuery("SELECT `quality` FROM world.items WHERE `entry` = '"..EntryID.."' LIMIT 1;");
- local QualityID = XQualityID:GetColumn(0):GetLong()
- local XDisplayID = WorldDBQuery("SELECT `displayid` FROM world.items WHERE `entry` = '"..EntryID.."' LIMIT 1;");
- local DisplayID = XDisplayID:GetColumn(0):GetLong()
- local XInventorytypeID = WorldDBQuery("SELECT `inventorytype` FROM world.items WHERE `entry` = '"..EntryID.."' LIMIT 1;");
- local InventorytypeID = XInventorytypeID:GetColumn(0):GetLong()
- local XSheathID = WorldDBQuery("SELECT `sheathID` FROM world.items WHERE `entry` = '"..EntryID.."' LIMIT 1;");
- local SheathID = XSheathID:GetColumn(0):GetLong()
- File:write(""..tostring(EntryID)..","..tostring(ClassID)..","..tostring(SubclassID)..","..tostring(Field4ID)..","..tostring(QualityID)..","..tostring(DisplayID)..","..tostring(InventorytypeID)..","..tostring(SheathID)..",\n")
- print("logged: "..EntryID.."")
- repeat
- EntryID = (EntryID+1)
- local Idtest = WorldDBQuery("SELECT `entry` FROM world.items WHERE `entry` = '"..EntryID.."' limit 1;");
- until (Idtest~=nil)or(EntryID==(End+1))
- until (EntryID==(End+1))
- pPlayer:SendBroadcastMessage("item.patch completed.");
- EntryId = 0
- File:close()
- return false;
- end
- return;
- end
- print"\n Admin items.patch maker loaded\n"
- RegisterServerHook(16, "Itempatchcreator")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement