-
Total de itens
2553 -
Registro em
-
Última visita
-
Dias Ganhos
73
Tudo que zipter98 postou
-
Ops, errei outra letra. Corrigido.
-
programação Monstro não acertar hit em outro monstro (selvagem)
pergunta respondeu ao roriscrave de zipter98 em Resolvidos
Nesse caso, teste o código configurando o evento manualmente. -
Ops, coloquei sem querer uma letra minúscula onde não devia. Corrigido.
-
<event type="death" name="deathEffect" event="script" value="nome_do_arquivo.lua"/>
-
action Qual script sobrecarrega MENOS o server?
pergunta respondeu ao roriscrave de zipter98 em Scripts
O primeiro, que eu também particularmente escolheria por ter um processo menos cansativo de configuração. -
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)
-
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
-
programação Monstro não acertar hit em outro monstro (selvagem)
pergunta respondeu ao roriscrave de zipter98 em Resolvidos
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); -
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)
-
pedido [Pedido] spell de área que só aparece efeito no mostro
pergunta respondeu ao Jefferson14789 de zipter98 em Scripts
Código alterado, como você pediu. -
pedido [Pedido] spell de área que só aparece efeito no mostro
pergunta respondeu ao Jefferson14789 de zipter98 em Scripts
Tem sim. Daqui a pouco edito. -
pedido [Pedido] spell de área que só aparece efeito no mostro
pergunta respondeu ao Jefferson14789 de zipter98 em Scripts
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 -
poketibia como colocar 2 tipos de sons diferentes na mesma area, otc
pergunta respondeu ao Developer Berg de zipter98 em Clients
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) -
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
-
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
-
poketibia como colocar 2 tipos de sons diferentes na mesma area, otc
pergunta respondeu ao Developer Berg de zipter98 em Clients
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 -
poketibia como colocar 2 tipos de sons diferentes na mesma area, otc
pergunta respondeu ao Developer Berg de zipter98 em Clients
Se possível, poste como ficou o código alterado. -
pedido [Pedido] spell de área que só aparece efeito no mostro
pergunta respondeu ao Jefferson14789 de zipter98 em Scripts
Por acaso é a magia Chakra Impulse? -
Remova estas linhas do código: if combat == COMBAT_PHYSICALDAMAGE then return false end
-
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
-
O dano será aplicado quando o Mega Scizor reaparecer em outro lugar, independente se longe ou não do alvo?
-
What? Você entra na quest por esta porta mas tenta sair da quest pela mesma porta?
-
poketibia como colocar 2 tipos de sons diferentes na mesma area, otc
pergunta respondeu ao Developer Berg de zipter98 em Clients
Ops. Troque: for i = 1, #SOUNDS do SOUNDS[i].sound = SOUNDS_CONFIG.folder .. SOUNDS[i].sound end por: 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 -
script Criar função para quest por account..
tópico respondeu ao surfnament de zipter98 em Lixeira Pública
Não. As funções que enviei o link são responsáveis por manipular storages da account. Sem elas, o código que enviei não vai funcionar.
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.