Ir para conteúdo

Pergunta

Ola Xtibianos

Sera que algum de vcs poderiam fazer uma spell desta para min?, tentei fazer + nao tive muito sucesso ;/

Versao do meu server 7.92,.

 

vou colocar um script aki si vcs puderem usar como base agradeco!

 

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 38)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.70, -40, -7.10, 0)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 6000)
setConditionFormula(condition, -0.7, -0, -0.7, -0)

setCombatCondition(combat1, condition)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 38)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.70, -40, -7.10, 0)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 6000)
setConditionFormula(condition, -0.7, -0, -0.7, -0)
setCombatCondition(combat2, condition)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 38)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -4.70, -40, -7.10, 0)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 6000)
setConditionFormula(condition, -0.7, -0, -0.7, -0)
setCombatCondition(combat3, condition)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 38)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -4.70, -40, -7.10, 0)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 6000)
setConditionFormula(condition, -0.7, -0, -0.7, -0)
setCombatCondition(combat4, condition)


arr1 = {
{0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,1,0,0,0,0,1,0,0},
{0,0,0,0,0,1,1,1,0,0,0},
{0,0,1,1,0,0,0,1,0,1,0},
{1,0,0,1,1,0,1,0,1,0,0},
{0,1,0,0,0,2,1,1,0,0,1},
{1,0,0,1,1,0,1,0,0,0,1},
{0,1,1,0,0,0,1,0,0,0,1},
{1,0,1,0,1,0,1,0,1,0,1},
{0,0,0,1,1,1,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0}
}



arr2 = {
{0,0,0,0,1,0,0,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0},
{0,0,1,0,1,0,1,1,0,1,0},
{0,0,1,1,0,0,1,0,0,0,1},
{1,1,0,0,0,1,0,1,0,0,0},
{0,0,0,0,0,2,1,0,1,1,0},
{1,0,1,0,0,1,0,1,1,0,0},
{0,0,0,1,1,0,0,1,0,0,0},
{0,0,1,0,0,1,0,0,0,0,0},
{0,0,0,0,1,0,0,0,1,0,0},
{0,0,0,0,0,1,0,0,0,0,0}
}

arr3 = {
{0,0,1,0,0,1,0,0,0,0,0},
{0,0,0,0,1,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0,0,1,0},
{1,0,0,1,1,0,1,0,0,0,0},
{0,0,0,0,1,0,1,1,0,0,1},
{1,0,0,1,0,2,0,1,1,0,1},
{0,0,0,0,0,0,1,0,0,1,0},
{0,1,0,1,0,1,0,0,1,1,0},
{0,0,1,0,1,0,0,0,0,0,0},
{1,0,0,0,0,0,0,1,0,0,0},
{0,0,0,1,0,0,0,1,0,0,0}
}

arr4 = {
{0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,1,0,0,0,0,0},
{1,0,0,0,1,0,0,1,0,1,0},
{0,0,1,0,0,1,0,1,0,0,1},
{0,0,1,0,0,0,1,0,1,0,0},
{0,0,0,0,1,2,1,0,0,1,0},
{0,0,1,0,0,0,1,0,1,0,0},
{1,0,0,0,1,0,0,1,0,0,0},
{0,0,1,0,0,0,0,0,0,1,0},
{0,0,1,0,0,1,1,0,1,0,0},
{0,0,0,0,0,0,0,0,0,0,0}
}

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

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

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

local function onCastSpell3(parameters)
doCombat(parameters.cid, parameters.combat3, parameters.var)
end

local function onCastSpell4(parameters)
doCombat(parameters.cid, parameters.combat4, parameters.var)
end

function onTargetCreature(cid, target)
local function sun1(cid)
doPlayerSay(cid,"...",16)
return TRUE
end

local rand = math.random(1,5)
if isPlayer(target) == true and rand == 5 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
ddEvent(sun1, 1*1000,cid)
return TRUE
elseif isPlayer(target) == true and rand == 4 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
doSendMagicEffect(getCreaturePosition(target), 24)
ddEvent(sun1, 1*1000,cid)
return TRUE
elseif isPlayer(target) == true and rand < 4 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
return TRUE
else
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
return TRUE
end
end


setCombatCallback(combat1, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

function onTargetCreature(cid, target)
local function sun1(cid)
doPlayerSay(cid,"...",16)
return TRUE
end

local rand = math.random(1,5)
if isPlayer(target) == true and rand == 5 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
ddEvent(sun1, 1*1000,cid)
return TRUE
elseif isPlayer(target) == true and rand == 4 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
doSendMagicEffect(getCreaturePosition(target), 24)
ddEvent(sun1, 1*1000,cid)
return TRUE
elseif isPlayer(target) == true and rand < 4 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
return TRUE
else
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
return TRUE
end
end


setCombatCallback(combat2, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

function onTargetCreature(cid, target)
local function sun1(cid)
doPlayerSay(cid,"...",16)
return TRUE
end

local rand = math.random(1,5)
if isPlayer(target) == true and rand == 5 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
ddEvent(sun1, 1*1000,cid)
return TRUE
elseif isPlayer(target) == true and rand == 4 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
doSendMagicEffect(getCreaturePosition(target), 24)
ddEvent(sun1, 1*1000,cid)
return TRUE
elseif isPlayer(target) == true and rand < 4 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
return TRUE
else
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
return TRUE
end
end


setCombatCallback(combat3, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

function onTargetCreature(cid, target)
local function sun1(cid)
doPlayerSay(cid,"...",16)
return TRUE
end

local rand = math.random(1,5)
if isPlayer(target) == true and rand == 5 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
ddEvent(sun1, 1*1000,cid)
return TRUE
elseif isPlayer(target) == true and rand == 4 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
doSendMagicEffect(getCreaturePosition(target), 24)
ddEvent(sun1, 1*1000,cid)
return TRUE
elseif isPlayer(target) == true and rand < 4 then
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
return TRUE
else
doSendAnimatedText(getCreaturePosition(target), "Frozzen!", TEXTCOLOR_TEAL)
return TRUE
end
end


setCombatCallback(combat4, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")




local function Cooldown(cid)
if isPlayer(cid) == TRUE then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,'CD: Exevo Gran Mas Frigo')
end
end

local exhausted_seconds = 35 -- Segundos que o Player Poderá castar a spell novamente
local exhausted_storagevalue = 6347 -- Storage Value do Cool Down

function onCastSpell(cid, var)
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doPlayerSendCancel(cid,'O Cooldown não está pronto.')
return TRUE
end

local function spell4(cid)
return doCombat(cid, combat4, var)
end
local function spell3(cid)
addEvent(spell4, 1 * 750, cid)
return doCombat(cid, combat2, var)
end
local function spell3(cid)
return doCombat(cid, combat3, var)
end
local function spell2(cid)
addEvent(spell3, 1 * 750, cid)
return doCombat(cid, combat2, var)
end
local function spell1(cid)
addEvent(spell2, 1 * 750, cid)
return doCombat(cid, combat1, var)
end
addEvent(spell1, 1 * 750, cid)
addEvent(Cooldown, 1*35000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat1, var)
end


 

Axei um script do Whitewolf si der para modificar para funcionar no meu server xD!

 

local waves = 8 --- numero de vezes que vão cair as flechas

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 combat = createCombatObject()
local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, 9)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -30, -50, -40, -55)

local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, 1)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -30, -50, -40, -55)

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

local function stunEffect(cid)
doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

function onTargetTile(cid, pos)
if (math.random(0, 6) == 6) then
local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0})
if (isInArray(water, ground.itemid) == TRUE) then
local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
doSendDistanceShoot(newpos, pos, CONST_ANI_HOLY)
addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water})
else
local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
doSendDistanceShoot(newpos, pos, CONST_ANI_ARROW)
addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor})
end
end
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
for i = 0, waves do
addEvent(function()
if isCreature(cid) then
doCombat(cid, combat, var)
end
end, 200 * i)
end

return true
end

 

 

tentei colocar ele mais deu este erro aki

25t95i9.png

 

Editado por ShadowsinXT
Link para o comentário
https://xtibia.com/forum/topic/233842-spell-meteorcast-ajuda/
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

×
×
  • Criar Novo...