Postado Abril 9, 2015 10 anos Olá! Tenho um script de gemas do foxwolrd em mãos, mas quero acrescentar dois atributos... Queria que quando o player tivesse a storage da gema, ele ganhasse o atributo de regeneração de mana e life. Tipo, dar use na gema e ganhar o atributo de regeneração de 500 de mana e 1000 de sangue por segundo! Eu tentei fazer mas não consegui... Script: actions: function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerGroupId(cid) > 2 and getPlayerGroupId(cid) < 5 then return true end local voc = getPlayerVocation(cid) if getPlayerPromotionLevel(cid) > 0 then voc = voc - (getPlayerPromotionLevel(cid) * 4) end gem = gems.id[voc] if item.itemid == gem then if getPlayerLevel(cid) < 200 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"É necessário level 200 ou maior para absorver uma gema espiritual!") else if getPlayerPromotionLevel(cid) > 0 then if getPlayerStorageValue(cid,21203) == -1 then setPlayerStorageValue(cid,21203,1) doUseGem(cid, item) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Você absorveu uma gema espiritual!") doSendMagicEffect(getPlayerPosition(cid),65) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Você ainda possui uma gema espiritual absorvida.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Você precisa estar promovido para usar a gema.") end end else return false end return true end actions.xml: <action itemid="2154" script="other/gemas.lua" /> <action itemid="2155" script="other/gemas.lua" /> <action itemid="2156" script="other/gemas.lua" /> <action itemid="2158" script="other/gemas.lua" /> lib/047-gems.lua (criar) gems = { id = {2156, 2154, 2158, 2155, 2156, 2154, 2158, 2155}, storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012}, interval = {600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600} } gemMsg = { rnd = {"'´ . ,", ". '´ ,", "` . ,", ", '´ ."}, colorSorcerer = {180,180}, colorDruid = {30,30}, colorPaladin = {251,10}, colorKnight = {204,212}, colorMasterSorcerer = {180,180}, colorElderDruid = {30,30}, colorRoyalPaladin = {251,10}, colorEliteKnight = {204,212} } function doUseGem(cid, item) local level = getPlayerLevel(cid) local voc = getPlayerVocation(cid) local interval = gems.interval[voc] if getPlayerPromotionLevel(cid) > 0 then voc = voc - (getPlayerPromotionLevel(cid) * 4) end if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > 0 then return false end setPlayerStorageValue(cid, gems.storage[voc], 1) sendGemEffect(cid, gems.storage[voc], gems.interval[voc]) doRemoveItem(item.uid, 1) return true end function sendGemEffect(cid, storage, interval) if isPlayer(cid) then local pos = getThingPos(cid) local voc = getPlayerVocation(cid) local level = getPlayerLevel(cid) local color = 1 if level > 199 then if getPlayerPromotionLevel(cid) > 0 then voc = voc - (getPlayerPromotionLevel(cid) * 4) end if voc == 1 then color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)] elseif voc == 2 then color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)] elseif voc == 3 then color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)] elseif voc == 4 then color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)] end doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color) if getPlayerStorageValue(cid, gems.storage[voc]) >= 1 then addEvent(sendGemEffect, interval, cid, storage, interval) end else stopEvent(sendGemEffect(cid, storage, interval)) end end function doRemoveAllGemEffect(cid) for i = 1, table.maxn(gms.storage) do setPlayerStorageValue(cid, gems.storage[i], 0) end return true end function isGemActivated(cid) local voc = getPlayerVocation(cid) if getPlayerPromotionLevel(cid) > 0 then voc = voc - (getPlayerPromotionLevel(cid) * 4) end if getPlayerStorageValue(cid, gems.storage[voc]) > 0 then return true end return false end return true end login.lua if getPlayerStorageValue(cid, 21203) > 0 then local voc = getPlayerVocation(cid) if getPlayerPromotionLevel(cid) > 0 then voc = voc - (getPlayerPromotionLevel(cid) * 4) end if getPlayerStorageValue(cid, gems.storage[voc]) > 0 then sendGemEffect(cid, gems.storage[voc], gems.interval[voc]) end end Se alguém puder ajudar! @up Editado Abril 8, 2015 10 anos por NathanAmaro (veja o histórico de edições) Oi
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.