Ir para conteúdo

Posts Recomendados

Olá, vamos aprender agora a fazer invasão de Demons.

 

C:\Documents and Settings\USUARIO\Desktop\PASTA DO OT\data\actions\scripts

Crie um arquivo chamado: invasion.lua e coloque igual ao QUOTE abaixo.

 

--Invasion script

-- By TibiaGame Forum Xtibia

--Variables that need to be set according to your map/desire:

--topleft=the top left cordinate of the invasion area

--bottonright= the botton right cordinate of the invasion area

--maxmonsters= the maximum number of monsters that will appear. Set it "nil" for no monster limit.

--spawnrate= the chance of a monster appearing in a square of the invasion area

--species= the odds that determine what kind of monster will be summoned

-- DO NOT CHANGE THE FOLLOWING VARIABLES: checking, summonedtotal, checkforsummon.

 

function onUse(cid, item, frompos, item2, topos)

if getPlayerAccess(cid) ~=0 then

topleft={x=132, y=37, z=7}

bottonright={x=163, y=41, z=7}

maxmonsters= nil

 

checking={x=topleft.x, y=topleft.y, z=topleft.z} --Do Not Change

summonedtotal=0 --Do Not Change

 

repeat

checkforsummon=0 --Do Not Change

spawnrate=math.random(0,10)

if spawnrate==0 and summonedtotal ~= maxmonsters then

species=math.random(1,10)

 

if species == 1 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 2 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 3 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 4 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 5 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 6 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 7 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 8 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 9 then

checkforsummon = doSummonCreature("demon",checking)

elseif species == 10 then

checkforsummon = doSummonCreature("demon",checking)

else

checkforsummon = doSummonCreature("demon",checking)

end

 

-- if species<5 and species >=0 then

-- checkforsummon=doSummonCreature("dragon",checking)

-- elseif species == 5 then

-- checkforsummon=doSummonCreature("dragon lord",checking)

-- end

 

if checkforsummon~= 0 then

summonedtotal=summonedtotal+1

end

end

 

checking.x=checking.x+1

if checking.x>bottonright.x then

checking.x=topleft.x

checking.y=checking.y+1

end

until checking.y > bottonright.y

 

--doPlayerSay(cid,"/bc green "CUIDADO COM DEMONS, ESPALHADOS PELA CITY!",23)

print("Number of creatures summoned:",summonedtotal)

end

return 1

end

 

Ai eu coloque 10 Demons, se voce usa um mapa que o templo é "160 54 7" pode deixa do geito que tá, agora se voce usa Outro, apenas mude Isto:

 

topleft={x=0, y=0, z=0}

bottonright={x=0, y=0, z=0}

Cor : Está é uma mensagem para todos do ot fica ativo, que tem demon na city.

 

Depois de tudo isso, abre o seu ACTIONS.XML e adicione isto:

<action itemid="8988" script="invasion.lua" />

 

Ai no jogo voce usa: /i 8988 e da use no objeto. OBS: Só de 1 use se não vai transforma mais que 10 Demons :S.

 

ESPERO TER AJUDADO DUVIDAS/ELOGIOS ABAIXO OK!

Editado por TibiaGame
Link para o comentário
https://xtibia.com/forum/topic/107724-como-fazer-invas%C3%A3o-de-demon/
Compartilhar em outros sites

  • 4 months later...

cara isso fica dificil pros noobs saberem o que e.

poe de uma forma mais simples tipo na pasta do seu ot procura por data/actions etc....

C:\Documents and Settings\USUARIO\Desktop\PASTA DO OT\data\actions\scripts
Link para o comentário
https://xtibia.com/forum/topic/107724-como-fazer-invas%C3%A3o-de-demon/#findComment-755871
Compartilhar em outros sites

×
×
  • Criar Novo...