Ir para conteúdo

xWhiteWolf

Héroi
  • Registro em

  • Última visita

Tudo que xWhiteWolf postou

  1. 1) Ele tá tentando fazer uma operação aritmética em algo que não é um número (nil value ou valor nulo) O erro é na linha 322, que é essa daqui: local miss = ( (getSpeed(cid)) - (getSpeed(attacker)) ) * 0.26 Se essa função getSpeed estiver funcionando sem problemas a troca dela por essa daqui de cima deve resolver o problema mas se ela não tiver funcionando daí eu não vou poder te ajudar. 2) ele tá tentando transformar um item que não existe, presta atenção nessa função: ele ta transformando o item referente ao slot da legs no item 2395 mas essa é a função Ao Desequipar então ela só é ativada quando o item foi removido. Se ele foi removido, logo não tem como pegar o item desse slot haha ;] O jeito certo de fazer isso é assim: item é um dos parâmetros utilizados pelo callback onDeEquip, logo eu posso utilizá-lo livremente pra fazer oque eu quiser com o item que foi removido e o .uid no final é pra identificar que oque eu quero é a identidade daquele item em questão (se eu quisesse o id dele eu colocava item.itemid). Só substitui isso que vai funcionar, só lembra de declarar no movements.xml a função onDeEquip pro item em questão (mas acho que ja tá declarado)
  2. é possível, mas vc vai ter que garantir que os monstros sumonados não existam fora dessa quest pois pra fazer isso vc precisaria fazer uma função onKill que ao matar o monstro com o nome igual ao que vc colocar lá vai dar um storage pro player. Depois é só fazer as actions que ao clicar na pilastra ele checa se vc tem o storage da pilastra anterior e se tiver sumona o novo monstro.
  3. Essa spell é possível sim mas iria querer umas alterações fortes na source. Oque dá pra fazer é uma spell que sete o outfit como sendo esse looktype ai da tower e impeça ele de se mover (doCreatureSetNoMove(cid, 1)) mas ele ainda vai ser capaz de soltar magias e ser atacado.
  4. galera.. pelo amor de deus: "FALSE" e "TRUE" não existem... o correto é "false" e "true". Segundo que o script que o cara passou é onDeath e não onPrepareDeath. function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) and isPlayer(lastHitKiller) and getPlayerSlotItem(cid, 2).itemid == 2173 then doCreatureSetDropLoot(cid, false) doRemoveItem(cid, 2173) elseif isPlayer(cid) and isMonster(lastHitKiller) and getPlayerSlotItem(cid, 2).itemid == 2173 then doCreatureSetDropLoot(cid, false) end return true end
  5. Primeiro de tudo, pra que colocar um monte de Up no tópico? hahaha segundo: o dano que sai é a vida total da pessoa, a unica forma de mudar aquilo é fazendo um animated text e isso vai depender da versão do seu server. Reformula o tópico dizendo a versão do seu server e dizendo o número do efeito que você quer; Obs: lembre-se de fazer títulos concisos e que tenham a ver com o seu pedido;
  6. O erro do script do Killua acredito que seja uma diferença no nome da variável que ele utilizou. Testa dessa forma aqui: --- Sistema de Upgrade de itens feito por Killua. --- Sistema feito com base no do Bronson Server. local vocations = {1, 2, 4, 5, 6, 7, 8} -- Vocações que podem refinar itens local ids_bloqueados = {2160, 5706, 2463} -- Itens que não podem ser refinados local controle = { {level = 0, quantOre = 1, chance = 100}, -- Level do item, quantidade de Iron Ore necessaria, chance de sucesso {level = 1, quantOre = 2, chance = 90}, {level = 2, quantOre = 3, chance = 80}, {level = 3, quantOre = 4, chance = 70}, {level = 4, quantOre = 5, chance = 60}, {level = 5, quantOre = 6, chance = 50}, {level = 6, quantOre = 7, chance = 40}, {level = 7, quantOre = 8, chance = 30}, {level = 8, quantOre = 9, chance = 20}, {level = 9, quantOre = 10, chance = 10} } function getItemLevel(uid) if uid > 0 then return getItemAttribute(uid, "lvl") or 0 end return false end function doItemAddLevel(uid, count) if uid > 0 and tonumber(count) > 0 then return doItemSetAttribute(uid, "lvl", getItemLevel(uid) + count) end return false end function onUse(cid, item, fromPosition, itemEx, toPosition) if not isInArray(vocations, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "Sua vocacao nao pode refinar.") elseif isInArray(ids_bloqueados, itemEx.uid) then return doPlayerSendCancel(cid, "Este item nao pode ser refinado.") end if getItemName(item.uid).attack > 0 or getItemName(item.uid).defense > 0 or getItemName(item.uid).armor > 0 then for _, upgrade in pairs(controle) do local atk = getItemAttribute(itemEx.uid, "attack") or getItemName(item.uid).attack local def = getItemAttribute(itemEx.uid, "defense") or getItemName(item.uid).defense local arm = getItemAttribute(itemEx.uid, "armor") or getItemName(item.uid).armor local chance = math.random(1, 100) if getItemLevel(itemEx.uid) == upgrade.level then if doPlayerRemoveItem(cid, 5880, upgrade.quantOre) then doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_CRAPS) if chance <= upgrade.chance then if getItemLevel(itemEx.uid) == 0 then doItemSetAttribute(itemEx.uid, "description", "Esse item foi refinado por" ..getCreatureName(cid)) end doItemAddLevel(itemEx.uid, 1) doItemSetAttribute(itemEx.uid, "name", getItemNameById(itemEx.itemid).. " + " ..getItemLevel(itemEx.uid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce refinou com sucesso! Agora seu "..getItemNameById(itemEx.itemid).." eh level " ..getItemLevel(itemEx.uid)) if getItemName(item.uid).attack > 0 then doItemSetAttribute(itemEx.uid, "attack", atk + 1) return true elseif getItemName(item.uid).armor > 0 then doItemSetAttribute(itemEx.uid, "armor", arm + 1) return true elseif getItemName(item.uid).defense > 0 and getItemName(item.uid).attack <= 0 then doItemSetAttribute(itemEx.uid, "defense", def + 1) return true end else doTransformItem(itemEx.uid, 2256) doItemSetAttribute(itemEx.uid, 'name', "metal trash") doItemSetAttribute(itemEx.uid, 'attack', 0) doItemSetAttribute(itemEx.uid, 'armor', 0) doItemSetAttribute(itemEx.uid, 'defense', 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce falhou.") return true end else doPlayerSendCancel(cid, "Voce nao tem iron ores o suficiente. Voce precisa de "..upgrade.quantOre.." iron ores.") end end end else doPlayerSendCancel(cid, "Esse item nao pode ser refinado.") end return true end Agora falando dos outros scripts que foram postados aqui: os erros são da falta de funções do seu server.. toda hora que aparecer no console "attempt to call global 'NomeDaFunção' (a nil value) stack traceback:" significa que essa função não existe no seu server e tá retornando um valor inexistente quando você chama ela.
  7. seu server não tem a função doCreateTeleport, vc vai ter que adicionar ela manualmente pelas sources OU trocar essa função por uma outra equivalente do seu server
  8. qual item e qual a vocation você quer que vire?
  9. um cara pediu a mesma coisa aqui no suporte.. eu tentei ajudar e pra ele deu certo mas não sei como ele fez pra dar. É um tópico do azzouks se nao me engano
  10. isInArray({uid}, getPlayerSlotItem(cid, 1).uid) or isInArray({uid}, getPlayerSlotItem(cid, 4).uid) or isInArray({uid}, getPlayerSlotItem(cid, 7).uid) or isInArray({uid}, getPlayerSlotItem(cid, 8).uid) vai em data\lib\constant e vê quais são os slots da legs e do shield e apaga os outros. isInArray({uid}, getPlayerSlotItem(cid, 7).uid) or isInArray({uid}, getPlayerSlotItem(cid, 8).uid)
  11. se vc quer que todo hit dê critical coloque o sistema de critical do próprio tibia pelo config.lua. Meu script utiliza outro método e por conta disso se vc colocar uma chance muito alta ele vai dar um erro de overflow (quando repete algo tendendo a infinito)
  12. pega os scripts dessas potions no seu server e edita, é a maneira mais fácil
  13. function isHandItem(uid) -- NW based on Mock uid = uid or 0 if isInArray({1,2,3,4,5,6}, getItemWeaponType(uid)) then return true end return false end function getItemDodgePercent(itemuid) return getItemAttribute(itemuid, "dodgePercent") or 0 end function setItemDodgePercent(uid, percent) doItemSetAttribute(uid, "description", "[Dodge: "..percent.."%]") doItemSetAttribute(uid, "dodgePercent", percent) end function onUse(cid, item, fromPosition, itemEx, toPosition) level = 0 local upgrade = { [1] = {min = 1, max = 5, chance = 100}, [2] = {min = 5, max = 10, chance = 80}, [3] = {min = 10, max = 20, chance = 60}, [4] = {min = 20, max = 40, chance = 40}, [5] = {min = 40, max = 50, chance = 20} } function isWearing(uid) -- NW based on Mock uid = uid or 0 if isInArray({uid}, getPlayerSlotItem(cid, 1).uid) or isInArray({uid}, getPlayerSlotItem(cid, 4).uid) or isInArray({uid}, getPlayerSlotItem(cid, 7).uid) or isInArray({uid}, getPlayerSlotItem(cid, 8).uid) then return true end return false end if isHandItem(itemEx.uid) or isWearing(itemEx.uid) then local name = getItemName(itemEx.uid) local atual = math.floor(getItemDodgePercent(itemEx.uid)*10)/10 for i = 1, #upgrade do if string.find(tostring(name),"+".. i .."") then level = i end end if level >= #upgrade then doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Your item is already on max level, you can't upgrade it any further.") return true end if math.random(0,100) <= upgrade[level + 1].chance then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You leveled your "..getItemNameById(itemEx.itemid).." to ".. level+1 ..".") setItemDodgePercent(itemEx.uid, atual + (math.random(upgrade[level+1].min,upgrade[level+1].max))/10) doItemSetAttribute(itemEx.uid,'name', getItemNameById(itemEx.itemid)..' +'..(level+1)) doSendMagicEffect(toPosition, math.random(28,30)) else setItemDodgePercent(itemEx.uid, 0) doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Your "..getItemNameById(item.itemid).." has failed and destroyed the dodge of your "..getItemNameById(itemEx.itemid).." in the process") doSendMagicEffect(toPosition, 4) end else doPlayerSendTextMessage(cid, 24,"You cant refine this item.") end return true end
  14. passa como vc colocou no items.xml
  15. cara, se vc for usar esse script vc tem que deletar o outro dodge system.. Esse daqui é um arquivo.xml em mods, leia o tópico. A pedra que dá dodge percent nos itens é uma action sim, tá tudo escrito direitinho.
  16. coloca assim: no lugar de X coloca o Numero dessa sua vocação.. vê esse numero no vocations.xml <melee id="7959" unproperly="1" event="function" value="default"> <vocation id="X"/> </melee>
  17. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    testa com increaseMeleePercent
  18. torta como? manda como tá ela no seu spells.xml.
  19. vc colocou essa descrição direto no items.xml ou foi por alguma função?
  20. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    local config = { minlevel = 150, --- level que precisa price = 10000, --- preço itemid = 2547, --- id da bike storage = 45275 -- storage que guarda se ele ja comprou ou nao } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'bike') then if isPremium(cid) and getPlayerStorageValue(cid, config.storage) < 1 then if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == 0 then selfSay('You want to buy a bike? It will cost '..config.price..' gp\'s and you can only get one!', cid) talkState[talkUser] = 1 else selfSay('You must leave your bike slot empty in order to buy another one.', cid) end else selfSay('Either you aren\'t VIP or you have already bought your bike!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < config.price then selfSay('Its necessary to have at least '..config.price..' gp\'s in order to buy the bike!', cid) elseif getPlayerLevel(cid) < config.minlevel then selfSay('The minimum level for buying the bike is '..config.minlevel..'!', cid) else setPlayerStorageValue(cid, config.storage, 1) doPlayerRemoveMoney(cid,config.price) doPlayerAddItem(cid, config.itemid, 1, TRUE) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 selfSay('Ok.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  21. dá algum erro ou apenas a magia não sai? tenta deixar só um doCombat por cada lookdir que acho que resolve
  22. substitui a sua linha 6 por essa daqui: if (getPlayerStorageValue(attacker, lvlcrit) * 3) >= math.random (0,1000) then
  23. esse erro é causado algumas vezes de formar aleatória e não tem fundamento nenhum. Experimente deletar o arquivo e criar um novo ou apagar a linha 1 inteira e reescrever ela (sem copiar e colar) ou até mesmo pular algumas linhas que já resolve
  24. ---Script by mock the bear! local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{} for i=1,100 do ---Carrega as conditions --- HP conditionHP[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionHP[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionHP[i], CONDITION_PARAM_STAT_MAXHEALTH, 0+i) setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50) --MANA conditionMP[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionMP[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionMP[i], CONDITION_PARAM_STAT_MAXMANA, 0+i) setConditionParam(conditionMP[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionMP[i], CONDITION_PARAM_SUBID, 51) --Magic level conditionML[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionML[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionML[i], CONDITION_PARAM_STAT_MAGICLEVELPERCENT, 100+i) setConditionParam(conditionML[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionML[i], CONDITION_PARAM_SUBID, 52) --club axe sword conditionCLUB[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionCLUB[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_CLUBPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_SWORDPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_AXEPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SUBID, 53) --- shield conditionSHI[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionSHI[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionSHI[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i) setConditionParam(conditionSHI[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionSHI[i], CONDITION_PARAM_SUBID, 54) --- dist conditionDIST[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionDIST[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionDIST[i], CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i) setConditionParam(conditionDIST[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionDIST[i], CONDITION_PARAM_SUBID, 55) end function getSlotType(n) --By mock the bear if not n then return false end if n:match('%[(.+)%]') then n = n:match('%[(.+)%]') if n == '?' then return 0,n else return n:match('(.-)%.([+-])(%d+)%%') end else return false end end local function loadSet(cid) local t = {} for slot=1,9 do t[slot] = '' local s = getPlayerSlotItem(cid,slot).uid if s ~= 0 then t[slot] = getItemName(s) end end return t end function isInArray2(arr,var) -- Because in some servers it return 1 and 0 and others true and false for i,b in pairs(arr) do if var == b then return true end end return false end function check2(cid,i) if i == 5 or i == 6 then if isInArray({'head','necklace','backpack','body','legs','feet','ring'},getItemValue(getPlayerSlotItem(cid,i).itemid,'slotType') or '') then return false end end return true end function chk(cid,f) if not isPlayer(cid) then return end local t = loadSet(cid) for i=1,#f do if f[i] ~= t[i] then equip(cid,nil,slot) break end end addEvent(chk,200,cid,t) end items = { ---- Only to get attr: slotType because getItemName dont return it -.-' _VERSION='1.0 By mock', XML_DIR='data/items/items.xml', } do local ia = os.clock() io.write('Loading items') local i = io.open(items.XML_DIR,'r') local u = i:read(-1) i:close() local u = u:match('<items>(.+)</items>') for mi,id,mid,name,data,me in u:gmatch('<(%a-)%s*id%s*=%s*"(%d+)"%s*(.-)%s*name%s*=%s*"(.-)"%s*>(.-)</(%a*)>') do if mi == 'item' and me == 'item' then local td = {name=name,id=id,type=1} for key,value in data:gmatch('<attribute key="(.-)" value="(.-)"/>') do td[key] = value end for key,value in mid:gmatch('(.-)="(.-)"') do td[key] = value end items[tonumber(id)] = td items[name] = td end end for mi,id,mid,name,data in u:gmatch('<(%a-)%s*id%s*=%s*"(%d*)"%s*(.-)%s*name%s*=%s*"(%a+)"%s*/>') do if mi == 'item' then local td = {name=name,id=id,type=2} for key,value in mid:gmatch('(.-)="(.-)"') do td[key] = value end items[tonumber(id)] = td items[name] = td end end io.write('[done '..os.clock()-ia..']\n') end function getItemValue(item,value) return items[item] and items[item][value] end function equip(cid,item,slot) --By mock the bear local HP = getCreatureHealth(cid) local MP = getCreatureMana(cid) local t = {} if item then local mm,sinal,qto = getSlotType(getItemName(item.uid)) t[mm] = tonumber(qto) end for i=1,9 do -- Not on slot 10 > arrow if i ~= slot then if getPlayerSlotItem(cid,i).itemid ~= 0 then local aab = getPlayerSlotItem(cid,i).uid if aab and check2(cid,i) then for _ in getItemName(aab):gmatch('(%[.-%])') do local mm,sinal,qto2 = getSlotType(_) if mm then if not t[mm] then t[mm] = 0 end t[mm] = t[mm]+tonumber(qto2) t[mm] = t[mm] > 100 and 100 or t[mm] end end end end end end local fu = 0 local ca = {} local s = '' for sl,n in pairs(t) do fu = fu+1 s = s..''..n..'% more of '..sl..'\n' if sl == 'hp' then doAddCondition(cid,conditionHP[tonumber(n)]) doCreatureAddHealth(cid,HP-getCreatureHealth(cid)) ca[50] = 1 doPlayerSendTutorial(cid,19) elseif sl == 'mp' then doAddCondition(cid,conditionMP[tonumber(n)]) doCreatureAddMana(cid,HP-getCreatureMana(cid)) ca[51] = 1 doPlayerSendTutorial(cid,19) elseif sl == 'ml' then doAddCondition(cid,conditionML[tonumber(n)]) ca[52] = 1 elseif sl == 'cas' then doAddCondition(cid,conditionCLUB[tonumber(n)]) ca[53] = 1 elseif sl == 'shield' then doAddCondition(cid,conditionSHI[tonumber(n)]) ca[54] = 1 elseif sl == 'dist' then doAddCondition(cid,conditionDIST[tonumber(n)]) ca[55] = 1 end end if fu > 0 then addEvent(doPlayerSendTextMessage,100,cid,24,'You have:\n'..s) for i=50,55 do if not ca[i] then doRemoveCondition(cid,CONDITION_ATTRIBUTES,i) end end else for i=50,55 do doRemoveCondition(cid,CONDITION_ATTRIBUTES,i) end end return true end function onLogin(cid) ---Script by mock the bear! equip(cid,nil,slot) addEvent(chk,200,cid,loadSet(cid)) -- Here we check! return TRUE end
  25. tem dois jeitos... o primeiro é fazendo na action da porta uma verificação de criatura (é mais dificil mas acho que é o melhor esquema) Tem algumas funções que podem ajudar (isInRange) ou usando um for + getThingFromPos. A outra forma é mais propícia a bugs... você teria que fazer um creaturescripts onKill que te dá um storage e quando o player descesse aquelas escadas ali ele teria o storage setado pra 0 (movements). Daí ele teria que matar todos os monstros (se for 21 monstros vc colocar uma checagem que se o storage for menor que 20 ele não pode passar)

Informação Importante

Confirmação de Termo