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

Addon doll 8.54 0.3.6pl1

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,812
Solutions
6
Reaction score
822
I need a addon doll that got 3charges, every time u press ur outfit changes and it says 2charges left, 1charge left....
i want is as action script and no staff outfit!
rep++
 
not rlly, this was already released b4, and i got it, its an old idea LOL!

mine is infinity so i want it with charges :)
 
Idea stolen From : ForgottenL.se

Get your own ideas -.-

Nyan Cat, there are a lot of servers that I've seen BEFORE Forgotten Legend, that have had addon / outfit doll.
I don't think that RoHaN is the creator of EVERYTHING he creates. He gets ideas, which some has already used. So please think logical.
 
Original Script
Lua Code:

local config = {
itemid = 8982,
effect = 52,
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if (item.itemid == config.itemid) then
local i = math.random(1, 6)
local sets = {[1] = math.random(2, 74), [2] = math.random(76, 134), [3] = math.random(136, 160), [4] = math.random(192, 265), [5] = math.random(267, 301), [6] = math.random(303, 351)}
local tmp = getCreatureOutfit(cid)
tmp.lookType = sets
doCreatureChangeOutfit(cid, tmp)
doSendMagicEffect(getCreaturePosition(cid), config.effect)
end
return true
end

 
LUA:
local config = {
itemid = 8982,
effect = 52,
count = 3,
}
while (config.count > 0 ) do
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (config.count > 0 )  then
if (item.itemid == config.itemid) then
local i = math.random(1, 6)
local sets = {[1] = math.random(2, 74), [2] = math.random(76, 134), [3] = math.random(136, 160), [4] = math.random(192, 265), [5] = math.random(267, 301), [6] = math.random(303, 351)}
local tmp = getCreatureOutfit(cid)
tmp.lookType = sets[i]
doCreatureChangeOutfit(cid, tmp)
doSendMagicEffect(getCreaturePosition(cid), config.effect)
config.count = config.count - 1
if (config.count == 1 ) then
doCreatureSay(cid, "You have "..config.count.." charge left", TALKTYPE_ORANGE_1)
else 
doCreatureSay(cid, "You have "..config.count.." charges left", TALKTYPE_ORANGE_1)
end
end
end
end
return true
end
used your prototype and fixed it.
it says "You have 2 charges left", "you have 1 charge left" and "you have 0 charges left"
and it wont longer.
Tested on TFS 0.2.10

Hope you like it.
 
it works, but can u make it so after 0 charges the item disapers?
and if u got another one u can use it again, so if u got 2 dolls, u get 3 at the first and u can use the second doll 2 so u got another 3 in it.
 
LUA:
local config = {
itemid = 8982,
effect = 52,
count = 3,
}
while (config.count > 0 ) do
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (config.count > 0 )  then
if (item.itemid == config.itemid) then
local i = math.random(1, 6)
local sets = {[1] = math.random(2, 74), [2] = math.random(76, 134), [3] = math.random(136, 160), [4] = math.random(192, 265), [5] = math.random(267, 301), [6] = math.random(303, 351)}
local tmp = getCreatureOutfit(cid)
tmp.lookType = sets[i]
doCreatureChangeOutfit(cid, tmp)
doSendMagicEffect(getCreaturePosition(cid), config.effect)
config.count = config.count - 1
if (config.count == 1 ) then
doCreatureSay(cid, "You have "..config.count.." charge left", TALKTYPE_ORANGE_1)
else 
doCreatureSay(cid, "You have "..config.count.." charges left", TALKTYPE_ORANGE_1)
end
end
if (config.count == 0 ) then
doRemoveItem(item.uid, 1)
end
end
if (config.count == 0) then
config.count = config.count + 3
end
end
return true
end

evry addon doll has now 3 charges.... and will be removed
 
Last edited:
LUA:
local config = {
itemid = 8982,
effect = 52,
count = 3,
storage = 55555 -- use a free storage for this function.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
setPlayerStorageValue(cid, config.storage, 3)
if (item.itemid == config.itemid and getPlayerStorageValue(cid, config.storage) > 0 ) then
	local i = math.random(1, 6)
	local sets = {[1] = math.random(2, 74), [2] = math.random(76, 134), [3] = math.random(136, 160), [4] = math.random(192, 265), [5] = math.random(267, 301), [6] = math.random(303, 351)}
	local tmp = getCreatureOutfit(cid)
	tmp.lookType = sets[i]
	doCreatureChangeOutfit(cid, tmp)
	doSendMagicEffect(getCreaturePosition(cid), config.effect)
	if (config.count == 0) then
		config.count = 3
	end
	if (config.count > 0) then
		config.count = config.count - 1
		setPlayerStorageValue(cid, config.storage, config.count)	
	else
		setPlayerStorageValue(cid, config.storage, 2)
	end
		if (getPlayerStorageValue(cid, config.storage) == 1 ) then
			doCreatureSay(cid, "You have "..getPlayerStorageValue(cid, config.storage).." charge left", TALKTYPE_ORANGE_1)
		else 
			doCreatureSay(cid, "You have "..getPlayerStorageValue(cid, config.storage).." charges left", TALKTYPE_ORANGE_1)
		end
	end
if (getPlayerStorageValue(cid, config.storage) == 0 ) then
	doRemoveItem(item.uid, 1)
end	
return true
end

Fixed now with friend.
it uses storage so if he uses one dolls twice and then a other one the last one will be removed.
if its == 0 charges then it will be removed.
Worked on TFS 2.10.
 
Last edited:
can u make so the charges is on the doll not on the player? and when u right click the doll u can see how many charges left!
 
Mmm.... With items.xml maybe?

Add this tags:
<attribute key="charges" value="3" />
<attribute key="showcharges" value="1" />

On your doll's entrance at items.xml ;)

Maybe it will work... ^^

If not, then we need to use action ids... On doll... :/
 
:O
does this function exist in TFS 0.3.6pl1?
o.o
but can just refix the script so the doll have the charges? and shows?
i need script now :P
 
Back
Top