Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Olá galera do TK, estou aqui para pedir uma ajuda com uma talkaction que eu coloquei recentemente no meu servidor !!!

coloquei a Talkaction !comprar

o problema é que na parte de compra de skills, ela não está funcionando, ela faz o character relogar na hora da compra tudo certinho, cobra a quantidade de moedas para a compra de skills, mais acaba não acrecentando o skill ao player .

gostaria de saber se tenho que executar algum comando no phpmyadmin, para funcionar, 

se alguem puder me ajudar quanto a isso darei REP+

segue a baixo a TALKACTION - lembrando que é apenas as skills's que não são acrecentadas, o resto das vendas do script estão funcionando perfeitamente !!!

 

 

function onSay(cid, words, param)
 
if (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você precisa está em área [PROTECT ZONE] 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 ~= "1kk") and (param ~= "vip10") and (param ~= "vip20") and (param ~= "golden-set") and (param ~= "full-set") and (param ~= "dragon-set") and (param ~= "demon-set") and (param ~= "exp") and (param ~= "skillclub") and (param ~= "skillsword") and (param ~= "skillaxe") and (param ~= "skilldistance") and (param ~= "skillshielding") and (param ~= "magiclevel") and (param ~= "magiclevel2") and (param ~= "skillclub2") and (param ~= "skillsword2") and (param ~= "skillaxe2") and (param ~= "skilldistance2") and (param ~= "skillshielding2") and (param ~= "removerfrag") and (param ~= "removerredskull") and (param ~= "removerblackskull") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para comprar digite !comprar (nome do item)\nOpcoes:\n1kk = 100 crystal coins por 1 barra.\nvip10 = 10 dias de vip por 50 barras.\nvip20 = 20 dias de vip por 100 barras.\ngolden-set = golden helmet, golden armor, golden legs, golden boots por 3 barras.\nfull-set = demon helmet, magic plate armor, golden legs, mastermind shield por 5 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\ndragon-set = dragon scale helmet, dragon scale mail, dragon scale legs, dragon shield por 7 barras.\ndemon-set = demon helmet, demon armor, demon legs, demonrage sword, demon shield por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nexp = 100000000 pontos de experiencia por 30 barras.\nskillclub = adiciona 1 skill club por 25 barras.\nskillsword = adiciona 1 skill sword por 25 barras.\nskillaxe = adiciona 1 skill axe por 25 barras.\nskilldistance = adiciona 1 skill distance por 25 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 25 barras.\nmagiclevel = adiciona 1 magic level por 25 barras.\nmagiclevel2 = adiciona 2 magic level por 50 barras.\nskillclub2 = adiciona 2 skills club por 50 barras.\nskillsword2 = adiciona 2 skills sword por 50 barras.\nskillaxe2 = adiciona 2 skills axe por 50 barras.\nskilldistance2 = adiciona 2 skill distance por 50 barras.\nskillshielding2 = adiciona 2 skill shielding por 50 barras.\nremoverfrag = remove todos frags por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nremoverredskull = remove red skull por 15 barras.\nremoverblackskull = remove black skull por 25 barras.\n")
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:\n1kk = 100 crystal coins por 1 barras.\nvip10 = 10 dias de vip por 50 barras.\nvip20 = 20 dias de vip por 100 barras.\ngolden-set = golden helmet, golden armor, golden legs, golden boots por 3 barras.\nfull-set = demon helmet, magic plate armor, golden legs, mastermind shield por 5 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\ndragon-set = dragon scale helmet, dragon scale mail, dragon scale legs, dragon shield por 7 barras.\ndemon-set = demon helmet, demon armor, demon legs, demonrage sword, demon shield por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nexp = 100000000 pontos de experiencia por 30 barras.\nskillclub = adiciona 1 skill club por 25 barras.\nskillsword = adiciona 1 skill sword por 25 barras.\nskillaxe = adiciona 1 skill axe por 25 barras.\nskilldistance = adiciona 1 skill distance por 25 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 25 barras.\nmagiclevel = adiciona 1 magic level por 25 barras.\nmagiclevel2 = adiciona 2 magic level por 50 barras.\nskillclub2 = adiciona 2 skills club por 50 barras.\nskillsword2 = adiciona 2 skills sword por 50 barras.\nskillaxe2 = adiciona 2 skills axe por 50 barras.\nskilldistance2 = adiciona 2 skill distance por 50 barras.\nskillshielding2 = adiciona 2 skill shielding por 50 barras.\nremoverfrag = remove um frag por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nremoverredskull = remove red skull por 15 barras.\nremoverblackskull = remove black skull por 25 barras.\n")
return TRUE
end
 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "1kk") then
if getPlayerItemCount(cid, 9971) >= 1 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2160, 100)
doPlayerRemoveItem(cid, 9971, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1kk com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "vip10") then
if getPlayerItemCount(cid, 9971) >= 50 then
doPlayerAddPremiumDays(cid, 10)
doPlayerRemoveItem(cid, 9971, 50)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 10 dias de [DONATE] com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "vip20") then
if getPlayerItemCount(cid, 9971) >= 100 then
doPlayerAddPremiumDays(cid, 20)
doPlayerRemoveItem(cid, 9971, 100)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 30 dias de [DONATE] com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "golden-set") then
if getPlayerItemCount(cid, 9971) >= 3 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2471, 1)
doAddContainerItem(bag, 2466, 1)
doAddContainerItem(bag, 2470, 1)
doAddContainerItem(bag, 2646, 1)
doPlayerRemoveItem(cid, 9971, 10)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1 Golden-Set com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "full-set") then
if getPlayerItemCount(cid, 9971) >= 5 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2493, 1)
doAddContainerItem(bag, 2472, 1)
doAddContainerItem(bag, 2470, 1)
doAddContainerItem(bag, 2514, 1)
doPlayerRemoveItem(cid, 9971, 15)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1 Full-Set com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "dragon-set") then
if getPlayerItemCount(cid, 9971) >= 7 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2506, 1)
doAddContainerItem(bag, 2492, 1)
doAddContainerItem(bag, 2469, 1)
doAddContainerItem(bag, 2516, 1)
doPlayerRemoveItem(cid, 9971, 20)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1 Dragon-Set com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "demon-set") then
if getPlayerItemCount(cid, 9971) >= 10 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2493, 1)
doAddContainerItem(bag, 2494, 1)
doAddContainerItem(bag, 2495, 1)
doAddContainerItem(bag, 2520, 1)
doPlayerRemoveItem(cid, 9971, 20)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1 Demon-Set com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "exp") then
if getPlayerItemCount(cid, 9971) >= 10 then
if getPlayerLevel(cid) >= 8 then
doPlayerAddExperience(cid, 1000)
doPlayerRemoveItem(cid, 9971, 10)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1kk de exp com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
return TRUE
end
if getPlayerLevel(cid) >= 8 then
doPlayerAddExperience(cid, 10000)
doPlayerRemoveItem(cid, 9971, 15)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 10kk de exp com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
return TRUE
end
if getPlayerLevel(cid) >= 8 then
doPlayerAddExperience(cid, 100000)
doPlayerRemoveItem(cid, 9971, 30)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 100kk de exp com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
return TRUE
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
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 isElderDruid(cid) and not isMasterSorcerer(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids  podem comprar magic level.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("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 isKnight(cid) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de club.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local club = getPlayerSkillLevel(cid, SKILL_CLUB)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local sword = getPlayerSkillLevel(cid, SKILL_SWORD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local axe = getPlayerSkillLevel(cid, SKILL_AXE)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("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) and not isRoyalPaladin(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("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 isRoyalPaladin(cid) and not isEliteKnight(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights podem comprar skill de shield.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local shield = getPlayerSkillLevel(cid, SKILL_SHIELD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("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 == "magiclevel2") 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 isElderDruid(cid) and not isMasterSorcerer(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids podem comprar magic level.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `maglevel` = `maglevel` + 2 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 == "skillclub2") 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 isKnight(cid) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knight podem comprar skill de club.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local club = getPlayerSkillLevel(cid, SKILL_CLUB)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("UPDATE `player_skills` SET `value` = " .. (club + 2) .. ", `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 == "skillsword2") 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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local sword = getPlayerSkillLevel(cid, SKILL_SWORD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("UPDATE `player_skills` SET `value` = " .. (sword + 2) .. ", `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 == "skillaxe2") 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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >=25 then
local pid = getPlayerGUID(cid)
local axe = getPlayerSkillLevel(cid, SKILL_AXE)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("UPDATE `player_skills` SET `value` = " .. (axe + 2) .. ", `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 == "skilldistance2") 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) and not isRoyalPaladin(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("UPDATE `player_skills` SET `value` = " .. (distance + 2) .. ", `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 == "skillshielding2") 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 isRoyalPaladin(cid) and not isEliteKnight(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights e podem comprar skill de shield.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local shield = getPlayerSkillLevel(cid, SKILL_SHIELD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("UPDATE `player_skills` SET `value` = " .. (shield + 2) .. ", `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 == "removerfrag") then
if getPlayerItemCount(cid, 9971) >= 10 then
doPlayerRemoveItem(cid, 9971, 10)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ") LIMIT 1;")
setPlayerStorageValue(cid,11548,os.time()+0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você removeu seus frags com sucesso.")
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 == "removerredskull") then
if (getCreatureSkullType(cid) == SKULL_RED) == FALSE then  
doPlayerSendTextMessage(cid,27,"Você não está Red Skull para utilizar este comando.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 15 then
doPlayerRemoveItem(cid, 9971, 15)
db.executeQuery("UPDATE `players` SET `skulltime`=0 WHERE `id` = "..getPlayerGUID(cid))
local skullEnd = getPlayerSkullEnd(cid)
doPlayerSetSkullEnd(cid, skullEnd, SKULL_NONE)
setPlayerStorageValue(cid,11548,os.time()+0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você removeu sua Red Skull com sucesso.")
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 == "removerblackskull") then
if (getCreatureSkullType(cid) == SKULL_BLACK) == FALSE then  
doPlayerSendTextMessage(cid,27,"Você não está Black Skull para utilizar este comando.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
doPlayerRemoveItem(cid, 9971, 25)
db.executeQuery("UPDATE `players` SET `skulltime`=0 WHERE `id` = "..getPlayerGUID(cid))
local skullEnd = getPlayerSkullEnd(cid)
doPlayerSetSkullEnd(cid, skullEnd, SKULL_NONE)
setPlayerStorageValue(cid,11548,os.time()+0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você removeu sua Black Skull com sucesso.")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end
end
Editado por Micheel15 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

MMHUCMQ.png  Esta é uma mensagem automática, este tópico foi movido para a área correta.
  Regras do fórum: http://www.tibiaking.com/forum/topic/1281-regras-gerais/#comment-7680

Este tópico foi movido:
De: Scripting OTServ > OTServ > Actions e TalkActions
Para: Suporte OTServ > OTServ > Suporte de Scripts

Link para o post
Compartilhar em outros sites

Tenta usar ai

Spoiler

function onSay(cid, words, param)
 
if (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você precisa está em área [PROTECT ZONE] 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 ~= "1kk") and (param ~= "vip10") and (param ~= "vip20") and (param ~= "golden-set") and (param ~= "full-set") and (param ~= "dragon-set") and (param ~= "demon-set") and (param ~= "exp") and (param ~= "skillclub") and (param ~= "skillsword") and (param ~= "skillaxe") and (param ~= "skilldistance") and (param ~= "skillshielding") and (param ~= "magiclevel") and (param ~= "magiclevel2") and (param ~= "skillclub2") and (param ~= "skillsword2") and (param ~= "skillaxe2") and (param ~= "skilldistance2") and (param ~= "skillshielding2") and (param ~= "removerfrag") and (param ~= "removerredskull") and (param ~= "removerblackskull") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para comprar digite !comprar (nome do item)\nOpcoes:\n1kk = 100 crystal coins por 1 barra.\nvip10 = 10 dias de vip por 50 barras.\nvip20 = 20 dias de vip por 100 barras.\ngolden-set = golden helmet, golden armor, golden legs, golden boots por 3 barras.\nfull-set = demon helmet, magic plate armor, golden legs, mastermind shield por 5 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\ndragon-set = dragon scale helmet, dragon scale mail, dragon scale legs, dragon shield por 7 barras.\ndemon-set = demon helmet, demon armor, demon legs, demonrage sword, demon shield por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nexp = 100000000 pontos de experiencia por 30 barras.\nskillclub = adiciona 1 skill club por 25 barras.\nskillsword = adiciona 1 skill sword por 25 barras.\nskillaxe = adiciona 1 skill axe por 25 barras.\nskilldistance = adiciona 1 skill distance por 25 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 25 barras.\nmagiclevel = adiciona 1 magic level por 25 barras.\nmagiclevel2 = adiciona 2 magic level por 50 barras.\nskillclub2 = adiciona 2 skills club por 50 barras.\nskillsword2 = adiciona 2 skills sword por 50 barras.\nskillaxe2 = adiciona 2 skills axe por 50 barras.\nskilldistance2 = adiciona 2 skill distance por 50 barras.\nskillshielding2 = adiciona 2 skill shielding por 50 barras.\nremoverfrag = remove todos frags por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nremoverredskull = remove red skull por 15 barras.\nremoverblackskull = remove black skull por 25 barras.\n")
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:\n1kk = 100 crystal coins por 1 barras.\nvip10 = 10 dias de vip por 50 barras.\nvip20 = 20 dias de vip por 100 barras.\ngolden-set = golden helmet, golden armor, golden legs, golden boots por 3 barras.\nfull-set = demon helmet, magic plate armor, golden legs, mastermind shield por 5 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\ndragon-set = dragon scale helmet, dragon scale mail, dragon scale legs, dragon shield por 7 barras.\ndemon-set = demon helmet, demon armor, demon legs, demonrage sword, demon shield por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nexp = 100000000 pontos de experiencia por 30 barras.\nskillclub = adiciona 1 skill club por 25 barras.\nskillsword = adiciona 1 skill sword por 25 barras.\nskillaxe = adiciona 1 skill axe por 25 barras.\nskilldistance = adiciona 1 skill distance por 25 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nskillshielding = adiciona 1 skill shielding por 25 barras.\nmagiclevel = adiciona 1 magic level por 25 barras.\nmagiclevel2 = adiciona 2 magic level por 50 barras.\nskillclub2 = adiciona 2 skills club por 50 barras.\nskillsword2 = adiciona 2 skills sword por 50 barras.\nskillaxe2 = adiciona 2 skills axe por 50 barras.\nskilldistance2 = adiciona 2 skill distance por 50 barras.\nskillshielding2 = adiciona 2 skill shielding por 50 barras.\nremoverfrag = remove um frag por 10 barras.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nremoverredskull = remove red skull por 15 barras.\nremoverblackskull = remove black skull por 25 barras.\n")
return TRUE
end
 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(param == "1kk") then
if getPlayerItemCount(cid, 9971) >= 1 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2160, 100)
doPlayerRemoveItem(cid, 9971, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1kk com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "vip10") then
if getPlayerItemCount(cid, 9971) >= 50 then
doPlayerAddPremiumDays(cid, 10)
doPlayerRemoveItem(cid, 9971, 50)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 10 dias de [DONATE] com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "vip20") then
if getPlayerItemCount(cid, 9971) >= 100 then
doPlayerAddPremiumDays(cid, 20)
doPlayerRemoveItem(cid, 9971, 100)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 30 dias de [DONATE] com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "golden-set") then
if getPlayerItemCount(cid, 9971) >= 3 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2471, 1)
doAddContainerItem(bag, 2466, 1)
doAddContainerItem(bag, 2470, 1)
doAddContainerItem(bag, 2646, 1)
doPlayerRemoveItem(cid, 9971, 10)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1 Golden-Set com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "full-set") then
if getPlayerItemCount(cid, 9971) >= 5 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2493, 1)
doAddContainerItem(bag, 2472, 1)
doAddContainerItem(bag, 2470, 1)
doAddContainerItem(bag, 2514, 1)
doPlayerRemoveItem(cid, 9971, 15)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1 Full-Set com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "dragon-set") then
if getPlayerItemCount(cid, 9971) >= 7 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2506, 1)
doAddContainerItem(bag, 2492, 1)
doAddContainerItem(bag, 2469, 1)
doAddContainerItem(bag, 2516, 1)
doPlayerRemoveItem(cid, 9971, 20)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1 Dragon-Set com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "demon-set") then
if getPlayerItemCount(cid, 9971) >= 10 then
local bag = doPlayerAddItem(cid, 1997, 1)
doAddContainerItem(bag, 2493, 1)
doAddContainerItem(bag, 2494, 1)
doAddContainerItem(bag, 2495, 1)
doAddContainerItem(bag, 2520, 1)
doPlayerRemoveItem(cid, 9971, 20)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1 Demon-Set com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
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 == "exp") then
if getPlayerItemCount(cid, 9971) >= 10 then
if getPlayerLevel(cid) >= 8 then
doPlayerAddExperience(cid, 1000)
doPlayerRemoveItem(cid, 9971, 10)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 1kk de exp com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
return TRUE
end
if getPlayerLevel(cid) >= 8 then
doPlayerAddExperience(cid, 10000)
doPlayerRemoveItem(cid, 9971, 15)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 10kk de exp com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
return TRUE
end
if getPlayerLevel(cid) >= 8 then
doPlayerAddExperience(cid, 100000)
doPlayerRemoveItem(cid, 9971, 30)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você comprou 100kk de exp com sucesso.")
setPlayerStorageValue(cid,11548,os.time()+30)
return TRUE
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
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 isElderDruid(cid) and not isMasterSorcerer(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids  podem comprar magic level.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddMagLevel(cid, 1)
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 isKnight(cid) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de club.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local club = getPlayerSkillLevel(cid, SKILL_CLUB)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 1, 1, round)
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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local sword = getPlayerSkillLevel(cid, SKILL_SWORD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 2, 1, round)
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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local axe = getPlayerSkillLevel(cid, SKILL_AXE)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 3, 1, round)
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) and not isRoyalPaladin(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 4, 1, round)
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 isRoyalPaladin(cid) and not isEliteKnight(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights podem comprar skill de shield.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local shield = getPlayerSkillLevel(cid, SKILL_SHIELD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 5, 2, round)
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 == "magiclevel2") 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 isElderDruid(cid) and not isMasterSorcerer(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Sorcerers, Druids podem comprar magic level.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddMagLevel(cid, 2)
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 == "skillclub2") 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 isKnight(cid) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knight podem comprar skill de club.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local club = getPlayerSkillLevel(cid, SKILL_CLUB)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 1, 2, round)
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 == "skillsword2") 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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local sword = getPlayerSkillLevel(cid, SKILL_SWORD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 2, 2, round)
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 == "skillaxe2") 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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de axe.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >=25 then
local pid = getPlayerGUID(cid)
local axe = getPlayerSkillLevel(cid, SKILL_AXE)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 3, 2, round)
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 == "skilldistance2") 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) and not isRoyalPaladin(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins podem comprar skill de distance.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 4, 2, round)
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 == "skillshielding2") 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 isRoyalPaladin(cid) and not isEliteKnight(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Paladins, Knights e podem comprar skill de shield.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local shield = getPlayerSkillLevel(cid, SKILL_SHIELD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
doPlayerAddSkill(cid, 5, 2, round)
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 == "removerfrag") then
if getPlayerItemCount(cid, 9971) >= 10 then
doPlayerRemoveItem(cid, 9971, 10)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ") LIMIT 1;")
setPlayerStorageValue(cid,11548,os.time()+0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você removeu seus frags com sucesso.")
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 == "removerredskull") then
if (getCreatureSkullType(cid) == SKULL_RED) == FALSE then  
doPlayerSendTextMessage(cid,27,"Você não está Red Skull para utilizar este comando.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 15 then
doPlayerRemoveItem(cid, 9971, 15)
db.executeQuery("UPDATE `players` SET `skulltime`=0 WHERE `id` = "..getPlayerGUID(cid))
local skullEnd = getPlayerSkullEnd(cid)
doPlayerSetSkullEnd(cid, skullEnd, SKULL_NONE)
setPlayerStorageValue(cid,11548,os.time()+0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você removeu sua Red Skull com sucesso.")
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 == "removerblackskull") then
if (getCreatureSkullType(cid) == SKULL_BLACK) == FALSE then  
doPlayerSendTextMessage(cid,27,"Você não está Black Skull para utilizar este comando.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
doPlayerRemoveItem(cid, 9971, 25)
db.executeQuery("UPDATE `players` SET `skulltime`=0 WHERE `id` = "..getPlayerGUID(cid))
local skullEnd = getPlayerSkullEnd(cid)
doPlayerSetSkullEnd(cid, skullEnd, SKULL_NONE)
setPlayerStorageValue(cid,11548,os.time()+0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns você removeu sua Black Skull com sucesso.")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end
end

 

 

Link para o post
Compartilhar em outros sites

@Sekk estou tendo o mesmo problema ainda, a script não adiciona o skill, será que teria que executar algo no phpmyadmin ?

é só a compra de skills que não está pegando o resto ta funcionando 100 % , agradeço mt a colaboração deis de já 

 

Link para o post
Compartilhar em outros sites

@Micheel15, os comandos estão corretos.

 

Penso que sua 'table' pode não ter os mesmos índices (nome das colunas).

 

Assim, abra seu phpMyAdmin, bata uma 'screenshot' da tabela 'player_skills' aberta e coloque aqui pra eu ver.

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

Link para o post
Compartilhar em outros sites

então caro amigo @Sekk, axo que não tenho em meu phpmyadmin, o seu script, ele não deu erro nenhum na distro, o problema é que quando eu uso, o char reloga, e não ganha a skill,

dai estou optando para usar o metodo que o @Xagah sugeriu, por ele ter me ajudado em muitos scripts, você saberia adcionar a table, em meu phpmyadmin para me ajudar, ?

 

se souber pode me explicar, ?

 

obrigado deis de já !!!

o problema está sendo apenas na compra de skill, na compra da vip10, vip20, e as outras vendas, como redremover, blackremover, está tudo funcionando corretamente !

Link para o post
Compartilhar em outros sites

@Micheel15, Tenta algo diferente. Não sei se irá dar certo, mas mude:

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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local sword = getPlayerSkillLevel(cid, SKILL_SWORD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("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

Por:

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) and not isEliteKnight(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knights podem comprar skill de sword.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 25 then
local pid = getPlayerGUID(cid)
local sword = getPlayerSkillLevel(cid, SKILL_SWORD)
doPlayerRemoveItem(cid, 9971, 25)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
ammount = 2
db.executeQuery("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = |"..ammount.." 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

E veja se a compra do skill de 'sword' está funcionando.

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

Link para o post
Compartilhar em outros sites

@Fir3element , fire, quando coloquei essa query e executei a talk deu esse erro aqui na distro, igual da foto abaixo, saberia responder ? 

o character reloga, mais não recebe a skill !!!

 

 

@Xagah

 

@Sekk

 

erro distro.jpg

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Thiagodsw
      Olá galera do Tibia King !
      Venho por meio deste tópico, publicar a ultima versão do meu servidor derivado de Tibia NTO Battle.
       
      deixei para brincarem e verem sistemas, as sources não disponibilizarei nem o site. afinal é um projeto que fiz com carinho e está a venda as sources. Thogo#9713
       
      O que tem de diferente no NTO Battle ? 
       
      Aura System e Wings Healthbar Monster Bar Healthbar vocation Sistema Raridade Shaders Dungeons e Tasks Game Shop Entre outros Veja algumas Imagens !
       
       
      O que tem nesse Pacote de Arquivos NTO Battle? 
       
      Datapack mais recente e completa do servidor. ( compilada pra windows Client Compilado SQL
      ACC GOD - god/god


      QUALQUER MSG NO DISCORD Thogo#9713
      -source client e otserv e site.
       
      DOWNLOAD  &  SCAN


       
      Client:
      https://mega.nz/file/hbgnSDRJ#xQT-qQHWLUV2Dn8jalwMGblCWnmL0_s3rZfqbxO7znw
      Server:
      https://mega.nz/file/sSZXlZ6a#gow-Db6diNVrnnPIH7qyBqP8WmVLFxWy85-yub_f32Y


       
      Scan
      Client
      https://www.virustotal.com/gui/file/86da72135d75d826c2665bb572084c30288eea843c2cfe2f7a405cfe1ea2f59c/detection
      Servidor
      https://www.virustotal.com/gui/file/cfa4d83c8b6c12fa0daf28cefd6762a053aee7245e6be8f5c02594825a2e2c1e?nocache=1
    • Por amoxicilina
      Olá Kings, venho aqui trazer uma TalkAction pra você comprar premium account, sei que pode ser algo meio inútil por existir a store.
      Então vamos script:
       
       
    • Por HSinhori
      Eu já procurei em varios lugares, achei varios artigos sobre, porém nenhum resolveu, alguém sabe como eu faço para tanto o "soul" quanto as "skills" passarem de 256 no client? Eu sei que no servidor ela passa, pois aparece que eu avancei para o skill 300+, mas no cliente, quando é pra estar 257 ele zera e recomeça...
       
      Eu acredito que possa ser no client, posso estar errado, alguem sabe onde é, e como resolver?
       
      Eu uso OTClient e tfs 0.4 rev 4393
    • Por Ocrux
      Procuro equipe pra abrir um OT Rookgaard. 
      To terminando o mapa, acho que ta bonito e pouco grandinho.
       
      RookSmart
      Continente único, na base de Rookgaard & com cidades de referencias as do Tibia.
      Por hora tem 4 cidades Prontas: Rookgaard, Carlore, Liadahar e Akuahmun.
      Estou terminando a 5ª cidade: Dahlia (de gelo) & já to achando uma boa ideia colocar Roshamuul (já providenciei).
      O servidor ta em TFS 0.4, com sources & na versão 8.6 (creio eu que parado no tempo).
       
      Quem quiser formar uma equipe pra botar on & terminar o que falta, whatsapp: 15 935001689

      Mapa Mundi
       
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo