Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    72

Tudo que zipter98 postou

  1. Seu pokémon lhe abandonou. Lamento. Enfim, tente trocar: table.remove(randomPosis, index) por: for i = index, #randomPosis do randomPosis[i] = randomPosis[i + 1] or nil end
  2. Troque: local monster = Config.Monsters[getCreatureName(target):lower] por: local monster = Config.Monsters[getCreatureName(target):lower()]
  3. Ops, errei outra letra. Corrigido.
  4. Nesse caso, teste o código configurando o evento manualmente.
  5. Ops, coloquei sem querer uma letra minúscula onde não devia. Corrigido.
  6. <event type="death" name="deathEffect" event="script" value="nome_do_arquivo.lua"/>
  7. O primeiro, que eu também particularmente escolheria por ter um processo menos cansativo de configuração.
  8. Tags: <event type="logout" name="skullLogin" event="script" value="nome_do_arquivo.lua"/> <event type="statschange" name="skullStatsChange" event="script" value="nome_do_arquivo.lua"/> <event type="target" name="skullTarget" event="script" value="nome_do_arquivo.lua"/> Código (data/creaturescripts/scripts): local monsterName = "nome_do_monstro" function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and getCreatureSkullType(attacker) ~= SKULL_WHITE and isMonster(cid) and getCreatureName(cid) == monsterName and type == STATSCHANGE_HEALTHLOSS then doCreatureSetSkullType(attacker, SKULL_WHITE) end return true end function onTarget(cid, target) if isPlayer(cid) and getCreatureSkullType(cid) ~= SKULL_WHITE and isMonster(target) and getCreatureName(target) == monsterName then doCreatureSetSkullType(cid, SKULL_WHITE) end return true end function onLogin(cid) registerCreatureEvent(cid, "skullStatsChange") registerCreatureEvent(cid, "skullTarget") return true end
  9. data/lib/pokemon moves.lua: elseif spell == "Iron Body" then local ironBody = { outfit = xxx, --Outfit. duration = 5, --Duração. } doSetCreatureOutfit(cid, {lookType = ironBody.outfit}, ironBody.duration * 1000) setPlayerStorageValue(cid, 9658783, 1) addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 9658783, -1) end end, ironBody.duration * 1000)
  10. Não se esqueça de registrar o evento no arquivo .XML dos monstros. local config = { --["monster_name"] = effect, ["Dragon"] = 28, ["Orc"] = 13, --etc } function onDeath(cid) local effect = config[getCreatureName(cid)] if effect then doSendMagicEffect(getThingPos(cid), effect) end return true end
  11. function onStatsChange(cid, attacker, type, combat, value) if isMonster(attacker) and isMonster(cid) then return false end return true end Entretanto, você terá que registrar o evento no arquivo .XML de todos os monstros. Ou, caso não queira realizar a cansativa tarefa acima, você pode tentar: Nas sources do servidor, monster.cpp: Abaixo de: if(isSummon()) isMasterInRange = canSee(getMaster()->getPosition()); coloque: std::string event = "NOME_DO_EVENT0"; //Nome do evento configurado em creaturescripts.xml. creature->registerCreatureEvent(event);
  12. Não testei a spell. data/lib, areas.lua: spell_area = { --Área de posições que o pokémon pode teleportar. {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, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 3, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } data/lib, pokemon moves.lua: elseif spell == "NOME_DA_SPELL" then local config = { times = 4, --Vezes que o pokémon irá se teleportar. appearEffect = xxx, --Efeito que vai aparecer no pokémon ao aparecer. effect = xxx, --Efeito de corte de garras. combat = STEELDAMAGE, --Elemento. disappearInterval = 200, --Tempo para, depois de reaparecer, o pokémon desaparecer novamente. (em milésimos de segundo) teleportInterval = 400 --Intervalo de tempo entre cada teleporte do pokémon. (em milésimos de segundo) } local pos = getPosfromArea(cid, spell_area) local randomPosis = {} for i = 1, config.times do randomPosis[i] = pos[math.random(#pos)] if not isWalkable(randomPosis[i]) or getTileInfo(randomPosis[i]).protection then while not isWalkable(randomPosis[i]) do randomPosis[i] = pos[math.random(#pos)] end end end local function doTeleport(cid, time) if not isCreature(cid) then return true end if not isCreature(target) or time <= 0 then doAppear(cid) doCreatureSetNoMove(cid, false) doRegainSpeed(cid) end local index = math.random(#randomPosis) doTeleportThing(cid, randomPosis[index]) for i = index, #randomPosis do randomPosis[i] = randomPosis[i + 1] or nil end doAppear(cid) doSendMagicEffect(getThingPos(cid), config.appearEffect) doDanoWithProtect(cid, config.combat, getThingPos(target), 0, -min, -max, config.effect) addEvent(doDisapear, config.disappearInterval, cid) addEvent(doTeleport, config.teleportInterval, cid, time - 1) end doDisapear(cid) doCreatureSetNoMove(cid, true) doChangeSpeed(cid, -getCreatureSpeed(cid)) addEvent(doTeleport, config.teleportInterval, cid, config.times)
  13. Código alterado, como você pediu.
  14. Tem sim. Daqui a pouco edito.
  15. Se você não tiver a função getPosfromArea no seu servidor, recomendo instalá-la. local config = { effect = xxx, --Efeito. combat = xxx, --Combat/elemento da spell. area = { --Área da spell. {0, 0, 0, 0, 0, 1, 0, 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}, {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, 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, 0, 1, 0, 0, 0, 0, 0}, } } local combat = createCombatObject() setCombatArea(combat, createCombatArea(config.area)) setCombatParam(combat, COMBAT_PARAM_TYPE, config.combat) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -xx.x, x, -xx.x, x) function onCastSpell(cid, var) doCombat(cid, combat, var) for _, pos in pairs(getPosfromArea(cid, config.area)) do local pid = getTopCreature(pos).uid if isMonster(pid) then doSendMagicEffect(getThingPos(pid), config.effect) end end return true end
  16. Hm, troque: math.random(#SOUNDS[i].sound) por: math.random(1, #SOUNDS[i].sound) e troque: math.random(#toPlay.sound) por: math.random(1, #toPlay.sound)
  17. function onUse(cid, item, fromPosition, item2, toPosition) local myball = getPlayerSlotItem(cid, 8) if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "Retorne seu pokemon para poder usar a boost stone.") elseif myball.uid < 1 or item2.uid ~= myball.uid then return doPlayerSendCancel(cid, "Use this item on a pokeball in the pokeball slot.") end local boost = getItemAttribute(myball.uid, "boost") or 0 local boosts = 10 if boost == 70 then doPlayerSendCancel(cid, "Seu pokemon está no lvl máximo.") return true end boosts = boosts local pokemon = getItemAttribute(myball.uid, "poke") local off = pokes[pokemon].offense * boost_rate * boosts local def = pokes[pokemon].defense * boost_rate * boosts local agi = pokes[pokemon].agility * boosts local spatk = pokes[pokemon].specialattack * boost_rate * boosts local vit = pokes[pokemon].vitality * boost_rate * boosts newBoost = boost + boosts if newBoost > 70 then newBoost = 70 end doSetItemAttribute(myball.uid, "boost", newBoost) doItemSetAttribute(myball.uid, "offense", getItemAttribute(myball.uid, "offense") + off) doItemSetAttribute(myball.uid, "defense", getItemAttribute(myball.uid, "defense") + def) doItemSetAttribute(myball.uid, "speed", getItemAttribute(myball.uid, "speed") + agi) doItemSetAttribute(myball.uid, "specialattack", getItemAttribute(myball.uid, "specialattack") + spatk) doItemSetAttribute(myball.uid, "vitality", getItemAttribute(myball.uid, "vitality") + vit) doRemoveItem(item.uid, 1) doSendMagicEffect(getThingPos(item2.uid), 103) doPlayerSendTextMessage(cid, 27, "Parabéns, o seu "..pokemon..", foi bostado +"..boosts..".") doPlayerSendTextMessage(cid, 27, "Agora, o seu "..pokemon.." está bostado +"..newBoost..".") doSendAnimatedText(getThingPos(item2.uid), "+"..boosts.." Boost", 215) return true end
  18. function onUse(cid, item, fromPosition, item2, toPosition) local myball = getPlayerSlotItem(cid, 8) if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "Retorne seu pokemon para poder usar a boost stone.") elseif myball.uid < 1 or item2.uid ~= myball.uid then return doPlayerSendCancel(cid, "Use this item on a pokeball in the pokeball slot.") end local boost = getItemAttribute(myball.uid, "boost") or 0 local boosts = 10 if boost == 70 then doPlayerSendCancel(cid, "Seu pokemon está no lvl máximo.") return true end boosts = boosts local pokemon = getItemAttribute(myball.uid, "poke") local off = pokes[pokemon].offense * boost_rate * boosts local def = pokes[pokemon].defense * boost_rate * boosts local agi = pokes[pokemon].agility * boosts local spatk = pokes[pokemon].specialattack * boost_rate * boosts local vit = pokes[pokemon].vitality * boost_rate * boosts newBoost = boost + boosts if newBoost > 70 then newBoost = 70 end doSetItemAttribute(myball.uid, "boost", newBoost) doItemSetAttribute(myball.uid, "offense", getItemAttribute(myball.uid, "offense") + off) doItemSetAttribute(myball.uid, "defense", getItemAttribute(myball.uid, "defense") + def) doItemSetAttribute(myball.uid, "speed", getItemAttribute(myball.uid, "speed") + agi) doItemSetAttribute(myball.uid, "specialattack", getItemAttribute(myball.uid, "specialattack") + spatk) doItemSetAttribute(myball.uid, "vitality", getItemAttribute(myball.uid, "vitality") + vit) doRemoveItem(item.uid, 1) doSendMagicEffect(getThingPos(item2.uid), 103) doPlayerSendTextMessage(cid, 27, "Parabéns, o seu "..pokemon..", foi bostado +"..boosts..".") doPlayerSendTextMessage(cid, 27, "Agora, o seu "..pokemon.." está bostado +"..newBoost..".") doSendAnimatedText(getThingPos(item2.uid), "+"..boosts.." Boost", 215) return true end
  19. Você removeu uma linha importante... Acima de: for i = 1, #SOUNDS do local newSound = type(SOUNDS[i].sound) == "table" and SOUNDS[i].sound[math.random(#SOUNDS[i].sound)] or SOUNDS[i].sound SOUNDS[i].sound = SOUNDS_CONFIG.folder .. newSound end coloque: function init() ficando: function init() for i = 1, #SOUNDS do local newSound = type(SOUNDS[i].sound) == "table" and SOUNDS[i].sound[math.random(#SOUNDS[i].sound)] or SOUNDS[i].sound SOUNDS[i].sound = SOUNDS_CONFIG.folder .. newSound end
  20. Se possível, poste como ficou o código alterado.
  21. Por acaso é a magia Chakra Impulse?
  22. Remova estas linhas do código: if combat == COMBAT_PHYSICALDAMAGE then return false end
  23. function onAdvance(cid, skill, oldLevel, newLevel, time) db.query("INSERT INTO player_advances (cid, skill, oldlevel, newlevel, time) VALUES ('" .. getPlayerGUID(cid) .. "', '" .. skill .."', '" .. oldLevel .."', '" .. newLevel .."', '" .. os.time() .. "' )") return true end
  24. O dano será aplicado quando o Mega Scizor reaparecer em outro lugar, independente se longe ou não do alvo?
  25. What? Você entra na quest por esta porta mas tenta sair da quest pela mesma porta?
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...