• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Outfits.xml > quest="storage" - doesn't work?

Keram

Member
Joined
Jan 8, 2012
Messages
491
Reaction score
12
Location
DUBLIN
Hello,

I have a problem... I have made a box quest with a reward...

The script looks like that:
PHP:
function onUse(cid, item, frompos, item2, topos)

if item.uid == 58272 then
	if getPlayerStorageValue(cid,60748) == -1 then
		doPlayerAddItem(cid,5924,1)
		setPlayerStorageValue(cid,[B]60748[/B],1)
		doPlayerSendTextMessage(cid,22,"You have found a damaged steel helmet.")
	else
		doPlayerSendTextMessage(cid,22,"It is empty.")
	end
end

return true
end

So, when a player opens the box, he should have a storageDone at 60748

So, now I go to shaman outfit in my outfits.xml, and I added the quest="60748" to it
PHP:
	<outfit id="15" default="0" quest="60748">
		<list gender="0" lookType="158" name="Shaman">
			<stats maxHealth="100"/>
		</list>
		<list gender="1" lookType="154" name="Shaman">
			<stats maxHealth="100"/>
		</list>
	</outfit>

But, when I open the box on any of my chars, I just don't get the outfit :(

Do you know why this is happening? :S
I tried with some other quest scripts and also didn't work ;/ For a yalahar quest I even added these lines to a box script:
PHP:
doPlayerAddOutfit(cid, outfit_id, 0)
doPlayerAddOutfit(cid, outfit_id, 0)
but it didn't work as well ;/

Please help me :(
 
Last edited:
Try with storageId and storageValue.
XML:
<outfit id="XX" storageId="XXXX" storageValue="1">
	...
</outfit>
 
Try with storageId and storageValue.
XML:
<outfit id="XX" storageId="XXXX" storageValue="1">
	...
</outfit>

Nope, that didn't work :S

@FattyCPK,
it worked. I added it to the script... But why it didn't work with my outfit id from outfits.xml? ;o


I would still prefer to get the outfits.xml working because its so simple ;/ and now i have to add the lines to the script that i want to get outfit from ;/


EDIT
btw, it worked with my outfit id... I always added the lines "doPlayerAddOutfit..." BEFORE the "setPlayerStorageValue..."... Now I added it AFTER and it worked even with my outfit id...


BTW.... but the outfits.xml still doesnt work!!! ;(
 
Last edited:
What? 154 (male) and 158 (female) is the outfit ids.
No idea how it's harder to use my "solution" it should be easier since you don't have to change anything in outfit.xml either.
 
@up,

you used a "looktype id"... not the "outfit ID"... I think it doesnt really matter in this case... i mean like, if u use the looktype, you have to add 2 lines to the script... if u use just the outfit id... u only have to add 1 line

i chhanged it to my outfit ids (male and female) and it still worked...


but as i said, my outfits.xml still doesnt work ;(


and no,
I dont agree that it is easier to use your solution because if there is a quest where there are 5 boxes but you can take only 1... you have to add line in the whole script after every setPlayerStorageValue...

and it is easier just to write quest="storage_id" in outfits.xml than writing the lines in the whole script.
 
Last edited:
LUA:
<outfit id="XX" storageId="XXXX" storageValue="1">
to
LUA:
<outfit id="1" premium="yes" access="5"> <!-- storageId="60748" storageValue="1"-->
 
@Cronoxs, yea. What is the point of putting those as a comment? It won't be read anyway.

@FattyCPK,
that line is needed so people can't repeat the quest? ;o
 
What? 154 (male) and 158 (female) is the outfit ids.
No idea how it's harder to use my "solution" it should be easier since you don't have to change anything in outfit.xml either.

Actually, both solutions are easy.
LUA:
local itemId, outfitId, storage, uniqueId = 5924, 15, 60748, 58272

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.uid == itemId) then
		if(getPlayerStorageValue(cid, 60748) < 0) then
			doPlayerAddItem(cid, 5924, 1)
			doPlayerAddOutfitId(cid, outfitId, 0)
			doCreatureSetStorage(cid, storage, 1)
			doPlayerSendTextMessage(cid, 22, "You have found a damaged steel helmet.")
		else
			doPlayerSendTextMessage(cid, 22, "It is empty.")
		end
	end

	return true
end
Or...if you don't like storages...
LUA:
local itemId, outfitId, uniqueId = 5924, 15, 58272

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(canPlayerWearOutfitId(cid, outfitId)) then
		doPlayerAddItem(cid, 5924, 1)
		doPlayerAddOutfitId(cid, outfitId, 0)
		doPlayerSendTextMessage(cid, 22, "You have found a damaged steel helmet.")
	else
		doPlayerSendTextMessage(cid, 22, "It is empty.")
	end

	return true
end
 
@Ratser

but will a person be able to do the quest more than once with the second script as there is no storageDone...???


oh, sorry i just saw the line here:
if(canPlayerWearOutfitId(cid, outfitId)) then

so if he doesnt have this outfit, you will be able to open the chest... if you do, you cant open it...
 
Well, I still prefer the storage function ;p

Anyway, my outfits.xml still dont work (just the quest="storage_id" part) but I think I can live with adding 2 lines to the script that I want people to get outfits from :P
 
Back
Top