Ir para conteúdo

maicao22

Membro
  • Registro em

  • Última visita

Tudo que maicao22 postou

  1. Obrigado por me ajudarem, Duvida solucionada, podem colocar o status como resolvido.
  2. Mas a shield nao tem atributos armor, por exemplo a Blessed shield ((Def: 40).
  3. Ah nao funciona em shields. Entendi. O resto ta ok. Muito obrigado.
  4. Vou testar aqui e ja falo o resultado. Perfeito amigo. Simples hahha. Eu tentei fazer algo assim mas tava alterando errado. Muito obrigado por sua colaboração. Reputado. Unica coisa que falta eu ajeitar agora para o script ficar 100% é fazer ele funcionar nas armors, helmets, shields etc. Mas creio que deve ser algo na minha distro. Vou trocar para ver.
  5. maicao22 postou uma resposta no tópico em Códigos C++
    Teria para otx 2?
  6. Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). OTX 2; Mas os scripts do tfs 0.4 funcionam normalmente Base: 8.60 Qual erro está surgindo/O que você procura? Boa trade pessoal. Gostaria de uma ajuda da comunidade referente ao sistema de refine system do mock para fazer uma modificação no mesmo e deixá-lo semelhante ao do pbotwars. Vou usar os exemplos de look no item abaixo para tentar explicar melhor. [EXEMPLO DE ITEM NORMAL SEM SER REFINADO] You see a imperium axe (Atk:80, Def:30). It can only be wielded properly by elite knights of level 8 or higher. It weighs 40.00 oz. [AO USAR A PEDRA DE REFINAMENTO PRIMA VEZ] Your item has been upgrated to +1. You see a imperium axe +1 (Atk:81, Def:31). It can only be wielded properly by elite knights of level 8 or higher. It weighs 40.00 oz. [AO USAR A PEDRA DE REFINAMENTO SEGUNDA VEZ] Your item has been upgrated to +2. 17:06 You see a imperium axe +2 (Atk:83, Def:33). It can only be wielded properly by elite knights of level 8 or higher. It weighs 40.00 oz. Acima é o que esta ocorrendo, no entanto gostaria que ficasse da seguinte forma. Vejamos abaixo: [ITEM NORMAL SEM SER REFINADO] You see a imperium axe (Atk:80, Def:30). It can only be wielded properly by elite knights of level 8 or higher. It weighs 40.00 oz. [AO USAR A PEDRA DE REFINAMENTO PRIMA VEZ] Your item has been upgrated to +1. You see a imperium axe +1 (Atk:81, Def:31). It can only be wielded properly by elite knights of level 8 or higher. It weighs 40.00 oz. [AO USAR A PEDRA DE REFINAMENTO SEGUNDA VEZ] Your item has been upgrated to +2. 17:06 You see a imperium axe +2 (Atk:82, Def:32). It can only be wielded properly by elite knights of level 8 or higher. It weighs 40.00 oz. [AO USAR PELA TERCEIRA VEZ] Your item has been upgrated to +3. 17:06 You see a imperium axe +3 (Atk:83, Def:33). It can only be wielded properly by elite knights of level 8 or higher. It weighs 40.00 oz. E assim sucessivamente. Resumindo, quero que cada pedra de 1 a mais de upgrade no item e que a quantidade de vezes que ele foi refinado (em que usei a pedra) apareça antes dos atributos de atack e defesa. Vou deixar o código abaixo caso alguém possa me ajudar. Com certeza aquele rep + estará garantido. Muito obrigado! Você tem o código disponível? Se tiver publique-o aqui: --- Perfect refine system by Mock the bear (MTB). --- Email: [email protected] local gain = { gainArmor='&p+1',loseArmor='&p-1', gainShield='&s+2',loseShield='&s-2', gainAttack='&a+2',loseAttack='&a-2', gainDefense='&d+2',loseDefense='&d-2', chance='100/((#*(1/(@/2)))*(@/2))', -- Eu fiz essa equação para variar de +0 a +7 o item --- Essa equação deve retornar em % a chance do item se refinar (0-100) 100 = sempre, 0 = nunca maxlvl = 6, blocked_ids = {2488,8881} } -- &a = weapon attack -- &d = weapon defense -- &s = shield defense -- &p = armor defense -- # = nivel do item -- @ = max level if not setItemName then function setItemName(uid,name) return doItemSetAttribute(uid,'name',name) end function setItemArmor(uid,name) return doItemSetAttribute(uid,'armor',name) end function setItemDefense(uid,name) return doItemSetAttribute(uid,'defense',name) end function setItemAttack(uid,name) return doItemSetAttribute(uid,'attack',name) end function getItemAttack(uid) return getItemAttribute(uid,'attack') end function getItemDefense(uid) return getItemAttribute(uid,'defense') end function getItemArmor(uid) if type(uid) == 'number' then return getItemAttribute(uid,'armor') else return getItemInfo(uid.itemid).armor end end end function isArmor(uid) -- Function by Mock the bear. if (getItemArmor(uid) and getItemArmor(uid) ~= 0 and not getItemInfo(uid.itemid,'attack') and not getItemInfo(uid.itemid,'defense') and getItemWeaponType(uid.uid) == 0) then return true end return false end function isWeapon(uid) -- Function by Mock the bear. uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 or f == 4 then return TRUE end return FALSE end function isShield(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 5 then return TRUE end return FALSE end function getWeaponLevel(uid) -- Function by Mock the bear. uid = uid or 0 local name = getItemName(uid) local lvl = string.match(name,'+(%d)') return tonumber(lvl) or 0 end function doTransform(s,i) -- Function by Mock the bear. local c = string.gsub(s,'@',gain.maxlvl) local c = string.gsub(c,'&a',getItemAttack(i.uid) or getItemInfo(i.itemid).attack) local c = string.gsub(c,'&d',getItemDefense(i.uid) or getItemInfo(i.itemid).defense) local c = string.gsub(c,'&s',getItemDefense(i.uid) or getItemInfo(i.itemid).defense) local c = string.gsub(c,'&p',getItemArmor(i.uid) or getItemInfo(i.itemid).armor) local c = string.gsub(c,'#',getWeaponLevel(i.uid)) local q,err = loadstring('return '..c) assert(q,err) return assert(q()) end function onUse(cid, item, fromPosition, itemEx, toPosition) toPosition.stackpos = 255 if isInArray(gain.blocked_ids, itemEx.itemid) == TRUE or getItemWeaponType(itemEx.uid) > 4 or (getItemWeaponType(itemEx.uid) == 0 and isArmor(itemEx) == FALSE) or itemEx.itemid == 0 then doPlayerSendTextMessage(cid, 24,"You cant refine this item.") return TRUE end if isCreature(itemEx.uid) == TRUE then return FALSE end local level = getWeaponLevel(itemEx.uid) local chance = doTransform(gain.chance,itemEx) if chance >= math.random(0,100) or item.actionid >= 1000 or (item.actionid == 500 and math.random(0,100) <= 25) then if level+1 > gain.maxlvl then doSendMagicEffect(toPosition, 2) return doPlayerSendTextMessage(cid, 24,"Your item is on max level, you can't upgrade it.") else setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level+1)) doPlayerSendTextMessage(cid, 24,"Your item has been upgrated to +"..(level+1)..".") doSendMagicEffect(toPosition, 12) if isArmor(itemEx) == TRUE then local get = doTransform(gain.gainArmor,itemEx) setItemArmor(itemEx.uid,get) elseif isWeapon(itemEx.uid) == TRUE then setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx)) setItemDefense(itemEx.uid, doTransform(gain.gainShield,itemEx)) elseif isShield(itemEx.uid) == TRUE then setItemDefense(itemEx.uid, doTransform(gain.gainShield,itemEx)) end end else if level == 0 then doPlayerSendTextMessage(cid, 24,"No effect.") doSendMagicEffect(toPosition, 2) elseif level == gain.maxlvl then doSendMagicEffect(toPosition, 2) return doPlayerSendTextMessage(cid, 24,"Your item is on max level, you can't upgrade it.") elseif level > 0 then if level == 1 then setItemName(itemEx.uid, getItemNameById(itemEx.itemid)) doPlayerSendTextMessage(cid, 24,"Your item back to normal.") else setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level-1)) doPlayerSendTextMessage(cid, 24,"Your item back to +"..(level-1)..".") end if isArmor(itemEx) == TRUE then setItemArmor(itemEx.uid,doTransform(gain.loseArmor ,itemEx)) elseif isWeapon(itemEx.uid) == TRUE then setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx)) setItemDefense(itemEx.uid, doTransform(gain.loseShield,itemEx)) elseif isShield(itemEx.uid) == TRUE then setItemDefense(itemEx.uid, doTransform(gain.loseShield,itemEx)) end end doSendMagicEffect(toPosition, 9) end doRemoveItem(item.uid,1) return TRUE end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  7. Opa amigo, muito obrigado. Deu super certo aqui. Obrigado por colaborar. Só uma última coisa, como faço para que só seja teleportado uma vez? Porque no script ta configurado para ele ficar voltando para o local marcado a cada 30 segundos, mas gostaria que uma vez que ele fosse teleportado a primeira vez, isso não acontecesse mais. Creio que se eu aumentar o tempo isso resolve o problema. Mas se tiver como simplificar no código seria melhor. Só para você entender o que estou falando, o boss pertence a um local em uma determinada cidade. Quando atingir metade da vida. ele vai para outra cidade, onde os player terão que se dirigir para lá para continuar lutando com o boss. Mas uma vez que ele se teleporta para essa outra cidade vizinha, não precisa do mesmo ficar se teleportando toda hora para o local marcado. Mais uma vez muito obrigado, e rep + desde já.
  8. Opa, desde já obrigado. Mas testei aqui e não deu certo. Aparece isso na distro: [0:31:00.937] [Warning - Monster::Monster] Unknown event name - derrotarboss No creaturescript.xml está assim: <event type="statschange" name="derrotarboss" event="script" value="derrotarboss.lua"/> e no script do boss em questão, tem essa parte antes de fechar </monster> <script> <event name="derrotarboss"/> </script> Está faltando algo será?
  9. Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). TFS 0.4; Base: Qual erro está surgindo/O que você procura? Ola, estou tentando criar um script para quando o monstro tiver metade de vida, o mesmo ser teleportado para outro lugar. Mas o mais próximo que consegui chegar foi através da function onPrepareDeath, onde ele até é teleportado, mas somente depois de morrer. Assim sendo, mudei para statstschange mas ai nada ocorre, apenas morre e fica no seu lugar normal. Alguém poderia me ajudar com tal script para que ele funcione corretamente? Desde já agradeço. Veja o código abaixo que está em creaturescripts Você tem o código disponível? Se tiver publique-o aqui: function onStatsChange(cid, attacker, type, combat, value) if getCreatureHealth(cid) <= 4000 then doTeleportThing(cid,{x=1744, y=2440, z=7}) else return 0 end return 1 end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  10. tem como fazer o processo inverso? Compilar de windows para linux, ou seja, extrair as sources de um executavel windows?

Informação Importante

Confirmação de Termo