Solutions
-
marcot's post in (Resolvido)Itens Empurrados was marked as the answerCaso queira editar apenas alguns em específico, iria pelo caminho mais fácil, colocando uma uniqueid neles.
Se você deseja mudar todos, a ideia muda: você vai olhar algum programa para editar o arquivo items.otb, que fica em ./data/items/.
No programa que você escolher provavelmente já vai achar tudo bem fácil de trocar.
No link abaixo tem mais ou menos explicando o processo:
-
marcot's post in (Resolvido)baú, item dentro da backpack, demon parchment was marked as the answerlocal cfg = { playerStorage = 60999, globalStorage = 60999, time = 60 * 60 * 24, -- Tempo em segundos positions = { {x=33060, y=31623, z=15}, {x=33066, y=31623, z=15}, {x=33060, y=31627, z=15}, {x=33066, y=31627, z=15} } } function isCooldownReady() return os.time() > getGlobalStorageValue(cfg.globalStorage) end function onUse(cid, item, frompos, item2, topos) if not isCooldownReady() then return true end for _, t in pairs(cfg.positions) do doSummonCreature("Demon", t) end setPlayerStorageValue(cid, cfg.playerStorage, 1) setGlobalStorageValue(cfg.globalStorage, os.time() + cfg.time) end No script acima eu coloco como valor de storage o tempo atual somado ao tempo (segundos) necessário para a quest poder ser ativada novamente.
Eu fiz uns testes bem básicos aqui com tempos pequenos (como de 10 segundos) e aparentemente funciona.
-
marcot's post in (Resolvido)pegando key do bau was marked as the answerEle está te dizendo aí que tentou chamar a função doSetItemActionId e disse que isso é um valor nil, porque se não me engano em LUA tudo que não tá criado é nulo.
Não sei qual base está utilizando, mas a função de setar um action id para o TFS 0.4 é essa:
doItemSetActionId(uid, aid) Onde uid é o unique id do item e aid possivelmente o id que você quer.
-
marcot's post in (Resolvido)Dúvida com a função FOR was marked as the answerTestei no ambiente interativo de LUA
-- Input Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio > for i=10,0,-1 do >> print('Hello') >> end -- Output Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello A variável I começa com 10, o loop acaba em 0 e o incremento é de -1 a cada loop.
Note que repetiu o Hello 11 vezes.
-
marcot's post in (Resolvido)Erro Script was marked as the answer@mikaelkelvin
Tenta esse:
local vocs = { [5] = {{2323,1},{8871,1},{2647,1},{2643,1},{2525,1},{2191,1},{2268,1},{7620,1},{2293,1},{2120,1},{5710,1},{2789,15},{2305,1},{2261,1},{2274,1},{2273,1}}, [6] = {{2323,1},{8871,1},{2647,1},{2643,1},{2525,1},{2186,1},{2268,1},{2269,1},{2293,1},{7620,1},{2120,1},{5710,1},{2789,15},{2305,1},{2261,1},{2274,1},{2273,1}}, [7] = {{2457,1},{8872,1},{2647,1},{2643,1},{2525,1},{7368,1},{2268,1},{8472,1},{7620,1},{2293,1},{2120,1},{5710,1},{2789,15},{2305,1},{2261,1},{2274,1},{2273,1}}, [8] = {{2457,1},{2463,1},{2647,1},{2643,1},{2525,1},{2400,1},{7620,1},{7618,1},{2293,1},{2120,1},{5710,1},{2789,15},{2305,1},{2261,1},{2274,1},{2273,1}} } local storage = 548747 function onUse(cid, item, frompos, item2, topos) local var = vocs[getPlayerVocation(cid)] if not var then return true end if getPlayerStorageValue(cid, storage) > 0 then doPlayerSendTextMessage(cid,22,"It is empty.") return true end local backpack = doPlayerAddItem(cid, 1988, 1) -- backpackID for _, i_i in ipairs(var) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end setPlayerStorageValue(cid, storage, 1) doPlayerSendTextMessage(cid,22,"You have found a set from your vocation.") return true end A princípio o server seu só apontou erro de sintaxe, que abriu { e esqueceu de fechar
-
marcot's post in (Resolvido)Spell com posição heelp was marked as the answerAcho que os principais pontos que você teria que trabalhar nesse script são a posição, já que a posição modificada é esta diagonal do personagem:
Para ser a posição à direita do personagem você incrementa somente a coordenada X.
Outro pronto é trabalhar no retorno dos callbacks LUA, quando você utiliza getPlayerTarget, caso o jogador tenha um target ele receberá um objeto, que no caso é o que ele está targetando, seja uma criatura, um player, etc. e você fez a seguinte comparação:
if target == false then Caso o jogador não tenha um target, a função retorna 0. Caso você tenha dúvidas sobre o que a função te retorna, dê um print para aparecer no console o que você possui na variável, isso também é bem útil no debug, pra saber se uma determinada parte do script está sendo utilizada ou não.
Exemplo :
No teste acima o jogador não tinha um target
Sempre que você abrir uma função/if/etc. deixe tudo que está dentro alinhado para a direita e certifique-se que o end está alinhado com com seu respectivo if ou function, isso facilita MUITO a leitura de um código. Exemplo tirado de uma source:
No código acima você consegue identificar claramente onde começa e termina um bloco, além de saber o que faz parte de cada um
-
marcot's post in (Resolvido)[SUPORTE] CoolDown na Magia was marked as the answerTenta esse aqui
local combatDist = createCombatObject() setCombatParam(combatDist, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combatDist, COMBAT_PARAM_EFFECT, 75) setCombatParam(combatDist, COMBAT_PARAM_DISTANCEEFFECT, 31) setCombatFormula(combatDist, COMBAT_FORMULA_LEVELMAGIC, -13.7, 0, -19.9, 0) local condition = createConditionObject(CONDITION_FIRE) addDamageCondition(condition, 1, 1000, -5) addDamageCondition(condition, 1, 1000, -5) addDamageCondition(condition, 1, 1000, -4) addDamageCondition(condition, 1, 1000, -3) addDamageCondition(condition, 1, 1000, -2) addDamageCondition(condition, 1, 1000, -1) addDamageCondition(condition, 1, 1000, -25000) setCombatCondition(combatDist, condition) local function Cooldown(cid) if isPlayer(cid) == TRUE then doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,'CD: Adori Gran Dark') end end local combat= createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) local exhausted_seconds = 45 -- Segundos que o Player Poderá castar a spell novamente local exhausted_storagevalue = 9389 -- Storage Value do Cool Down function onCastSpell(cid, var) if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then doPlayerSendCancel(cid,'O Cooldown não está pronto.') return false end if(target == 1) then doPlayerSendCancel(cid,'Select your target.') doSendMagicEffect(getCreaturePosition(cid), 2) return false end local target = getCreatureTarget(cid) if(target ~= 0 and isPlayer(target) == 1) then local congelado = { lookType = getCreatureOutfit(target).lookType,lookHead = 9, lookBody = 9, lookLegs = 9, lookFeet = 9, lookAddons = getCreatureOutfit(target).lookAddons} doSetCreatureOutfit(target, congelado, 3000) setPlayerStorageValue(target, exhausted_storagevalue, os.time() + exhausted_seconds) doTargetCombatCondition(0, target, condition, CONST_ME_NONE) doPlayerSendTextMessage(target,20,'Voce está condenado.') doTargetCombatCondition(0, target, condition, CONST_ME_NONE) doCombat(cid, combatDist, numberToVariant(target)) else local monstro = { lookType = getCreatureOutfit(target).lookType,lookHead = getCreatureOutfit(target).lookHead, lookBody = getCreatureOutfit(target).lookBody, lookLegs = getCreatureOutfit(target).lookLegs, lookFeet = getCreatureOutfit(target).lookFeet, lookAddons = getCreatureOutfit(target).lookAddons} doSetCreatureOutfit(target, monstro, 3000) doTargetCombatCondition(0, target, condition, CONST_ME_NONE) doCombat(cid, combatDist, numberToVariant(target)) end rand = math.random(1,2) if rand == 1 and isPlayer(cid) == 1 then doPlayerSay(cid,"Adori Gran Dark",16) addEvent(Cooldown, 1*45000,cid) setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds) return doCombat(cid, combat, var) elseif rand == 2 and isPlayer(cid) == 1 then doPlayerSay(cid,"Adori Gran Dark",16) addEvent(Cooldown, 1*45000,cid) setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds) return doCombat(cid, combat, var) else addEvent(Cooldown, 1*45000,cid) setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds) return doCombat(cid, combat, var) end end Em versões novas de TFS dê preferência ao return de true/false, pois TRUE/FALSE são constantes 0 e 1, não o tipo bool
-
marcot's post in (Resolvido)[PEDIDO] "x" Bolt só funcionar com "x" Crossbow was marked as the answerInfelizmente não estou sabendo corrigir o bug que ficou, quando o jogador fica com o bow na mão que não seja o correto ele ganha skill como se estivesse batendo normalmente. Eu tentei usar o comando de addSkillTry mas parece que ele buga quando tento um valor negativo.
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 41) setCombatParam(combat, COMBAT_PARAM_HITCOLOR, 170) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 2, 1.2, 2) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, 31) setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 41) setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, 170) setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 0, -10000, 0, -13000) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, 31) setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 41) setCombatParam(combat3, COMBAT_PARAM_HITCOLOR, 170) setCombatFormula(combat3, COMBAT_FORMULA_SKILL, 0, -13000, 0, -15000) local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, 5000) setConditionParam(condition, CONDITION_PARAM_SPEED, -400) setConditionFormula(condition, 0, 0, 0, 0) setCombatCondition(combat2, condition) local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, 5000) setConditionParam(condition, CONDITION_PARAM_SPEED, -600) setConditionFormula(condition, 0, 0, 0, 0) setCombatCondition(combat3, condition) function onUseWeapon(cid, var) local rand = math.random(1,100) bowID = 13038 itemLeft = getPlayerSlotItem(cid, 6) itemRight = getPlayerSlotItem(cid, 5) if itemLeft.itemid ~= bowID and itemRight.itemid ~= bowID then flechas = getPlayerSlotItem(cid, 10) -- doPlayerAddSkillTry(cid, SKILL_DISTANCE, -1, true) -- BUGA A SKILL DO PERSONAGEM, NAO DESCOMENTAR doPlayerAddItem (cid, flechas.itemid, 1) return false end if rand <= 4 then doSendAnimatedText(getPlayerPosition(cid), "Critical!", TEXTCOLOR_BLACK) doCombat(cid, combat2, var) elseif rand <= 7 then doSendAnimatedText(getPlayerPosition(cid), "Critical!", TEXTCOLOR_BLACK) doCombat(cid, combat3, var) else doCombat(cid, combat, var) end end
-
marcot's post in (Resolvido)Script baseado em getPlayerLookDir was marked as the answerAqui está o script corrigido:
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) setCombatArea(combat,createCombatArea({{1}, {0}, {0}, {2}})) local combat_2 = createCombatObject() setCombatParam(combat_2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat_2, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatParam(combat_2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatFormula(combat_2, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) setCombatArea(combat_2,createCombatArea({{1}, {0}, {0}, {2}})) function onCastSpell(cid, var) direction = getCreatureLookDirection(cid) if direction == SOUTH then doCombat (cid, combat, var) elseif direction == NORTH then doCombat (cid, combat_2, var) else return false end return true end Para cada IF que você inicia você tem que ter um END fechando, e você pode usar e abusar das constantes setadas no global, você não precisa usar as direções como números.
-
marcot's post in (Resolvido)pedido script held fusion was marked as the answer@Danxi
Eu testei um pouco o sistema e a princípio parece que funcionou. Gostaria que você testasse adequadamente e, caso encontre algum bug, me mande aqui nessa mesma página que vou tentar corrigir.
Nome:
Fusão de Held Item Testado em:
The Forgotten Server 0.4 Como instalar:
1) Cole a tag em data/actions/actions.xml 2) Crie um arquivo chamado "heldFusion.lua" em data/actions/scripts e cole o "script" dentro dele 3) Vá no map editor de sua preferência, crie um contêiner e um ativador (nos testes usei uma alavanca), guarde a posição do contêiner, pois será necessário na configuração do script. 4) Ainda no map editor, coloque o actionID 10001 no ativador Pronto! Tag:
<action actionid = "10001" event = "script" value = "heldFusion.lua" /> Script:
-- Held Fusion 0.1 by Marcot -- Se encontrou algum erro no script, favor enviar PM explicando os erros -- http://www.tibiaking.com/forum/profile/120572-marcot/ -- Configuracoes necessarias para o script local config = { quest = { -- Precisa fazer quest? (Nao mexa caso negativo) necessaria = false, -- Eh necessario fazer uma quest para liberar o sistema? storageID = 10001, -- Qual o storageID dessa quest? (caso true, anteriormente) }, chestPos = {x = 92, y = 114, z = 7, stackpos = 1}, -- Posicao do Bau (certifique-se que nao tenha nada encima dele) -- Tenha atencao para que a soma das chances dos helds em cada tier seja igual a 100 helds = { -- Item IDs e chance de vir o held [1] = { -- Array Tier 1 {ID = 2159, chance = 10}, {ID = 2160, chance = 80}, {ID = 2158, chance = 10}, }, [2] = { -- Array Tier 2 {ID = 2000, chance = 20}, {ID = 2001, chance = 20}, {ID = 2002, chance = 20}, {ID = 2003, chance = 20}, {ID = 2004, chance = 20}, }, [3] = { -- Array Tier 3 }, [4] = { -- Array Tier 4 }, [5] = { -- Array Tier 5 }, [6] = { -- Array Tier 6 }, [7] = { -- Array Tier 7 }, }, } function onUse(cid, item, fromPosition, itemEx, toPosition) if config.quest.necessaria and getPlayerStorageValue (cid, config.quest.storageID) == 0 then -- Erro caso a pessoa use a maquina sem ter feito a quest -- Valido apenas quando a opcao esta ativada doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don\'t have permission to use this machine.") return false end items = {nil, nil, nil} container = getThingFromPos(config.chestPos) for i = 0, 2 do items[i + 1] = getContainerItem (container.uid, i) if items [i + 1].itemid == 0 or items [i + 1].itemid == nil then -- Erro quando tem menos de 3 itens no bau doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 3 held items to fuse.") return false end end heldType = {nil, nil, nil} for j=1, 3 do for i=1, 7 do for k = 1, #config.helds[i] do if config.helds[i][k].ID == items[j].itemid then heldType[j] = i end end end if heldType [j] == nil then -- Erro a ser exibido caso o jogador coloque algum item que nao seja um held na maquina doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This machine works only to held items.") return false end end if heldType[1] ~= heldType[2] or heldType[2] ~= heldType[3] then -- Erro a ser exibido caso o jogador coloque helds de tiers diferentes doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need helds with the same tier.") return false elseif heldType[1] == 7 or heldType[2] == 7 or heldType[3] == 7 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot fuse tier 7 held items.") return false end -- Sortear qual held vira for i = 1, 3 do doRemoveItem(items[i].uid, 1) end tierSorteado = heldType[1] + 1 numeroSorte = math.random(1, 100) itemIDSorteado = sorteiaValor (tierSorteado, numeroSorte) doPlayerAddItem(cid, itemIDSorteado, 1) -- Mensagem exibida ao fundir com sucesso doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You received your new held item.") return true end -- Função retirada de https://pt.stackoverflow.com/questions/147884/sorteio-aleat%C3%B3rio-mas-com-diferentes-probabilidades function sorteiaValor (tierSorteado, numeroSorte) x = numeroSorte for i = 1, #config.helds[tierSorteado] do x = x - config.helds[tierSorteado][i].chance if x <= 0 then return config.helds[tierSorteado][i].ID end end end
Caso queira personalizar as mensagens eu deixei comentários encima de cada mensagem explicando quando são executadas, desculpe pelo meu inglês fisk, só consigo ler, quando vou escrever é um desastre.
P.S.: Note que o script só olha os 3 primeiros itens de dentro do contêiner, portanto, cabe ao utilizador do script limitar o slot desse contêiner para 3.
[EDIT] Link para compreender a configuração do stackpos:
-
marcot's post in (Resolvido)[PEDIDO] Spells Hiraishin Ni No Dan Seal e Hiraishin Ni No Dan was marked as the answerTAG data/spells/spells.xml:
<instant name="Hiraishin No Jutsu" words="hiraishin ni no dan seal" lvl="12" mana="20" prem="1" aggressive="1" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="hiraishin.lua"> <vocation id="4"/> </instant> <instant name="Hiraishin no Jutsu" words="hiraishin ni no dan" lvl="18" mana="10" prem="1" aggressive="1" params="1" exhaustion="2000" needlearn="0" event="script" value="hiraishinII.lua"> <vocation id="4"/> </instant> hiraishin.lua
local config = { storageID = 49609, mark_time = 10 * 60, effectWhenTeleport = 339, -- Efeito ao teleportar effectWhenUsed = 152, } local errorMsg = { pz = "Seu alvo nao pode estar fora do PZ.", playerOnly = "Voce so pode usar este jutsu em players.", alreadyMarked = "Voce ja marcou um jogador.", } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 152) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) function onCastSpell(cid, var) --local target = getThingFromPosition(variantToPosition(var), 1) if isPlayer(getCreatureTarget(cid)) then if getPlayerStorageValue (cid, config.storageID) <= 0 then setPlayerStorageValue(cid, config.storageID, 1) doPlayerSendTextMessage(cid,22, "Voce marcou o player ".. getCreatureName(getCreatureTarget(cid))) local struct = { left = config.mark_time * 3, player = cid, target = target, var = var } addEvent(teleportIsTrue, 333, struct) else doSendMagicEffect(getPlayerPosition(cid), 2) doPlayerSendCancel(cid, errorMsg.alreadyMarked) return false end else doSendMagicEffect(getPlayerPosition(cid), 2) doPlayerSendCancel(cid, errorMsg.playerOnly) return false end return doCombat(cid, combat, var) end function teleportIsTrue (struct) if struct.left ~= 0 then if getPlayerStorageValue (struct.player, config.storageID) == 2 then doTeleportThing(struct.player, getThingPosition(getCreatureTarget(struct.player)), true) setPlayerStorageValue(struct.player, config.storageID, 0) doSendMagicEffect(getPlayerPosition(struct.player), config.effectWhenTeleport) doPlayerSendTextMessage(struct.player,22, "Voce perdeu sua marcacao.") return TRUE end struct.left = struct.left - 1 addEvent (teleportIsTrue, 333, struct) elseif struct.left == 0 then doPlayerSendTextMessage(struct.player,22, "Voce perdeu sua marcacao.") setPlayerStorageValue(struct.player, config.storageID, 0) else return FALSE end end hiraishinII.lua
local config = { storageID = 49609, mark_time = 6, } function onCastSpell(cid, var) --local target = getThingFromPosition(variantToPosition(var), 1) if getPlayerStorageValue (cid, config.storageID) == 1 then setPlayerStorageValue(cid, config.storageID, 2) else doPlayerSendTextMessage(cid,22, "Voce nao marcou nenhum jogador.") return false end return true end Quanto à parte de não cancelar o target não conheço muito bem, mas acredito que a própria source do OTServer ja deva cancelar quando sái da tela. Não sei se existe alguma função em LUA que mantenha o target enquanto o jogador está fora da tela.
-
marcot's post in (Resolvido)[dxp] alguns pokémons com revive bugado was marked as the answerSó uma ultima tentativa,
tenta trocar pra:
if (item2.itemid == b.on and #getCreatureSummons(cid) < 1) or (item2.itemid == b.off and #getCreatureSummons(cid) < 1) or (item2.itemid == b.use and #getCreatureSummons(cid) < 1 and not isRiderOrFlyOrSurf(cid)) then
Saindo do lado mais técnico para tentar simplificar: num if você tem uma expressão assim como (1 + 2), mas com apenas verdadeiro e falso como possíveis resultados. Caso a expressão resulte em verdadeiro, o que está dentro do bloco do if será executado:
if true then <bloco do if> else <bloco do else> end Caso o if não seja executado, o else será executado.
A expressão do script se for traduzir ficaria algo assim:
SE id do item for igual a b.on ou id do item igual a b.off ou (id do item igual a b.use e quantidade de summons do player menor que um e não estiver em ride/fly/surf faça
if item2.itemid == b.on or item2.itemid == b.off or (item2.itemid == b.use and #getCreatureSummons(cid) < 1 and not isRiderOrFlyOrSurf(cid)) then -
marcot's post in (Resolvido)[ Pedido ] tem que lança magia was marked as the answer@apollo333, @Samu DS
Desculpem nao ter respondido, estava maratonando uma série ontem.
Aqui a versão upando ML e com exausted:
local config = { requiredLevel = 100, -- Level necessario usingMana = 200, -- Mana que sera gasta storageID = 40001, -- Mude se ja estiver em uso timeExausted = 1, -- Tempo de exausted global } local errorMsg = { level = "Not enough level.", exausted = "You are exausted.", mana = "Not enough mana.", } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 49) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.5, -30, -1.1, 0) local arr = { {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 2, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0} } local area = createCombatArea(arr) setCombatArea(combat, area) function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) > config.requiredLevel then if getPlayerStorageValue (cid, config.storageID) < os.time() then if getPlayerMana(cid) > config.usingMana then doPlayerAddMana(cid, -config.usingMana) doPlayerAddSpentMana(cid, config.usingMana, true) setPlayerStorageValue(cid, config.storageID, os.time() + config.timeExausted) return doCombat(cid, combat, numberToVariant(cid)) else doPlayerSendCancel(cid, errorMsg.mana) doSendMagicEffect(getCreaturePosition(cid), 2) end else doPlayerSendCancel(cid, errorMsg.exausted) doSendMagicEffect(getCreaturePosition(cid), 2) end else doPlayerSendCancel(cid, errorMsg.level) end return TRUE end
-
marcot's post in (Resolvido)[PEDIDO] Tile que ganha outfit temporariamente was marked as the answerVá em data/movements/movements.xml e adicione a linha:
<movevent event="StepIn" actionid="13541" script="outfit_tile.lua" /> Agora vá em data/movements/scripts e crie um arquivo chamado outfit_tile.lua e cole o seguinte código nele:
local config = { actionID = 13541, outfit = {lookType = 75 , lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}, -- Outfit time = 10 -- Tempo em segundos } function onStepIn(cid, item, pos) if isPlayer(cid) then if item.actionid == config.actionID then doSetCreatureOutfit(cid, config.outfit, config.time * 1000) end end end Para que funcione você deverá adicionar o actionID escolhido ao piso que você quer que execute o script, ou seja, terá que fazê-lo no Map Editor a princípio.
-
marcot's post in (Resolvido)Como Alterar As Imagens Dos Slots? was marked as the answer@Hokograma
Com esse seu editor de PIC você não consegue extrair as imagens do PIC e editá-las (para depois recompilar)?
Editando só aquele campo você mantém intacto o resto das coisas. Eu uso aqui o pic_editor_v21 by Trooper, mas não posso postar porque se não me engano o antivirus aponta ele como vírus.
[EDIT]
O programa extrai aquelas imagens ali de 0 a 6 a partir do tibia.pic e de pois disso é só alterar e pedir pra ele compilar o novo tibia.pic que aí já altera.