Postado Agosto 4, 2014 10 anos Autor o kawarimi defensive funcionou certinho, mas o kawarimi attack ele faz a distro parar de funcionar, não aparece nenhum erro ela apenas para de funcionar, porque será?
Postado Agosto 4, 2014 10 anos creaturescripts.xml <event type="statschange" name="defensive2" event="script" value="defensive2.lua"/> login.lua ---------- Defensive 2 ---------------- registerCreatureEvent(cid, "defensive2") if getPlayerStorageValue(cid, 3482102) < 0 then setPlayerStorageValue(cid, 3482102, 0) end defensive2.lua: local config = { storage = 3482102, effect1 = 2, --- efeito ao ser atacado e teleportar percent = 30 -- porcentagem de esquivar } function onStatsChange(cid, attacker, type, combat, value) if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then if getPlayerStorageValue(cid,config.storage) > 0 and isCreature(attacker) and math.random(1,100) <= config.percent then doSendMagicEffect(getCreaturePosition(cid), config.effect1) doTeleportThing(cid, getCreaturePosition(attacker), false) doTargetCombatHealth(cid, attacker, 1, -50, -100, 255) setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) - 1) doPlayerSendTextMessage(cid, 20, "You have now ".. getPlayerStorageValue(cid, config.storage) .." charge(s).") return true end end return true end spells.xml: <instant name="kawarimi no jutsu attack" words="kawarimi no jutsu attack" lvl="16" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/kawarimiattack.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> kawarimiattack.lua local config = { storage = 3482102, cooldown = 3, --- tempo entre um uso e outro maxcharge = 20, --- máximo de cargas que dá pra acumular effect1 = 29 -- efeito que sai ao falar a spell } function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) >= 20 then doPlayerSendCancel(cid, "You already reached the max of charges for this skill.") return false end if os.time() - getPlayerStorageValue(cid, 55700) >= config.cooldown then setPlayerStorageValue(cid, 55700, os.time()) doSendMagicEffect(getCreaturePosition(cid), config.effect1) setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) + 1) doPlayerSendTextMessage(cid, 27, "You have now ".. getPlayerStorageValue(cid, config.storage) .." charge(s).") else doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55700))).." seconds.") return false end return true end Quando eu falei em duplicar tudo e mudar os nomes/storages era isso que eu tava falando.. Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Agosto 4, 2014 10 anos Autor eu fiz isso e só para ter certeza refiz copiando o seu porém ainda da erro, a distro para de funcionar quando ele usa
Postado Agosto 4, 2014 10 anos você deve estar tentando usar vários creaturescripts no mesmo char e isso tá bugando seu server... testa cada um separadamente. Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Maio 26, 2016 9 anos Em 04/08/2014 at 00:16, xWhiteWolf disse: creaturescripts.xml <event type="statschange" name="defensive2" event="script" value="defensive2.lua"/> login.lua ---------- Defensive 2 ---------------- registerCreatureEvent(cid, "defensive2") if getPlayerStorageValue(cid, 3482102) < 0 then setPlayerStorageValue(cid, 3482102, 0) end defensive2.lua: local config = { storage = 3482102, effect1 = 2, --- efeito ao ser atacado e teleportar percent = 30 -- porcentagem de esquivar } function onStatsChange(cid, attacker, type, combat, value) if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then if getPlayerStorageValue(cid,config.storage) > 0 and isCreature(attacker) and math.random(1,100) <= config.percent then doSendMagicEffect(getCreaturePosition(cid), config.effect1) doTeleportThing(cid, getCreaturePosition(attacker), false) doTargetCombatHealth(cid, attacker, 1, -50, -100, 255) setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) - 1) doPlayerSendTextMessage(cid, 20, "You have now ".. getPlayerStorageValue(cid, config.storage) .." charge(s).") return true end end return true end spells.xml: <instant name="kawarimi no jutsu attack" words="kawarimi no jutsu attack" lvl="16" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/kawarimiattack.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> kawarimiattack.lua local config = { storage = 3482102, cooldown = 3, --- tempo entre um uso e outro maxcharge = 20, --- máximo de cargas que dá pra acumular effect1 = 29 -- efeito que sai ao falar a spell } function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) >= 20 then doPlayerSendCancel(cid, "You already reached the max of charges for this skill.") return false end if os.time() - getPlayerStorageValue(cid, 55700) >= config.cooldown then setPlayerStorageValue(cid, 55700, os.time()) doSendMagicEffect(getCreaturePosition(cid), config.effect1) setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) + 1) doPlayerSendTextMessage(cid, 27, "You have now ".. getPlayerStorageValue(cid, config.storage) .." charge(s).") else doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55700))).." seconds.") return false end return true end Quando eu falei em duplicar tudo e mudar os nomes/storages era isso que eu tava falando.. Man voce poderia editar essa script assim, voce ativa a Spell e fica 5 segundos sem receber nenhum dano e fica um effect em cima do player( so funfa em player e não em mobs.)
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.