/* Please give back to this community, submit something to the forum that you learn or make or design which others can benifit from. Don't just Take Take. The community needs Programmers to make tools or scripts to make it easier to manage our Test Servers People my be willing to share new Files if you put some effort back in to showing that you deserve it. This code you have now has taken months of work and many sleepless nights to learn and design, it is not perfect but works as intended, I submit it as free to return thanks to the community for making the current server files avilable If you have new Bin's/Lua's/Database files please share with me.*/USE [ROM_ImportDB]DECLARE @ToPlayer NVARCHAR ( 50 );SET @ToPlayer = N'playernamehere'; -- < This is where you edit the name of the player to mail to >------------------------------------------------------------------------------------------ Here you define the Value Attributes for the EQ being mailed ---------------------- Exceeding the range will produce non game spec results ----------------------------------------------------------------------------------------------DECLARE @EQMainDura int; SET @EQMainDura = 200; -- Valid Range 0-200DECLARE @EQPlus int; SET @EQPlus = 6; -- Valid Range 0-20DECLARE @EQRareity int; SET @EQRareity = 0; -- Valid Range 0-7DECLARE @EQTier int; SET @EQTier = 9; -- Valid Range 1-20DECLARE @EQWepTier int; SET @EQWepTier = 5; -- Valid Range 1-20DECLARE @EQRuneSlots int; SET @EQRuneSlots = 0; -- Valid Range 0-4 (Notice: Keep this Value at Zero. This value adds runes slots, so if item has 4 runes and this value is 4 then item will have 8 slots. This is not good)DECLARE @EQBaseTier int; SET @EQBaseTier = 3; -- Check the base Tier of your item in game, if it is T4 then change make @EQBaseTier = 4---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------DECLARE @EQDurable int; SET @EQDurable = @EQMainDura * 100;DECLARE @EQBinaryString VARCHAR ( 32 ); SET @EQBinaryString = '';DECLARE @EQWepBinString VARCHAR ( 32 ); SET @EQWepBinString = '';----- This Adds the EQ's Base Tier to your Desired Tier -----set @EQTier = @EQTier + @EQBaseTier;set @EQWepTier = @EQWepTier + @EQBaseTier;-------------------------------------------------------------------------------- EQMainDura String -----------------------declare @intvalue int;set @intvalue = @EQMainDura;declare @vsresult1 varchar ( 8 ); -- length of the binary stringdeclare @inti int;select @inti = 8, @vsresult1 = ''; --< change this number toowhile @inti > 0 begin select @vsresult1 = convert ( char ( 1 ), @intvalue % 2 ) + @vsresult1; select @intvalue = convert ( int, ( @intvalue / 2 ) ), @inti = @inti - 1; end---------------------------------------------------------------------------------- EQPlus String -------------------------set @intvalue = @EQPlus;declare @vsresult3 varchar ( 5 ); -- length of the binary stringselect @inti = 5, @vsresult3 = ''; --< change this number toowhile @inti > 0 begin select @vsresult3 = convert ( char ( 1 ), @intvalue % 2 ) + @vsresult3; select @intvalue = convert ( int, ( @intvalue / 2 ) ), @inti = @inti - 1; end--------------------------------------------------------------------------------- EQRareity String -----------------------set @intvalue = @EQRareity;declare @vsresult4 varchar ( 3 ); -- length of the binary stringselect @inti = 3, @vsresult4 = ''; --< change this number toowhile @inti > 0 begin select @vsresult4 = convert ( char ( 1 ), @intvalue % 2 ) + @vsresult4; select @intvalue = convert ( int, ( @intvalue / 2 ) ), @inti = @inti - 1; end---------------------------------------------------------------------------------- EQTier String -------------------------set @intvalue = @EQTier;declare @vsresult5 varchar ( 5 ); -- length of the binary stringselect @inti = 5, @vsresult5 = ''; --< change this number toowhile @inti > 0 begin select @vsresult5 = convert ( char ( 1 ), @intvalue % 2 ) + @vsresult5; select @intvalue = convert ( int, ( @intvalue / 2 ) ), @inti = @inti - 1; end-------------------------------------------------------------------------------- EQWepTier String ------------------------set @intvalue = @EQWepTier;declare @vsresult7 varchar ( 5 ); -- length of the binary stringselect @inti = 5, @vsresult7 = ''; --< change this number toowhile @inti > 0 begin select @vsresult7 = convert ( char ( 1 ), @intvalue % 2 ) + @vsresult7; select @intvalue = convert ( int, ( @intvalue / 2 ) ), @inti = @inti - 1; end-------------------------------------------------------------------------------- EQRuneSlots String ----------------------set @intvalue = @EQRuneSlots;declare @vsresult6 varchar ( 3 ); -- length of the binary stringselect @inti = 3, @vsresult6 = ''; --< change this number toowhile @inti > 0 begin select @vsresult6 = convert ( char ( 1 ), @intvalue % 2 ) + @vsresult6; select @intvalue = convert ( int, ( @intvalue / 2 ) ), @inti = @inti - 1; end-------------------------------------------------------------set @EQBinaryString = @EQBinaryString + @vsresult6 + @vsresult3 + @vsresult4 + @vsresult5 + @vsresult1 + @vsresult1;set @EQWepBinString = @EQWepBinString + @vsresult6 + @vsresult3 + @vsresult4 + @vsresult7 + @vsresult1 + @vsresult1;------------ Convert EQBinary String to Decimal -------------DECLARE @EQBinary VARCHAR ( 100 );DECLARE @EQWepBinary VARCHAR ( 100 );SET @EQBinary = @EQBinaryString;SET @EQWepBinary = @EQWepBinString;------------DECLARE @characters CHAR ( 36 ), @eqresult BIGINT, @eqindex SMALLINT, @wepresult BIGINT, @wepindex SMALLINT, @base BIGINT;------------SELECT @characters = '0123456789abcdefghijklmnopqrstuvwxyz', @eqresult = 0, @eqindex = 0, @base = 2; WHILE @eqindex < LEN ( @EQBinary )BEGIN SELECT @eqresult = @eqresult + POWER ( @base, @eqindex ) * ( CHARINDEX ( SUBSTRING ( @EQBinary, LEN ( @EQBinary ) - @eqindex, 1 ), @characters ) - 1 ); SET @eqindex = @eqindex + 1; END------------SELECT @characters = '0123456789abcdefghijklmnopqrstuvwxyz', @wepresult = 0, @wepindex = 0, @base = 2; WHILE @wepindex < LEN(@EQWepBinary)BEGIN SELECT @wepresult = @wepresult + POWER ( @base, @wepindex ) * ( CHARINDEX ( SUBSTRING ( @EQWepBinary, LEN ( @EQWepBinary ) - @wepindex, 1 ), @characters ) - 1); SET @wepindex = @wepindex + 1;END------------DECLARE @EQExValue INT;DECLARE @WEPExValue INT;------------IF @eqresult > 2147483647 BEGIN SET @eqresult = @eqresult - ( 2147483648 * 2 ); ENDSET @EQExValue = @eqresult;------------IF @wepresult > 2147483647 BEGIN SET @wepresult = @wepresult - ( 2147483648 * 2 ); ENDSET @WEPExValue = @wepresult;-------------------------------------------------------------DECLARE @CreateTime INT;SET @CreateTime = DATEDIFF ( s, '1970-01-01 00:00:00', GETUTCDATE ( ) );-------------------------------------------------------------DECLARE @MainWep1H BINARY ( 20 );DECLARE @MainWep2H BINARY ( 20 );DECLARE @RangeWep BINARY ( 20 );DECLARE @Tally BINARY ( 20 );DECLARE @RingA BINARY ( 20 );DECLARE @RingB BINARY ( 20 );DECLARE @Earring1 BINARY ( 20 );DECLARE @Earring2 BINARY ( 20 );DECLARE @Necklace BINARY ( 20 );DECLARE @Belt BINARY ( 20 );DECLARE @Pants BINARY ( 20 );DECLARE @Gloves BINARY ( 20 );DECLARE @Shoulder BINARY ( 20 );DECLARE @Cape BINARY ( 20 );DECLARE @Body BINARY ( 20 );DECLARE @Boots BINARY ( 20 );DECLARE @Helm BINARY ( 20 );DECLARE @Wings BINARY ( 20 );SET @MainWep2H = 0x122B272FED314A321F32E131455333515B51634E000000000000000000000000;SET @Tally = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000SET @RingA = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000SET @RingB = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Earring1 = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Earring2 = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Necklace = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Belt = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Pants = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Gloves = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Shoulder = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Cape = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Body = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Boots = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Helm = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;SET @Wings = 0x112B262F622FD02F122B272F9450BE506D50DB4E000000000000000000000000;-------------------------------------------------------------DECLARE @Serial INT; DECLARE @Random INT; DECLARE @Upper INT; DECLARE @Lower INT;SET @Lower = 1; SET @Upper = 999999999;SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 211659, 1, @EQDurable, @WEPExValue, 211659, @MainWep2H, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 234068, 1, @EQDurable, @EQExValue, 234068, @Tally, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 222159, 1, @EQDurable, @EQExValue, 222159, @RingA, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 222165, 1, @EQDurable, @EQExValue, 222165, @RingB, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 222161, 1, @EQDurable, @EQExValue, 222161, @Earring1, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 222163, 1, @EQDurable, @EQExValue, 222163, @Earring2, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 222157, 1, @EQDurable, @EQExValue, 222157, @Necklace, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 223804, 1, @EQDurable, @EQExValue, 223804, @Belt, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 223542, 1, @EQDurable, @EQExValue, 223542, @Pants, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 223541, 1, @EQDurable, @EQExValue, 223541, @Gloves, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 223513, 1, @EQDurable, @EQExValue, 223513, @Shoulder, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 224734, 1, @EQDurable, @EQExValue, 224734, @Cape, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 223540, 1, @EQDurable, @EQExValue, 223540, @Body, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 223543, 1, @EQDurable, @EQExValue, 223543, @Boots, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);SELECT @Random = ROUND ( ( ( @Upper - @Lower - 1 ) * RAND ( ) + @Lower ), 0 ); SET @Serial = @Random; INSERT [dbo].[ImportMail]([WorldID], [ToName], [OrgObjID], [Count], [Durable], [ExValue], [ImageObjectID], [Ability], [Title], [Content], [GmName], [Serial], [CreateTime]) VALUES(1, @ToPlayer, 223515, 1, @EQDurable, @EQExValue, 223515, @Helm, N'Welcome', N'Magical Equipement', N'System', @Serial, @CreateTime);