Ir para conteúdo
Banner com Efeitos

Featured Replies

  • Respostas 14
  • Visualizações 3.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • 1-  creaturescripts.xml <event type="statschange" name="defensive1" event="script" value="defensive1.lua"/> login.lua ---------- Defensive 1 ---------------- registerCreatureEvent(cid, "

  • oque eu perguntei é oque vc quis dizer com essa %... é tipo 30% de chance de esquivar (não tomar dano) e remover 1 carga da spell ou seria algo como esquivar apenas 30% do dano?

  • vou fazer e colocar um máximo que o player pode stackar pra evitar que o cara deixe no bot stackando infinitos dodges hahaha.. vou colocar 20 por padrão

Postado

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

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado

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

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

  • 1 year later...
Postado
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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo