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

Vocation quest chest.

Wasted15

New Member
Joined
Aug 15, 2009
Messages
32
Reaction score
0
Hi I was wondering if it was possible to make a chest at the end of the quest that give u an items depending on your vocation. Like if your a knight u get a sword, or if you are a sorcerer you get a wand etc.. If it is can you make it for me or link me to one because I could not find one. Thank you
 
Hey Wasted15,

I Think You Can't Do This ,

So You Have To Do 4 Chests At The End Of The Quest .. ( Map )

Reagrds,

// Zarby
 
You can do it EASILY...
First of all, it is somewhere on forum sooooo
And its easy script
like
if isSorcerer(cid) then
do whateva you want(in this case add item)
elseif isDruid(cid)
and so on, look how looks main chest script in ur distro and base this one on main quest chest script
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
SorcererItem = 2000,
DruidItem = 3000,
PaladinItem = 4000,
KnightPaladin = 5000
}

if getPlayerStorageValue(cid,9004) == 1 then
    doPlayerSendCancel(cid,"Sorry, you have already done this quest.")
  elseif isSorcerer(cid) == true then
                doPlayerAddItem(cid,config.SorcererItem,1)
                doCreatureSay(cid, "Heres an item for a Sorcerer", TALKTYPE_ORANGE_1)
                setPlayerStorageValue(cid,9004,1)
        elseif isDruid(cid) == true then
                    doPlayerAddItem(cid,config.DruidItem,1)
                doCreatureSay(cid, "Heres an item for a Druid", TALKTYPE_ORANGE_1)
                setPlayerStorageValue(cid,9004,1)
        elseif isPaladin(cid) == true then
                    doPlayerAddItem(cid,config.PaladinItem,1)
                doCreatureSay(cid, "Heres an item for a Paladin", TALKTYPE_ORANGE_1)
                setPlayerStorageValue(cid,9004,1)
        elseif isKnight(cid) == true then
                    doPlayerAddItem(cid,config.KnightItem,1)
                doCreatureSay(cid, "Heres an item for a Knight", TALKTYPE_ORANGE_1)
                setPlayerStorageValue(cid,9004,1)
end 
    return TRUE
         end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local items = {
		[1] = {2160, 1},
		[2] = {2152, 2},
		[3] = {2152, 3},
		[4] = {2154, 4}
	}
	local voc = getPlayerVocation(cid)
	if getPlayerStorageValue(cid,9004) == 1 then
		doPlayerSendCancel(cid,"Sorry, you have already done this quest.")
	else
		if (items[voc][1] and items[voc][2]) then
			doPlayerAddItem(cid, items[voc][1], items[voc][2])
			setPlayerStorageValue(cid,9004,1)
		end
	end
	return true
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local items = {
		[1] = {2160, 1},
		[2] = {2152, 2},
		[3] = {2152, 3},
		[4] = {2154, 4}
	}
	local voc = getPlayerVocation(cid)
	if getPlayerStorageValue(cid,9004) == 1 then
		doPlayerSendCancel(cid,"Sorry, you have already done this quest.")
	else
		if (items[voc][1] and items[voc][2]) then
			doPlayerAddItem(cid, items[voc][1], items[voc][2])
			setPlayerStorageValue(cid,9004,1)
		end
	end
	return true
end

Want more hunted chojrak?
 
I have this script here:
local add_item = {
[1] = {8867},
[2] = {7884},
[3] = {8872},
[4] = {2476},
}
local itans = {'Dragon Robe', 'Terra Cape', 'Belted Cape', 'Knight Armor'}




function onUse(cid, item, fromPosition, itemEx, toPosition)
local player_voc = getPlayerVocation(cid)
if(getPlayerStorageValue(cid, 20200) > 0) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
return true
end
local reward=getThing(doCreateItemEx(add_item[player_voc][1], 1))
if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space.")
return true
else
if(add_item[player_voc] ~= nil) then
doPlayerGiveItem(cid, add_item[player_voc][1], 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've Found a " .. itans[player_voc] .. ".")
setPlayerStorageValue(cid, 20200, 1)
end
end
end

But what happens is the player now recieves one in their bag and one on the ground...
 
Ok, I fixed it... By not once telling the script to actually GIVE the item to the player.. Hi-Five scripting

local add_item = {
[1] = {8867},
[2] = {7884},
[3] = {8872},
[4] = {2476},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local player_voc = getPlayerVocation(cid)
if(getPlayerStorageValue(cid, 20200) > 0) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
return true
end
if(add_item[player_voc] ~= nil) then
local reward=getThing(doCreateItemEx(add_item[player_voc][1], 1))
if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a " .. getItemArticle(reward.uid) .. " " .. getItemName(reward.uid) .." that weighs " .. getItemWeight(reward.uid) .. " oz. You must make more space for it.")
return true
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've Found " .. getItemArticle(reward.uid) .. " " .. getItemName(reward.uid) .. ".")
setPlayerStorageValue(cid, 20200, 1)
return true
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Screw off fag")
return true
end
end
 
Last edited:
#scripter5#
You forget about vocations with promotion (5 - 8).

#EDIT#
So change yours table to this:
Code:
local add_item = {
[1] = {8867},
[2] = {7884},
[3] = {8872},
[4] = {2476},
[5] = {8867},
[6] = {7884},
[7] = {8872},
[8] = {2476}
}
 
Back
Top