Postado Março 7, 2018 7 anos Tenta rodar com esses: local burnBuff = { storageID = 23000, interval = 1, -- intervalo entre turnos damage = 5, -- dano de cada turno ticks = 5, -- quantidade de turnos effect = CONST_ME_HITBYFIRE, -- efeito } -- FIRE EFFECT local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, burnBuff.effect) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) local condition = createConditionObject(CONDITION_FIRE) setConditionParam(condition, CONDITION_PARAM_DELAYED, 1) addDamageCondition(condition, burnBuff.ticks, burnBuff.interval, -burnBuff.damage) setCombatCondition(combat, condition) function onAttack(cid, target) storageStatus = getPlayerStorageValue (cid, burnBuff.storageID) playerPos = getCreaturePosition (cid) targetPos = getCreaturePosition (target) if storageStatus == 0 then return true end -- FIM - jogador sem o buff if getDistanceBetween (playerPos, targetPos) > 1 then return true end -- FIM - jogador longe if storageStatus == 1 then -- Efeito Energy doCombatAreaCondition(cid, targetPos, nil, condition, burnBuff.effect) end return true end local energyBuff = { storageID = 23001, chance = 50, -- % de ativacao, 0~100 effect = CONST_ME_ENERGYHIT, -- efeito } -- ENERGY EFFECT local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -0.6, -30, -1.2, 0) local arr = { {0, 0, 0}, {1, 3, 1}, {0, 0, 0} } local area = createCombatArea(arr) setCombatArea(combat1, area) ------------------------------------------------------------------------ function onAttack(cid, target) storageStatus = getPlayerStorageValue (cid, energyBuff.storageID) playerPos = getCreaturePosition (cid) targetPos = getCreaturePosition (target) if storageStatus == 0 then return true end -- FIM - jogador sem o buff if getDistanceBetween (playerPos, targetPos) > 1 then return true end -- FIM - jogador longe if storageStatus == 1 then -- Efeito Energy if math.random (0, 100) < energyBuff.chance then -- % de ativacao doCombat(cid, combat1, numberToVariant(target)) -- Dano em area doSendMagicEffect (targetPos, energyBuff.effect) -- efeito end end return true end local healBuff = { storageID = 23002, chance = 25, -- % de ativacao, 0~100 lifePercentage = 25, -- % de vida em cura, 0~100 effect = CONST_ME_SMALLPLANTS, -- efeito } function onAttack(cid, target) storageStatus = getPlayerStorageValue (cid, healBuff.storageID) playerPos = getCreaturePosition (cid) targetPos = getCreaturePosition (target) if storageStatus == 0 then return true end -- FIM - jogador sem o buff if getDistanceBetween (playerPos, targetPos) > 1 then return true end -- FIM - jogador longe if storageStatus == 1 then -- Efeito de Heal if math.random (0, 100) < healBuff.chance then -- % de ativacao doCreatureAddHealth (cid, getCreatureMaxHealth(cid) * healBuff.lifePercentage / 100) -- formula de Heal doSendMagicEffect (playerPos, healBuff.effect) -- efeito end end return true end local waterBuff = { storageID = 23004, cooldown = 30, -- tempo para ativar proximo cooldownStorage = 23003, -- storage interval = 1, -- intevalo entre turnos effect = CONST_ME_LOSEENERGY, -- efeito } -- WATER EFFECT local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, waterBuff.effect) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -0.6, -30, -1.2, 0) local arr2 = { {1, 1, 1}, {1, 2, 1}, {1, 1, 1} } local area = createCombatArea(arr2) setCombatArea(combat2, area) function onAttack(cid, target) storageStatus = getPlayerStorageValue (cid, waterBuff.storageID) playerPos = getCreaturePosition (cid) targetPos = getCreaturePosition (target) if storageStatus == 0 then return true end -- FIM - jogador sem o buff if getDistanceBetween (playerPos, targetPos) > 1 then return true end -- FIM - jogador longe if storageStatus == 1 then if getPlayerStorageValue(cid, waterBuff.cooldownStorage) < os.time() then -- respeitando intervalo (para nao stackar 2 skills) setPlayerStorageValue (cid, waterBuff.cooldownStorage, os.time() + waterBuff.cooldown) -- cooldown set addEvent (waterCombat, waterBuff.interval * 1000, cid, waterBuff.cooldown) -- inicia evento waterCombat, responsavel pela skill end end return true end -- evento waterCombat function waterCombat (cid, times) if times == 0 then -- caso base de recursividade, quando termina o evento return true else -- caso recursivo doCombat (cid, combat2, numberToVariant(cid)) -- skill individual addEvent (waterCombat, waterBuff.interval * 1000, cid, times - 1) -- reativa o evento end end Para os testes os StorageIDs estão diferentes uns dos outros e todos são ativados quando o storage guarda 1. Pra adicionar serão necessárias 4 tags e você tem que adicionar pra cada tag uma daquelas linhas do login.lua com o nome correto
Postado Março 8, 2018 7 anos Autor @marcot cara vlw a ajuda vo testa aqui.... @marcot cara a action nao ia mudar caso fosse separado? esses scritps? feedbacks 1- o de energia ele nao aparece o efeito do player que foi atacado 2-- resto de boa Projects are being developed....
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.