• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MoveEvent [PHP][NPC][GlobalEvent] Auction System [Beta]

QuaS

Cykotitan Pwned =/
Joined
Sep 11, 2008
Messages
838
Reaction score
28
Location
Poland/ Wroclaw
Attention (8 Juny)
DO NOT USE IT! IT'S SQL VUNERABLE!

Attention (28 June)
Don't use this system. There is bug with a item u are trying to add ( i mean a blocked one) They back to a owner but stats are changed (try to puut soft boots 16 mins left, and there back wih a parcel bran new one, etc.) Using on own Risk.

I'll Fix it in next update.

Last Update: [09 April 2010. 17:00 CET]
auctions.php - Ver: 1.18
accountdepot.php - Ver: 1.21


Hello Otlanders!

I'd like to show you my auction system. It was finished in December and i decided to relase it. it is something like an ebay. You can sell, manage, buy items being offline.

Please note that it is a Beta Stage!.

Screenshots:
9pz041.jpg


35n1nqr.jpg


311kio4.jpg


11817hh.jpg


2uqkr4x.jpg


242y0b8.jpg



Here We go!

1. Instalation:

a) Sql
Queries:
PHP:
CREATE TABLE IF NOT EXISTS `z_slots` (
  `id` int(11) NOT NULL auto_increment,
  `aid` int(11) default NULL,
  `val` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `z_auctions` (
  `id` int(11) NOT NULL auto_increment,
  `player_name` varchar(255) default NULL,
  `item_id` int(11) default NULL,
  `item_name` varchar(255) default NULL,
  `count` int(11) default NULL,
  `cost` int(11) default NULL,
  `date` int(11) default NULL,
  `date_expire` int(11) default NULL,
  `account_id` int(11) default NULL,
  `active` int(11) default '0',
  `count_now` int(11) default '0',
  `des` text,
  `smiles` int(11) default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `z_purcharsers` (
  `id` int(11) NOT NULL auto_increment,
  `player_name` varchar(255) default NULL,
  `auction_id` int(11) default NULL,
  `count` int(11) default NULL,
  `date` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `z_account_depotitems` (
  `id` int(11) NOT NULL auto_increment,
  `account_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `count` int(11) NOT NULL,
  `added` int(15) NOT NULL,
  `item_name` varchar(255) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `z_account_communication` (
  `id` int(11) NOT NULL auto_increment,
  `player_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `count` int(11) NOT NULL,
  `added` int(15) NOT NULL,
  `done` int(15) NOT NULL,
  `alle` int(11) NOT NULL default '0',
  `account_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

ALTER TABLE accounts ADD last_auction INT(11) default '0'

ALTER TABLE accounts ADD last_acc_action INT(11) default '0'

ALTER TABLE accounts ADD balance INT(11) default '0'

b) PHP:

auctions.php: (look on attachments. File is just too long xD)
account_depot.php: (same)

index.php:
You know where:
PHP:
		case "account_store";
		$subtopic = "account_store";
		$topic = "Your Account Store";
		include("account_depot.php");
		break;

		case "auctions";
		$topic = "Auctions";
		$subtopic = "auctions";
		include("auctions.php");
		break;

Also add a link on ur site to ?subtopic=auctions and ?subtopic=account_store

Configuration:

in auctions.php:
PHP:
function replaceImage($id, $imgdir='images/items')
Change to ur items folder. (WITHOUT '/' at end!. There is also many diffrent option. They are explained in file.

in account_depot.php
PHP:
function replaceImage($id, $imgdir='images/items')
same as earlier.

Images
Copy folder auctions to /images/


b) LUA:
1.Open folder lua/
Copy all as it should be.

Open Account_Depot.lua in movements.
Change mailBoxPos to any mailbox position on your map in Account_Depot.lua in Movements and auction.lua Globalevents scripts.


now globalevents.xml:
PHP:
	<globalevent name="slots" interval="34000" event="script" value="auction_s.lua"/>
	<globalevent name="auction" interval="36000" event="script" value="auction.lua"/>

movements.xml
PHP:
<movevent type="AddItem" tileitem="1" actionid="22000" event="script" value="account_depot.lua"/>

Add npc Margot a place to Spawn

Create Somewhere (i this the best fit near dp) Some item(the best is coal basin xD) and add to it Actionid 22000

I this it is all.


2. How does it Works?:

Just Look:
I put MPA to coal Basin.
vl3ed.jpg

x2km88.jpg


and now you can make an auction or just take it back do depot:

2ikwj8h.jpg

10ric6v.jpg

5mh0mp.jpg


And the hot Margot:
21o4pbn.jpg

epkxao.jpg




3. Common Problems:

Q: Parcels doens't works
A: Make sure that scripts in movements and globalevents are set good mailBoxPos. If they do then You propably have Diffrent ID of Depot and Town. Or you just didn't execute a query. There is also another reason Timing in globalevents.xml. Make sere that u need seconds or miliseconds (default set to ms)

Q: Does this script store information about special atributes eg: other name, attack, def etc?
A: At the moment, no. It just takes ID and name of item. Possibly change in future updates.

Ufff.. Finally the end. I'd like to thanks:
Richux for a place to test it !;)
Chojrak His idea about mailBox.

Please, post your opinion ;)

Regards
QuaS~


Changelog:
Code:
patch 1.18: SQL vulnerable fixed. Problem with missing ';' at end of queries (account_depot.php fixed too [ver 1.21]). Thanks Chojrak for telling me this bug.
patch 1.17: Added replaceImage. If image  doesn't exist then show default image.
patch 1.16: Some visual changes.
patch 1.15: Post vulnerable fixed. Sorry richux xP
 

Attachments

Last edited:
Nicely done, it's far better than other one released here. I will test it soon, thanks for the release! +20

But I have one question. What if someone will throw loads of trash on coal basins? Database will be flooded with useless data.
 
Last edited:
Great idea "miszczu" :]

This script store information about special atributes eg: other name, attack, def etc?
 
Nicely done, it's far better than other one released here. I will test it soon, thanks for the release! +20

But I have one question. What if someone will throw loads of trash on coal basins? Database will be flooded with useless data.


Each Account can store only 30 Items in Depot. ;) If you try add 31th item then it is sent to ur depot in parcel. Also you can add just 1 iten per 30 seconds due abuses (same with npc Margot and Website actions like, add buy edit delete send)


Great idea "miszczu" :]

This script store information about special atributes eg: other name, attack, def etc?

Actually not... it just take amount and ID of item...
 
;/ error http://localhost:8090/?subtopic=account_store
please help me!

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'balance' in 'field list'' in C:\xampp\htdocs\pot\OTS_Account.php:772 Stack trace: #0 C:\xampp\htdocs\pot\OTS_Account.php(772): PDO->query('SELECT `balance...') #1 C:\xampp\htdocs\account_depot.php(24): OTS_Account->getCustomField('balance') #2 C:\xampp\htdocs\index.php(282): include('C:\xampp\htdocs...') #3 {main} thrown in C:\xampp\htdocs\pot\OTS_Account.php on line 772

and have error http://localhost:8090/?subtopic=auctions


Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'balance' in 'field list'' in C:\xampp\htdocs\pot\OTS_Account.php:772 Stack trace: #0 C:\xampp\htdocs\pot\OTS_Account.php(772): PDO->query('SELECT `balance...') #1 C:\xampp\htdocs\auctions.php(208): OTS_Account->getCustomField('balance') #2 C:\xampp\htdocs\index.php(288): include('C:\xampp\htdocs...') #3 {main} thrown in C:\xampp\htdocs\pot\OTS_Account.php on line 772



I cole my database sql and have error

consulta SQL:

ALTER TABLE accounts ADD last_auction INT( 11 ) default '0' ALTER TABLE accounts ADD last_acc_action INT( 11 ) default '0' ALTER TABLE accounts ADD balance INT( 11 ) default '0'

Mensagens do MySQL : Documentação
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE accounts ADD last_acc_action INT(11) default '0'

ALTER TABLE acco' at line 3

I'm brazil
 
Last edited by a moderator:
well, moving it IS simple: just copy that blob xD
Chojrak, you want to tell me that you had the only thing I miss to finish my eq tooltip?
 
hehe, so you decided to release it? That's great! Anyways, I don't want to say anything bad about Quas, he is roxorz dude :D, but you people should be carefull when using this script, because when I first tested it(it was a while ago, now its updated and this bug is probably fixed, idk) players discovered ability to somehow edit item ids when they are placed in auction. So they could get any items they want for free. That can fuck up ur server economy pretty well, so keep ur eyes open.
 
More like an offline selling system? My idea of an auction is that you set a "min fee" etc Dragon shield "Min 3.5k, buyout 6k".

And people can start bid on it, after x days highest bidder will get the item (Or if somebody takes buyout they will instantly get it). :p
 
hehe, so you decided to release it? That's great! Anyways, I don't want to say anything bad about Quas, he is roxorz dude :D, but you people should be carefull when using this script, because when I first tested it(it was a while ago, now its updated and this bug is probably fixed, idk) players discovered ability to somehow edit item ids when they are placed in auction. So they could get any items they want for free. That can fuck up ur server economy pretty well, so keep ur eyes open.

I know! i fixed it! haha xD sry for that xP look in auctions.php for patch 1.15 xP. There was a security bug xP Fixed it. I'll write some changelog to ppl know that i fixed some things. Anyway if you find a bug, then report it xP

Znote said:
More like an offline selling system? My idea of an auction is that you set a "min fee" etc Dragon shield "Min 3.5k, buyout 6k".

And people can start bid on it, after x days highest bidder will get the item (Or if somebody takes buyout they will instantly get it). :p

Yep i have this in mind for future relases. Actually it is only 'Buy now' Version at the moment ;)
 
Since you can't get the attack or defense from the item, could you add a check for a certain aid to block upgraded items from being added?
 
Back
Top