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

Every vocation receive ITEMS at level 45,

ugurdrahs

New Member
Joined
May 6, 2010
Messages
555
Reaction score
2
Location
Netherland
Does someone make it so when a vocation receive level 45 he receive items;

sorcerer receive; wand of inferno
Knights: knight axe, fire sword, and another club weapon
pallys: enchanted spear
druids: hailstorm rod


I use this script so people get money at level 45,
but how to make it so they get items?
PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
       
        if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45) then
                doPlayerAddItem(cid, 2160, 5)
                setPlayerStorageValue(cid, 99963, 1)
                doPlayerSendTextMessage(cid, 22, "You have received 5 crystal coins because you reached level 45")
                end
        return TRUE
end
 
Last edited:
Tested and works now :)
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
local reward = {
	["sorcerer"] = {2187},
	
	["druid"] = {2183},
	
	["paladin"] = {7367},
	
	["knight"] = {2430, 2392, 2436},
}
local level = 45
local storage, vocation = 99821, ""
	if getPlayerStorageValue(cid, storage) ~= 1 and skill == SKILL__LEVEL and newlevel >= level then
		if isInArray({1, 5}, getPlayerVocation(cid)) then
			vocation = "sorcerer"
		end
		if isInArray({2, 6}, getPlayerVocation(cid)) then
			vocation = "druid"
		end
		if isInArray({3, 7}, getPlayerVocation(cid)) then
			vocation = "paladin"
		end
		if isInArray({4, 8}, getPlayerVocation(cid)) then
			vocation = "knight"
		end
		for _, itemid in ipairs(reward[vocation]) do
			doPlayerAddItem(cid, itemid, 1)
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received a reward as a gratulation for reaching level 45.")
		setPlayerStorageValue(cid, storage, 1)
	end
	return true
end
 
Last edited:
Tested and works now :)
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
local reward = {
	["sorcerer"] = {2187},
	
	["druid"] = {2183},
	
	["paladin"] = {7367},
	
	["knight"] = {2430, 2392, 2436},
}
local level = 45
local storage, vocation = 99821, ""
	if getPlayerStorageValue(cid, storage) ~= 1 and skill == SKILL__LEVEL and newlevel >= level then
		if isInArray({1, 5}, getPlayerVocation(cid)) then
			vocation = "sorcerer"
		end
		if isInArray({2, 6}, getPlayerVocation(cid)) then
			vocation = "druid"
		end
		if isInArray({3, 7}, getPlayerVocation(cid)) then
			vocation = "paladin"
		end
		if isInArray({4, 8}, getPlayerVocation(cid)) then
			vocation = "knight"
		end
		for _, itemid in ipairs(reward[vocation]) do
			doPlayerAddItem(cid, itemid, 1)
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received a reward as a gratulation for reaching level 45.")
		setPlayerStorageValue(cid, storage, 1)
	end
	return true
end

thanks alot m8!!

repp+ for u,

but one other question,
I also want it for level 90, but can I use the same storage?
PHP:
local storage, vocation = 99821, ""

or do I need make new one?
 
Back
Top