• 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!

Kinda hard modification on C++ script [ANTI-DUPE]

Dankoo

Active Member
Joined
Sep 4, 2010
Messages
1,007
Reaction score
27
I'm trying to do an track item system by adapting this script: http://otland.net/f35/random-attributes-71833/#post736133

So, my system works like:

I set this to the item I want to track:

XML:
	<item id="2195" name="boots of haste">
		<attribute key="weight" value="750" />
		<attribute key="slotType" value="feet" />
		<attribute key="speed" value="40" />
		<attribute key="trackid" chance="100" random_min="1" random_max="100" />
		<attribute key="showattributes" value="1" />
	</item>

And it's working actually, but there are two problems:

- The trackid that is set is randomic, so there's a chance to get two trackids, it should be SERIAL
- To get information about attributes trough SQL it's kinda impossible, 'cause it's stored in BLOB (binaries)

What I want to change in the code:

Instead going random, set a serial number
Instead storing this number in item's attributes, set in the column "trackid" on players_items

I really have to leave now, I'll post what I've done here in a few, but it's easily modifyable trhough the original script... I don't know shi* about c++ and managed to do it lol

Thanks in advance. ^_^
 
Last edited:
I'm trying to do an track item system by adapting this script: http://otland.net/f35/random-attributes-71833/#post736133

So, my system works like:

I set this to the item I want to track:

XML:
	<item id="2195" name="boots of haste">
		<attribute key="weight" value="750" />
		<attribute key="slotType" value="feet" />
		<attribute key="speed" value="40" />
		<attribute key="trackid" chance="100" random_min="1" random_max="100" />
		<attribute key="showattributes" value="1" />
	</item>

And it's working actually, but there are two problems:

- The trackid that is set is randomic, so there's a chance to get two trackids, it should be SERIAL
- To get information about attributes trough SQL it's kinda impossible, 'cause it's stored in BLOB (binaries)

What I want to change in the code:

Instead going random, set a serial number
Instead storing this number in item's attributes, set in the column "trackid" on players_items

I really have to leave now, I'll post what I've done here in a few, but it's easily modifyable trhough the original script... I don't know shi* about c++ and managed to do it lol

Thanks in advance. ^_^

It's not impossible to check trackid via SQL, you can get info about attributes like this
SQL:
select *, convert(attributes using latin1) from player_items where convert(attributes using latin1) like '%trackid%'

You can set the trackid as an attribute to the item (saved on field attributes) and also save the serial in a new table (to check if the serial has been used or not), check my post about anti-dupe system, it doesn't save the serial in a new table, it gets info directly from the item attribute and check if the generated serial has been used, but it's working with the attribute 'serial' and not 'trackid', you can copy from my post the queries used to get serials from attributes.

PD: My anti-dupe system is a lua-script, you need to create the codes to make it on sources, but you can copy queries from it.
 
With this query it returns just "trackid", not the trackid NUMBER y'know?

You can set the trackid as an attribute to the item
Yes, I've done it.
and also save the serial in a new table (to check if the serial has been used or not)
That's what I want. But don't know how to do it with C++
check my post about anti-dupe system
What post, link please? *-* [nevermind, got it by searching your posted messages --- Great script, eh?]
it gets info directly from the item attribute and check if the generated serial has been used
Yes, that's the idea.

darkhaos, do you use msn? if so, add me, I'll not bother you, just get some tips so I can develop it here: [email protected]

Thanks.

-- edit --

Ok darkhaos, i've seen your script, it really opens a lot of options! But I want to know, is it possible to set automatically an serial number to an item the moment it drops in a monster? Trough C++ when iten is created in-game, it receives an serial number y'know

- My system don't work well in two aspects:
It generates random, instead of serial numbers
Can't find it trough queries.. If I could adapt the code to set the serial in a column at SQL, would be great...

In your script, in order for the duping system works, I would have to set manually an serial ID to each item, right?
 
Last edited:
Like, how to make an creaturescript that sets

LUA:
doItemSetAttribute(uid, "serial", generateSerial())

To items in array, when monster drop loot?

That's the problem :|
 
find random attributes and set this one in the same function as randomization
serial can be used quite easy: just set global storage +1 every time and use that value as serial number probably? checking for doubled would still need query to get all serials and check if anyone of them is doubled or not
 
darkhaos... That's the key

How to set an serial when monster dies?

Have you done this script?

I only see a way by using this script:

http://otland.net/f82/lua-sql-monster-loot-system-22906/#post230401

-- edit --

To make it working when item is created, you'll need to edit the sources

That's what I've done, but can't see the trackid number, even if it exists, it's stored in "attributes" column, wich is binary stuff, and need an special program to read it and stuff
 
Back
Top