Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Galera do tk!, eu tenho um servidor de WAR 8.6 queria modificar uma coisinha simples que ele tem mas nao sei onde.

 

No meu servidor quando um player mata o outro ele ganha recompensa. Exemplos abaixos

 

Atualmente: Ao matar 1 player. Recompensa: 5 Platinum Coin

Como eu gostaria: Ao matar 1 player. Recompensa: 5 Platinum Coin e 3 Talons (id:2151)

 

DEATHBROADCAST ATUAL:

 

local config = {
    affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?

    killStorageValue = 3943,
    deathStorageValue = 3944,

    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
    rewardItem = {
        use = true,
        itemid = 2152,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
    },

    killMessage = {
        use = true,
        text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
        messageClass = MESSAGE_STATUS_CONSOLE_BLUE
    },

    broadcastMessage = {
        use = true,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
        text = "|KILLERNAME| [|KILLERLEVEL|] just killed |TARGETNAME| [|TARGETLEVEL|]!",
        messageClass = MESSAGE_STATUS_WARNING
    },

    killerAnimation = {
        use = true,
        text = "Frag!", -- Only 9 letters! No "commands" here.
        color = 144
    },

    targetAnimation = {
        use = true,
        text = "Owned!", -- Only 9 letters! No "commands" here.
        color = 180
    }
}

function onDeath(cid, corpse, deathList)
    for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
        local killer = deathList
        if(isPlayer(killer) == TRUE) then
            local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
            local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
        
            local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
            local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
        
            setPlayerStorageValue(killer, config.killStorageValue, targetKills)
            setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)

            local killerLevel = getPlayerLevel(killer)
            local targetLevel = getPlayerLevel(cid)
            local levelDiff = targetLevel - killerLevel

            local values = {
                ["KILLERKILLS"]         = killerKills,
                ["KILLERDEATHS"]        = killerDeaths,
                ["KILLERNAME"]          = getCreatureName(killer),
                ["KILLERLEVEL"]         = killerLevel,
            
                ["TARGETKILLS"]         = targetKills,
                ["TARGETDEATHS"]        = targetDeaths,
                ["TARGETNAME"]          = getCreatureName(cid),
                ["TARGETLEVEL"]         = targetLevel
            }

            function formateString(str)
                return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
            end
        
            if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
                local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 5)
            end
            if(config.killMessage.use) then
                doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
            end
            if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then
                broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)
            end
            if(config.killerAnimation.use) then
                doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
            end
            if(config.targetAnimation.use) then
                doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
            end
        end
    end

    return true
end

 

 

REP+ e meus agradecimentos a quem me ajudar !

Link para o post
Compartilhar em outros sites
local config = {
    affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?
    killStorageValue = 3943,
    deathStorageValue = 3944,
    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
    rewardItem = {
        use = true,
        itemid = 2152,
		itemid2 = 2151,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
    },
    killMessage = {
        use = true,
        text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
        messageClass = MESSAGE_STATUS_CONSOLE_BLUE
    },
    broadcastMessage = {
        use = true,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
        text = "|KILLERNAME| [|KILLERLEVEL|] just killed |TARGETNAME| [|TARGETLEVEL|]!",
        messageClass = MESSAGE_STATUS_WARNING
    },
    killerAnimation = {
        use = true,
        text = "Frag!", -- Only 9 letters! No "commands" here.
        color = 144
    },
    targetAnimation = {
        use = true,
        text = "Owned!", -- Only 9 letters! No "commands" here.
        color = 180
    }
}
function onDeath(cid, corpse, deathList)
    for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
        local killer = deathList
        if(isPlayer(killer) == TRUE) then
            local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
            local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
        
            local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
            local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
        
            setPlayerStorageValue(killer, config.killStorageValue, targetKills)
            setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
            local killerLevel = getPlayerLevel(killer)
            local targetLevel = getPlayerLevel(cid)
            local levelDiff = targetLevel - killerLevel
            local values = {
                ["KILLERKILLS"]         = killerKills,
                ["KILLERDEATHS"]        = killerDeaths,
                ["KILLERNAME"]          = getCreatureName(killer),
                ["KILLERLEVEL"]         = killerLevel,
            
                ["TARGETKILLS"]         = targetKills,
                ["TARGETDEATHS"]        = targetDeaths,
                ["TARGETNAME"]          = getCreatureName(cid),
                ["TARGETLEVEL"]         = targetLevel
            }
            function formateString(str)
                return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
            end
        
            if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
                local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 5)
                doPlayerAddItem (killer, config.rewardItem.itemid2, 3)
            end
            if(config.killMessage.use) then
                doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
            end
            if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then
                broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)
            end
            if(config.killerAnimation.use) then
                doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
            end
            if(config.targetAnimation.use) then
                doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
            end
        end
    end
    return true
end

 

Editado por Talesigorvr (veja o histórico de edições)

Não dou suporte via PM, crie um tópico caso tenha dúvidas.

Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.

Link para o post
Compartilhar em outros sites

Vlw mano, tava precisando mt,Rep+. Agora você poderia me dar uma força pra quando um player matar MC não ganhar recompensa?

3 minutos atrás, Talesigorvr disse:

local config = {
    affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?
    killStorageValue = 3943,
    deathStorageValue = 3944,
    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
    rewardItem = {
        use = true,
        itemid = 2152,
		itemid2 = 2151,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
    },
    killMessage = {
        use = true,
        text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
        messageClass = MESSAGE_STATUS_CONSOLE_BLUE
    },
    broadcastMessage = {
        use = true,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
        text = "|KILLERNAME| [|KILLERLEVEL|] just killed |TARGETNAME| [|TARGETLEVEL|]!",
        messageClass = MESSAGE_STATUS_WARNING
    },
    killerAnimation = {
        use = true,
        text = "Frag!", -- Only 9 letters! No "commands" here.
        color = 144
    },
    targetAnimation = {
        use = true,
        text = "Owned!", -- Only 9 letters! No "commands" here.
        color = 180
    }
}
function onDeath(cid, corpse, deathList)
    for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
        local killer = deathList
        if(isPlayer(killer) == TRUE) then
            local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
            local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
        
            local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
            local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
        
            setPlayerStorageValue(killer, config.killStorageValue, targetKills)
            setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
            local killerLevel = getPlayerLevel(killer)
            local targetLevel = getPlayerLevel(cid)
            local levelDiff = targetLevel - killerLevel
            local values = {
                ["KILLERKILLS"]         = killerKills,
                ["KILLERDEATHS"]        = killerDeaths,
                ["KILLERNAME"]          = getCreatureName(killer),
                ["KILLERLEVEL"]         = killerLevel,
            
                ["TARGETKILLS"]         = targetKills,
                ["TARGETDEATHS"]        = targetDeaths,
                ["TARGETNAME"]          = getCreatureName(cid),
                ["TARGETLEVEL"]         = targetLevel
            }
            function formateString(str)
                return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
            end
        
            if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
                local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 5)
                doPlayerAddItem (killer, config.rewardItem.itemid2, 3)
            end
            if(config.killMessage.use) then
                doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
            end
            if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then
                broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)
            end
            if(config.killerAnimation.use) then
                doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
            end
            if(config.targetAnimation.use) then
                doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
            end
        end
    end
    return true
end

 

Vlw mano, tava precisando mt,Rep+. Agora você poderia me dar uma força pra quando um player matar MC não ganhar recompensa?

Link para o post
Compartilhar em outros sites
local config = {
    affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?
    killStorageValue = 3943,
    deathStorageValue = 3944,
    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
    rewardItem = {
        use = true,
        itemid = 2152,
		itemid2 = 2151,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
    },
    killMessage = {
        use = true,
        text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
        messageClass = MESSAGE_STATUS_CONSOLE_BLUE
    },
    broadcastMessage = {
        use = true,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
        text = "|KILLERNAME| [|KILLERLEVEL|] just killed |TARGETNAME| [|TARGETLEVEL|]!",
        messageClass = MESSAGE_STATUS_WARNING
    },
    killerAnimation = {
        use = true,
        text = "Frag!", -- Only 9 letters! No "commands" here.
        color = 144
    },
    targetAnimation = {
        use = true,
        text = "Owned!", -- Only 9 letters! No "commands" here.
        color = 180
    }
}

local function isMC (cid)
	for _, pid in pairs(getPlayersOnline()) do
		if(cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid)) then
			doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_BLUE, "MSG caso seja MC.")
		return true
		end
	end
return true
end

function onDeath(cid, corpse, deathList)
	if not isMC (cid) then
		for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
			local killer = deathList
			if(isPlayer(killer) == TRUE) then
				local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
				local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
			
				local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
				local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
			
				setPlayerStorageValue(killer, config.killStorageValue, targetKills)
				setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
				local killerLevel = getPlayerLevel(killer)
				local targetLevel = getPlayerLevel(cid)
				local levelDiff = targetLevel - killerLevel
				local values = {
					["KILLERKILLS"]         = killerKills,
					["KILLERDEATHS"]        = killerDeaths,
					["KILLERNAME"]          = getCreatureName(killer),
					["KILLERLEVEL"]         = killerLevel,
				
					["TARGETKILLS"]         = targetKills,
					["TARGETDEATHS"]        = targetDeaths,
					["TARGETNAME"]          = getCreatureName(cid),
					["TARGETLEVEL"]         = targetLevel
				}
				function formateString(str)
					return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
				end
			
				if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
					local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 5)
					doPlayerAddItem (killer, config.rewardItem.itemid2, 3)
				end
				if(config.killMessage.use) then
					doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
				end
				if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then
					broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)
				end
				if(config.killerAnimation.use) then
					doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
				end
				if(config.targetAnimation.use) then
					doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
				end
			end
		end
	end
    return true
end

 

Não dou suporte via PM, crie um tópico caso tenha dúvidas.

Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.

Link para o post
Compartilhar em outros sites
20 horas atrás, Talesigorvr disse:

Funcionou?

Mano acabei de testar, não funcionou, não esta dando nenhum dos 2 itens.

Link para o post
Compartilhar em outros sites

Você testou com o mesmo computador/mesma internet?

Não dou suporte via PM, crie um tópico caso tenha dúvidas.

Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.

Link para o post
Compartilhar em outros sites
8 horas atrás, Talesigorvr disse:

Você testou com o mesmo computador/mesma internet?

Sim, não dá nenhum error porém a pessoa não recebe o item, eu testei primeiro o deathbroad sem configuração de MC, e ele não pegou.

Editado por caioitalo1 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Esse é o único script do sistema?

Eu só adicionei duas linhas de código, uma que define o item que será adicionado e outra que adiciona o item ao player...

Não faz sentido parar de funcionar, verifique se você copiou o código inteiro.

Teste com o código antigo e com o que eu passei, para ver se o erro persiste.

Não dou suporte via PM, crie um tópico caso tenha dúvidas.

Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.

Link para o post
Compartilhar em outros sites
2 horas atrás, Talesigorvr disse:

Esse é o único script do sistema?

Eu só adicionei duas linhas de código, uma que define o item que será adicionado e outra que adiciona o item ao player...

Não faz sentido parar de funcionar, verifique se você copiou o código inteiro.

Teste com o código antigo e com o que eu passei, para ver se o erro persiste.

Irei tentar

 

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.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por LeoTK
      Salve galera neste tópico irei postar algumas prints do mapa do servidor para quem queira acompanhar e quem sabe até utilizar de inspiração para mapear o seu NTO.
       
      #Att 11/08/2022

       
       
       
       
      Konoha (Em Desenvolvimento)
       
       
       
       
    • Por DiigooMix
      Como o título já diz, será que alguém possui sprite do hitto e se possível as transformações dele?
    • Por OmegaZero
      Olá gostaria que alguém me ajudasse com uma "scripting" não sei se é pela mesma, seria o seguinte uma determinada arma teria a chance de dar double hit e não sei oque fazer alguem poderia ajudar?

      OBS:não sei se é o local correto se não for mova, desculpe
    • Por Madarasenju
      Olá galera do Tibia King, queria por uns npc's no meu server que não tem função de trade nem nada do tipo, queria que eles só andassem como enfeite, Rep+ Pra quem me ajudar... grato desde já.
    • Por SilenceRoot
      A magia é assim o você usa a a magia e ela ficará ativado por 10 segundos, até que o inimigo lance a primeira magia ou todos de uma vez, quando ele lançar a primeira magia, ele não lhe acertará ou seja esquivando dela, e logo em seguida será teletransportado aleatoriamente ao redor do inimigo que usou.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo