Tudo que Mathias Kenfi postou
-
(Resolvido)Verificar posição de um player
Opa amigo agora não está dando erro, porém ele executa a ação a todo momento, mesmo se não tiver players em volta de mim
-
(Resolvido)Verificar posição de um player
Opa mano, obrigado pela ajuda, mas deu esse seguinte erro V [29/1/2019 13:37:54] [Error - Action Interface] [29/1/2019 13:37:54] data/actions/scripts/testeitem.lua:onUse [29/1/2019 13:37:54] Description: [29/1/2019 13:37:54] data/actions/scripts/testeitem.lua:5: attempt to index a boolean value [29/1/2019 13:37:54] stack traceback: [29/1/2019 13:37:54] data/actions/scripts/testeitem.lua:5: in function 'checkPlayersAround' [29/1/2019 13:37:54] data/actions/scripts/testeitem.lua:27: in function <data/actions/scripts/testeitem.lua:26> Eu deixei o script dessa maneira V function checkPlayersAround(uid) local players = {} -- Deixe vazio local pos = getCreaturePosition(uid) local positions = { [1] = {x = pos.x -1, y = pos.y, z = pos.z}, [2] = {x = pos.x +1, y = pos.y, z = pos.z}, [3] = {x = pos.x, y = pos.y +1, z = pos.z}, [4] = {x = pos.x, y = pos.y -1, z = pos.z} } for _, var in pairs(positions) do for i = 0, 255 do var.stackpos = i tile = getTileThingByPos(var) if tile.uid > 0 and isPlayer(tile.uid) then table.insert(players, tile.uid) end end end if not players then return false end return players end function onUse(cid, item, frompos, item2, topos) if checkPlayersAround(uid) then doSendMagicEffect(getCreaturePos(cid), 17) end return true end
-
(Resolvido)Verificar posição de um player
Olá galera do TibiaKing, venho aqui pedir a vocês que me ajudem em um scripting de verificar a posição de um Player, vou resumir abaixo. Eu quero que o script cheque se tem um player ao redor do Player que executou x ação (qualquer ação), exemplo: If playerpos.x=x-1 then executar ação end Ele deveria checar se tem 1 Player na posx -1, mas não sei muito bem como funciona os checkin de Position
-
(Resolvido)Dano Variar Pela ml -TFS 0.4
Da mesma forma
-
(Resolvido)Dano Variar Pela ml -TFS 0.4
Sim
-
(Resolvido)Dano Variar Pela ml -TFS 0.4
Para fazer por Skill você deve mudar > getPlayerMagLevel(cid) < para getPlayerSkillLevel(cid, skillid) em Skill ID você coloca o ID da skill que vai checar SKILL_CLUB = 1 SKILL_SWORD = 2 SKILL_AXE = 3 SKILL_DISTANCE = 4 SKILL_SHIELD = 5 SKILL_FISHING = 6
-
(Resolvido)Dano Variar Pela ml -TFS 0.4
Sua quantidade ML é a quantidade em % que aumenta no Dano Base EXEMPLO: Se o Dano base é 25000 e você tem 35 de Magic Level, vai aumentar 35% de 25000 ou seja, 25000+8750=33750
-
(Resolvido)Fazer item sumir
Tente com isso VV -- tratamento pra remover a pos salva local remove = getTileItemById(position[getPlayerStorageValue(cid, config.storage)], config.itemid).uid doPlayerSetStorageValue(cid, config.storage, 0) positions[getPlayerStorageValue(cid, config.storage)] = nil doRemoveItem(remove, 1)
-
(Resolvido)Dano Variar Pela ml -TFS 0.4
local w = { [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE}, } function onUseWeapon(cid, var) local ml = (getPlayerMagLevel(cid)*25000/100) local min, max = (25000+ml),(25000+ml) local effect = getPlayerStorageValue(cid, 4561) local target = getCreatureTarget(cid) if target ~= 0 then local wx = w[effect] or w[math.random(#w)] doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh) addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef) end return true end
-
(Resolvido)Fazer item sumir
Você pode criar 1 script de movements que remove o item, POR EXEMPLO: function onAddItem(moveItem, tileItem, position, cid) local time = 10 -- Tempo em segundos que o item será removido if isPlayer(cid) then addEvent(doRemoveItem, time*1000, moveItem.uid) doSendMagicEffect(getCreaturePosition(cid), 29) end end <movevent event="AddItem" itemid="11615" script="nomedoarquivo.lua"/>
-
(Resolvido)Fazer item sumir
quantidade é igual a quantidade, ou seja QUANTIDADE, simplesmente coloque o id do item e a quantidade de items que vai remover.................................................... Explique o que seu SCRIPT faz
-
(Resolvido)Dano Variar Pela ml -TFS 0.4
local dano = (getPlayerMagLevel(cid) * 25000/100) -- Aqui é a porcentagem que de 25000, se seu Magic Level é 25, irá retornar 25% de 25000 local min, max = (25000+dano),(25000+dano) -- Aqui irá somar o valor anterior ou seja, (25000+% de 25000) local w = { [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE}, } function onUseWeapon(cid, var) local effect = getPlayerStorageValue(cid, 4561) local target = getCreatureTarget(cid) if target ~= 0 then local wx = w[effect] or w[math.random(#w)] doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh) addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef) end return true end
-
(Resolvido)Dano Variar Pela ml -TFS 0.4
local magic = getPlayerMagLevel(cid) -- Não mexa local dano = (magic * 25000/100) -- Aqui é a porcentagem que de 25000, se seu Magic Level é 25, irá retornar 25% de 25000 local min, max = (25000+dano),(25000+dano) -- Aqui irá somar o valor anterior ou seja, (25000+% de 25000) local w = { [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE}, } function onUseWeapon(cid, var) local effect = getPlayerStorageValue(cid, 4561) local target = getCreatureTarget(cid) if target ~= 0 then local wx = w[effect] or w[math.random(#w)] doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh) addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef) end return true end
-
(Resolvido)Look
Utilize este script \/ function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid,' [Critical: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48903)) or 0))..'] [Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,98798644)) or 0))..']\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..']') return true elseif thing.uid == cid then doPlayerSetSpecialDescription(cid,' [Critical: '..math.max(0,(tonumber(getCreatureStorage(cid,48903)) or 0))..'] [Dodge: '..math.max(0,(tonumber(getCreatureStorage(cid,98798644)) or 0))..']\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..']') local string = '\nLevel: ['.. getPlayerLevel(cid) ..'] .' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' Voc: '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerStorageValue(cid, 30001) >= 1 then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..']\nMana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end
-
(Resolvido)Fazer item sumir
Claro, doRemoveItem(item.uid, count) o item.uid tem que ser declarado na callback da função, tente usar \/ doPlayerRemoveItem(cid, itemid, quantidade)
-
ERRO AO COMPILAR OTX (Microsoft Visual Studio 2013)
Eu baixei o OTX e as sources do Fir3z, eu segui um tutorial de compilação (Link no final) aqui no TK, instalei BOOST e o Tfs SDK, porém na Hora de compilar eu ainda tenho esse Erro abaixo VV Eu usei tfs-sdk-3.2-otx e a Boost: boost_1_55_0-msvc-12.0-32
-
PROCURO PROGRAMADOR
Estou procurando um programador para minha equipe
-
PROCURO PROGRAMADOR
Olá, estou tendo vários problemas na Distro do meu OT e não consigo compilar e muito menos resolver os erros que aparecem, se algum programador tiver interesse em me ajudar, chama WPP >> 34992411778 << que iremos discutir mais a fundo
-
Script dinâmico para weapon
Entendi, você quer um script que cheque o "min" é o "max", para que quando for refinar, esses números aumentariam. Se for isso eu acho que não há como, pelomenos não dessa maneira, já que "min" e "max" estão em xml, e um script está em LUA, mas você pode me chamar no PV que eu lhe digo formas de fazer esse sistema de refinamento
-
Porcentagem Vip em Spells
O Dano donate é esse V function onGetFormulaValues(cid, level, skill, attack, factor) local skillTotal, levelTotal = skill + attack, level / 5 local min = (25*(skillTotal / 3 + levelTotal)/100) local max = (25*(skillTotal + levelTotal)/100) return -min, -max end setCombatCallback(combatdonate, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") Nem eu entendo essa formula, então pra simplificar seria melhor essa abaixo V function onGetFormulaValues(cid, level, skill) local skl = (100*skill/100) -- Checa 100% do skill do Player (se você tiver 100 de sword, vai ser 100) local lvl = (100*lvl/100) -- Aqui checa seu 100% do seu Level (se você for Level 300, vai ser 300) local total = lvl + skl -- Aqui soma as variáveis acima (300+100=400) local max = (25*total/100) + total -- Aqui checa o total que seria 400, ou seja, 25% de 400 será 100 + total (400) return -max, -max -- Aqui é O Dano que causará, será -500 end setCombatCallback(combatdonate, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
-
Porcentagem Vip em Spells
Você pode fazer um creatrescripts (um pouco mais complicado) ou apenas criar uma Combat novo para cada magia, segue o script abaixo de exemplo Exori Hur, Exemplo 1: local combatfree = createCombatObject() setCombatParam(combatfree, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combatfree, COMBAT_PARAM_BLOCKARMOR, true) setCombatParam(combatfree, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE) setCombatParam(combatfree, COMBAT_PARAM_USECHARGES, true) function onGetFormulaValues(cid, level, skill, attack, factor) local skillTotal, levelTotal = skill + attack, level / 5 return -(skillTotal / 3 + levelTotal), -(skillTotal + levelTotal) end setCombatCallback(combatfree, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") local combatdonate = createCombatObject() setCombatParam(combatdonate, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combatdonate, COMBAT_PARAM_BLOCKARMOR, true) setCombatParam(combatdonate, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE) setCombatParam(combatdonate, COMBAT_PARAM_USECHARGES, true) function onGetFormulaValues(cid, level, skill, attack, factor) local skillTotal, levelTotal = skill + attack, level / 5 local min = (25*(skillTotal / 3 + levelTotal)/100) local max = (25*(skillTotal + levelTotal)/100) return -min, -max end setCombatCallback(combatdonate, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) local player = Player(cid) if not player then return true end if player:isVip() then doCombat(cid, combatdonate, var) else doCombat(cid, combatfree, var) end return true end
-
Script dinâmico para weapon
Não entendi muito bem, você quer um monte de arma que tivessem o mesmo script?
-
(Resolvido)Magia por Itens
Você deve deixar Normal no Items.xml, você deve registrar como Runa no Spells.xml Exemplo: <rune name="Sword" id="ID" allowfaruse="1" charges="1" lvl="60" maglv="1" exhaustion="1000" needtarget="1" blocktype="solid" event="script" value="NOME DO ARQUIVO.lua"/>
-
Function onAttack muito RÁPIDO
É quase isso mano, o que eu quero na Real, é como se eu estivesse usando uma 2° arma, e o statschange costuma substituir o Damage das spells e das armas, e eu quero que seja apenas em armas, por isso estava utilizando a função "function onAttack" OBS: O script que usei no post foi apenas um exemplo.
-
Function onAttack muito RÁPIDO
Fala galera do TibiaKing, estou tendo um problema com a função "function onAttack(cid, target" O que ocorre, é que se eu fizer um script como essse abaixo: function onAttack(cid, target) if getPlayerStorageValue(cid, 13540) >= 1 then doSendMagicEffect(cid, 40) end return true end O script irá agir com MUITA velocidade, ele não tem um intervalo de ativação, não é como se o script ativasse só quando atacasse, ele simplesmente ativa ao atacar e durante o intervalo do primeiro ataque e do segundo ataque, ele faz o script umas 30x. A attackspeed está entre 200 e 250, então mesmo se isso fosse influenciar, o time delay seria de no máximo 4x por segundo. Se alguém puder me ajudar agradeço