Muitoo Bomm !! REP +
- Forums
- OTServ
- Recursos
- Scripting
- Globalevents e Spells
- [Creaturescript] Presentes (Igual Global Wars)
[Creaturescript] Presentes (Igual Global Wars)
By SkyDangerous, 13 de dez. de 2011 in Globalevents e Spells
info
Group: Campones
Joined: 18/11/11
Posts: 28
Reputation: +1

info
Group: Campones
Joined: 15/10/11
Posts: 12
Reputation: +3
Tibia Character: Clix Zaro

muinto bom, tenho um feito aqui parecido
mias esse ai ta legal
Edited Dezembro 13 by PauloBriiito
info
Group: Lorde
Joined: 17/01/09
Posts: 2.1k
Reputation: +395
Tibia Character: Adra Sata

Existe alguns scripts parecido.
Porém esse eu fiz com ideia do servidor global wars.
info
Group: Campones
Joined: 17/08/11
Posts: 61
Reputation: 0
Tibia Character: 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+
info
Group: Infante
Joined: 13/10/08
Posts: 1.6k
Reputation: +420
Tibia Character: 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é.
info
Group: Lorde
Joined: 17/01/09
Posts: 2.1k
Reputation: +395
Tibia Character: Adra Sata

Opa ..
Malz , vou modificar lá. vlw !
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)
Edited Dezembro 15 by lordbug99
info
Group: Infante
Joined: 13/10/08
Posts: 1.6k
Reputation: +420
Tibia Character: 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.
info
Group: Lorde
Joined: 17/01/09
Posts: 2.1k
Reputation: +395
Tibia Character: Adra Sata

uauha.
beleza !
vou modificar-lo jaja quando tiver tempo .D
info
Group: Campones
Joined: 12/03/06
Posts: 26
Reputation: 0
Tibia Character: Secret

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




info
Group: Lorde
Joined: 17/01/09
Posts: 2.1k
Reputation: +395
Tibia Character: 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
depois na creaturescript.xml coloque a tag.
logo em seguida registra o evento no login.lua
Depois, só rodar e seja feliz ;D
Altere do seu jeito ;D
Edited Dezembro 14 by SkyDangerous