Postado Fevereiro 24, 2016 9 anos Precisava que a área dessa spell fosse random, que não ficasse saindo apenas nos lugares indicados no (arr), tiver como me ajudar fico agradecido, e se precisar de uma explicação melhor comentem, obrigado desde já local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625} local combatx = createCombatObject() local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHISYCALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 35) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -77777.1, -5000, -77777.1, -5000) local arr1 = { {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0 ,1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0 ,0 ,0, 0, 0, 2, 0, 0, 0, 0, 0} } local area1 = createCombatArea(arr1) local areax = createCombatArea(arr1) setCombatArea(combatx, area1) setCombatArea(combat1, area1) function onTargetTile(cid, pos) doCombat(cid,combat1,positionToVariant(pos)) end setCombatCallback(combatx, CALLBACK_PARAM_TARGETTILE, "onTargetTile") local function onCastSpell1(parameters) doCombat(parameters.cid, combatx, parameters.var) end function onCastSpell(cid, var) local parameters = { cid = cid, var = var} addEvent(onCastSpell1, 100, parameters) end
Postado Fevereiro 25, 2016 9 anos testa assim: Spoiler local combat = createCombatObject() local meteor = createCombatObject() setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(meteor, COMBAT_PARAM_DISTANCEEFFECT, 35) setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -77777.1, -5000, -77777.1, -5000) combat_arr = { {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0} } local combat_area = createCombatArea(combat_arr) setCombatArea(combat, combat_area) local function meteorCast(p) doCombat(p.cid, p.combat, positionToVariant(p.pos)) end function onTargetTile(cid, pos) if (math.random(1, 100) <= 40) then addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = meteor}) end end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) return doCombat(cid, combat, var) end Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
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.