• 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:
LUA:
local voc = 0
function onAdvance(cid, skill, oldlevel, newlevel)
local config = {
	1 = {
		[2187] = 1 -- [itemid] = count
	},
	2 = {
		[2183] = 1 -- [itemid] = count
	},	
	3 = {
		[7367] = 1 -- [itemid] = count
	},
	4 = {
		[2430] = 1 -- [itemid] = count
		[2392] = 1 -- [itemid] = count
		[2436] = 1 -- [itemid] = count
	}
	storage = 99963
}  
	if getPlayerStorageValue(cid, config.storage) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45 then
		for _, items in pairs(config) do
			voc = voc + 1
			if getPlayerVocation(cid) == voc or getPlayerVocation(cid) == (voc + 4) then
				for itemid, count in pairs(items) do
					doPlayerAddItem(cid, itemid, count)
				end
			end
		end
		setPlayerStorageValue(cid, config.storage, 1)
		doPlayerSendTextMessage(cid, 22, "You have received a reward as a gratulation for reaching level 45.")
	end
	return true
end
Give this a try, not tested.
 
Last edited:
LUA:
local voc = 0
function onAdvance(cid, skill, oldlevel, newlevel)
local config = {
	1 = {
		[2187] = 1 -- [itemid] = count
	},
	2 = {
		[2183] = 1 -- [itemid] = count
	},	
	3 = {
		[7367] = 1 -- [itemid] = count
	},
	4 = {
		[2430] = 1 -- [itemid] = count
		[2392] = 1 -- [itemid] = count
		[2436] = 1 -- [itemid] = count
	}
	storage = 99963
}  
	if getPlayerStorageValue(cid, config.storage) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45 then
		for _, items in pairs(config) do
			voc = voc + 1
			i (getPlayerVocation(cid) == voc or getPlayerVocation(cid) == (voc + 4) then
				for itemid, count in pairs(items) do
					doPlayerAddItem(cid, itemid, count)
				end
			end
		end
		setPlayerStorageValue(cid, config.storage, 1)
		doPlayerSendTextMessage(cid, 22, "You have received a reward as a gratulation for reaching level 45.")
	end
	return true
end
Give this a try, not tested.

not working :(
 
Last edited:
Code:
local voc = 0
function onAdvance(cid, skill, newlevel)
local config = {
	1 = {
		[2187] = 1
	},
	2 = {
		[2183] = 1
	},	
	3 = {
		[7367] = 1
	},
	4 = {
		[2430] = 1
		[2392] = 1 
		[2436] = 1
	}
	storage = 40000
}  
	if getPlayerStorageValue(cid, config.storage) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45 then
		for _, items in pairs(config) do
			voc = voc + 1
			i (getPlayerVocation(cid) == voc or getPlayerVocation(cid) == (voc + 4) then
				for itemid, count in pairs(items) do
					doPlayerAddItem(cid, itemid, count)
				end
			end
		end
		setPlayerStorageValue(cid, config.storage, 1)
		doPlayerSendTextMessage(cid, 22, "You have received a reward as a gratulation for reaching level 45.")
	end
	return true
end

not sure, but try
 
Code:
local voc = 0
function onAdvance(cid, skill, newlevel)
local config = {
	1 = {
		[2187] = 1
	},
	2 = {
		[2183] = 1
	},	
	3 = {
		[7367] = 1
	},
	4 = {
		[2430] = 1
		[2392] = 1 
		[2436] = 1
	}
	storage = 40000
}  
	if getPlayerStorageValue(cid, config.storage) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45 then
		for _, items in pairs(config) do
			voc = voc + 1
			i (getPlayerVocation(cid) == voc or getPlayerVocation(cid) == (voc + 4) then
				for itemid, count in pairs(items) do
					doPlayerAddItem(cid, itemid, count)
				end
			end
		end
		setPlayerStorageValue(cid, config.storage, 1)
		doPlayerSendTextMessage(cid, 22, "You have received a reward as a gratulation for reaching level 45.")
	end
	return true
end

not sure, but try


not working. :S
 
Last edited:
in creaturescipts.xml it should be like
LUA:
	<event type="advance" name="AdvanceReward" event="script" value="yourscriptpathhere"/>
 
not tested but i am almost sure it will work.

LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
       
        if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45) then 
		 if isSorcerer(cid) then
                doPlayerAddItem(cid, 2160, 5) --- edit item to add for voc
                setPlayerStorageValue(cid, 99963, 1) --- edit storage if used Up too
                doPlayerSendTextMessage(cid, 22, "You have received 5 crystal coins because you reached level 45")
		 elseif isDruid(cid) then
				doPlayerAddItem(cid, 2160, 5) --- edit item to add for voc
                setPlayerStorageValue(cid, 99963, 1) --- edit storage if used
                doPlayerSendTextMessage(cid, 22, "You have received 5 crystal coins because you reached level 45")
		 elseif isPaladin(cid) then
		        doPlayerAddItem(cid, 2160, 5) --- edit item to add for voc
                setPlayerStorageValue(cid, 99963, 1) --- edit storage if used
                doPlayerSendTextMessage(cid, 22, "You have received 5 crystal coins because you reached level 45")
		 elseif isKnight(cid) then
				doPlayerAddItem(cid, 2160, 5) --- edit item to add for voc
                setPlayerStorageValue(cid, 99963, 1) --- edit storage if used
                doPlayerSendTextMessage(cid, 22, "You have received 5 crystal coins because you reached level 45")
                end
				end
        return TRUE
end
 
try this

LUA:
local rewards = {
	[1] = {2187},
	[2] = {2183},
	[3] = {7367},
	[4} = {2430,2392,2436}
	}

local s = 99483 -- storage
function onAdvance(cid,skill,oldLevel,newLevel)
local t,c = 0,{} -- don't touch!
	if getPlayerStorageValue(cid,s) ~= 1 and skill = SKILL_LEVEL and newLevel >= 45 then
	local r = rewards[getPlayerVocation(cid)]
		for i = 1,#r do
			doPlayerAddItem(cid,r[i],1)
			t = t+1
			table.insert(c,getItemNameById(r[i]))
		end
		doPlayerSendTextMessage(cid,22,'You\'ve received '..(t == 1 and 'a' or 'these')..' '..(t == 1 and 'reward' or 'rewards')..': '..table.concat(c,', ')..' for getting level 45!')
		doSendMagicEffect(getThingPos(cid),CONST_ME_MAGIC_GREEN)
		setPlayerStorageValue(cid,s,1)
	end
	return true
end
 
try this

LUA:
local rewards = {
	[1] = {2187},
	[2] = {2183},
	[3] = {7367},
	[4} = {2430,2392,2436}
	}

local s = 99483 -- storage
function onAdvance(cid,skill,oldLevel,newLevel)
local t,c = 0,{} -- don't touch!
	if getPlayerStorageValue(cid,s) ~= 1 and skill = SKILL_LEVEL and newLevel >= 45 then
	local r = rewards[getPlayerVocation(cid)]
		for i = 1,#r do
			doPlayerAddItem(cid,r[i],1)
			t = t+1
			table.insert(c,getItemNameById(r[i]))
		end
		doPlayerSendTextMessage(cid,22,'You\'ve received '..(t == 1 and 'a' or 'these')..' '..(t == 1 and 'reward' or 'rewards')..': '..table.concat(c,', ')..' for getting level 45!')
		doSendMagicEffect(getThingPos(cid),CONST_ME_MAGIC_GREEN)
		setPlayerStorageValue(cid,s,1)
	end
	return true
end

not working
 
Back
Top