Ir para conteúdo
  • 0

Cut System Duvida....


Zikaduh

Pergunta

Eu fiz tipo um armengo com o sistema de mineração do azeroth que deu certo so que tem um negoço que eu quero muda e não consigo..

 

 

local configs = {
sign = {{level = {1,99}, quant = {1,2}, percent = 20},
{level = {100,120}, quant = {1,5}, percent = 35},
{level = {121,130}, quant = {1,7}, percent = 45},
{level = {131,140}, quant = {1,8}, percent = 65},
{level = {141,149}, quant = {1,9}, percent = 70},
{level = {150}, quant = {1,10}, percent = 100}},
trees = {2708, 2768, 2767, 2702, 2785, 2700, 2707, 2711, 2706, 2707, 2705, 2719, 7024, 5156, 5157, 2697, 2698, 2701, 2702, 2703, 2704, 2707, 2712, 2718, 2719, 2720, 2709, 2710, 2722, 2725, 2726, 2770, 2786, 4006, 4007, 4008, 4009, 4010, 7020, 7021, 7022, 7023},
wood = {{5901, 'all'}},
tree_delay = 200, --[em minutos
MaxLevel = 150,
breakChance = 75

}
--END Configs--
function onUse(cid, item, fromPosition, itemEx, toPosition, onUse)
local STORAGE_SKILL_LEVEL = 20000
local STORAGE_SKILL_TRY = 20001
local skillLevel = getPlayerStorageValue(cid,STORAGE_SKILL_LEVEL)
local skillTry = getPlayerStorageValue(cid,STORAGE_SKILL_TRY)
local objeto2 = getThingFromPos(toPosition)
local player = (cid)

if skillLevel == -1 then
setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,1)
end
for Q = 1, #configs.sign do
if configs.sign[Q].level[2] == nil then
configs.sign[Q].level[2] = configs.sign[Q].level[1]
end
if skillLevel >= configs.sign[Q].level[1] and skillLevel <= configs.sign[Q].level[2] then
quant = math.random(configs.sign[Q].quant[1],configs.sign[Q].quant[2])
percent = configs.sign[Q].percent
break
end
end
for i = 1, #configs.trees do
if objeto2.itemid == configs.trees then

if math.random(1,100) <= configs.breakChance then
doPlayerSendCancel(cid,"Your axe has broke")
doSendMagicEffect(toPosition, 3)
doRemoveItem(item.uid,0)
doPlayerSay(cid,"Cortando",1)
return true
else

if math.random(1,100) <= percent then
possible_wood = {{},{}}
for h = 1, #configs.wood do
if configs.wood[h][2] == objeto2.itemid then
possible_wood[1][#possible_wood[1]+1] = configs.wood[h][1]
else
if configs.wood[h][2] == 'all' then
possible_wood[2][#possible_wood[2]+1] = configs.wood[h][1]
end
end
end
if possible_wood[1][1] == nil and possible_wood[2][1] == nil then
doPlayerSay(cid,"This tree can not be chopped.",1)
elseif possible_wood[1][1] ~= nil then
doPlayerAddItem(cid,possible_wood[1][math.random(1,#possible_wood[1])],quant)
elseif possible_wood[1][1] == nil and possible_wood[2][1] ~= nil then
doPlayerAddItem(cid,possible_wood[2][math.random(1,#possible_wood[2])],quant)
end
if possible_wood[1][1] ~= nil or possible_wood[2][1] ~= nil then
if skillTry >= 0 then
setPlayerStorageValue(cid,STORAGE_SKILL_TRY,skillTry + 1)
else
setPlayerStorageValue(cid,STORAGE_SKILL_TRY,1)
end
doPlayerSay(cid," ",1)
doItemSetAttribute(objeto2.uid, "name", "remains of wood ore")
doSendMagicEffect(toPosition, 3)
addEvent(doTreeReturn,configs.tree_delay * 1000/60,toPosition,objeto2.itemid)
doTransformItem(objeto2.uid, 8786)
break
end
else
doPlayerSendCancel(cid,"You destroyed the tree...")
doSendMagicEffect(toPosition, 3)
doItemSetAttribute(objeto2.uid, "name", "remains of wood ore")
addEvent(doTreeReturn,configs.tree_delay * 1000/60,toPosition,objeto2.itemid)
doTransformItem(objeto2.uid, 8785)
break
end
end
else
doPlayerSendCancel(cid,"I can only chop trees")
end
end
if skillTry >= ((skillLevel+1)*3) then
if skillLevel == configs.MaxLevel then
doPlayerSay(cid,"I got the max level in tree cutting.",1)
setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0)
else
setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,skillLevel + 1)
setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0)
doPlayerSay(cid,"I advanced from level ".. skillLevel .." to level ".. skillLevel + 1 .." in chopping skill.",1)
doPlayerSay(cid,"LEVEL UP!",1)
end
end
end

function doTreeReturn(itemposition,oldid)
local pos = getThingfromPos(itemposition)
doTransformItem(pos.uid,oldid)
doSetItemText(pos.uid, getItemNameById(oldid))
doSendMagicEffect(itemposition,math.random(45,45))
end

 

 

Mais eu queria muda a cor da mensagem que ta vindo em amarelo (fica aparecendo toda hora no defaut)

para verde ou laranja (igual a de spell).

Eu tentei fazer isso mais ainda fico em amarelo.

 

 

if math.random(1,100) <= configs.breakChance then
doPlayerSendCancel(cid,"Your axe has broke")
doSendMagicEffect(toPosition, 3)
doRemoveItem(item.uid,0)
doPlayerSay(cid,"Cortando",1,TEXTCOLOR_GREEN)
return true
else

 

 

Quem me ajuda darei REP+


Darei 3 Rep+


Alguem ajuda to precisando muito disso.

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

cara acho que nao vai funcionar mas se funcionar blz... se nao funcionar troque a mesma linha por esta aki

 

doPlayerSendTextMessage(cid,25,"O bau esta vazil.")

 

 

basta modificar oq vai aparecer na menssagem e a cor e lugar ali na quele numero:25 para outro como por exemplo:

doPlayerSendTextMessage(cid,24,"Voce esta cortando.")

 

 

mas se nao adiantar nao sei...
e lembre se isto eh soh se a ideia do cara ali em cima nao funcionar...
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...