[PHP + MySQL] Multisell Generator

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
RiZe
Posts: 122
Joined: Mon Mar 24, 2008 12:44 am
Location: Czech Republic
Contact:

[PHP + MySQL] Multisell Generator

Post by RiZe »

Here is the very first version of my Multisell Generator written in PHP and using MySQL. It handles input file with given structure to output XML multisell file.

Here are the input examples

Code: Select all

 # header = Town of Giran - Grocer Selvetia - Quest# maintainEnchantment = truep-20253-5;i-5345-2;i-1000p-20253-1;i-5345 
Some description should be fine so. Lines with "#" are used as vars. "header" is the special one, not neccessary, it's just top comment in multisell file (see lower). The second one is more important, "maintainEnchantment" is attribute for <list> but it's optional.

After that, there are next two lines.

Code: Select all

 p-20253-5 p = Production (i for Ingredient)20253 = Item ID5 = Item Count (optional, 1 is used in this case) 

Code: Select all

p-20253-5;i-5345-2;i-1000
5 Production items with ID 20253, 2 Ingredient items with ID 5345 and 1 Ingredient item with ID 1000. Quite simple and now the output.

Code: Select all

 <?xml version="1.0" encoding="UTF-8"?><!-- Town of Giran - Grocer Selvetia - Quest --><list maintainEnchantment="true">  <!-- 5 Agathion of Love (Event) for 2 Recipe: Inferno Earring(70%) + Book of Aklantoth - Part 3 -->  <item id="1">    <ingredient id="5345" count="2"/>    <ingredient id="1000" count="1"/>    <production id="20253" count="5"/>  </item>  <!-- Agathion of Love (Event) for Recipe: Inferno Earring(70%) -->  <item id="2">    <ingredient id="5345" count="1"/>    <production id="20253" count="1"/>  </item></list> 
And here you go. Simple and commented multisell file. Enjoy :)

PS. Don't forget to edit Config.php file to fit your database settings. Tested on Windows 7 RC with Apache 2.0 and PHP 5.2.5

EDIT: Ups, little mistake made in last seconds before upload (SQL syntax error). Fixed
You do not have the required permissions to view the files attached to this post.
Last edited by RiZe on Sat Jan 08, 2011 10:56 am, edited 1 time in total.
Devastator
Posts: 14
Joined: Tue May 05, 2009 7:25 am
Location: Lithuania
Contact:

Re: [PHP + MySQL] Multisell Generator

Post by Devastator »

Very nice script, thanks for share.
Image
mrvietdung
Posts: 43
Joined: Fri Dec 10, 2010 4:31 am

Re: [PHP + MySQL] Multisell Generator

Post by mrvietdung »

<list maintainEnchantment="true">
It can protect the multisell without illegel bypass? Anyone tested, plz give me information. Thanks
EddyKine
Posts: 5
Joined: Sat Dec 25, 2010 11:12 pm

Re: [PHP + MySQL] Multisell Generator

Post by EddyKine »

File atached is corrupt plz upload again. thxs
User avatar
RiZe
Posts: 122
Joined: Mon Mar 24, 2008 12:44 am
Location: Czech Republic
Contact:

Re: [PHP + MySQL] Multisell Generator

Post by RiZe »

mrvietdung wrote:<list maintainEnchantment="true">
It can protect the multisell without illegel bypass? Anyone tested, plz give me information. Thanks
I'll give you an example. You have multisell to change Sealed Avadon Boots for Avadon Boots - Robe and player wants to change the sealed ones for unsealed but he has already enchanted them to +6. Now when the maintainEnchantment is set to false, he will get +0 Avadon Boots - Robe for his +6 Sealed Avadon Boots but when you set the maintainEnchantment to true he will get +6 Avadon Boots - Robe. Is it clear now?
EddyKine wrote:File atached is corrupt plz upload again. thxs
Fortunately I've found the script again and uploaded it. Hopefully it is not some dev version :-)
mrvietdung
Posts: 43
Joined: Fri Dec 10, 2010 4:31 am

Re: [PHP + MySQL] Multisell Generator

Post by mrvietdung »

Clear for all :D Thanks.
Post Reply