Postado Outubro 21, 2017 7 anos Olá , Caros Tenho um script de spell e gostei muito dele, mas o grande problema enfrentado é que ela só tem dano max e min, eu gostaria que o dano fosse de acordo com o level do player e a weapon ou wands ou axe que a vocation estiver usando. Me Ajudem! PFV! Script: Spoiler local config = { efeitoTele = 10, -- efeito q ira aparacer a cada teleport. efeitoDamage = 37, -- efeito q ira aparecer ao hitar no alvo hits = 5, -- quantos hits vai dar delay = 200, -- intervalo de tempo a cada hit min = 100, -- dano minimo max = 350, -- dano maximo damage = COMBAT_PHYSICALDAMAGE -- tipo do dano } function isWalkable(pos, creature, pz, proj) -- 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 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 getPosDirs(p, dir) -- mkalo return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function validPos(pos) tb = {} for i = 1, 8 do newpos = getPosDirs(pos, i) if isWalkable(newpos) then table.insert(tb, newpos) end end table.insert(tb, pos) return tb end spell = { start = function (cid, target, markpos, hits) if not isCreature(cid) then return true end if not isCreature(target) or hits < 1 then doTeleportThing(cid, markpos) doSendMagicEffect(getThingPos(cid), config.efeitoTele) return true end posAv = validPos(getThingPos(target)) rand = #posAv == 1 and 1 or #posAv - 1 doSendMagicEffect(getThingPos(cid), config.efeitoTele) doTeleportThing(cid, posAv[math.random(1, rand)]) doAreaCombatHealth(cid, config.damage, getThingPos(target), 0, -config.min, -config.max, config.efeitoDamage) addEvent(spell.start, config.delay, cid, target, markpos, hits - 1) end } function onCastSpell(cid) target = getCreatureTarget(cid) if target then spell.start(cid, target, getThingPos(cid), config.hits) end return true end Alguém poderia alterar este script? Editado Outubro 21, 2017 7 anos por TheKiler (veja o histórico de edições)
Postado Outubro 22, 2017 7 anos Solução @TheKiler Spoiler local config = { efeitoTele = 10, -- efeito q ira aparacer a cada teleport. efeitoDamage = 37, -- efeito q ira aparecer ao hitar no alvo hits = 5, -- quantos hits vai dar delay = 200, -- intervalo de tempo a cada hit dano = { base = 100, --dano base lvl = { {lvl_min = 1, lvl_max = 100, mult = 1}, --até lvl 100 multiplica dano por 1 {lvl_min = 101, lvl_max = 200, mult = 1.1}, --até lvl 200 multiplica dano por 1.1 {lvl_min = 201, lvl_max = 300, mult = 1.2}, --até lvl 300 multiplica dano por 1.2 {lvl_min = 301, lvl_max = 400, mult = 1.3} --até lvl 400 multiplica dano por 1.3 }, weapon = { [1.1] = {8932,11301}, --[multiplicador] = {ids das armas} [1.2] = {8931,11300}, [1.3] = {8930,8929} }, variacao = 50 --variacao que pode haver de dano }, damage = COMBAT_PHYSICALDAMAGE -- tipo do dano } function isWalkable(pos, creature, pz, proj) -- 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 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 getPosDirs(p, dir) -- mkalo return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function validPos(pos) tb = {} for i = 1, 8 do newpos = getPosDirs(pos, i) if isWalkable(newpos) then table.insert(tb, newpos) end end table.insert(tb, pos) return tb end spell = { start = function (cid, target, markpos, hits) if not isCreature(cid) then return true end if not isCreature(target) or hits < 1 then doTeleportThing(cid, markpos) doSendMagicEffect(getThingPos(cid), config.efeitoTele) return true end posAv = validPos(getThingPos(target)) rand = #posAv == 1 and 1 or #posAv - 1 doSendMagicEffect(getThingPos(cid), config.efeitoTele) doTeleportThing(cid, posAv[math.random(1, rand)]) local l,danof = getPlayerLevel(cid),config.dano.base for _,t in pairs(config.dano.lvl) do if t.lvl_min <= l and t.lvl_max >= l then danof = danof * t.mult break end end for m,t in pairs(config.dano.weapon) do if isInArray(t,getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid) or isInArray(t,getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid) then danof = danof * m break end end doAreaCombatHealth(cid, config.damage, getThingPos(target), 0, -danof, -(danof - config.dano.variacao), config.efeitoDamage) addEvent(spell.start, config.delay, cid, target, markpos, hits - 1) end } function onCastSpell(cid) target = getCreatureTarget(cid) if target then spell.start(cid, target, getThingPos(cid), config.hits) end return true end Você vai configurar nesta parte: Spoiler dano = { base = 100, --dano base lvl = { {lvl_min = 1, lvl_max = 100, mult = 1}, --até lvl 100 multiplica dano por 1 {lvl_min = 101, lvl_max = 200, mult = 1.1}, --até lvl 200 multiplica dano por 1.1 {lvl_min = 201, lvl_max = 300, mult = 1.2}, --até lvl 300 multiplica dano por 1.2 {lvl_min = 301, lvl_max = 400, mult = 1.3} --até lvl 400 multiplica dano por 1.3 }, weapon = { [1.1] = {8932,11301}, --[multiplicador] = {ids das armas} [1.2] = {8931,11300}, [1.3] = {8930,8929} }, variacao = 50 --variacao que pode haver de dano },
Postado Outubro 22, 2017 7 anos Autor 6 minutos atrás, antharaz disse: @TheKiler Ocultar conteúdo local config = { efeitoTele = 10, -- efeito q ira aparacer a cada teleport. efeitoDamage = 37, -- efeito q ira aparecer ao hitar no alvo hits = 5, -- quantos hits vai dar delay = 200, -- intervalo de tempo a cada hit dano = { base = 100, --dano base lvl = { {lvl_min = 1, lvl_max = 100, mult = 1}, --até lvl 100 multiplica dano por 1 {lvl_min = 101, lvl_max = 200, mult = 1.1}, --até lvl 200 multiplica dano por 1.1 {lvl_min = 201, lvl_max = 300, mult = 1.2}, --até lvl 300 multiplica dano por 1.2 {lvl_min = 301, lvl_max = 400, mult = 1.3} --até lvl 400 multiplica dano por 1.3 }, weapon = { [1.1] = {8932,11301}, --[multiplicador] = {ids das armas} [1.2] = {8931,11300}, [1.3] = {8930,8929} }, variacao = 50 --variacao que pode haver de dano }, damage = COMBAT_PHYSICALDAMAGE -- tipo do dano } function isWalkable(pos, creature, pz, proj) -- 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 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 getPosDirs(p, dir) -- mkalo return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function validPos(pos) tb = {} for i = 1, 8 do newpos = getPosDirs(pos, i) if isWalkable(newpos) then table.insert(tb, newpos) end end table.insert(tb, pos) return tb end spell = { start = function (cid, target, markpos, hits) if not isCreature(cid) then return true end if not isCreature(target) or hits < 1 then doTeleportThing(cid, markpos) doSendMagicEffect(getThingPos(cid), config.efeitoTele) return true end posAv = validPos(getThingPos(target)) rand = #posAv == 1 and 1 or #posAv - 1 doSendMagicEffect(getThingPos(cid), config.efeitoTele) doTeleportThing(cid, posAv[math.random(1, rand)]) local l,danof = getPlayerLevel(cid),config.dano.base for _,t in pairs(config.dano.lvl) do if t.lvl_min <= l and t.lvl_max >= l then danof = danof * t.mult break end end for m,t in pairs(config.dano.weapon) do if isInArray(t,getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid) or isInArray(t,getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid) then danof = danof * m break end end doAreaCombatHealth(cid, config.damage, getThingPos(target), 0, -danof, -(danof - config.dano.variacao), config.efeitoDamage) addEvent(spell.start, config.delay, cid, target, markpos, hits - 1) end } function onCastSpell(cid) target = getCreatureTarget(cid) if target then spell.start(cid, target, getThingPos(cid), config.hits) end return true end Você vai configurar nesta parte: Ocultar conteúdo dano = { base = 100, --dano base lvl = { {lvl_min = 1, lvl_max = 100, mult = 1}, --até lvl 100 multiplica dano por 1 {lvl_min = 101, lvl_max = 200, mult = 1.1}, --até lvl 200 multiplica dano por 1.1 {lvl_min = 201, lvl_max = 300, mult = 1.2}, --até lvl 300 multiplica dano por 1.2 {lvl_min = 301, lvl_max = 400, mult = 1.3} --até lvl 400 multiplica dano por 1.3 }, weapon = { [1.1] = {8932,11301}, --[multiplicador] = {ids das armas} [1.2] = {8931,11300}, [1.3] = {8930,8929} }, variacao = 50 --variacao que pode haver de dano }, Em outros tipos de spell com script's diferentes eu consigo colocar isto também?
Postado Outubro 22, 2017 7 anos Autor 16 minutos atrás, antharaz disse: Não, tem que mudar elas. E só por level? Ex: é possível eu colocar em qualquer script de spell para multiplicar por level?
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.