Ir para conteúdo
  • Cadastre-se

sistema reset que volte a vida e mana


Posts Recomendados

Este tópico foi movido para a área correta. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

This topic has been moved to the correct area. This is an automated message!
Please read the forum rules.

 

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Reset System" version="1.0" author="Kimoszin" contact="tibiaking.com" enabled="yes">
 
    <!-- Configuracao -->
        <config name="reset_config"><![CDATA[
                config = {
                        level = 100,                      
                        premium = false,        
                        storage = 54676,
                }
 
 				function getResets(cid)
					resets = getCreatureStorage(cid, config.storage)
					if resets < 0 then
						resets = 0
					end
					return resets
				end
				
 
                function reset(cid)
                        if (config.premium and not(isPremium(cid)) ) then
                                return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need have a premium account.")
                        end
 
                        if (getPlayerLevel(cid) < config.level) then
                                return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce precisa ser lvl "..config.level..".")
                        end
 
                        if not(getTilePzInfo(getCreaturePosition(cid))) then
                                return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce precisa estar em area pz para resetar")
                        end											  
						
					    doPlayerAddLevel(cid, - (getPlayerLevel(cid) - 8))
                        doCreatureSetStorage(cid, config.storage, getResets(cid)+1)
					    doRemoveCreature(cid)
						db.query("UPDATE `players` SET `health`= "..resethp..",`healthmax`= "..resethp.." WHERE `players`.`id`= ".. playerid .."")
						db.query("UPDATE `players` SET `mana`= "..resetmana..",`manamax`= "..resetmana.." WHERE `players`.`id`= ".. playerid .."")
						return true
                end
 

        ]]></config>
 
        <!-- Talkaction para resetar -->
        <talkaction words="!reset" event="buffer"><![CDATA[
                domodlib('reset_config')
			   if isInArray({1,2}, getPlayerVocation(cid)) then					   
				   resethp = (getResets(cid)+1)*1
				   resetmana = (getResets(cid)+1)*1
			   elseif getPlayerVocation(cid) == 3 then
				   resethp = (getResets(cid)+1)*1
				   resetmana = (getResets(cid)+1)*1
			   elseif getPlayerVocation(cid) == 4 then
				   resethp = (getResets(cid)+1)*1
				   resetmana = (getResets(cid)+1)*1
				end
				playerid = getPlayerGUID(cid)
                reset(cid)
        ]]></talkaction>
 
        <!-- Talkaction para ver quantos resets tem -->
        <talkaction words="!myresets" event="buffer"><![CDATA[
                domodlib('reset_config')
                return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Tem "..getResets(cid).." Resets.")
        ]]></talkaction>
 
        <!-- Tile -->
        <movevent type="StepIn" actionid="9911" event="script"><![CDATA[
                domodlib('reset_config')
                function onStepIn(cid, item, position, fromPosition)
                        local minResets = 1
 
                        if (not(getResets(cid) >= minResets)) then
                                doPlayerSendCancel(cid, "Desculpe, vc precisa ter "..minResets.." Resets para passar por aqui.")
                                return doTeleportThing(cid, fromPosition)
                        end
 
                        doPlayerSendCancel(cid, "Bem Vindo")
                end
        ]]></movevent>
 
        <!-- Porta -->
        <action actionid="9910" event="script"><![CDATA[
                domodlib('reset_config')
                function onUse(cid, item, position, fromPosition)
                        local minResets = 5
 
                        if not(getResets(cid) >= minResets) then
                                return doPlayerSendCancel(cid, "Desculpe, vc precisa ter "..minResets.." Resets para passar por aqui.")
                        end
 
                        doPlayerSendCancel(cid, "Bem Vindo")
                end
        ]]></action>
		
</mod>

level=100 (level necessário para reset)

resethp = (getResets(cid)+1)*1 (quanto vai ganhar de vida ao resetar, neste caso nada)

resetmana = (getResets(cid)+1)*1 (quanto de mana vai ganhar ao resetar, neste caso nada)

 

Arrumei os erros de português do script ; )

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites
13 minutos atrás, aicilopmes123 disse:

@Werner teria como voce colocar pra mim pro reset aparecer no look ? fazendo favor 

fraglook.lua

--Script By Theax "" 
function getPlayerFrags(cid) 
    local time = os.time() 
    local times = {today = (time - 86400), week = (time - (7 * 86400))} 
  
    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") 
    if(result:getID() ~= -1) then 
        repeat 
            local content = {date = result:getDataInt("date")} 
            if(content.date > times.today) then 
                table.insert(contents.day, content) 
            elseif(content.date > times.week) then 
                table.insert(contents.week, content) 
            else 
                table.insert(contents.month, content) 
            end 
        until not result:next() 
        result:free() 
    end 
  
    local size = { 
        day = table.maxn(contents.day), 
        week = table.maxn(contents.week), 
        month = table.maxn(contents.month) 
    }  
    return size.day + size.week + size.month 
end  

function getResets(cid)
	resets = getCreatureStorage(cid, 54676)
	if resets < 0 then
		resets = 0
	end
	return resets
end
  
function onLogin(cid) 
    registerCreatureEvent(cid, "fraglook") 
    return true 
end 
  
function onLook(cid, thing, position, lookDistance) 
    if isPlayer(thing.uid) and thing.uid ~= cid then 
        doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']\n[Resets: '..getResets(thing.uid)..']') 
        return true 
    elseif thing.uid == cid then 
        doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']\n[Resets: '..getResets(thing.uid)..']') 
		
        local string = 'You see yourself.' 
        if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then 
            string = string..' You are '.. getPlayerGroupName(cid) ..'.' 
        elseif getPlayerVocation(cid) ~= 0 then 
            string = string..' You are '.. getPlayerVocationName(cid) ..'.' 
        else 
            string = string..' You have no vocation.' 
        end 
        string = string..getPlayerSpecialDescription(cid)..'' 
  
        if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then 
            string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.' 
        end 
  
        if getPlayerGuildId(cid) > 0 then  
            string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) 
            string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' 
        end  
  
        if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then 
            string = string..'nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' 
            string = string..'nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' 
        end 
  
        if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then 
            string = string..'nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' 
        end 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)   
        return false 
    end 
    return true 
end

 

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo