[Creaturescript] Presentes (Igual Global Wars)

SkyDangerous
em Globalevents e Spells

SkyDangerous

Deus Kalec
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 17/01/09Posts: 2098Char no Tibia: Adra Sata

Sem fazer nada, achei interessante essa coisa de presente lá no global wars, resolvi fazer um bem básico só para testar, fazia muito tempo que não postava nada mesmo.

 

Crie um arquivo na pasta creaturescript/scripts com nome de presentes.lua

function onAdvance(cid, skill, oldLevel, newLevel)
if getPlayerStorageValue(cid, 99963) < 1 and getPlayerLevel(cid) >= 19 then
doPlayerAddLevel(cid,30)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid,22,"Voce recebeu 30 leveis de presente")
return 1
end

if getPlayerStorageValue(cid, 99962) < 2 and getPlayerLevel(cid) >= 70 then
doPlayerAddItem(cid,2160,2)
setPlayerStorageValue(cid, 99962, 2)
doPlayerSendTextMessage(cid,22,"Voce recebeu 20k de dinheiro")
return 1
end

if getPlayerStorageValue(cid, 99961) < 3 and getPlayerLevel(cid) >= 125 then
doPlayerAddItem(cid,2160,10)
setPlayerStorageValue(cid, 99961,3)
doPlayerSendTextMessage(cid,22,"Voce recebeu 100k de dinheiro")
return 1
end

if getPlayerStorageValue(cid, 99960) < 4 and getPlayerLevel(cid) >= 200 then
doPlayerAddItem(cid,2160,20)
setPlayerStorageValue(cid, 99960,4)
doPlayerSendTextMessage(cid,22,"Voce recebeu 200k de dinheiro")
return 1
end
return TRUE
end

 

depois na creaturescript.xml coloque a tag.

<event type="advance" name="presente" event="script" value="presentes.lua"/>

 

logo em seguida registra o evento no login.lua

registerCreatureEvent(cid, "presente")

 

Depois, só rodar e seja feliz ;D

Altere do seu jeito ;D

Me segui lá (:

 

b906.png

http://ageofwar.servegame.com/

IP: ageofwar.servegame.com

TIBIA: 10.78

GLOBAL PERFECT CUSTOM

MapperTibiano

Saii Do Xtibia
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 18/11/11Posts: 28

Muitoo Bomm !! REP +

Saii Do Xtibia :s

PauloBriiito

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/10/11Posts: 12Char no Tibia: Clix Zaro

muinto bom, tenho um feito aqui parecido

mias esse ai ta legal

SkyDangerous

Deus Kalec
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 17/01/09Posts: 2098Char no Tibia: Adra Sata

Existe alguns scripts parecido.

Porém esse eu fiz com ideia do servidor global wars.

Me segui lá (:

 

b906.png

http://ageofwar.servegame.com/

IP: ageofwar.servegame.com

TIBIA: 10.78

GLOBAL PERFECT CUSTOM

hanskered

Mais épico que o Chuck Norris
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 18/08/11Posts: 61Char no Tibia: Akyles

Bom pra quem não tem. Foi um bom script, mas eu já tenho aqui :X pra quem não tem no server, depende muito também dos XP's. se for global, poe item suave xD se não perde a graça :I

enfim, mais uma vez o SkyDangerous aí ajudando a galera. REP+

[ ]1post

[ ]5 posts (SERVO)

[ ]10 posts (CAMPONÊS)

[ ]25 posts (CAÇADOR)

[ ]50 posts (CAVALEIRO)

[X]100 posts (BARONETE)

[ ]200 posts (BARÃO)

[ ]300 posts (VISCONDE)

[ ]400 posts (DUQUE)

[ ]600 posts (ARQUEDUQUE)

[ ]800 posts (ARISTOCRATA)

[ ]1000 posts (REGENTE)

[ ]1400 posts (SÁBIO)

[ ]1800 posts (SACERDOTE)

[ ]2500 posts (PRÍNCIPE)

 

---------------------------------------//---------------------------------------------------------------------------

att,xtibiahelp -Ajudando e Transformando a diversão Xtibiana

logo_new.png

funny-gifs-those-damned-pokemons.gif

Demonbholder

avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 13/10/08Posts: 1551Char no Tibia: Demonbholder

Ta errado o script. Digamos que ele vá para o level 125, fique com o storage 3 e morra ate voltar ao level 69. Ai ele chega ao 70 e ganha a recompensa de novo.

 

O certo seria:

 

 

function onAdvance(cid, skill, oldLevel, newLevel)
if getPlayerStorageValue(cid, 99963) < 1 and getPlayerLevel(cid) >= 19 then
doPlayerAddLevel(cid,30)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid,22,"Voce recebeu 30 leveis de presente")
return 1
end

if getPlayerStorageValue(cid, 99962) < 2 and getPlayerLevel(cid) >= 70 then
doPlayerAddItem(cid,2160,2)
setPlayerStorageValue(cid, 99962, 2)
doPlayerSendTextMessage(cid,22,"Voce recebeu 20k de dinheiro")
return 1
end

if getPlayerStorageValue(cid, 99961) < 3 and getPlayerLevel(cid) >= 125 then
doPlayerAddItem(cid,2160,10)
setPlayerStorageValue(cid, 99961,3)
doPlayerSendTextMessage(cid,22,"Voce recebeu 100k de dinheiro")
return 1
end

if getPlayerStorageValue(cid, 99960) < 4 and getPlayerLevel(cid) >= 200 then
doPlayerAddItem(cid,2160,20)
setPlayerStorageValue(cid, 99960,4)
doPlayerSendTextMessage(cid,22,"Voce recebeu 200k de dinheiro")
return 1
end
return TRUE
end

 

Trocar o sinal de ~= por <. Até.

Oie :D

SkyDangerous

Deus Kalec
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 17/01/09Posts: 2098Char no Tibia: Adra Sata

Opa ..

Malz , vou modificar lá. vlw !

Me segui lá (:

 

b906.png

http://ageofwar.servegame.com/

IP: ageofwar.servegame.com

TIBIA: 10.78

GLOBAL PERFECT CUSTOM

Vinc

The white fox
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/10/11Posts: 625Gênero: Masculino

@SkyDangerous

algumas dicas

1º n é nessesario 4 storages

2º ponha "if skill == SKILL__LEVEL then" pra,n fica checando toda ves que o player ganha um skill ou ml

3º nesse caso melhor usa "newlevel" do que usa getplayerlevel(obs: se for usa essa parte tenque usa o if acima)

^w^

Demonbholder

avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 13/10/08Posts: 1551Char no Tibia: Demonbholder

nossa, eu achei que vc tivesse usado o mesmo storage, por isso eu corrigi o seu script, mas se for usar 4 storages, pode usar o sinal de ~= sim.

 

mas o mais aconselhável é usar só 1 storage.

Oie :D

SkyDangerous

Deus Kalec
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 17/01/09Posts: 2098Char no Tibia: Adra Sata

uauha.

beleza !

 

vou modificar-lo jaja quando tiver tempo .D

Me segui lá (:

 

b906.png

http://ageofwar.servegame.com/

IP: ageofwar.servegame.com

TIBIA: 10.78

GLOBAL PERFECT CUSTOM

ThalesGodoi

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 12/03/06Posts: 26Char no Tibia: Secret

quando o player atinge lvl 19 ele pula para lvl 629 e no console da um erro overflow algo assim

oque será?

[GOD] Thales


Http://thaneo.sytes.net
Mapa Global FULL
150 Players+
24 Horas