Em 1º Lugar:
Antes de tudo um feliz dia das crianças para nos !
![]()
![]()
skill = {
item = 2160, -- Item
quantidade = 100, -- Quantidade
quantidadeskill = 400, -- Skill adicionada
limiteskill = 400 -- Limite
}
magicLevel = {
item = 2160,
quantidade = 100,
quantidademl = 250,
limitedeml = 250
}
skillID = {
["club"] = SKILL_CLUB,
["sword"]= SKILL_SWORD,
["axe"] = SKILL_AXE,
["distance"] = SKILL_DISTANCE,
["shielding"] = SKILL_SHIELD
}
vocationSkill = { -- Vocações - SKILL
["club"] = {4, 8},
["sword"] = {4, 8},
["axe"] = {4, 8},
["distance"] = {3, 7},
["shielding"] = {4, 8}
}
vocationMagicLevel = {1, 2, 5, 6} -- Vocações - MAGIC LEVEL
protectZone = "sim"
function onSay(cid, words, param, channel)
local pid = getPlayerGUID(cid)
if (protectZone == "sim") and (not getTilePzInfo(getCreaturePosition(cid))) then
doPlayerSendCancel(cid, "Você precisa estar em protection zone pra poder comprar.")
end
if (param == '') then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Como usar: !comprar club; !comprar magiclevel.")
return true
end
local storage, duration = 5, 5
if (param == 'magiclevel') then
if getPlayerMagLevel(cid) < magicLevel.limitedeml then
if isInArray(vocationMagicLevel, getPlayerVocation(cid)) then
if doPlayerRemoveItem(cid, magicLevel.item, magicLevel.quantidade) then
if (os.time() - getPlayerStorageValue(cid, storage)) >= duration then
setPlayerStorageValue(cid, storage, os.time())
doRemoveCreature(cid, true)
db.executeQuery("UPDATE `players` SET `maglevel` = `maglevel` + ".. magicLevel.quantidademl .." WHERE `id` = ".. pid)
else
doPlayerSendCancel(cid, "Espere ".. duration .." segundos para comprar novamente.")
end
else
doPlayerSendCancel(cid, "Você não tem o item requerido.")
end
else
doPlayerSendCancel(cid, "Voce não pode comprar magic level.")
end
else
doPlayerSendCancel(cid, "Você chegou no limite de magic level.")
end
return true
end
if(skillID[param:lower()]) then
if(getPlayerSkill(cid, skillID[param:lower()]) < skill.limiteskill) then
if isInArray(vocationSkill[param:lower()], getPlayerVocation(cid)) then
if doPlayerRemoveItem(cid, skill.item, skill.quantidade) then
if (os.time() - getPlayerStorageValue(cid, storage)) >= duration then
setPlayerStorageValue(cid, storage, os.time())
doRemoveCreature(cid, true)
db.executeQuery("UPDATE `player_skills` SET `value` = `value` + ".. skill.quantidadeskill .." WHERE `player_id` = ".. pid .. " and `skillID[` = ".. skillID[param:lower()])
else
doPlayerSendCancel(cid, "Espere ".. duration .." segundos para comprar novamente.")
end
else
doPlayerSendCancel(cid, "Você não tem o item requerido.")
end
else
doPlayerSendCancel(cid, "Voce não pode comprar este skill.")
end
else
doPlayerSendCancel(cid, "Você chegou no limite de skill.")
end
else
doPlayerSendCancel(cid, "Skill desconhecida.")
end
return true
end


info
Grupo: Campones
Registrado: 16/02/11
Posts: 18
Reputação: -1
Char no Tibia: Latininhoo
Boa tarde Galerinha do xtibia !
Antes de tudo um feliz dia das crianças para nos !
Então eu gostaria de um script que os players possam comprar skills por comando exemplo:
!comprar skill magic
e etc
Só que por barras id [9971]
ops o servidor é versão 0.4.1
8.60
Muito obrigado.
Não estranhe se vocês ja viram eu pedindo isso é que faiz tempo que estou atras huashauhsuahshuaus
Ninguém ?
Ninguém ?
aLGUÉN ?
Editado Outubro 12 por lefsty