Olá, estou com um problema com o script, ou seja, quando um pokémon usa um feitiço, este feitiço não bate e o pior de tudo é que quando colo o script no 2º ataque, eles têm a mesma aparência, alguém poderia ajudar eu com isso? versão é Pokeaimar Level System.
Blizzard/Moves
MOVES["Blizzard"] = {
description = "Blizzard deals damage and has a 10% chance of freezing the opponent.",
category = MOVE_CATEGORY.SPECIAL,
clientIconId = 11779,
iconId = 13405,
dType = DAMAGE_TYPE_ICE,
functionName = "Blizzard",
type = SKILLS_TYPES.AREA,
requiredEnergy = 0,
requiredLevel = 50,
damage = 110,
damageType = ELEMENT_ICE,
effect = EFFECT_ICEBERG,
projectile = PROJECTILE_ICE,
areaName = "bigArea",
area = bigArea,
cooldownTime = 27,
cooldownStorage = 15088
}
Blizzard Scipts
local SKILL_NAME = "Blizzard"
local SKILL_AREAS = {
createCombatArea(Blizzard),
createCombatArea(Blizzard)
}
local rand = 30 / #SKILL_AREAS
local combats = {}
for i, skillArea in ipairs(SKILL_AREAS) do
combats[i] = createCombatObject()
onTargetCreature_Blizzard = function(cid, target)
doSkillDamage(cid, target, SKILL_NAME)
if (not isCreature(target)) then return end -- Defeated
if (not doPokemonSpecialAbilityCheck(target, POKEMON_SPECIAL_ABILITY_IDS.SHIELD_DUST, nil) and getRandom(0, 100) <=
(doPokemonSpecialAbilityCheck(cid, POKEMON_SPECIAL_ABILITY_IDS.SERENA_GRACE, nil) and (rand * 2) or rand)) then
doCreatureAddStatus(target, CREATURE_STATUS_FLINCH, nil, cid)
end
end
function fallProjectile(cid, pos)
if not isCreature(cid) then return true end
local apos = pos
local frompos = {x=apos.x-7,y=apos.y-6,z=apos.z}
doSendDistanceShoot(frompos, pos, 36)
end
function sendEff(cid, pos)
if not isCreature(cid) then return true end
local apos = pos
doSendMagicEffect(apos, EFFECT_ICEBERG_TWO)
end
function onCastSpell(cid, var)
local t = {}
local posic = getThingPos(cid)
for x = -6, 6 do
for y = -7, 8 do
local posi = {x = posic.x + x, y = posic.y-5 + y, z = posic.z, stackpos = 0}
table.insert(t, posi)
end
end
for v = 1, #t do
if (#t >= 1) then
local random = math.random(1, #t)
addEvent(fallProjectile, v * 12, cid, t[random])
addEvent(sendEff, v * 14, cid, t[random])
end
end
return true
end
end
local function doSpell(cid, combat, var)
if (isCreature(cid)) then
doCombat(cid, combat, var)
end
end
function onCastSpell(cid, var)
for i, combat in ipairs(combats) do
addEvent(doSpell, 500 * (i - 1) + 1, cid, combat, var)
end
return true
end
Shadow Storm moves
MOVES["Shadow Storm"] = {
description = "Shadow Storm deals damage and has a 30% chance of causing the target to flinch.",
category = MOVE_CATEGORY.PHYSICAL,
clientIconId = 28779,
iconId = 0,
dType = DAMAGE_TYPE_GHOST,
functionName = "ShadowStorm",
type = SKILLS_TYPES.AREA,
requiredEnergy = 0,
requiredLevel = 25,
damage = 38,
damageType = ELEMENT_GHOST,
effect = EFFECT_SHADOW_STORM,
areaName = "bigArea",
area = bigArea,
cooldownTime = 50,
cooldownStorage = 15241
}
Shadow storm Scripts
local SKILL_NAME = "Shadow Storm"
local SKILL_AREAS = {
createCombatArea(ShadowStorm),
createCombatArea(ShadowStorm)
}
local rand = 30 / #SKILL_AREAS
local combats = {}
for i, skillArea in ipairs(SKILL_AREAS) do
combats[i] = createCombatObject()
onTargetCreature_ShadowStorm = function(cid, target)
doSkillDamage(cid, target, SKILL_NAME)
if (not isCreature(target)) then return end -- Defeated
if (not doPokemonSpecialAbilityCheck(target, POKEMON_SPECIAL_ABILITY_IDS.SHIELD_DUST, nil) and getRandom(0, 100) <=
(doPokemonSpecialAbilityCheck(cid, POKEMON_SPECIAL_ABILITY_IDS.SERENA_GRACE, nil) and (rand * 2) or rand)) then
doCreatureAddStatus(target, CREATURE_STATUS_FLINCH, nil, cid)
end
end
onTargetTile_ShadowStorm = function(cid, position)
position.x = position.x + math.random(0, 2)
position.y = position.y + math.random(0, 2)
doSendDistanceShoot(getSkyPosition(position), position, PROJECTILE_NIGHT_SHADE)
addEvent(doSendMagicEffect, 150, position, EFFECT_SHADOW_STORM)
end
setCombatCallback(combats[i], CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature_ShadowStorm")
setCombatCallback(combats[i], CALLBACK_PARAM_TARGETTILE, "onTargetTile_ShadowStorm")
setCombatArea(combats[i], skillArea)
end
local function doSpell(cid, combat, var)
if (isCreature(cid)) then
doCombat(cid, combat, var)
end
end
function onCastSpell(cid, var)
for i, combat in ipairs(combats) do
addEvent(doSpell, 500 * (i - 1) + 1, cid, combat, var)
end
return true
end
function fallProjectile(cid, pos)
if not isCreature(cid) then return true end
local apos = pos
local frompos = {x=apos.x-7,y=apos.y-6,z=apos.z}
doSendDistanceShoot(frompos, pos, 15)
end
function sendEff(cid, pos)
if not isCreature(cid) then return true end
local apos = pos
doSendMagicEffect(apos, EFFECT_SHADOW_STORM)
end
function onCastSpell(cid, var)
local t = {}
local posic = getThingPos(cid)
for x = -6, 6 do
for y = -7, 8 do
local posi = {x = posic.x + x, y = posic.y-5 + y, z = posic.z, stackpos = 0}
table.insert(t, posi)
end
end
for v = 1, #t do
if (#t >= 1) then
local random = math.random(1, #t)
addEvent(fallProjectile, v * 12, cid, t[random])
addEvent(sendEff, v * 14, cid, t[random])
end
end
return true
end