Postado Maio 30, 2020 5 anos Galera, estou com uma magia aqui a distancia, porem, ela não está com efeito a distancia... ja tentei de tudo: local combat, dosenddistanceeffect alguém sabe resolver? Spoiler local function suck(cid, target) if isCreature(cid) then if isCreature(target) then local formula = math.random(getPlayerLevel(cid), getPlayerLevel(cid) * 10) doCreatureAddHealth(cid, formula) doCreatureAddHealth(target, -formula) doSendAnimatedText(getThingPos(cid), "+"..formula, COLOR_GREEN) doSendAnimatedText(getThingPos(target), "-"..formula, COLOR_RED) doSendMagicEffect(getThingPos(cid), 12) doSendMagicEffect(getThingPos(target), 45) return true end end return true end function onCastSpell(cid) local config = { arrounds = 3, -- Vezes que a magia vai atacar exaust = 5, -- tempo de exaust -> 1 = 1s level = 50, mana = 4500, -- Mana que vai gastar time = 1000, -- tempo para executar a magia novamente (arrounds) -> 1 = 1s t = getCreatureTarget(cid), --- Não mexa. } if config.t <= 0 then doPlayerSendCancel(cid, "You need a target.") return false end if getCreatureMana(cid) < config.mana then doPlayerSendCancel(cid, "You need "..config.mana.." of mana to cast this spell.") return false end if getPlayerLevel(cid) < config.level then doPlayerSendCancel(cid, "You need level "..config.level.." to cast this spell.") return false end if exhaustion.get(cid, 21511) then doPlayerSendCancel(cid, "You need wait "..exhaustion.get(cid, 21511).." seconds.") return false end exhaustion.set(cid, 21511, config.exaust) doCreatureAddMana(cid, - config.mana) doCreatureSay(cid, "BLOOD SUCK", TALKTYPE_MONSTER) for a = 1, config.arrounds do addEvent(suck, config.time * a, cid, config.t) end return false end Up
Postado Junho 3, 2020 5 anos local function suck(cid, target) if isCreature(cid) then if isCreature(target) then local formula = math.random(getPlayerLevel(cid), getPlayerLevel(cid) * 10) doCreatureAddHealth(cid, formula) doCreatureAddHealth(target, -formula) doSendAnimatedText(getThingPos(cid), "+"..formula, COLOR_GREEN) doSendAnimatedText(getThingPos(target), "-"..formula, COLOR_RED) doSendMagicEffect(getThingPos(cid), 12) doSendMagicEffect(getThingPos(target), 45) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) return true end end return true end function onCastSpell(cid) local config = { arrounds = 3, -- Vezes que a magia vai atacar exaust = 5, -- tempo de exaust -> 1 = 1s level = 50, mana = 4500, -- Mana que vai gastar time = 1000, -- tempo para executar a magia novamente (arrounds) -> 1 = 1s t = getCreatureTarget(cid), --- Não mexa. } if config.t <= 0 then doPlayerSendCancel(cid, "You need a target.") return false end if getCreatureMana(cid) < config.mana then doPlayerSendCancel(cid, "You need "..config.mana.." of mana to cast this spell.") return false end if getPlayerLevel(cid) < config.level then doPlayerSendCancel(cid, "You need level "..config.level.." to cast this spell.") return false end if exhaustion.get(cid, 21511) then doPlayerSendCancel(cid, "You need wait "..exhaustion.get(cid, 21511).." seconds.") return false end exhaustion.set(cid, 21511, config.exaust) doCreatureAddMana(cid, - config.mana) doCreatureSay(cid, "BLOOD SUCK", TALKTYPE_MONSTER) for a = 1, config.arrounds do addEvent(suck, config.time * a, cid, config.t) end return false end ve se vc curte Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Junho 3, 2020 5 anos Autor 4 minutos atrás, L3K0T disse: local function suck(cid, target) if isCreature(cid) then if isCreature(target) then local formula = math.random(getPlayerLevel(cid), getPlayerLevel(cid) * 10) doCreatureAddHealth(cid, formula) doCreatureAddHealth(target, -formula) doSendAnimatedText(getThingPos(cid), "+"..formula, COLOR_GREEN) doSendAnimatedText(getThingPos(target), "-"..formula, COLOR_RED) doSendMagicEffect(getThingPos(cid), 12) doSendMagicEffect(getThingPos(target), 45) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) return true end end return true end function onCastSpell(cid) local config = { arrounds = 3, -- Vezes que a magia vai atacar exaust = 5, -- tempo de exaust -> 1 = 1s level = 50, mana = 4500, -- Mana que vai gastar time = 1000, -- tempo para executar a magia novamente (arrounds) -> 1 = 1s t = getCreatureTarget(cid), --- Não mexa. } if config.t <= 0 then doPlayerSendCancel(cid, "You need a target.") return false end if getCreatureMana(cid) < config.mana then doPlayerSendCancel(cid, "You need "..config.mana.." of mana to cast this spell.") return false end if getPlayerLevel(cid) < config.level then doPlayerSendCancel(cid, "You need level "..config.level.." to cast this spell.") return false end if exhaustion.get(cid, 21511) then doPlayerSendCancel(cid, "You need wait "..exhaustion.get(cid, 21511).." seconds.") return false end exhaustion.set(cid, 21511, config.exaust) doCreatureAddMana(cid, - config.mana) doCreatureSay(cid, "BLOOD SUCK", TALKTYPE_MONSTER) for a = 1, config.arrounds do addEvent(suck, config.time * a, cid, config.t) end return false end ve se vc curte mano, saiu o efeito de distancia, porém, ele está em toda a volta do target, e não aparece ele saindo do player. Por exemplo: S=target xxx xSx xxx e do player n sai nada
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.