Ir para conteúdo

Featured Replies

Postado
  • Este é um post popular.

Fala galera do TK, hoje vim trazer pra vocês um script de um server bem famoso, trata-se de nada mais e nada menos doque a Aegis of Immortal do Fox World. Quase nenhum OTserver consegue me deixar com vontade de jogar, mas se tem um que chegou bem próximo foi o Fox e o motivo é a criatividade dos caras. É muito fácil aprender lua e ser um ótimo scripter mas ter criatividade pra criar esse tipo de script é bem mais raro. Sem mais delongas vou apresentar a idéia do script e logo em seguida ensinar a instalar no seu servidor. 

 
Aegis of the Immortal
Descrição: É obtida 1 carga ao vencer o boss Aegis (aparece em invasões). Com esta técnica, o jogador ganha a aura do boss, e se morrer é teleportado para a Aegis Dimension, e após 3 segundos volta para o lugar que estava, com life e mana full como se não tivesse sido tocado. (limite de 1 carga) Tipo: (B.Skill) Vocações: All Vocations Elemento: n/a

fonte: site do fox


Well, o script é bem simpleszinho mas eu apanhei pra caramba pra fazer ele funcionar certinho (acredito que nem o script dos caras do Fox funcione da maneira correta, mas esse daqui vai funcionar)

Antes de tudo você tem que criar uma área no seu map editor e colocar ela inteira como no-pvp e no-logout. Essa vai ser a área que você vai ser teleportado, será a sua "Aegis Dimension".


35auhj5.jpg



Feito isso você vai precisar adicionar essa linha em creaturescripts.xml:

   <event type="statschange" name="reborn" script="reborn.lua"/> 

obs: eu levei muito tempo tentando fazer por onPrepareDeath mas aparentemente essa função não funciona tão bem quanto statschange e acabava chamando a si mesma repetidas vezes.

agora crie um arquivo chamado reborn.lua na pasta creaturescripts\scripts e coloque isso dentro dele:

local config = {
pos = {x=42, y=234, z=7}, -- posição da aegis dimension
tempo = 15, -- tempo pra voltar
effect1 = 66, -- efeito ao morrer
effect2 = 10, -- efeito ao retornar a vida
storage = 19332
}




function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHLOSS and value >= getCreatureHealth(cid) then
if getPlayerStorageValue(cid, config.storage) > 0 then
doPlayerSetStorageValue(cid, config.storage, (getPlayerStorageValue(cid, config.storage)-1))
addEvent(doTeleportThing, 1000*config.tempo, cid, getThingPos(cid), true)
addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(cid), config.effect2)
doSendMagicEffect(getThingPos(cid), config.effect1)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doTeleportThing(cid, config.pos)
if isCreature(attacker) then
doPlayerSendTextMessage(cid, 27, "You were killed by ".. getCreatureName(attacker) ..". Now it's time to get your REVENGE!")
end
if isPlayer(attacker) and isCreature(cid) then
doPlayerSendTextMessage(attacker, 27, "You killed ".. getCreatureName(cid) .."!")
end
for i = 1,config.tempo  do
addEvent(function()
if isCreature(cid) then
doPlayerSendTextMessage(cid,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)")
end
end, 1000*i)
end


return false
end
end
return true
end



Agora você só tem que adicionar essa linha no creaturescripts\scripts\login.lua (de preferencia antes do ultimo return true)

--- BOSS SKILLS ----
registerCreatureEvent(cid, "reborn")
if getPlayerStorageValue(cid, 19332) == -1 then
        setPlayerStorageValue(cid, 19332, 0) 
    end 

Agora seu server possui a Aegis of Immortal e você pode configurar essa skill passiva de diferentes maneiras:
1) Pode ser uma quest que dá como prêmio X quantidades dessa skill
2) Um npc que vende X quantidades da skill
3) Um item que ao ser equipado ativa a skill
4) Um boss que vc mata e ganha quantidades dela
5) Um bonus em algum evento
6) Um item de shop
etc.

Tudo que vc precisa fazer é criar um script que dê o storage 19332, o valor do storage é o numero de vezes que vc vai utilizar a skill.

aqui tem um exemplo de uma quest que ganha 5 charges da Aegis of Immortal:

function onUse(cid, item)
local storage = 19332
if getPlayerStorageValue(cid, storage) ~= 5 then
doPlayerSetStorageValue(cid, storage, 5)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have habilited your [BOSS SKILL]")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your [BOSS SKILL] is already with "..getPlayerStorageValue(cid, storage).." charges.")
end
return true
end

e aqui tem algumas fotos de como fica no seu server:


AO MORRER, SE O PLAYER TIVER A SKILL ELE VAI SUMIR E APARECERÁ O EFEITO 1
2vrvrjm.jpg




O PLAYER IRÁ PARA A POSIÇÃO ESPECIFICADA NO SCRIPT, ONDE TERÁ SUA VIDA/MANA CHEIAS E SERÁ AVISADO SOBRE QUEM O MATOU. UM CONTADOR IRÁ DIZER QUANTOS SEGUNDOS FALTAM PARA O PLAYER VOLTAR A POSIÇÃO DE SUA MORTE
34fekuv.jpg




FEITO ISSO ELE VOLTA A POSIÇÃO PARA SE VINGAR DAQUELES QUE O MATARAM.
30igrbc.jpg



 

Espero que vcs tenham gostado.. 
Vou dar 20% de Crédito pro Kilua porque sem o tutorial dele de addEvent isso daqui não seria possível e 30% pro pessoal do Fox por terem me dado a idéia do script.  :ha:
 

EDIT: Fiz um monstro q dá essa skill ao morrer, só que eu inovei um pouquinho e fiz ele tendo a skill, ou seja, vc tem que matar ele um numero X de vezes pra valer de verdade kkk A graça é que esse numero de X é inerente ao player (fiz por storage), então se um grupo de 10 pessoas for fazer e cada hora uma matar, serão (X+1) vezes no mínimo auhauhauh Só que como ele não dá loot e o unico premio dele é a skill pra quem matar X vezes, então o pessoal dá KS mesmo. Enfim, aproveitem:

creaturescripts\scripts\aegis.lua

local config = {
storagekill = 19500, --- storage q conta a quantidade de kills
storageaegis = 19332, --- storage da skill
tempo = 5, -- tempo até ele renascer
times = 2, --- quantidade de vezes que tenho que matar
charges = 1, --- cargas da skill q ganha ao matar definitivamente
effect1 = 66, -- efeito ao morrer
effect2 = 10  --- efeito ao renascer
}


function onKill(cid, target, lastHit)
local killed = getPlayerStorageValue(cid,config.storagekill)
local skill = getPlayerStorageValue(cid, config.storageaegis)


if isMonster(target) and getCreatureName(target):lower() == 'aegis' then
if killed < config.times then
doCreatureSay(target, "I'll be back mortal...", 20)
doSendMagicEffect(getThingPos(target), config.effect1)
setPlayerStorageValue(cid, config.storagekill, killed+1)
addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2)
addEvent(doCreateMonster, 1000*config.tempo, "Aegis", getCreaturePosition(target), true)
end


if killed >= config.times then
setPlayerStorageValue(cid, config.storagekill, 0)
if skill < config.charges then
doPlayerSendTextMessage(cid,22,"Congratulations, you just killed "..getCreatureName(target).." and earned Aegis of Immortal skill!")
setPlayerStorageValue(cid, config.storageaegis, config.charges)
end
end
end
return true
end

creaturescripts\scripts\login.lua
registerCreatureEvent(cid, "aegis") 
if getPlayerStorageValue(cid, 19500) == -1 then
        setPlayerStorageValue(cid, 19500, 0) 
    end 

creaturescripts.xml

<event type="kill" name="aegis" script="aegis.lua"/>

monster\aegis.xml

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Aegis" nameDescription="Aegis, the immortal" race="blood" experience="0" speed="605" manacost="0">
<health now="100000" max="100000"/>
<look type="287" head="0" body="0" legs="0" feet="0" corpse="0"/>
<targetchange interval="2000" chance="15"/>
<strategy attack="60" defense="5"/>
<flags>
<flag summonable="0"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="0"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="1"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="210" attack="260"/>
<attack name="lifedrain" interval="1000" chance="20" range="3" min="-550" max="-1050"/>
<attack name="firecondition" interval="1000" chance="7" range="2" min="-800" max="-1200">
<attribute key="shootEffect" value="fire"/>
<attribute key="areaEffect" value="yellowspark"/>
</attack>
<attack name="physical" interval="1000" chance="7" radius="6" target="0" min="-250" max="-750">
<attribute key="areaEffect" value="explosion"/>
</attack>
<attack name="death" interval="1000" chance="50" radius="5" target="0" min="-200" max="-500">
<attribute key="areaEffect" value="mortarea"/>
<attribute key="shootEffect" value="suddendeath"/>
</attack>
<attack name="firefield" interval="1000" chance="4" radius="5" target="0">
<attribute key="areaEffect" value="explosion"/>
</attack>
<attack name="fire" interval="1000" chance="34" range="7" radius="7" target="1" min="-350" max="-850">
<attribute key="shootEffect" value="fire"/>
<attribute key="areaEffect" value="firearea"/>
</attack>
<attack name="fire" interval="1000" chance="13" length="8" spread="0" min="-500" max="-1000">
<attribute key="areaEffect" value="explosion"/>
</attack>
<attack name="fire" interval="1000" chance="10" length="8" spread="3" min="-300" max="-1500">
<attribute key="areaEffect" value="firearea"/>
</attack>
</attacks>
<defenses armor="165" defense="150">
<defense name="healing" interval="1000" chance="25" min="2000" max="3000">
<attribute key="areaEffect" value="blueshimmer"/>
</defense>
<defense name="speed" interval="1000" chance="10" speedchange="1800" duration="4000">
<attribute key="areaEffect" value="redshimmer"/>
</defense>
</defenses>
<immunities>
<immunity physical="0"/>
<immunity energy="1"/>
<immunity fire="1"/>
<immunity poison="0"/>
<immunity lifedrain="1"/>
<immunity paralyze="1"/>
<immunity outfit="1"/>
<immunity drunk="1"/>
<immunity invisible="1"/>
</immunities>
<voices interval="5000" chance="50">
<voice sentence="Poor innocent, I CAN'T DIE HAHAHAHAAHA"/>
<voice sentence="Your soul will be mine!"/>
<voice sentence="MUAHAHAHAAHAHA, I TOLD YOU" yell="1"/>
</voices>
</monster>

OBS: edite ele porque eu coloquei ele muito forte, com muita vida e com muita recuperação de vida.


monster\monsters.xml

<monster name="Aegis" file="aegis.xml"/>

Editado por xWhiteWolf (veja o histórico de edições)

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)

  • Respostas 47
  • Visualizações 9.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • como assim só o verdadeiro? Aegis não sumona aegis pra ter mais de um. O restante eu posso fazer

  • ficou bem merda do jeito q vc pediu, a graça do boss era ele possuir a skill e não deixar corpse.. mas já que vc quer imitar os cara do fox então toma: no xml do monstro vc coloca o corpse: corps

  • depende muito d como seu server interpreta a function onKill..  se ele executar pra todos q ajudaram a matar vc precisa editar o aegis.lua no creaturescript e troca onde tá cid por lasthit como f

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