Ir para conteúdo
  • 0

spell com chance de dar condition


rohfagundes

Pergunta

eu to querendo fazer um spell com chance de dar condition em quem pegar '-'

 

ai eu fiz uma aqui mas n esta funcionando

nem sei se esta certo

 

ta ai

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)

setCombatParam(combat, COMBAT_PARAM_EFFECT, 115)

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.7, 0, -0.5, 0)

 

 

local chance = 40

if math.random(1,100) >= chance then

local condition = createConditionObject(CONDITION_DRUNK)

setCombatParam(combat, COMBAT_PARAM_EFFECT, 31)

setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)

setCombatCondition(combat, condition)

end

 

crush = {

{0, 0, 0},

{1, 3, 1},

{0, 0, 0}

}

 

local area = createCombatArea(crush)

setCombatArea(combat, area)

 

local function onCastSpell1(parameters)

doCombat(parameters.cid, combat, parameters.var)

end

 

function onCastSpell(cid, var)

doPlayerAddSpentMana(cid, 1, true)

local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 000, parameters)

return true

end

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

tenta isso

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 115)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.7, 0, -0.5, 0)

local combat1 = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 115)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.7, 0, -0.5, 0)

local condition = createConditionObject(CONDITION_DRUNK)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 31) 
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setCombatCondition(combat1, condition)

crush = {
{0, 0, 0},
{1, 3, 1},
{0, 0, 0}
}

local area = createCombatArea(crush)
setCombatArea(combat, area)

local function onCastSpell1(parameters)
doCombat(parameters.cid, combat, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, combat1, parameters.var)
end

function onCastSpell(cid, var)
doPlayerAddSpentMana(cid, 1, true)
local parameters = { cid = cid, var = var}
onCastSpell1(parameters)
if math.random(1,100) >= 40 then
onCastSpell2(parameters)
end
return true
end

Link para o comentário
Compartilhar em outros sites

  • 0

tenta isso

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 115)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.7, 0, -0.5, 0)

local combat1 = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 115)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.7, 0, -0.5, 0)

local condition = createConditionObject(CONDITION_DRUNK)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 31)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setCombatCondition(combat1, condition)

crush = {
{0, 0, 0},
{1, 3, 1},
{0, 0, 0}
}

local area = createCombatArea(crush)
setCombatArea(combat, area)

local function onCastSpell1(parameters)
doCombat(parameters.cid, combat, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, combat1, parameters.var)
end

function onCastSpell(cid, var)
doPlayerAddSpentMana(cid, 1, true)
local parameters = { cid = cid, var = var}
onCastSpell1(parameters)
if math.random(1,100) >= 40 then
onCastSpell2(parameters)
end
return true
end

 

funcionou certinho =)

vlw +rep

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...