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

TFS 1.X+ skills limit

VitorElias12

New Member
Joined
Jul 30, 2017
Messages
17
Reaction score
1
this script a part of it is not limiting the amount of skills that can buy skill distance, club, ax, sword, the skills limit is 350. the magiclevel is limiting I believe that the error is in that part.


(if player:getSkillLevel(v.skill) >= v.lim or (v.lim - player:getSkillLevel(v.skill)) < v.incre then)


SKILL_CLUB = "skill_club"
SKILL_DISTANCE = "skill_dist"
SKILL_SHIELD = "skill_shielding"
SKILL_MAGLEVEL = "maglevel"
SKILL_SWORD = "skill_sword"
SKILL_AXE = "skill_axe"
local coinID = 9971 -- moeda para comprar skills
local tb = {
["sd"] = {t= 1, bag = 5926, item= 2268, bag_quant = 2, price= 50, msg= "Parabéns você comprou 4k de SD com sucesso."},
["uh"] = {t= 1, bag = 2002, item= 2273, bag_quant = 3, price= 30, msg= "Parabéns você comprou 6k de UH com sucesso."},
["explo"] = {t= 1, bag = 2001, item= 2313, bag_quant = 3, price= 10, msg= "Parabéns você comprou 6k de Explosion com sucesso."},
["super divine axe"] = {t= 2, item = 8926, price= 60, msg= "Você comprou um super divine axe com sucesso."},
["super divine staff"] = {t= 2, item = 8922, price= 60, msg= "Você comprou um super divine staff com sucesso."},
["super divine club"] = {t= 2, item = 7423, price= 60, msg= "Você comprou um super divine club com sucesso."},
["super divine sword"] = {t= 2, item = 7403, price= 60, msg= "Você comprou um super divine sword com sucesso."},
["super divine crossbow"] = {t= 2, item = 8851, price= 60, msg= "Você comprou um super divine crossbow com sucesso."},
["livro nivel 6"] = {t= 2, item = 8921, price= 60, msg= "Você comprou um livro nivel 6 com sucesso."},
["vip10"] = {t= 3, days= 10, price= 5},
["vip30"] = {t= 3, days= 30, price= 10},
["magiclevel"] = {t= 4, vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 3, incre = 1, skill = SKILL_MAGLEVEL},
["skillclub"] = {t= 5, vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, price= 1, incre = 1, skill = SKILL_CLUB},
["skillsword"] = {t= 5, vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, price= 1, incre = 1, skill = SKILL_SWORD},
["skillaxe"] = {t=5 , vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350, price= 1, incre = 1, skill = SKILL_AXE},
["skilldistance"] = {t= 5, vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350, price= 1, incre = 1, skill = SKILL_DISTANCE},
["skillshielding"] = {t= 5, vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 1, incre = 1, skill = SKILL_SHIELD},
["magiclevel5"] = {t= 4, vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 15, incre = 5, skill = SKILL_MAGLEVEL},
["skillclub10"] = {t= 5, vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, price= 10, incre = 10, skill = SKILL_CLUB},
["skillsword10"] = {t= 5, vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, price= 10, incre = 10, skill = SKILL_SWORD},
["skillaxe10"] = {t=5 , vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350, price= 10, incre = 10, skill = SKILL_AXE},
["skilldistance10"] = {t= 5, vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350, price= 10, incre = 10, skill = SKILL_DISTANCE},
["skillshielding10"] = {t= 5, vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 341, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 10, incre = 10, skill = SKILL_SHIELD},
["removerfrag"] = {t= 6, price= 10},
}
local storage = 45611
function onSay(player, words, param)
local player = Player(player)
local pid = player:getGuid()
local tile = player:getTile()
local param = param:lower()
if not tile:hasFlag(TILESTATE_PROTECTIONZONE) then
player:sendCancelMessage("Você precisa está em área protegida para utilizar este comando.")
return true
end
if player:getStorageValue(storage) >= os.time() then
player:sendCancelMessage("Por medidas de segurança você só pode utilizar este comando em " .. player:getStorageValue(storage)-os.time() .. " segundos.")
return true
end
if param == "" then
player:popupFYI("Para comprar digite !comprar (nome do item)\nOpcoes:\nsd = 4000 em SD por 50 barras.\nuh = 6000 em UH por 40 barras.\nexplo = 6000 em explosion por 10 barras.\nvip10 = 10 dias de vip por 5 barras.\nvip30 = 30 dias de vip por 10 barras.\ndivine staff = divine staff por 30 barras.\ndivine axe = divine axe por 30 barras.\nlivro nivel 6 = livro nivel 6 por 60 barras.\ndivine club = divine club por 30 barras.\ndivine sword = divine sword por 30 barras.\ndivine crossbow = divine crossbow por 30 barras.\nlivro nivel 5 = livro nivel 5 por 30 barras.\nsuper divine axe = super divine axe por 60 barras.\nsuper divine club = super divine club por 60 barras.\nsuper divine sword = super divine sword por 60 barras.\nsuper divine staff = super divine staff por 60 barras.\nsuper divine crossbow = super divine crossbow por 60 barras.\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.\nremoverfrag = remove todos frags por 100k.\nO Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponíveis.")
return true
end
for f, v in pairs(tb) do
if param == f then
if v.t == 1 then
if player:getItemCount(coinID) >= v.price then
local item_quant = (v.bag_quant * 2000)/100
for x = 1, v.bag_quant do
local bag = player:addItem(v.bag, 1)
for i = 1, item_quant do
bag:addItem(v.item, 100)
end
end
player:removeItem(coinID, v.price)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, v.msg)
player:setStorageValue(storage, os.time()+1)
break
else
player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
end
elseif v.t == 2 then
if player:getItemCount(coinID) >= v.price then
item = player:addItem(v.item, 1)
item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Este item pode ser adquirido através do shopping. Adquirido dia " .. os.date("%d/%m/%Y - %X") .." por ".. player:getName() ..". Serial: ".. player:getGuid() ..".")
player:removeItem(coinID, v.price)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, v.msg)
player:setStorageValue(storage, os.time()+1)
break
else
player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
end
elseif v.t == 3 then
if player:getItemCount(coinID) >= v.price then
player:addPremiumDays(v.days)
player:removeItem(coinID, v.price)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou " .. v.days .. " dias de vip com sucesso.")
player:setStorageValue(storage, os.time()+1)
break
else
player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
end
elseif v.t == 4 then
if player:getBaseMagicLevel() >= v.lim then
player:sendCancelMessage(v.lim_msg)
return true
end
if not isInArray(v.vocations, player:getVocation():getId()) then
player:sendCancelMessage(v.voc_msg)
return true
end
if player:getItemCount(coinID) >= v.price then
player:removeItem(coinID, v.price)
player:setStorageValue(storage, os.time()+1)
player:remove()
db.query("UPDATE players SET ".. v.skill .. " = " .. v.skill .. " + " .. v.incre .. " WHERE id = ".. pid)
else
player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
end
elseif v.t == 5 then
if not isInArray(v.vocations, player:getVocation():getId()) then
player:sendCancelMessage(v.voc_msg) return false
end
if player:getSkillLevel(v.skill) >= v.lim or (v.lim - player:getSkillLevel(v.skill)) < v.incre then
player:sendCancelMessage("Você não pode comprar esse skill.") return false
end
if player:getItemCount(coinID) >= v.price then
player:removeItem(coinID, v.price)
player:setStorageValue(storage, os.time()+1)
player:remove()
db.query("UPDATE players SET ".. v.skill .. " = " .. v.skill .. " + " .. v.incre .. " WHERE id = ".. pid)
return true
else
player:sendCancelMessage("Você não possui a quantidade necessária para comprar.") return false
end
elseif v.t == 6 then
if player:getItemCount(2160) >= v.price then
player:removeItem(2160, v.price)
player:setSkull(SKULL_NONE)
player:setSkullTime(0)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull and frags has been removed!")
player:setStorageValue(storage, os.time()+1)
db.query("UPDATE player_deaths SET unjustified = 0 WHERE unjustified = 1 AND killed_by = " .. db.escapeString(player:getName()))
else
player:sendCancelMessage("Você não possui a quantidade necessária para comprar.")
end
end
end
end

return false
end
 
change

Lua:
if player:getSkillLevel(v.skill) >= v.lim or (v.lim - player:getSkillLevel(v.skill)) < v.incre then
player:sendCancelMessage("Você não pode comprar esse skill.") return false
end

to

Lua:
if player:getSkillLevel(v.skill) >= v.lim or (v.lim - player:getSkillLevel(v.skill)) < v.incre then
player:sendCancelMessage("Você não pode comprar esse skill.") return true
end
 
change

Lua:
if player:getSkillLevel(v.skill) >= v.lim or (v.lim - player:getSkillLevel(v.skill)) < v.incre then
player:sendCancelMessage("Você não pode comprar esse skill.") return false
end

to

Lua:
if player:getSkillLevel(v.skill) >= v.lim or (v.lim - player:getSkillLevel(v.skill)) < v.incre then
player:sendCancelMessage("Você não pode comprar esse skill.") return true
end
1612216750283.png

is still passing the skill limit :(
 
Lua:
if player:getSkillLevel(v.skill) >= v.lim or (player:getSkillLevel(v.skill) +  v.incre) > v.lim then
player:sendCancelMessage("Você não pode comprar esse skill.") return true
end
 
Try use:

Lua:
if player:getSkillLevel(v.skill) >= v.lim or (player:getSkillLevel(v.skill) + v.incre) >= v.lim then
    player:sendCancelMessage("Você não pode comprar esse skill.")
    return false
end

Or only (In that case it can pass a little, but it will block when it pass.):

Lua:
if player:getSkillLevel(v.skill) >= v.lim then
    player:sendCancelMessage("Você não pode comprar esse skill.")
    return false
end
 
Try use:

Lua:
if player:getSkillLevel(v.skill) >= v.lim or (player:getSkillLevel(v.skill) + v.incre) >= v.lim then
    player:sendCancelMessage("Você não pode comprar esse skill.")
    return false
end

Or only (In that case it can pass a little, but it will block when it pass.):

Lua:
if player:getSkillLevel(v.skill) >= v.lim then
    player:sendCancelMessage("Você não pode comprar esse skill.")
    return false
end

Thanks for trying to help I did the test with the 2 you sent me and both still pass the skills limit I'm giving up now :(
i have another script here but this is for tfs 0.4 will it be possible to make any changes to otx?


function onSay(cid, words, param)

if (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você precisa está em área protegida para utilizar este comando.")
return TRUE
end

if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED,"Por medidas de segurança você só pode utilizar este comando em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return TRUE
end


if(param ~= "") and (param ~= "skillclub") and (param ~= "skillsword") and (param ~= "skillaxe") and (param ~= "skilldistance") and (param ~= "skillshielding") and (param ~= "magiclevel") and (param ~= "magiclevel5") and (param ~= "skillclub10") and (param ~= "skillsword10") and (param ~= "skillaxe10") and (param ~= "skilldistance10") and (param ~= "skillshielding10") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para comprar digite !comprar (nome do item)\nOpcoes:\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponíveis.")
return TRUE
end

if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para comprar digite !comprar (nome do item)\nOpcoes:\n.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.")
return TRUE
end


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "magiclevel") then
if getPlayerMagLevel(cid) >= 200 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter magic level acima de 200.")
return TRUE
end
if(not isSorcerer(cid) and not isDruid(cid) and not isInfernalist(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids e Infernalists podem comprar magic level.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 3 then
local pid = getPlayerGUID(cid)
doPlayerRemoveItem(cid, 9971, 3)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE players SET maglevel = maglevel + 1 WHERE id = "..pid)
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skillclub") then
if getPlayerSkillLevel(cid, SKILL_CLUB) >= 350 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isDrunou(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Drunous podem comprar skill de club.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 1 then
local pid = getPlayerGUID(cid)
local club = getPlayerSkillLevel(cid, SKILL_CLUB)
doPlayerRemoveItem(cid, 9971, 1)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (club + 1) .. ", count = 0 WHERE skillid = 1 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skillsword") then
if getPlayerSkillLevel(cid, SKILL_SWORD) >= 350 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 1 then
local pid = getPlayerGUID(cid)
local sword = getPlayerSkillLevel(cid, SKILL_SWORD)
doPlayerRemoveItem(cid, 9971, 1)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (sword + 1) .. ", count = 0 WHERE skillid = 2 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skillaxe") then
if getPlayerSkillLevel(cid, SKILL_AXE) >= 350 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 1 then
local pid = getPlayerGUID(cid)
local axe = getPlayerSkillLevel(cid, SKILL_AXE)
doPlayerRemoveItem(cid, 9971, 1)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (axe + 1) .. ", count = 0 WHERE skillid = 3 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skilldistance") then
if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 350 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isPaladin(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 1 then
local pid = getPlayerGUID(cid)
local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE)
doPlayerRemoveItem(cid, 9971, 1)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (distance + 1) .. ", count = 0 WHERE skillid = 4 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skillshielding") then
if getPlayerSkillLevel(cid, SKILL_SHIELD) >= 350 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if(not isPaladin(cid) and not isKnight(cid) and not isDrunou(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights e Drunous podem comprar skill de shield.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 1 then
local pid = getPlayerGUID(cid)
local shield = getPlayerSkillLevel(cid, SKILL_SHIELD)
doPlayerRemoveItem(cid, 9971, 1)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (shield + 1) .. ", count = 0 WHERE skillid = 5 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "magiclevel5") then
if getPlayerMagLevel(cid) >= 196 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter magic level acima de 200.")
return TRUE
end
if(not isSorcerer(cid) and not isDruid(cid) and not isInfernalist(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids e Infernalists podem comprar magic level.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 15 then
local pid = getPlayerGUID(cid)
doPlayerRemoveItem(cid, 9971, 15)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE players SET maglevel = maglevel + 5 WHERE id = "..pid)
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skillclub10") then
if getPlayerSkillLevel(cid, SKILL_CLUB) >= 341 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isDrunou(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Drunous podem comprar skill de club.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 10 then
local pid = getPlayerGUID(cid)
local club = getPlayerSkillLevel(cid, SKILL_CLUB)
doPlayerRemoveItem(cid, 9971, 10)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (club + 10) .. ", count = 0 WHERE skillid = 1 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skillsword10") then
if getPlayerSkillLevel(cid, SKILL_SWORD) >= 341 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 10 then
local pid = getPlayerGUID(cid)
local sword = getPlayerSkillLevel(cid, SKILL_SWORD)
doPlayerRemoveItem(cid, 9971, 10)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (sword + 10) .. ", count = 0 WHERE skillid = 2 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skillaxe10") then
if getPlayerSkillLevel(cid, SKILL_AXE) >= 341 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 10 then
local pid = getPlayerGUID(cid)
local axe = getPlayerSkillLevel(cid, SKILL_AXE)
doPlayerRemoveItem(cid, 9971, 10)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (axe + 10) .. ", count = 0 WHERE skillid = 3 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skilldistance10") then
if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 341 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isPaladin(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 10 then
local pid = getPlayerGUID(cid)
local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE)
doPlayerRemoveItem(cid, 9971, 10)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (distance + 10) .. ", count = 0 WHERE skillid = 4 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "skillshielding10") then
if getPlayerSkillLevel(cid, SKILL_SHIELD) >= 341 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if(not isPaladin(cid) and not isKnight(cid) and not isDrunou(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights e Drunous podem comprar skill de shield.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 10 then
local pid = getPlayerGUID(cid)
local shield = getPlayerSkillLevel(cid, SKILL_SHIELD)
doPlayerRemoveItem(cid, 9971, 10)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.query("UPDATE player_skills SET value = " .. (shield + 10) .. ", count = 0 WHERE skillid = 5 and player_id = " .. pid .. ";")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
end
end
return TRUE
end
 
Back
Top