
Tudo que 139 postou
-
Avatar Imperium War
Te enviei PM.
-
Adicionar Função Random
local id_arma = 7707 --id da arma usada function onStatsChange(cid, attacker, type, combat, value) if isPlayer(target) and type == COMBAT_PHYSICALDAMAGE and (getPlayerSlotItem(attacker, CONST_SLOT_RIGHT).itemid == id_arma or getPlayerSlotItem(attacker, CONST_SLOT_LEFT).itemid == id_arma) then if math.random(1, 5) == 1 then doCreatureAddHealth(attacker, value) end end return true end
-
Script Criar ponte...
local function removeTileItemById(pos, itemId) for i = 0, 255 do pos.stackpos = i local item = getThingFromPos(pos) if item.itemid == itemId then doRemoveItem(item.uid, 1) return true end end return false end local tiles, var, ret = { {x = 1468, y = 947, z = 6}, {x = 1469, y = 947, z = 6} }, 5901, 9230 local duracao = 10 -- em segundos function onUse(cid, item, fromPosition, itemEx, toPosition) local t = getTileItemById(tiles[1], ret).uid if t > 0 then return true end if not doPlayerRemoveItem(cid, var, 4) then doPlayerSendCancel(cid, 'Você precisa de 4 madeiras para construir a ponte.') doSendMagicEffect(getThingPos(cid), 2) return true end for i = 1, #tiles do doCreateItem(ret, 1, tiles[i]) addEvent(removeTileItemById, duracao*1000, tiles[i], ret) doSendMagicEffect(tiles[i], CONST_ME_POFF) end return true end
-
AJUDA [Wand]
É possível sim. Cria duas cópias desse script aí, nomeando como copia1.lua e copia2.lua por exemplo. Aí você abre eles e altera o dano ali no "local min, max = 870, 1000", conforme forem os danos originais das suas wands. local min, max = 870, 1000 local storage = 722656 local function getMinDamage(level, magLevel) local min = ((level * 1.05) + (magLevel * 1.00)) local naturalDamage = math.random(-30,45) min = min + naturalDamage if min < 870 then min = 870 end return math.floor(min) end local function getMaxDamage(level, magLevel) local max = ((level * 1.05) + (magLevel * 1.00)) local naturalDamage = math.random(-20,45) max = max + naturalDamage if max < 1000 then max = 1000 end return math.ceil(max) end Depois é só abrir o weapons.xml e designar os scripts copia1 e copia2 pras respectivas wands.
-
CONDITION_BLEEDING erro com spell em ot 8.6
Já tentou alterar para CONDITION_PHYSICAL?
-
AJUDA [Wand]
É mais fácil colocar o damage dessa sua wand pra escalar com level e magic level do char (assim ninguém precisa usar outra) do que deixar todas as outras no mesmo molde. Posta o script da sua wand.
-
Cura em area
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, 13) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local combatHeal = createCombatObject() setCombatParam(combatHeal, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combatHeal, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combatHeal, COMBAT_PARAM_COLOR_BLUE, 23) setHealingFormula(combatHeal, COMBAT_FORMULA_LEVELMAGIC, 63, 62, 61, 60) arr = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area = createCombatArea(arr) setCombatArea(combat, area) function onTargetCreature(cid, target) if isPlayer(target) then doCombat(cid, combatHeal, numberToVariant(target)) end end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(cid, var) return doCombat(cid, combat, var) end
-
Spell dando index a nil value
O Dr. Frankestein ficaria orgulhoso desse código. Pelo que eu entendi deveria ser isso:
-
Magia de Área com Delay.
@raphadoidera
-
Spell - Big Regeneration
@Elieder Alterei o meu primeiro comentário lá em cima, ta com a correção pra valores acima de 99%. Testa e se estiver funcionando marca como solução pra encerrar o tópico.
-
Spell - Big Regeneration
Mostra com as outras vocações que você diz que a cura não ta aumentando.
-
Spell - Big Regeneration
Me mostra o que aparece na distro: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local voc_bonus = { -- valor da cura adicional, ex: 0%, 10%, 50%, 100%, 200% ["Tanque"] = 50, ["Suporte"] = 25, ["Dano"] = 0, } local table_vocs = { -- last_id é o último id da vocação, a tabela precisa estar em ordem crescente. [1] = {last_id = 10, voc = "Naruto", classe = "Dano"}, [2] = {last_id = 20, voc = "Sasuke", classe = "Dano"}, [3] = {last_id = 30, voc = "Chouji", classe = "Tanque"}, [4] = {last_id = 40, voc = "Hidan", classe = "Tanque"}, [5] = {last_id = 50, voc = "Hashirama", classe = "Suporte"}, [6] = {last_id = 60, voc = "Obito", classe = "Suporte"}, } local function getBonus(cid, base) local pvoc = getPlayerVocation(cid) for k, _ in ipairs(table_vocs) do if pvoc <= table_vocs[k].last_id then print("lastid: "..table_vocs[k].last_id) print("voc: "..table_vocs[k].voc) bonus = voc_bonus[table_vocs[k].classe]/100 if bonus < 1 then bonus = bonus + 1 end total = base * bonus print("total: "..total.."| base: "..base.." | bonus: "..bonus) print("") return total end end end function onGetPlayerMinMaxValues(cid, level, magLevel) local min = ((level*0)+(magLevel*0)+200) local max = ((level*0)+(magLevel*0)+250) return getBonus(cid, min), getBonus(cid, max) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end
-
Spell - Big Regeneration
Msg de erro? Aqui ta funcionando certinho.
-
Spell - Big Regeneration
@elielder Nesse caso é só alterar o "last_id" de 10 pra 12 mesmo. O "[1]" não tem nada a ver com os ids da vocação, é só pra organizar a tabela mesmo, tipo: 1ª vocação -> Naruto 2ª vocação -> Sasuke Etc. Ah, alterei uma linha do script, atualiza o seu aí.
-
SCRIPT DE TRAP BUGADA.
@raphadoidera local c = { trapId = 2718, -- id do trap trapTime = 4, -- tempo do trap em segundos exhaustStorage = 1060602, -- storage do exhausted exhaustTime = 20 -- tempo do exhausted em segundos } local trap = createCombatObject() setCombatArea(trap, createCombatArea({ {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,1,1,1,0,0}, {0,0,1,2,1,0,0}, {0,0,1,1,1,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0} })) function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 onTargetTile(cid, pos) if isWalkable(pos, true, true, true) then doSendMagicEffect(pos, 111) doCreateItem(c.trapId, 1, pos) addEvent(function() local thing = getTileItemById(pos, c.trapId).uid if(thing ~= 0) then doRemoveItem(thing) end end, c.trapTime * 1000) end end setCombatCallback(trap, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) local target = variantToNumber(var) if(isPlayer(cid)) then if(math.max(0, (exhaustion.get(cid, c.exhaustStorage) or 0)) > 0) then doPlayerSendCancel(cid, "You are exhausted. Wait " .. exhaustion.get(cid, c.exhaustStorage) .. " second" .. (exhaustion.get(cid, c.exhaustStorage) > 1 and "s" or "") .. ".") return false else exhaustion.set(cid, c.exhaustStorage, c.exhaustTime) end end doCombat(cid, trap, var) return true end
-
Spell - Big Regeneration
@elielder local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local voc_bonus = { -- valor da cura adicional, ex: 0%, 10%, 50%, 100%, 200% ["Tanque"] = 50, ["Suporte"] = 25, ["Dano"] = 0, } local table_vocs = { -- last_id é o último id da vocação, a tabela precisa estar em ordem crescente. [1] = {last_id = 12, voc = "Naruto", classe = "Dano"}, [2] = {last_id = 20, voc = "Sasuke", classe = "Dano"}, [3] = {last_id = 30, voc = "Chouji", classe = "Tanque"}, [4] = {last_id = 40, voc = "Hidan", classe = "Tanque"}, [5] = {last_id = 50, voc = "Hashirama", classe = "Suporte"}, [6] = {last_id = 60, voc = "Obito", classe = "Suporte"}, } local function getBonus(cid, base) local pvoc = getPlayerVocation(cid) for k, _ in ipairs(table_vocs) do if pvoc <= table_vocs[k].last_id then bonus = voc_bonus[table_vocs[k].classe]/100 + 1 total = base * bonus return total end end end function onGetPlayerMinMaxValues(cid, level, magLevel) local min = ((level*0)+(magLevel*0)+200) local max = ((level*0)+(magLevel*0)+250) return getBonus(cid, min), getBonus(cid, max) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end
-
(Resolvido) Pedido Spell de invisibilidade
Pq vc não usa a do nightwolf? Não funciona no seu server?
-
Chave q some em 15 dias
<item id="ITEMID" article="a" name="chave"> <attribute key="weight" value="5000" /> <attribute key="duration" value="1296000" /> -- 15 dias em segundos <attribute key="decayTo" value="0" /> <attribute key="showduration" value="1" /> </item>
-
(Resolvido)Ajuda com esse script efeito quando player logar [SCRIPT]
@KR33 editei o meu último comentário com o a correção do código, agora está funcionando 100%.
-
Pvp em char sem vocação
- (Resolvido)Ajuda com esse script efeito quando player logar [SCRIPT]
Agora os erros estão explicados. Finalizei o script do Sun, colocando os efeitos pra saírem por 5 segundos e centralizados devidamente no char.- (Resolvido)Ajuda com esse script efeito quando player logar [SCRIPT]
Roda esse código aqui e mostra a print com valor do storage que vai aparecer na sua distro. @KR33 local cfg = { storage = 259005, effect = { [1] = {number = 1002, offset = {x = 1, y = 0}, delay = 5000}, --[2] = {number = 1002, offset = {x = 1, y = 0}, delay = 5000}, -- etc... } } local function startEffectCycle(cid) if (isCreature(cid)) then print("Valor do storage: "..getCreatureStorage(cid, cfg.storage)) local t = cfg.effect[getCreatureStorage(cid, cfg.storage)] if (t) then local position = getThingPosition(cid) position.x = position.x + t.offset.x position.y = position.y + t.offset.y doSendMagicEffect(position, t.number) addEvent(startEffectCycle, t.delay, cid) else addEvent(startEffectCycle, 1000, cid) end end end function onLogin(cid) if (getCreatureStorage(cid, cfg.storage) < 1) then doCreatureSetStorage(cid, cfg.storage, 1) end startEffectCycle(cid) return true end- SCRIPT DE MÍSSIL (Por Favor, me ajudem)
local rng = math.random(0, 1) local toposA = {x = tpos.x + rng-1, y = tpos.y + rng, z = tpos.z} local toposB = {x = tpos.x + rng, y = tpos.y + rng-1, z = tpos.z} Esse rng é pra gerar um número aleatório entre 0 e 1. Esse número vai ser uma base pra alterar o destino dos 2 misseis adicionais. O uso dele é pra modificar a coordenada do target (tpos), gerando duas novas coordenadas (diferentes entre sí) ao redor do target, a toposA e a toposB.- SCRIPT DE MÍSSIL (Por Favor, me ajudem)
Tinha feito o último rapidão pelo celular, agora ta certo: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 41) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -78.2, 1, -88.2, 1) function onCastSpell(cid, var) local waittime = 2 -- Tempo de exhaustion local storage = 1000600 if exhaustion.check(cid, storage) then return false end local mypos = getCreaturePosition(cid) local tpos = getCreaturePosition(getCreatureTarget(cid)) local position1 = {x=tpos.x+1, y=tpos.y+1, z=tpos.z} local position2 = {x=mypos.x+3, y=mypos.y, z=mypos.z} local rng = math.random(0, 1) local toposA = {x = tpos.x + rng-1, y = tpos.y + rng, z = tpos.z} local toposB = {x = tpos.x + rng, y = tpos.y + rng-1, z = tpos.z} doSendMagicEffect(position1, 106) doSendMagicEffect(position2, 189) doSendDistanceShoot(mypos, toposA, 41) doSendDistanceShoot(mypos, toposB, 41) exhaustion.set(cid, storage, waittime) return doCombat(cid, combat, var) end- Como debugar o código para encontrar o local do erro
O uso da getPlayerSlotItem também não ta aí, então tem que ir rastreando de função em função até achar ela. Checa a docastspell, isMega, getMegaID, e tudo que estiver dento delas. Meu palpite é que o cid que ela esteja recebendo seja um monstro (pokémon) ao invés do treinador, ou algo do tipo. - (Resolvido)Ajuda com esse script efeito quando player logar [SCRIPT]
Informação Importante
Confirmação de Termo