muito bom testando
- Forums
- OTServ
- Recursos
- Scripting
- Mods, funções e outros
- [PVP-System] Changer 1.0
[PVP-System] Changer 1.0
By Roksas, 25 de set. de 2013 in Mods, funções e outros
info
Group: Campones
Joined: 23/06/13
Posts: 32
Reputation: +1
Tibia Character: poni maldito

info
Group: Herói
Joined: 25/10/12
Posts: 2.4k
Reputation: +687
Gender: Masculino
Tibia Character: Nuncative

Parabéns Roksas, ótimo script meu jovem!! ![]()
info
Group: Herói
Joined: 12/06/12
Posts: 1k
Reputation: +362
Gender: Masculino
Tibia Character: Aarow

Muito Bom mesmo em parabéns.
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

Obrigado galera, gostaria que usassem-o ;d
info
Group: Campones
Joined: 28/03/13
Posts: 1
Reputation: 0

Cara como faz para desligar o pvp? (desligar)
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

/pvp guild, off /pvp level, 0
só coloca uma linha pro login.lua, se n vai da erro se o cara tenta attacka e nunca tiver usado a talk(o storage vai ser nil)
Edited Setembro 28 by lordbug99
info
Group: Marquês
Joined: 03/02/13
Posts: 1.2k
Reputation: +254
Gender: Masculino
Tibia Character: Partiu Baladinha

Tem um erro, ao atacar monstros, veja isso aí.
info
Group: Campones
Joined: 29/01/12
Posts: 72
Reputation: +3
Gender: Masculino
Tibia Character: Ann Seehy

Outro erro, se o player atica o PVP GUILD ON, ele não ataca os players da guild. Até ai tudo nos conformes. Mas também não ataca nenhum outro player, independente do PVP LEVEL estar em 0.
Mais uma coisa. Se o player está com o PVP GUILD ativado, e PVP LEVEL em 0, além de ele não atacar NENHUM outro player em TARGET somente, ele pega skull se da uma magia de área, entretanto, sem dar dano a nenhum player em volta.




info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino
[PVP-System] Changer 1.0
Saudações marmanjada, firmeza na tereza? Vim apresentar hoje á vocês um sistema criado por mim, uma ideia bem legal, que seria o jogador escolher quem ele pode atacar, isso por guild e/ou level. Uma solução muito prática para quem não quer atacar amigos ou newbies na war
Vá em (data/talkactions/scripts), crie um arquivo cujo nome seja pvpSys.lua e adicione dentro:
--[[ PVP-System Changer 1.0, criado por Roksas! Acesse já XTIBIA.COM ]]-- function onSay(cid, words, param) local s = string.explode(param, ",") if not s[1] then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[PVP-System] Acesso negado. É necessário que informe o tipo de PVP.") and true end --//--// if s[1] == "guild" then if not s[2] then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[PVP-System] Acesso negado. Favor informar os parâmetros {on} ou {off}.") and true end if (getPlayerGuildId(cid) < 1) or (not getPlayerGuildId(cid)) then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[PVP-System] Acesso negado. Você não pode utilizar este comando, pois não percente á nenhuma guild.") and true end if s[2] == "on" then if getPlayerStorageValue(cid, 21400) >= 1 then return doPlayerSendCancel(cid, "[PVP-System] Acesso negado. Já está ativado o seu Guild PVP.") and true end setPlayerStorageValue(cid, 21400, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[PVP-System] Você ativou o Guild PVP, agora não pode atacar players da sua guild.") elseif s[2] == "off" then if getPlayerStorageValue(cid, 21400) < 1 then return doPlayerSendCancel(cid, "[PVP-System] Acesso negado. Já está desativado o seu Guild PVP.") and true end setPlayerStorageValue(cid, 21400, -1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[PVP-System] Você desativou o Guild PVP, pode atacar os players de sua guild.") return true end return true end --//--// if s[1] == "level" then if not s[2] then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[PVP-System] Acesso negado. Favor informar o level mínimo para atacar.") and true end if tonumber(s[2]) > getPlayerLevel(cid) then return doPlayerSendCancel(cid, "[PVP-System] Acesso negado. Você não pode determinar leveis maiores que o seu.") and true end if getPlayerStorageValue(cid, 21401) == tonumber(s[2]) then return doPlayerSendCancel(cid, "[PVP-System] Acesso negado. Este level já foi determinado antes.") and true end setPlayerStorageValue(cid, 21401, tonumber(s[2])) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[PVP-System] Acesso negado. Você determinou o level mínimo para atacar ["..s[2].."].") return true end --//--// return true endNo arquivo talkactions.xml da pasta (data/talkactions), você deve adicionar a seguinte tag:
Muito bem, esta parte foi a instalação do comando utilizado, agora iremos adicionar ao nosso servidor a parte de hits e target.
Em (creaturescripts/scripts), devemos criar um arquivo com o mesmo nome, no caso, pvpSys.lua e nele, adicionar isto dentro:
function onTarget(cid, target) --//--// if getPlayerStorageValue(cid, 21400) >= 1 then if getPlayerGuildId(cid) == getPlayerGuildId(target) then return doPlayerSendCancel(cid, "[PVP-System] Você não pode atacar jogadores da mesma guild com este PVP ativado.") and false end return false end --//--// if getPlayerStorageValue(cid, 21401) >= getPlayerLevel(target) then return doPlayerSendCancel(cid, "[PVP-System] Acesso negado. Não é possível atacar jogadores com level menor que ["..getPlayerStorageValue(cid, 21401).."].") and false end return true end --//--// function onStatsChange(cid, attacker, type, combat, value) --//--// if type == STATSCHANGE_HEALTHLOSS then if getPlayerStorageValue(attacker, 21400) >= 1 then if getPlayerGuildId(attacker) == getPlayerGuildId(cid) then return false end return false end --//--// if getPlayerStorageValue(attacker, 21401) >= getPlayerLevel(cid) then return false end end return true end --//--//Na mesma pasta, podemos encontrar o arquivo login.lua, no qual adicionamos estas linhas:
Voltando uma pasta (data/creaturescripts), abriremos o arquivo creaturescripts.xml com algum editor de texto e dentro coloquemos estas tags:
É isto aêe galerinha, espero que tenham gostado e que funcione, qualquer dúvida estou aqui para respondê-los haha.
#Perfect, #GoodLuck.
Edited Abril 8 by CyberBot