Ir para conteúdo

Featured Replies

Postado

Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website).

TFS 0.4

Base: 

Eu queria colocar cooldown de 10 segundos (NAO É EXAUSTH) nessas 4 magias que tenho, tipo o cooldown seria dentro do script, mas eu nao sei fazer,  eu achei alguns posts aqui no tibiaking mas nenhum deles é explicando (é a magia ja pronta), dai tentei botar algumas linhas mas não funcionou, algum ser de DEUS pode me ajudar pf


Magia 1:

Spoiler

local acombat = createCombatObject()

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 4)
function onGetFormulaValues(cid, level, maglevel)
min = -(level*10.2)
max = -(level*10.2)
return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local 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 area = createCombatArea(arr)
setCombatArea(acombat, area)

function onTargetTile(cid, pos)
rand = math.random(1 ,8)
if rand == 1 then
npos = {x = pos.x + 3, y = pos.y, z = pos.z}
elseif rand == 2 then
npos = {x = pos.x - 3, y = pos.y, z = pos.z}
elseif rand == 3 then
npos = {x = pos.x, y = pos.y + 3, z = pos.z}
elseif rand == 4 then
npos = {x = pos.x, y = pos.y - 3, z = pos.z}
elseif rand == 5 then
npos = {x = pos.x - 3, y = pos.y + 3, z = pos.z}
elseif rand == 6 then
npos = {x = pos.x + 3, y = pos.y + 3, z = pos.z}
elseif rand == 7 then
npos = {x = pos.x - 3, y = pos.y - 3, z = pos.z}
elseif rand == 8 then
npos = {x = pos.x + 3, y = pos.y - 3, z = pos.z}
end
doSendDistanceShoot(npos, pos, 3)
doCombat(cid,combat,positionToVariant(pos))
end

setCombatCallback(acombat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, acombat, var)
end

 

Magia 2:

Spoiler

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 8)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 8)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
function onGetFormulaValues(cid, level, maglevel)
min = -(level*10.2)
max = -(level*10.2)
return min, max
end

setCombatCallback(combat3, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

arr1 = {
{0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1},
{0, 0, 0, 0, 0, 3, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0},
}

arr2 = {
{0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
}

arr3 = {
{0, 0, 0, 0, 1, 1, 1, 0, 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},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{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, 0, 1, 1, 1, 0, 0, 0, 0},
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)

function onCastSpell(cid, var)

doCombat(cid, combat1, var)
doCombat(cid, combat2, var)
doCombat(cid, combat3, var)

return true
end

 

Magia 3:

Spoiler

 

local acombat = createCombatObject()

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 255)
function onGetFormulaValues(cid, level, maglevel)
min = -(level*9.3)
max = -(level*9.3)
return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local 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 area = createCombatArea(arr)
setCombatArea(acombat, area)

function onTargetTile(cid, pos)
rand = math.random(1 ,8)
if rand == 1 then
npos = {x = pos.x + 1, y = pos.y, z = pos.z}
elseif rand == 2 then
npos = {x = pos.x - 1, y = pos.y, z = pos.z}
elseif rand == 3 then
npos = {x = pos.x, y = pos.y + 1, z = pos.z}
elseif rand == 4 then
npos = {x = pos.x, y = pos.y - 1, z = pos.z}
elseif rand == 5 then
npos = {x = pos.x - 1, y = pos.y + 1, z = pos.z}
elseif rand == 6 then
npos = {x = pos.x + 1, y = pos.y + 1, z = pos.z}
elseif rand == 7 then
npos = {x = pos.x - 1, y = pos.y - 1, z = pos.z}
elseif rand == 8 then
npos = {x = pos.x + 1, y = pos.y - 1, z = pos.z}
end
doSendDistanceShoot(npos, pos, 2)
doCombat(cid,combat,positionToVariant(pos))
end

setCombatCallback(acombat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, acombat, var)
end

 


Magia 4:

Spoiler

 

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 4)

local condition = createConditionObject(CONDITION_DRUNK)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2000)
setCombatCondition(combat1, condition)

function onGetFormulaValues(cid, level, maglevel)
min = -(level*4.8)
max = -(level*4.8)
return min, max
end


setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{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, 3, 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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

local area1 = createCombatArea(arr1)

setCombatArea(combat1, area1)

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

function onCastSpell(cid, var)
local parameters = { cid = cid, var = var, combat1 = combat1 }
addEvent(onCastSpell1, 0, parameters)
addEvent(onCastSpell1, 500, parameters)

return true
end

 

 

  • Respostas 15
  • Visualizações 739
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Erro meu, tenta assim.   if exhaustion.get(cid, 3305) then doPlayerSendCancel(cid, 'Wait '.. exhaustion.get(cid, 150) ..' seconds, before using this spell again.') return false end exh

Posted Images

Postado

Após isso:

function onCastSpell(cid, var)

Adicione isso:

	if exhaustion.get(cid, 3305) then
		doPlayerSendCancel(cid, 'Wait '.. exhaustion.get(cid, 150) ..' seconds, before using this spell again.')
		return true
	end
	exhaustion.set(cid, 3305, 10)

 

 

 

 

Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito.

                                                                                                                                                                                                                                        Aristóteles 

Postado
3 horas atrás, poko360 disse:

Opa, obg por responder, to na faculdade, assim que eu chegar eu testo, thanks

@Way20 pegou nao =/

 

Algum erro?

 

 

 

Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito.

                                                                                                                                                                                                                                        Aristóteles 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo