Ir para conteúdo

xWhiteWolf

Héroi
  • Registro em

  • Última visita

Tudo que xWhiteWolf postou

  1. não tem nada a ver com o monstro cara kk vê se agora funciona: function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { position = {x=1183, y=1224, z=7}, -- Posição aonde sera criado o teleport position1 = {x=1216, y=1250, z=7}, position2 = {x=1216, y=1258, z=7}, position3 = {x=1222, y=1250, z=7}, position4 = {x=1222, y=1258, z=7}, fromPosition = {x=1215, y=1249, z=7}, toPosition = {x=1223, y=1259, z=7}, walls = {x=1177, y=1224, z=7}, wallr = {x=1177, y=1224, z=7, stackpos = 1}, id = 1498, time = 2 -- tempo que o teleport ira sumir em minutos } local monsterPositions = { {x = 75, y = 140, z = 7}, --posição do monstro 1 {x = 75, y = 140, z = 7}, --posição do monstro 2 {x = 75, y = 140, z = 7}, --posição do monstro 3 {x = 75, y = 140, z = 7}, --posição do monstro 4 {x = 75, y = 140, z = 7}, --posição do monstro 5 {x = 75, y = 140, z = 7} --posição do monstro 6 } local t = { level = 120, -- level minimo para poder entrar inicio = -- posical inicial dos players { {x=1182,y=1224,z=7} }, fim = -- posição para onde serão teleportados { {x=1221,y=1254,z=7} } } local time = 120 local gsto = 4567 local test = {} for _, k in ipairs(t.inicio) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.level ) then doPlayerSendCancel(cid, 'Não tem 5 players.') return true end table.insert(test, x) end for _, mPos in ipairs(monsterPositions) do local mob = getTopCreature(cPos).uid if mob ~= 0 and isMonster(mob) then doRemoveCreature(mob) doCreateMonster("Annihilon", mPos) else doCreateMonster("Annihilon", mPos) end end for i, pid in ipairs(test) do doSendMagicEffect(t.inicio[i], CONST_ME_POFF) doTeleportThing(pid, t.fim[i], false) doSendMagicEffect(t.fim[i], CONST_ME_ENERGYAREA) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end doCreateItem(config.id, 1, config.walls) for i = 1,time do formula = time - 1*i addEvent(doSendAnimatedText,i*1000, config.position, formula, math.random(1, 255)) addEvent(doSendAnimatedText,i*1000, config.position1, formula, math.random(1, 255)) addEvent(doSendAnimatedText,i*1000, config.position2, formula, math.random(1, 255)) addEvent(doSendAnimatedText,i*1000, config.position3, formula, math.random(1, 255)) addEvent(doSendAnimatedText,i*1000, config.position4, formula, math.random(1, 255)) end function removeWall() return true end addEvent(removeWall, config.time*60*1000) for x = config.fromPosition.x, config.toPosition.x do for y = config.fromPosition.y, config.toPosition.y do for z = config.fromPosition.z, config.toPosition.z do areapos = {x = x, y = y, z = z, stackpos = 253} getMonsters = getThingfromPos(areapos) if isMonster(getMonsters.uid) then doRemoveCreature(getMonsters.uid) end end end end function removePlayer() if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) end end addEvent(removePlayer, config.time*60*1000) return TRUE end eu não entendi direito esse script aí, os scripters em geral tem mania de fazer os scripts de forma meio burra.. odeio gente que fica colocando if falso then print falso. Porra, é gasto de memória atoa, é muito mais simples coloca if verdadeiro fazer tal coisa e pronto
  2. xWhiteWolf respondeu ao post em um tópico de macalo em Suporte Tibia OTServer
    amigo, esse script tá certinho, o problema tá no globalevents.xml Warning - BaseEvents::loadFromXml] Cannot open globalevents.xml file.
  3. ajudou muito. Dá uma dica, fala como é, oque faz, qual premio ganha.. Eu não jogo tibia cara, não faço a mínima ideia doque é isso que vc tá falando
  4. edite as posições e teste. Se não funfar avisa aqui que eu nem tive tempo de testar function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { position = {x=1183, y=1224, z=7}, -- Posição aonde sera criado o teleport position1 = {x=1216, y=1250, z=7}, position2 = {x=1216, y=1258, z=7}, position3 = {x=1222, y=1250, z=7}, position4 = {x=1222, y=1258, z=7}, fromPosition = {x=1215, y=1249, z=7}, toPosition = {x=1223, y=1259, z=7}, walls = {x=1177, y=1224, z=7}, wallr = {x=1177, y=1224, z=7, stackpos = 1}, id = 1498, time = 2 -- tempo que o teleport ira sumir em minutos } local monsterPositions = { {x = 75, y = 140, z = 7}, --posição do monstro 1 {x = 75, y = 140, z = 7}, --posição do monstro 2 {x = 75, y = 140, z = 7}, --posição do monstro 3 {x = 75, y = 140, z = 7}, --posição do monstro 4 {x = 75, y = 140, z = 7}, --posição do monstro 5 {x = 75, y = 140, z = 7} --posição do monstro 6 } local t = { level = 120, -- level minimo para poder entrar inicio = -- posical inicial dos players { {x=1182,y=1224,z=7} }, fim = -- posição para onde serão teleportados { {x=1221,y=1254,z=7} } } local time = 120 local gsto = 4567 local test = {} for _, k in ipairs(t.inicio) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.level ) then doPlayerSendCancel(cid, 'Não tem 5 players.') return true end table.insert(test, x) end for i, pid in ipairs(test) do for _, mPos in ipairs(monsterPositions) do local mob = getTopCreature(cPos).uid if mob ~= 0 and isMonster(mob) then doRemoveCreature(mob) doCreateMonster("Annihilon", mPos) else doCreateMonster("Annihilon", mPos) end end doSendMagicEffect(t.inicio[i], CONST_ME_POFF) doTeleportThing(pid, t.fim[i], false) doSendMagicEffect(t.fim[i], CONST_ME_ENERGYAREA) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end doCreateItem(config.id, 1, config.walls) for i = 1,time do formula = time - 1*i addEvent(doSendAnimatedText,i*1000, config.position, formula, math.random(1, 255)) addEvent(doSendAnimatedText,i*1000, config.position1, formula, math.random(1, 255)) addEvent(doSendAnimatedText,i*1000, config.position2, formula, math.random(1, 255)) addEvent(doSendAnimatedText,i*1000, config.position3, formula, math.random(1, 255)) addEvent(doSendAnimatedText,i*1000, config.position4, formula, math.random(1, 255)) end function removeWall() return true end addEvent(removeWall, config.time*60*1000) for x = config.fromPosition.x, config.toPosition.x do for y = config.fromPosition.y, config.toPosition.y do for z = config.fromPosition.z, config.toPosition.z do areapos = {x = x, y = y, z = z, stackpos = 253} getMonsters = getThingfromPos(areapos) if isMonster(getMonsters.uid) then doRemoveCreature(getMonsters.uid) end end end end function removePlayer() if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) end end addEvent(removePlayer, config.time*60*1000) return TRUE end
  5. @GstavoLiber ele quer que quando os players entrem crie 6 monstros em posições que ele não falou mas espera que a gente leia a mente dele, a unica edição que tem que fazer aí é aumentar a area do fromposition e toposition pro local que ele for colocar os monstros no mapa editor; Nenhuma parte desse script tá configurada pra criar monstros, apenas pra remover os monstros qnd eles entrarem, o summon das criaturas tá pelo map editor, aposto que um spaw bem rápido do tipo 1 segundo. Muda o script pra que quando eles derem go cheque se tem players dentro e retorne um erro caso tenha pois aí não tem o risco do povo bugar a anihi. Ao entrar, remover tudo que tem lá dentro e recriar as criaturas nas posições predefinidas (usar uma table pras posições é opcional) Eu faria mas o script é bem simpleszinho e tem um monte de anihis que ele poderia baixar e editar as duas posições a mais que ele quer, fora que to com o dedo quebrado me incomoda muito scriptar de tala
  6. xWhiteWolf respondeu ao post em um tópico de macalo em Suporte Tibia OTServer
    o console tá te falando exatamente aonde tá o problema e qual é o problema data/globalevents/scripts/shop.lua:100: '=' expected near '>' o problema é no script shop.lua na linha 100: era esperado um = perto de > Tentei resolver pra você mas parece que seu script tem 78 linhas, então não tem como o erro ser na linha 100. Se você editou o script antes de postar aqui, poste a versão original pra gente tentar te ajudar
  7. cara não é por nada não mas vc ao menos chegou a ler oque os caras do tópico tão falando?
  8. essa mensagem é padrão das sources, não acho que vá dar pra mudar. Oque dá pra fazer é uma serie de gambiarras na lib e na própria spell mas é muito trabalho pra pouca utilidade. É muito mais fácil colocar um global event pra ficar falando aonde comprar magias
  9. nao dá pra te ajudar se vc não fizer seu tópico nesse formato: Versão do server: Versão do tibia: Categoria do script: Oque faz: Detalhes adicionais:
  10. velho, no meu OT funcionou perfeitamente.. eu ja chequei o script mil vezes e não achei nada que pudesse impedir de rodar na 8.4 e na 8.6. Pra falar a verdade rodou tão bem que eu até fiz umas alterações no script pra caso vc esteja usando o full glacier set ela adicione dano de congelamento ao paralisar --[[Script made 100% by Night Wolf and Nogard do not remove the fucking credits or I may kill you and practice necrofily with your filthy body]] --condição que irá adicionar local gelocondition = createConditionObject(CONDITION_PARALYZE) setConditionParam(gelocondition, CONDITION_PARAM_TICKS, 10000) setConditionFormula(gelocondition, -0.9, 0, -0.9, 0) local frigo = createConditionObject(CONDITION_FREEZING) setConditionParam(frigo, CONDITION_PARAM_DELAYED, 1) addDamageCondition(frigo, 5, 2000, -300) addDamageCondition(frigo, 5, 2000, -200) addDamageCondition(frigo, 5, 2000, -100) ------- local config = { itemid = 7897, --id do item que deverá ser equipado para ativar o gelo place = 4, --posição que o item deve estar para funcionar, cheque na tabela abaixo percent = 5, --se vc quiser 20%, coloque 5 pois 1/5 = 0,2 (20%) valorvida = 300 --quanto deve ser o valor minimo de vida a perder para executar o script } local head = { itemid = 7902, place = 1 } local legs = { itemid = 7896, place = 7 } local boots = { itemid = 7892, place = 8 } local necklace = { itemid = 7888, place = 2 } --[[ Tabela de places possíveis CONST_SLOT_HEAD (1) = helmet CONST_SLOT_NECKLACE (2) = necklace slot (amulet of loss etc.) CONST_SLOT_BACKPACK (3) = backpack, bag CONST_SLOT_ARMOR (4) = armor CONST_SLOT_LEFT (5) = left hand (its really hand placed >> (right page on screen)) CONST_SLOT_RIGHT (6) = right hand (its really hand placed << (left page on screen)) CONST_SLOT_LEGS (7) = legs CONST_SLOT_FEET (8) = boots CONST_SLOT_RING (9) = ring slot CONST_SLOT_AMMO (10) = ammo slot (arrows etc.)]] ----------------------------------------------- function canEffect(pos, pz, proj) -- Night Wolf based on Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onStatsChange(cid, attacker, type, combat, value) if (getPlayerSlotItem(cid, config.place).itemid == config.itemid) then if type == STATSCHANGE_HEALTHLOSS and value >= config.valorvida then if math.random (1,config.percent) == 1 then local pos = getPlayerPosition (cid) local effectPositions = { {x = pos.x, y = pos.y - 2, z = pos.z}, {x = pos.x, y = pos.y + 2, z = pos.z}, {x = pos.x - 2, y = pos.y, z = pos.z}, {x = pos.x + 2, y = pos.y, z = pos.z}, {x = pos.x - 2, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y + 1, z = pos.z}, {x = pos.x - 2, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 2, z = pos.z}, {x = pos.x + 1, y = pos.y - 2, z = pos.z}, {x = pos.x + 1, y = pos.y + 2, z = pos.z}, {x = pos.x - 1, y = pos.y + 2, z = pos.z} } local conditionPositions = { {x = pos.x, y = pos.y - 2, z = pos.z}, {x = pos.x, y = pos.y + 2, z = pos.z}, {x = pos.x - 2, y = pos.y, z = pos.z}, {x = pos.x + 2, y = pos.y, z = pos.z}, {x = pos.x - 2, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y + 1, z = pos.z}, {x = pos.x - 2, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 2, z = pos.z}, {x = pos.x + 1, y = pos.y - 2, z = pos.z}, {x = pos.x + 1, y = pos.y + 2, z = pos.z}, ---- {x = pos.x, y = pos.y - 1, z = pos.z}, {x = pos.x, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y, z = pos.z}, {x = pos.x + 1, y = pos.y, z = pos.z}, {x = pos.x - 1, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 1, z = pos.z}, {x = pos.x + 1, y = pos.y - 1, z = pos.z}, {x = pos.x + 1, y = pos.y + 1, z = pos.z}, ------ {x = pos.x - 1, y = pos.y + 2, z = pos.z} } if isCreature(cid) == TRUE then for _, cPos in ipairs(conditionPositions) do local mob = getTopCreature(cPos).uid if canEffect (cPos) and mob ~= 0 and isMonster(mob) then doAddCondition(mob, gelocondition) if (getPlayerSlotItem(cid, head.place).itemid == head.itemid) and (getPlayerSlotItem(cid, legs.place).itemid == legs.itemid) and (getPlayerSlotItem(cid, boots.place).itemid == boots.itemid) and (getPlayerSlotItem(cid, necklace.place).itemid == necklace.itemid) then doAddCondition(mob, frigo) end end if (getPlayerSlotItem(cid, head.place).itemid == head.itemid) and (getPlayerSlotItem(cid, legs.place).itemid == legs.itemid) and (getPlayerSlotItem(cid, boots.place).itemid == boots.itemid) and (getPlayerSlotItem(cid, necklace.place).itemid == necklace.itemid) then if canEffect (cPos) then doSendMagicEffect(cPos, 43) end end end for _, ePos in ipairs(effectPositions) do if canEffect(ePos) then doSendMagicEffect(ePos, 41) end end else end else end return true else end return true end return true end mas mesmo assim é estranho, se não tá dando erro no console era pra funcionar (pelo menos se vc colocou tudo certinho no creaturescripts.xml e no login.lua)
  11. xWhiteWolf respondeu ao post em um tópico de Seagull em Suporte Tibia OTServer
    uma dica pra quem tá começando é: se seu script não funcionar e não der erro no console coloque um monte de else's pra mandar mensagem pro player indicando aonde é o erro.. no seu caso ficaria assim: function onAttack(cid, target) -- Ao Atacar. local atacante = isPlayer(cid) local atacado = isPlayer(target) local skulls = {1, 2, 3, 4, 5} if atacante and atacado then if getPlayerStorageValue(target, 2000) == 1 and getPlayerStorageValue(cid, 3000) == 1 then if getCreatureSkullType(cid) == skulls then doCreatureSetSkullType(cid, 0) doRemoveCondition(cid, CONDITION_INFIGHT) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "There's no skull to remove.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You or "..getCreatureName(target).." don't have the required storages.") end end return true end Fora que isso é um creaturescript, você tem que declarar ele no creaturescripts.xml e registrar o evento no creaturescripts\scripts\login.lua creaturescripts.xml: <event type="attack" name="attackpk" script="attackpk.lua"/> e em login.lua adiciona essa linha: registerCreatureEvent(cid, "attackpk")
  12. spell: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS) function onGetFormulaValues(cid, level, maglevel) local min = -((level/5)+(maglevel*3.99)+75) local max = -((level/5)+(maglevel*9.99)+150) return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local area = createCombatArea(AREA_CROSS6X6) setCombatArea(combat, area) function onCastSpell(cid, var) if exhaustion.check(cid, 23001) == false then exhaustion.set(cid, 23000, 1000) return doCombat(cid, combat, var) else doPlayerSendCancel(cid, "You are exhausted.") end end potion: local config = { removeOnUse = "yes", usableOnTarget = "yes", -- can be used on target? (fe. healing friend) splashable = "no", range = -1, realAnimation = "yes", -- make text effect visible only for players in range 1x1 multiplier = { health = 1.0, mana = 1.0 } } config.removeOnUse = getBooleanFromString(config.removeOnUse) config.usableOnTarget = getBooleanFromString(config.usableOnTarget) config.splashable = getBooleanFromString(config.splashable) config.realAnimation = getBooleanFromString(config.realAnimation) local POTIONS = { [8704] = {empty = 7636, splash = 42, health = {45, 95}}, -- small health potion [7618] = {empty = 7636, splash = 42, health = {100, 180}}, -- health potion [7588] = {empty = 7634, splash = 42, health = {200, 300}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion [7591] = {empty = 7635, splash = 42, health = {450, 500}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion [8473] = {empty = 7635, splash = 42, health = {600, 750}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion [7620] = {empty = 7636, splash = 47, mana = {40, 130}}, -- mana potion [7589] = {empty = 7634, splash = 47, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion [7590] = {empty = 7635, splash = 47, mana = {120, 250}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion [8472] = {empty = 7635, splash = 43, health = {200, 300}, mana = {100, 150}, level = 80, vocations = {3, 7}, vocStr = "paladins"} } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local potion = POTIONS[item.itemid] if(not potion) then return false end if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then if(not config.splashable) then return false end if(toPosition.x == CONTAINER_POSITION) then toPosition = getThingPosition(item.uid) end doDecayItem(doCreateItem(POOL, potion.splash, toPosition)) doRemoveItem(item.uid, 1) if(not potion.empty or config.removeOnUse) then return true end if(fromPosition.x ~= CONTAINER_POSITION) then doCreateItem(potion.empty, fromPosition) else doPlayerAddItem(cid, potion.empty, 1) end return true end if(hasCondition(cid, CONDITION_EXHAUST)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return true end if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1) return true end if(config.range > 0 and cid ~= itemEx.uid and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(itemEx.uid)) > config.range) then return false end local health = potion.health if exhaustion.check(cid, 23000) == false then if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.multiplier.health))) then return false end exhaustion.set(cid, 23001, 1000) else doPlayerSendCancel(cid, "You are exhausted.") end local mana = potion.mana if exhaustion.check(cid, 23000) == false then if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.multiplier.mana))) then return false end exhaustion.set(cid, 23001, 1000) else doPlayerSendCancel(cid, "You are exhausted.") end doSendMagicEffect(getThingPosition(itemEx.uid), CONST_ME_MAGIC_BLUE) if(not config.realAnimation) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) else for i, tid in ipairs(getSpectators(getThingPosition(itemEx.uid), 1, 1)) do if(isPlayer(tid)) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid) end end return TRUE end doAddCondition(cid, exhaust) doRemoveItem(item.uid, 1) if(not potion.empty or config.removeOnUse) then return true end if(fromPosition.x ~= CONTAINER_POSITION) then doCreateItem(potion.empty, fromPosition) else doPlayerAddItem(cid, potion.empty, 1) end return true end obs: eu não tenho certeza se em "exhaustion.set(cid, 23001, 1000) " esse 1000 é em milisegundos ou em segundos então caso o exhausted ficar muito escroto mude ali pra 60
  13. como é uma função das sources acho dificil, dá upgrade no seu server pra 8.54 ou maior que daí funciona sem problema. Fiz esse script baseado no TFS 0.3.6, versão 8.54
  14. você colou seu creaturescripts.xml errado '--' <?xml version="1.0" encoding="UTF-8"?> <creaturescripts> <event type="login" name="Conected" script="conected.lua"/> <event type="login" name="Anti-MC" event="script" value="Anti-MC.lua"/> <event type="login" name="PlayerLogin" script="login.lua"/> <event type="login" name="FirstSet" script="firstset.lua"/> <event type="death" name="onPlayerDeath" script="playerdeath.lua"/> <event type="death" name="PlayerDeath" script="playerdeath.lua"/> <event type="joinchannel" name="GuildMotd" script="guildmotd.lua"/> <event type="login" name="granaura" script="granaura.lua"/> <event type="statschange" name="glacierrobe" script="glacierrobe.lua"/> <!-- aegis --> <event type="death" name="aegis" script="aegis.lua"/> <event type="logout" name="PlayerLogout" script="logout.lua"/> <event type="kill" name="boss" script="boss.lua" /> <event type="kill" name="owned" script="owned.lua"/> </creaturescripts> aqui está.. se isso não resolver o problema é a função statschange que talvez não exista em 8.4;
  15. o erro da sua magia foi que ela tinha um end a mais. Você tem que se ligar nesses detalhes. Recomendo que vc baixe algum bloco de notas inteligente pra fazer esse tipo de alteração (eu uso o notepad ++) local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS) function onGetFormulaValues(cid, level, maglevel) local min = -((level/5)+(maglevel*3.99)+75) local max = -((level/5)+(maglevel*9.99)+150) return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local area = createCombatArea(AREA_CROSS6X6) setCombatArea(combat, area) function onCastSpell(cid, var) if exhaustion.check(cid, 23001) == false then exhaustion.set(cid, 23000, 1000) return doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23000).."]") end end e na sua potion vc não colocou nada pra setar storage, o certo seria assim: local config = { removeOnUse = "yes", usableOnTarget = "yes", -- can be used on target? (fe. healing friend) splashable = "no", range = -1, realAnimation = "yes", -- make text effect visible only for players in range 1x1 multiplier = { health = 1.0, mana = 1.0 } } config.removeOnUse = getBooleanFromString(config.removeOnUse) config.usableOnTarget = getBooleanFromString(config.usableOnTarget) config.splashable = getBooleanFromString(config.splashable) config.realAnimation = getBooleanFromString(config.realAnimation) local POTIONS = { [8704] = {empty = 7636, splash = 42, health = {45, 95}}, -- small health potion [7618] = {empty = 7636, splash = 42, health = {100, 180}}, -- health potion [7588] = {empty = 7634, splash = 42, health = {200, 300}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion [7591] = {empty = 7635, splash = 42, health = {450, 500}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion [8473] = {empty = 7635, splash = 42, health = {600, 750}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion [7620] = {empty = 7636, splash = 47, mana = {40, 130}}, -- mana potion [7589] = {empty = 7634, splash = 47, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion [7590] = {empty = 7635, splash = 47, mana = {120, 250}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion [8472] = {empty = 7635, splash = 43, health = {200, 300}, mana = {100, 150}, level = 80, vocations = {3, 7}, vocStr = "paladins"} } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local potion = POTIONS[item.itemid] if(not potion) then return false end if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then if(not config.splashable) then return false end if(toPosition.x == CONTAINER_POSITION) then toPosition = getThingPosition(item.uid) end doDecayItem(doCreateItem(POOL, potion.splash, toPosition)) doRemoveItem(item.uid, 1) if(not potion.empty or config.removeOnUse) then return true end if(fromPosition.x ~= CONTAINER_POSITION) then doCreateItem(potion.empty, fromPosition) else doPlayerAddItem(cid, potion.empty, 1) end return true end if(hasCondition(cid, CONDITION_EXHAUST)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return true end if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1) return true end if(config.range > 0 and cid ~= itemEx.uid and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(itemEx.uid)) > config.range) then return false end local health = potion.health if exhaustion.check(cid, 23000) == false then if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.multiplier.health))) then return false end exhaustion.set(cid, 23001, 1000) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23000).."]") end local mana = potion.mana if exhaustion.check(cid, 23000) == false then if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.multiplier.mana))) then return false end exhaustion.set(cid, 23001, 1000) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23000).."]") end doSendMagicEffect(getThingPosition(itemEx.uid), CONST_ME_MAGIC_BLUE) if(not config.realAnimation) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) else for i, tid in ipairs(getSpectators(getThingPosition(itemEx.uid), 1, 1)) do if(isPlayer(tid)) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid) end end return TRUE end doAddCondition(cid, exhaust) doRemoveItem(item.uid, 1) if(not potion.empty or config.removeOnUse) then return true end if(fromPosition.x ~= CONTAINER_POSITION) then doCreateItem(potion.empty, fromPosition) else doPlayerAddItem(cid, potion.empty, 1) end return true end testa agora e me fala se deu
  16. esse é o script da minha strong health potion, note que o exhaust dela tá configurado pra funcionar só entre dois usos seguintes local MIN = 50 local MAX = 100 local EMPTY_POTION = 7636 local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) if isPlayer(itemEx.uid) == FALSE then return FALSE end if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return TRUE end if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then return FALSE end doAddCondition(cid, exhaust) doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE) doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, EMPTY_POTION) return TRUE end agora editando pra colocar o exhaust que vc quer ficaria assim: local MIN = 50 local MAX = 100 local EMPTY_POTION = 7636 local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) if isPlayer(itemEx.uid) == FALSE then return FALSE end if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return TRUE end if exhaustion.check(cid, 23000) == false then exhaustion.set(cid, 23001, 1000) if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then return FALSE end doAddCondition(cid, exhaust) doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE) doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, EMPTY_POTION) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23000).."]") end return TRUE end o 23000 é o storage que salva o exhausted das magias, e cria um 23001 pra salvar o das potions. Daí é só ir editando as magias uma por uma e adicionando a linha inversa. if exhaustion.check(cid, 23001) == false then exhaustion.set(cid, 23000 1000) ficando assim por exemplo no exori local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onGetFormulaValues(cid, level, skill, attack, factor) local skillTotal, levelTotal = skill + attack, level / 5 return -(skillTotal * 1.5 + levelTotal), -(skillTotal * 2.5 + levelTotal) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) if exhaustion.check(cid, 23001) == false then exhaustion.set(cid, 23000, 1000) return doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23000).."]") end end obs: exhaustion.set(cid, 23000, 1000) 23000 é o storage e 1000 é o tempo em milisegundos que vai ficar o exhausted mas essa função acho que só existe a partir do 8.6. Caso seu server seja anterior a isso você precisa colocar isso daqui na lib exhaustion = { check = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end return getPlayerStorageValue(cid, storage) >= os.time(t) end, get = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end local exhaust = getPlayerStorageValue(cid, storage) if(exhaust > 0) then local left = exhaust - os.time(t) if(left >= 0) then return left end end return false end, set = function (cid, storage, time) setPlayerStorageValue(cid, storage, os.time(t) + time) end, make = function (cid, storage, time) local exhaust = exhaustion.get(cid, storage) if(not exhaust) then exhaustion.set(cid, storage, time) return true end return false end } Se der algum erro posta aqui o erro e as informações completas do tipo (que server vc usa, qual versão do tibia, detalhes, etc.)
  17. não entendi nada desse quests.xml.... daonde vc tirou isso? qual a versão do server? nunca tinha visto nada parecido antes o.O
  18. pra fazer isso vc tem q desabilitar a troca de outfit (ou seja, n vai dar pra mudar a cor) dai vc coloca no seu account manager ou no seu oraculo pra dar o outfit da raça dependendo da classe que o cara escolher.
  19. eu ainda prefiro o velho notedpad++ e procurar as funções direto na lib e na source mas cada um é cada um
  20. deixa assim e vê se funciona ?xml version="1.0" encoding="UTF-8"?> <creaturescripts> <event type="login" name="Conected" script="conected.lua"/> <event type="login" name="Anti-MC" event="script" value="Anti-MC.lua"/> <event type="login" name="PlayerLogin" script="login.lua"/> <event type="login" name="FirstSet" script="firstset.lua"/> <event type="death" name="onPlayerDeath" script="playerdeath.lua"/> <event type="death" name="PlayerDeath" script="playerdeath.lua"/> <event type="joinchannel" name="GuildMotd" script="guildmotd.lua"/> <event type="login" name="granaura" script="granaura.lua"/> <event type="statschange" name="glacierrobe" script="glacierrobe.lua"/> <!-- aegis --> <event type="death" name="aegis" script="aegis.lua"/> <event type="logout" name="PlayerLogout" script="logout.lua"/> <!-- aegis --> <event type="kill" name="boss" script="boss.lua" /> <event type="kill" name="owned" script="owned.lua"/> </creaturescripts>
  21. se vc manjar de script faz assim: toda vez q usar pot seta um storage por x tempo e antes de castar qualquer spell checa o storage, se tiver com valor 1 ele nao solta, se tiver com valor 0 ele solta
  22. velho, me desculpe a sinceridade mas pra vc querer fazer essas coisas no seu server vc tem que ao menos saber o básico. Não dá pra querer ter um server foda se for pra ficar dependendo dos outros pra tudo. Eu to com o dedo quebrado e é um saco digitar pra te explicar tudo, re-lê tudo aí e vai fuçando seu server q uma hora oque eu falei vai fazer sentido Vocês são todos confusos, tem regras no site pra facilitar e mesmo assim a maioria não lê. Você pede uma coisa e depois fala outra e não posta script nenhum.. não dá pra fazer mágica cara, me ajuda a te ajudar. Posta os scripts e caso dê erro copia e cola o erro do console
  23. testa o da ana paula, qnd der erro vc tem q ser mais específico e me dizer q tipo de erro aconteceu e oque aparece no console.. lembre-se q eu nao tenho o mesmo server q vc.
  24. use o "pesquisar antes amigo" http://www.tibiaking.com/forum/topic/31450-pedido-editar-items/

Informação Importante

Confirmação de Termo