I need help with knight weapons when it comes to getting items on level ( different each vocation)
My script is like this
And i need knight weapons to be that it differs on wich skill is highest for instance you have 16 in Sword and 14 in Axe, you will get the Fire sword and not Fire axe.
Please tell me if you need me to clarify it.
Thanks!
Bump
My script is like this
Code:
local c = {
[{1,5}] = {
[15] = {items = {{itemid = 2188, count = 1}}, storage = 99963},
[30] = {items = {{itemid = 2189, count = 1}}, storage = 99964},
[70] = {items = {{itemid = 2268, count = 50}, storage = 99965}
},
[{2,6}] = {
[15] = {items = {{itemid = 2185, count = 1}}, storage = 99963},
[30] = {items = {{itemid = 2181, count = 1}}, storage = 99964},
[70] = {items = {{itemid = 2268, count = 50}}, storage = 99965}
},
[{3,7}] = {
[15] = {items = {{itemid = 2389, count = 5}}, storage = 99963},
[20] = {items = {{itemid = 2456, count = 1}, {itemid = 2544, count = 100}}, storage = 99964},
[60] = {items = {{itemid = 7367, count = 5}}, storage = 99965}
},
[{4,8}] = {
[15] = {items = {{itemid = 2160, count = 1}}, storage = 99963},
[30] = {items = {{itemid = 2160, count = 1}, {itemid = 2160, count = 3}}, storage = 99964},
[45] = {items = {{itemid = 2160, count = 1}, {itemid = 2160, count = 5}}, storage = 99965}
}
}
function onAdvance(cid, skill, oldlevel, newlevel)
if skill ~= SKILL_LEVEL then
return true
end
for voc, x in pairs(c) do
if isInArray(voc, getPlayerVocation(cid)) then
for level, z in pairs(x) do
if newlevel >= level and getPlayerStorageValue(cid, z.storage) ~= 1 then
local text = ""
for v = 1, #z.items do
count, info = z.items[v].count, getItemDescriptions(z.items[v].itemid)
local ret = ", "
if v == 1 then
ret = ""
elseif v == #z.items then
ret = " and "
end
text = text .. ret
text = text .. (count > 1 and count or info.article).." "..(count > 1 and info.plural or info.name)
doPlayerAddItem(cid, z.items[v].itemid, z.items[v].count)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you reached level "..level.." and received "..text..".")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)
setPlayerStorageValue(cid, z.storage, 1)
end
end
end
end
return true
And i need knight weapons to be that it differs on wich skill is highest for instance you have 16 in Sword and 14 in Axe, you will get the Fire sword and not Fire axe.
Please tell me if you need me to clarify it.
Thanks!
Bump
Last edited by a moderator: