Em pokemon moves.lua:
elseif spell == "Air Vortex" then
local config = {
outfit = xxx, --Outfit.
time = {xxx, xxx}, --{Duração da spell, intervalo entre cada "tick" de dano (em milésimos de segundos)},
storage = 93828,
effects = {
pullEffects = {
distance = xxx, --Distance effect do efeito de puxar pokémons.
effect = xxx, --Efeito de tornado.
},
damageEffect = xxx, --Efeito do redemoinho que aplica dano.
},
}
local time = os.time() + config.time[1]
function Pull(cid, ret)
local pos = getPosfromArea(cid, pullArea)
if pos and #pos > 0 then
for i = 1, #pos do
local c = getTopCreature(pos[i]).uid
if c > 0 then
if ehMonstro(c) then
doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid)))
doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell)
elseif isSummon(c) then
local master = getCreatureMaster(c)
if isSummon(cid) then
if getPlayerStorageValue(master, 52480) >= 1 and getPlayerStorageValue(master, 52481) >= 0 then
local masterCid = getCreatureMaster(cid)
if isDuelingAgainst(masterCid, master) then
doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid)))
doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell)
end
end
else
doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid)))
doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell)
end
end
end
end
end
end
function doSendTornado(cid, pos)
if not isCreature(cid) then return true end
if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
doSendDistanceShoot(getThingPos(cid), pos, config.effects.pullEffects.distance)
doSendMagicEffect(pos, config.effects.pullEffects.effect)
end
function vortexDamage(cid)
if not isCreature(cid) then
return true
elseif time - os.time() < 0 then
return true
end
doDanoWithProtect(cid, FLYINGDAMAGE, getThingPos(cid), damageArea, min, max, config.effects.damageEffect)
addEvent(vortexDamage, config.time[2], cid)
end
local ret = {id = 0, cd = config.time[1], check = 0, cond = {"Silence", "Paralyze"}}
for b = 1, 3 do
for a = 1, 20 do
local pos = {x = getThingPos(cid).x + math.random(-4, 4), y = getThingPos(cid).y + math.random(-3, 3), z = getThingPos(cid).z}
addEvent(doSendTornado, a * 75, cid, pos)
end
end
Pull(cid, ret)
vortexDamage(cid)
doCreatureSetNoMove(cid, true)
doChangeSpeed(cid, -getCreatureSpeed(cid))
doSetCreatureOutfit(cid, {lookType = config.outfit}, config.time[1] * 1000)
setPlayerStorageValue(cid, config.storage, time)
addEvent(function()
if isCreature(cid) then
doCreatureSetNoMove(cid, false)
doRegainSpeed(cid)
end
end, config.time[1] * 1000)
Em areas.lua:
damageArea = createCombatArea{ --Área do dano da spell + redemoinhos.
{1, 1, 1},
{1, 2, 1},
{1, 1, 1},
}
pullArea = { --Área onde os pokémons serão puxados.
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
Em newStatusSyst.lua:
Troque todos os:
if ret and ret.cond then
ret.id = pid
ret.check = getPlayerStorageValue(pid, conds[ret.cond])
doCondition2(ret)
end
por:
if ret and ret.cond then
if type(ret.cond) == "table" then
for i = 1, #ret.cond do
ret.id = pid
ret.check = getPlayerStorageValue(pid, conds[ret.cond[i]])
doCondition2(ret)
end
else
ret.id = pid
ret.check = getPlayerStorageValue(pid, conds[ret.cond])
doCondition2(ret)
end
end
Depois, troque:
if ret.cond and ret.cond == "Miss" then
doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell)
elseif ret.cond and ret.cond == "Silence" then
doSilence2(ret.id, ret.cd, ret.eff, ret.check)
elseif ret.cond and ret.cond == "Slow" then
doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first)
elseif ret.cond and ret.cond == "Confusion" then
doConfusion2(ret.id, ret.cd, ret.check)
elseif ret.cond and ret.cond == "Burn" then
doBurn2(ret.id, ret.cd, ret.check, ret.damage)
elseif ret.cond and ret.cond == "Poison" then
doPoison2(ret.id, ret.cd, ret.check, ret.damage)
elseif ret.cond and ret.cond == "Fear" then
doFear2(ret.id, ret.cd, ret.check, ret.skill)
elseif ret.cond and ret.cond == "Stun" then
doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell)
elseif ret.cond and ret.cond == "Paralyze" then
doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first)
elseif ret.cond and ret.cond == "Sleep" then
doSleep2(ret.id, ret.cd, ret.check, ret.first)
elseif ret.cond and ret.cond == "Leech" then
doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage)
end
por:
if type(ret.cond) == "table" then
for i = 1, #ret.cond do
if ret.cond[i] and ret.cond[i] == "Miss" then
doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell)
elseif ret.cond[i] and ret.cond[i] == "Silence" then
doSilence2(ret.id, ret.cd, ret.eff, ret.check)
elseif ret.cond[i] and ret.cond[i] == "Slow" then
doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first)
elseif ret.cond[i] and ret.cond[i] == "Confusion" then
doConfusion2(ret.id, ret.cd, ret.check)
elseif ret.cond[i] and ret.cond[i] == "Burn" then
doBurn2(ret.id, ret.cd, ret.check, ret.damage)
elseif ret.cond[i] and ret.cond[i] == "Poison" then
doPoison2(ret.id, ret.cd, ret.check, ret.damage)
elseif ret.cond[i] and ret.cond[i] == "Fear" then
doFear2(ret.id, ret.cd, ret.check, ret.skill)
elseif ret.cond[i] and ret.cond[i] == "Stun" then
doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell)
elseif ret.cond[i] and ret.cond[i] == "Paralyze" then
doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first)
elseif ret.cond[i] and ret.cond[i] == "Sleep" then
doSleep2(ret.id, ret.cd, ret.check, ret.first)
elseif ret.cond[i] and ret.cond[i] == "Leech" then
doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage)
end
end
else
if ret.cond and ret.cond == "Miss" then
doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell)
elseif ret.cond and ret.cond == "Silence" then
doSilence2(ret.id, ret.cd, ret.eff, ret.check)
elseif ret.cond and ret.cond == "Slow" then
doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first)
elseif ret.cond and ret.cond == "Confusion" then
doConfusion2(ret.id, ret.cd, ret.check)
elseif ret.cond and ret.cond == "Burn" then
doBurn2(ret.id, ret.cd, ret.check, ret.damage)
elseif ret.cond and ret.cond == "Poison" then
doPoison2(ret.id, ret.cd, ret.check, ret.damage)
elseif ret.cond and ret.cond == "Fear" then
doFear2(ret.id, ret.cd, ret.check, ret.skill)
elseif ret.cond and ret.cond == "Stun" then
doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell)
elseif ret.cond and ret.cond == "Paralyze" then
doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first)
elseif ret.cond and ret.cond == "Sleep" then
doSleep2(ret.id, ret.cd, ret.check, ret.first)
elseif ret.cond and ret.cond == "Leech" then
doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage)
end
end
Depois, em data/talkactions/scripts, move1.lua:
Abaixo de:
if isSleeping(mypoke) or isSilence(mypoke) then --alterado v1.5
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode fazer isso agora.")
return 0
else
newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)
end
coloque:
if getPlayerStorageValue(mypoke, 93828) > os.time() then
return doPlayerSendCancel(cid, "Your pokemon can't use moves right now.")
end
Outra hora escrevo o código do Unown Help e Unown Rush (vou sair daqui a pouco).
Perguntas: Há uma quantia mínima de Unowns para usar o Unown Rush? O dano de tal spell aumenta de acordo com o número de Unowns summonados? Seria bem legal isso (ex.: cada Unown aumenta o dano da spell em 5%).