eduardo190696Força de vontade ensina até os mortosEVisconde
info
Grupo: Visconde
Registrado: 22/09/10
Posts: 474
Reputação: +47
20 de setembro de 2012 às 04:19
opa, queria que meus summon tivessem ataques estilo de pokemon, então resolvi pegar um script de poketibia dos "m1", só que quando vou usar, tem horas que não hita nada, tem horas que heala o inimigo e tem horas que funciona
-----------------NORMAL Quick Attack------------------------------
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 111)
setCombatFormula(combat1, COMBAT_FORMULA_DAMAGE, -6.6, 0, -5.7, 0)
---------------- Wirlwind -------------------------------
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 42)
setCombatFormula(combat2, COMBAT_FORMULA_DAMAGE, -6.6, 0, -5.7, 0)
arr2 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 3, 0, 3, 0, 3, 0, 0, 0},
{0, 0, 0, 3, 0, 3, 0, 3, 0, 0, 0},
{0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
local area2 = createCombatArea(arr2)
setCombatArea(combat2, area2)
local c = {
["Dragon Lord"] = {x = {m6 = combat1, spell = "Test 1", minLv = 1,distance = 3 }},
["Dragon"] = {x = {m6 = combat2, spell = "Test 2", minLv = 1,distance = 3 }},
}
function onSay(cid, var)
local summ = getCreatureSummons(cid)
if #summ == 0 then
return doPlayerSendCancel(cid, "Sorry, but you need a summon.")
end
for n = 1, #summ do
for name, _ in pairs(c) do
if getCreatureName(summ[n]):lower() == name:lower() then
local con = c[name].x
if getPlayerLevel(cid) < con.minLv then
return doPlayerSendCancel(cid, "Sorry, but you must be level " .. con.minLv .. " or higher to cast.") and doSendMagicEffect(getThingPos(cid), 2)
end
local distance = (not con.distance) and 1 or con.distance
if not isCreature(getCreatureTarget(cid)) or getCreatureTarget(cid) == summ[n] then
return doPlayerSendCancel(cid, "Invalid target.") and doSendMagicEffect(getThingPos(cid), 2)
end
if getDistanceBetween(getThingPos(summ[n]), getThingPos(getCreatureTarget(cid))) > distance then
return doPlayerSendCancel(cid, "Sorry, your summon is too far away.") and doSendMagicEffect(getThingPos(cid), 2)
end
doCombat(summ[n], con.m6, numberToVariant(getCreatureTarget(cid)))
doCreatureSay(cid, name .. ", " .. con.spell .. ".")
doSendMagicEffect(getThingPos(cid), 2)
end
end
end
return true
end
info
Grupo: Visconde
Registrado: 22/09/10
Posts: 474
Reputação: +47
opa, queria que meus summon tivessem ataques estilo de pokemon, então resolvi pegar um script de poketibia dos "m1", só que quando vou usar, tem horas que não hita nada, tem horas que heala o inimigo e tem horas que funciona
-----------------NORMAL Quick Attack------------------------------ local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, 111) setCombatFormula(combat1, COMBAT_FORMULA_DAMAGE, -6.6, 0, -5.7, 0) ---------------- Wirlwind ------------------------------- local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, 42) setCombatFormula(combat2, COMBAT_FORMULA_DAMAGE, -6.6, 0, -5.7, 0) arr2 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 3, 0, 3, 0, 3, 0, 0, 0}, {0, 0, 0, 3, 0, 3, 0, 3, 0, 0, 0}, {0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area2 = createCombatArea(arr2) setCombatArea(combat2, area2) local c = { ["Dragon Lord"] = {x = {m6 = combat1, spell = "Test 1", minLv = 1,distance = 3 }}, ["Dragon"] = {x = {m6 = combat2, spell = "Test 2", minLv = 1,distance = 3 }}, } function onSay(cid, var) local summ = getCreatureSummons(cid) if #summ == 0 then return doPlayerSendCancel(cid, "Sorry, but you need a summon.") end for n = 1, #summ do for name, _ in pairs(c) do if getCreatureName(summ[n]):lower() == name:lower() then local con = c[name].x if getPlayerLevel(cid) < con.minLv then return doPlayerSendCancel(cid, "Sorry, but you must be level " .. con.minLv .. " or higher to cast.") and doSendMagicEffect(getThingPos(cid), 2) end local distance = (not con.distance) and 1 or con.distance if not isCreature(getCreatureTarget(cid)) or getCreatureTarget(cid) == summ[n] then return doPlayerSendCancel(cid, "Invalid target.") and doSendMagicEffect(getThingPos(cid), 2) end if getDistanceBetween(getThingPos(summ[n]), getThingPos(getCreatureTarget(cid))) > distance then return doPlayerSendCancel(cid, "Sorry, your summon is too far away.") and doSendMagicEffect(getThingPos(cid), 2) end doCombat(summ[n], con.m6, numberToVariant(getCreatureTarget(cid))) doCreatureSay(cid, name .. ", " .. con.spell .. ".") doSendMagicEffect(getThingPos(cid), 2) end end end return true end