Postado Agosto 3, 2021 3 anos é apenas um chute, tenho familiaridade 0 com spells de poketibia, mas tentei mesclar com um outro script da comunidade, também não testei desabilitei os magic effects para melhor depuração local SKILL_NAME = "Shadow Storm" local SKILL_AREAS = { createCombatArea(ShadowStorm), createCombatArea(ShadowStorm), createCombatArea(ShadowStorm) } local rand = 60 / #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) local t = {} local posic = getThingPos(cid) for x = =7. 7 do for y = -7, 7 do local posi = {x = posic.x + x, y = posic.y + y, z = posic.z, stackpos = 0} table.insert(t, posi) end end local function doFallShadow(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, PROJECTILE_NIGHT_SHADE) end for v = 1, #t do if #t >= 1 then local random = math.random(1, #t) addEvent(doFallShadow, v * 24, cid, t[random]) t = doRemoveElementFromTable(t, t[random]) end end -- addEvent(doSendMagicEffect, 150, randomposition, EFFECT_SHADOW_STORM) dstv efeito 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, 8000 * (i - 1) + 1, cid, combat, var) end return true end
Postado Agosto 4, 2021 3 anos Autor Quote [Error - LuaScriptInterface::loadFile] data/spells/scripts/../../lib/ps/events/spells/scripts/Shadow Storm.lua:23: unexpected symbol near '=' [Warning - Event::loadScript] Cannot load script (data/spells/scripts/../../lib/ps/events/spells/scripts/Shadow Storm.lua) data/spells/scripts/../../lib/ps/events/spells/scripts/Shadow Storm.lua:23: unexpected symbol near '='
Postado Agosto 4, 2021 3 anos 9 horas atrás, Step Records disse: perdão, substitua as linhas 23 e 24 por for x = -7. 7 do for y = -7, 7 do //edit https://gyazo.com/654569b32d693794d021ea5db971cf5f se for este o resultado esperado, creio que basta adaptar para o poketibia, segue o código: Spoiler 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, 7) end function sendEff(cid, pos) if not isCreature(cid) then return true end local apos = pos doSendMagicEffect(apos, CONST_ME_ICEATTACK) 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
Postado Agosto 5, 2021 3 anos Autor @So volto tarde e agora você pode me explicar por que quando eu colo tudo isso em spella shadow Storm e blizzard ele mostra uma animação? : / e vou acrescentar que nem um nem outro soletram nada supera 0 erros no console Blizzard: Spoiler 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 onTargetTile_Blizzard = function(cid, position) position.x = position.x + math.random(0, 2) position.y = position.y + math.random(0, 2) doSendDistanceShoot(getSkyPosition(position), position, PROJECTILE_ICE) addEvent(doSendMagicEffect, 150, position, EFFECT_ICEBERG_TWO) end setCombatCallback(combats[i], CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature_Blizzard") setCombatCallback(combats[i], CALLBACK_PARAM_TARGETTILE, "onTargetTile_Blizzard") 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, 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 Shadow Storm: Spoiler 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 Editado Agosto 5, 2021 3 anos por Step Records (veja o histórico de edições)
Postado Agosto 5, 2021 3 anos no caso, você teria que adaptar ao poketibia, principalmente, retirando algumas partes do script já que é realmente uma spell, você pode ver que a função "onCastSpell" está no seu código, sendo assim, essa parte não vai ser executada nunca, gerando 0 erros no console Spoiler local SKILL_NAME = "Shadow Storm" local SKILL_AREAS = { createCombatArea(ShadowStorm), createCombatArea(ShadowStorm) } local rand = 30 / #SKILL_AREAS local combats = {} 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, 7) end function sendEff(cid, pos) if not isCreature(cid) then return true end local apos = pos doSendMagicEffect(apos, CONST_ME_ICEATTACK) end 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) 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 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 em casos de erro como faltando um "end" para fechar algum escopo, leia o erro e vá até a linha pedida, verifique se tem um end e precisa de um end (fiz pelo cel)
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.