Ir para conteúdo

Featured Replies

Postado

Olá pessoal do TibiaKing, Hoje trago para vocês uma Script de Reset System que encontrei, mas que tem como diferencial que ao Resetar o char não desloga.

--> É mais utilizado por Otservers como Subwat que se pega altos níveis rapidamente.

 

1- Vá na pasta do seu OT/data/talkactions e adicione esta TAG ao arquivo "talkactions.xml"

  Citar

<talkaction words="!resetar;!reset" event="script" value="reset.lua"/>

2- Após adicionar a TAG vá para data/talkaction/scripts e crie um arquivo .lua chamado reset e cole isso dentro:

  Citar

function onSay(cid, words, param, channel)

config = {
RemainingLvl=8,
exper=4200,
pid=getPlayerGUID(cid),
batle="yes"
}

function getPlayerResets(cid)
resets = getPlayerStorageValue(cid,1021)
if resets < 0 then
resets = 0
end
return resets
end

if (config.batle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")      
return TRUE
end

if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED,"Por medidas de segurança você só pode utilizar este comando em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return TRUE
end

local healthMax, manaMax = getCreatureMaxHealth(cid), getCreatureMaxMana(cid)
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 85 and getPlayerResets(cid) == 15 then
if getPlayerLevel(cid) >= 16000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 16000 ou mais para poder resetar.") 
end
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 80 and getPlayerResets(cid) == 14 then
if getPlayerLevel(cid) >= 15000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 15000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 70 and getPlayerResets(cid) == 13 then
if getPlayerLevel(cid) >= 14000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 14000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 65 and getPlayerResets(cid) == 12 then
if getPlayerLevel(cid) >= 13000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 13000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 60 and getPlayerResets(cid) == 11 then
if getPlayerLevel(cid) >= 12000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 12000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 55 and getPlayerResets(cid) == 10 then
if getPlayerLevel(cid) >= 11000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 11000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 50 and getPlayerResets(cid) == 9 then
if getPlayerLevel(cid) >= 10000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 10000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 45 and getPlayerResets(cid) == 8 then
if getPlayerLevel(cid) >= 9000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 9000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 40 and getPlayerResets(cid) == 7 then
if getPlayerLevel(cid) >= 8000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 8000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 35 and getPlayerResets(cid) == 6 then
if getPlayerLevel(cid) >= 7000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 7000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 30 and getPlayerResets(cid) == 5 then
if getPlayerLevel(cid) >= 6000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 6000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 25 and getPlayerResets(cid) == 4 then
if getPlayerLevel(cid) >= 5000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 5000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 20 and getPlayerResets(cid) == 3 then
if getPlayerLevel(cid) >= 4000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 4000 ou mais para poder resetar.") 
end
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 15 and getPlayerResets(cid) == 2 then
if getPlayerLevel(cid) >= 3000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 3000 ou mais para poder resetar.") 
end
end

----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 10 and getPlayerResets(cid) == 1 then
if getPlayerLevel(cid) >= 2000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 2000 ou mais para poder resetar.") 
end
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1021) < 5 and getPlayerResets(cid) == 0 then
if getPlayerLevel(cid) >= 1000 then 
setPlayerStorageValue(cid,1021,getPlayerResets(cid)+1) 
setPlayerStorageValue(cid,11548,os.time()+30)
doPlayerAddLevel(cid, config.RemainingLvl)
setCreatureMaxHealth(cid, healthMax)
setCreatureMaxMana(cid, manaMax)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
db.executeQuery("UPDATE `players` SET `reset` = `reset` + 1 WHERE `id` = "..config.pid)
else 
doPlayerSendCancel(cid,"Você precisa ter level 1000 ou mais para poder resetar.") 
end
end


return true
end

3- Execute a query para criar uma coluna "reset" no MySQL

  Citar

ALTER TABLE `players` ADD `reset` BIGINT(255) NOT NULL DEFAULT '0';

4- Para finalizar configuere o index.php do seu Gesior para receber a pagina PHP

  Citar

<?php
	$limitt = 100; 
	$zap = $SQL->query('SELECT `name`,`level`, `reset`  FROM `players` WHERE `group_id` < '.$config['site']['players_group_id_block'].' AND `name` != "Account Manager" ORDER BY `reset` DESC, `level` DESC LIMIT 100;'); 
	$number_of_rows = 0; 
	$main_content .= '
		<center><h2>Reset Ranking</h2></center>
		<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>
	<tr bgcolor="#af2126">
		<td><font color="white">Nome</font></td>
		<td><font color="white">Reset</font></td>
		<td><font color="white">Level</font></td>
	</tr>
	';	
	foreach($zap as $wynik) { 
	if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; }
		$number_of_rows++; 
	$main_content .= '
	<tr bgcolor="'.$bgcolor.'">
		<td>
			<a href="index.php?subtopic=characters&name='.urlencode($wynik['name']).'">
			<b> '.$wynik['name'].' </b></a>
		</td>
		<td>
			'.$wynik['reset'].'
		</td>
		<td>
			'.$wynik['level'].'
		</td>
	</tr>
		';
	}
	$main_content .= '
		</tr>	
	</table>';

?>

Para alterar a quantidade de Resets permitidos é so Remover ou Adicionar as linhas, a mesma coisa para alterar o level do RESET.

 

             Te ajudei ? Deixa aquele REP+ pra fortalecer, basta clicar em GOSTEI

                                                       housefoda.gif

                                        tk-melhor.png

  • 1 month later...

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