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

C++ Max item count.

Avandia

Active Member
Joined
Apr 26, 2017
Messages
53
Solutions
1
Reaction score
30
Any idea how to do max item count example. Creating rune via spell you can create 2x SD you can split to 1x two runes, but you cant connect them together to make 2x one rune.

Any ideas?

Something like charges on old tibia, but for new TFS.
 

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
2,864
Solutions
12
Reaction score
1,940
Location
Poland
the items can't stack if their custom attributes differ. You may add this
Code:
local randomId = ""
for i = 1, 10 do
    randomId = randomId .. math.random(0, 9)
end

item:setCustomAttribute(100, randomId)

in data/spells/lib/spells.lua, in function Player:conjureItem, the exact place is:

Code:
	local item = self:addItem(conjureId, conjureCount)
	if not item then
		self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
		self:getPosition():sendMagicEffect(CONST_ME_POFF)
		return false
	end
                  -- <-- here
	if item:hasAttribute(ITEM_ATTRIBUTE_DURATION) then
		item:decay()
	end
 
OP
A

Avandia

Active Member
Joined
Apr 26, 2017
Messages
53
Solutions
1
Reaction score
30
the items can't stack if their custom attributes differ. You may add this
Code:
local randomId = ""
for i = 1, 10 do
    randomId = randomId .. math.random(0, 9)
end

item:setCustomAttribute(100, randomId)

in data/spells/lib/spells.lua, in function Player:conjureItem, the exact place is:

Code:
    local item = self:addItem(conjureId, conjureCount)
    if not item then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        self:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end
                  -- <-- here
    if item:hasAttribute(ITEM_ATTRIBUTE_DURATION) then
        item:decay()
    end
Where to add this 1st part of script?
 
Top