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

quest chest dosent work? workt before...

Status
Not open for further replies.

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
Hey all my chests have been changed since i updated my server to the latest trunk!
They workt before change i dint use any script at all but now they dont work....
They where using uniq id but now they dont work.
can it be becouse that the map is 8.5 and the server is 8.62?

But this did work before!
this script dosent work:
LUA:
local cfg = {
      addItem = 132,
      amount = 1,
      storId = 1001
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
         if getPlayerStorageValue(cid, cfg.storId) == -1 then
            doPlayerAddItem(cid, cfg.addItem, cfg.amount)
            doPlayerSendTextMessage(cid, 22, "You have found " .. getItemArticleById(cfg.addItem) .. " " .. getItemNameById(cfg.addItem) .. ".")
            setPlayerStorageValue(cid, cfg.storId, 1)
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
         else
             doPlayerSendTextMessage(cid, 22, "It is empty.")
             doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
         end
         return true
end
 
LUA:
function onUse(cid, item, frompos, item2, topos)


if item.uid == 55xxx then
if getPlayerStorageValue(cid,55xxx) == -1 then
doPlayerSendTextMessage(cid,25,"You have found an item!")
doPlayerAddItem(cid,ItemID,1)
setPlayerStorageValue(cid,55xxx,1)
else
doPlayerSendTextMessage(cid,25,"The chest is empty.")
end

end
return TRUE
end
 
well it should not be the scripts that are wrong.
Becouse i have non scripts except 1 And that one aint working also.
I have only put the chests with uniq id and they get the item but when the push the chest they can just open the chest noting else the open it like a bag.
and there is noting inside!
 
16:54 You see a chest (Vol:15).
ItemID: [1740], UniqueID: [2272].
Position: [X: 967] [Y: 474] [Z: 7].

Uniqueid is the items that they should get from the chest not by a script.
And the items is not added inside the chest!
But do you need to add it in the chest?
Do i need to change the maps version to the same server version?
The map is now 8.55 and server is 8.62
 
Remove the unique ID, it's not the item ID that shows up in the chest.
You've got to make an action ID for the chests..
 
how come it workt before?:S
i only added that in the mapeditor and they got the item i dint use any script.
and some with a script dosent work.

Dosent work:
local cfg = {
addItem = 2157,
amount = 5,
storId = 1006
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, cfg.storId) == -1 then
doPlayerAddItem(cid, cfg.addItem, cfg.amount)
doPlayerSendTextMessage(cid, 22, "You have found " .. getItemArticleById(cfg.addItem) .. " " .. getItemNameById(cfg.addItem) .. ".")
setPlayerStorageValue(cid, cfg.storId, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
else
doPlayerSendTextMessage(cid, 22, "It is empty.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return true
end
 
what action id?
The script i posted i added a the item inside thouse quest chest

And the one with out scripts has only uniq id on the chests.
 
I mean you need a line in your actions.xml for every action chest you make..
Like this for example..

50ccchest.lua

LUA:
function onUse(cid, item, frompos, item2, topos)


if item.uid == 55115 then
if getPlayerStorageValue(cid,55115) == -1 then
doPlayerSendTextMessage(cid,25,"You have found 50 Crystal Coins!")
doPlayerAddItem(cid,2160,50)
setPlayerStorageValue(cid,55115,1)
else
doPlayerSendTextMessage(cid,25,"The chest is empty.")
end

end
return TRUE
end

actions.xml

XML:
<action uniqueid="55115" script="50ccchest.lua" />
 
i had added it in actions.xml.
<action uniqueid="1006" event="script" value="custom quests/dpchest1.lua" />
my script only do the Empty part.
 
Fully configurable.

LUA:
local r = {
	i = 2895, -- item given
	c = 1, -- item count
	tc = MESSAGE_STATUS_CONSOLE_BLUE, -- message color
	ms = 'You gained an item!', -- message on succeed
	mf = 'You can\'t open this chest twice.', -- message on fail
	m = CONST_ME_MAGIC_BLUE, -- Magic Effect
	s = 2581 -- Storagevalue used.
	}

function onUse(cid,item,fromPos,itemEx,toPos)
	if getPlayerStorageValue(cid,r.s) < 0 then
		doPlayerAddItem(cid,r.i,r.c)
		doPlayerSendTextMessage(cid,r.tc,r.ms)
		doSendMagicEffect(v,r.m)
		setPlayerStorageValue(cid,r.s,1)
	else
		doPlayerSendCancel(cid,r.mf)
		doSendMagicEffect(v,CONST_ME_POFF)
	end
	return true
end

just make sure the locals are right.
 
Status
Not open for further replies.
Back
Top