Ir para conteúdo
  • 0

Pergunta

Bom se alguem souber fazer ficaria legal, já vi em um servidor, você usava !mudarpvp, sem fight, ai vc trocava pra non pvp, ninguem podia te matar, e poderia trocar dps só de 3hrs, mas ao usar isso ele deixa-se a sua exp pela metade, skill e ml pela metade das rates

Link para o comentário
https://xtibia.com/forum/topic/213522-talkaction-mudar-pvp/
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Tenho um sistema do Vodkart aqui, e dou os devidos creditos a ele, vou te passar e explicar os passos (coisa que na postagem dele nao tem) para vc aplicar (eh por NPC)

 

NPC

 

 

domodlib('pvpmode_func')

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

local msg = string.lower(msg)

local config = {

price = {[0] = 100000,[1] = 300000},

level = 100,

days = 7,

storage = 321523

}

if isInArray({"change","trocar", "pvp", "pk"}, msg) then

npcHandler:say("You want "..(getPlayerPVPMode(cid) == 0 and "enable" or "disable").." your pvp now for "..config.price[getPlayerPVPMode(cid)].." gp(s)? {yes}", cid)

talkState[talkUser] = 1

elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerLevel(cid) >= config.level then

if getPlayerStorageValue(cid,config.storage) <= os.time() then

if doPlayerRemoveMoney(cid, config.price[getPlayerPVPMode(cid)]) then

setPlayerPVPMode(cid, getPlayerPVPMode(cid) == 0 and 1 or 0)

doCreatureSetSkullType(cid, getPlayerPVPMode(cid) == 1 and 1 or 0)

setPlayerStorageValue(cid, config.storage, os.time()+config.days*86400)

npcHandler:say("Now you set pvp mode to "..(getPlayerPVPMode(cid) == 0 and "off" or "on")..".", cid)

else

npcHandler:say("Sorry, You don't have money!", cid)

talkState[talkUser] = 0

end

else

npcHandler:say("Sorry, but you must wait until "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." to change your pvp again!", cid)

talkState[talkUser] = 0

end

else

npcHandler:say("Sorry, You need level "..config.level.." or more to change your pvp!", cid)

talkState[talkUser] = 0

end

elseif isInArray({"no","nao"}, msg) then

selfSay("Then not.", cid)

talkState[talkUser] = 0

npcHandler:releaseFocus(cid)

end

return TRUE

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

Explicando as lines modificaveis (continua funcionando o script porem altera algumas configuraçoes)

 

price = {[0] = 100000,[1] = 300000}, -------------- preço para ativar/desativar o pvp (no caso ele cobra 10 crystal coins para ativar e 30 pra desativar)

 

 

level = 100, obviamente eh o level para ativar e desativar pvp (que geralmente, se usa o mesmo setado pra começar o pvp na conf.lua)

 

 

days = 7, novamente obvio, os dias pra poder trocar de volta :) aki ta 1 semana no caso pode ser 1 dia trocando o 7 por 1

 

qualquer duvida ou erro comente abaixo

Link para o comentário
https://xtibia.com/forum/topic/213522-talkaction-mudar-pvp/#findComment-1515037
Compartilhar em outros sites

  • 0

Tenho um sistema do Vodkart aqui, e dou os devidos creditos a ele, vou te passar e explicar os passos (coisa que na postagem dele nao tem) para vc aplicar (eh por NPC)

 

NPC

 

 

domodlib('pvpmode_func')

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

local msg = string.lower(msg)

local config = {

price = {[0] = 100000,[1] = 300000},

level = 100,

days = 7,

storage = 321523

}

if isInArray({"change","trocar", "pvp", "pk"}, msg) then

npcHandler:say("You want "..(getPlayerPVPMode(cid) == 0 and "enable" or "disable").." your pvp now for "..config.price[getPlayerPVPMode(cid)].." gp(s)? {yes}", cid)

talkState[talkUser] = 1

elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerLevel(cid) >= config.level then

if getPlayerStorageValue(cid,config.storage) <= os.time() then

if doPlayerRemoveMoney(cid, config.price[getPlayerPVPMode(cid)]) then

setPlayerPVPMode(cid, getPlayerPVPMode(cid) == 0 and 1 or 0)

doCreatureSetSkullType(cid, getPlayerPVPMode(cid) == 1 and 1 or 0)

setPlayerStorageValue(cid, config.storage, os.time()+config.days*86400)

npcHandler:say("Now you set pvp mode to "..(getPlayerPVPMode(cid) == 0 and "off" or "on")..".", cid)

else

npcHandler:say("Sorry, You don't have money!", cid)

talkState[talkUser] = 0

end

else

npcHandler:say("Sorry, but you must wait until "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." to change your pvp again!", cid)

talkState[talkUser] = 0

end

else

npcHandler:say("Sorry, You need level "..config.level.." or more to change your pvp!", cid)

talkState[talkUser] = 0

end

elseif isInArray({"no","nao"}, msg) then

selfSay("Then not.", cid)

talkState[talkUser] = 0

npcHandler:releaseFocus(cid)

end

return TRUE

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

Explicando as lines modificaveis (continua funcionando o script porem altera algumas configuraçoes)

 

price = {[0] = 100000,[1] = 300000}, -------------- preço para ativar/desativar o pvp (no caso ele cobra 10 crystal coins para ativar e 30 pra desativar)

 

 

level = 100, obviamente eh o level para ativar e desativar pvp (que geralmente, se usa o mesmo setado pra começar o pvp na conf.lua)

 

 

days = 7, novamente obvio, os dias pra poder trocar de volta :) aki ta 1 semana no caso pode ser 1 dia trocando o 7 por 1

 

qualquer duvida ou erro comente abaixo

 

Vai levar meu rep, mas não vou usar, fica mt apelão, todos vão usar isso e ficar top sem ninguem pra poder atrapalhar nem nada alguem consegue fazer qnd tiver com NON PVP MODE ativado, ganhar metade da xp normal?

Editado por gmstrikker
Link para o comentário
https://xtibia.com/forum/topic/213522-talkaction-mudar-pvp/#findComment-1515985
Compartilhar em outros sites

  • 0

bom eu editei a linha aonde dizia pra setar a skull pra setar pra diminuir a rate, testa ae e ve se funfa...

 

 

domodlib('pvpmode_func')

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

local msg = string.lower(msg)

local config = {

price = {[0] = 100000,[1] = 300000},

level = 100,

days = 7,

rate = 0.5,

storage = 321523

}

if isInArray({"change","trocar", "pvp", "pk"}, msg) then

npcHandler:say("You want "..(getPlayerPVPMode(cid) == 0 and "enable" or "disable").." your pvp now for "..config.price[getPlayerPVPMode(cid)].." gp(s)? {yes}", cid)

talkState[talkUser] = 1

elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerLevel(cid) >= config.level then

if getPlayerStorageValue(cid,config.storage) <= os.time() then

if doPlayerRemoveMoney(cid, config.price[getPlayerPVPMode(cid)]) then

setPlayerPVPMode(cid, getPlayerPVPMode(cid) == 0 and 1 or 0)

doPlayerSetExperienceRate(cid, rate, getPlayerPVPMode(cid) == 1 and 1 or 0)

doPlayerSetExperienceRate(cid, 1.0 , getPlayerPVPMode(cid) == 0 and 1 or 0)

setPlayerStorageValue(cid, config.storage, os.time()+config.days*86400)

npcHandler:say("Now you set pvp mode to "..(getPlayerPVPMode(cid) == 0 and "off" or "on")..".", cid)

else

npcHandler:say("Sorry, You don't have money!", cid)

talkState[talkUser] = 0

end

else

npcHandler:say("Sorry, but you must wait until "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." to change your pvp again!", cid)

talkState[talkUser] = 0

end

else

npcHandler:say("Sorry, You need level "..config.level.." or more to change your pvp!", cid)

talkState[talkUser] = 0

end

elseif isInArray({"no","nao"}, msg) then

selfSay("Then not.", cid)

talkState[talkUser] = 0

npcHandler:releaseFocus(cid)

end

return TRUE

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

a modificaçao foi a seguinte

 

coloquei a rate local pra 0.5 (metade)

 

 

local config = {

price = {[0] = 100000,[1] = 300000},

level = 100,

days = 7,

rate = 0.5,

storage = 321523

}

 

 

doPlayerSetExperienceRate(cid, rate, getPlayerPVPMode(cid) == 1 and 1 or 0)

doPlayerSetExperienceRate(cid, 1.0 , getPlayerPVPMode(cid) == 0 and 1 or 0)

 

ou seja, se o pvp estiver on == 1 (variavel 1 pra ligado) e off_nopvp == variavel 0 (ou seja pvp n existe variavel 0)

 

esquece, baixei um server aqui pra testar mas n consigo falar com o npc... deixa kieto

Editado por Arpegius
Link para o comentário
https://xtibia.com/forum/topic/213522-talkaction-mudar-pvp/#findComment-1516159
Compartilhar em outros sites

  • 0

bom eu editei a linha aonde dizia pra setar a skull pra setar pra diminuir a rate, testa ae e ve se funfa...

 

 

domodlib('pvpmode_func')

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

local msg = string.lower(msg)

local config = {

price = {[0] = 100000,[1] = 300000},

level = 100,

days = 7,

rate = 0.5,

storage = 321523

}

if isInArray({"change","trocar", "pvp", "pk"}, msg) then

npcHandler:say("You want "..(getPlayerPVPMode(cid) == 0 and "enable" or "disable").." your pvp now for "..config.price[getPlayerPVPMode(cid)].." gp(s)? {yes}", cid)

talkState[talkUser] = 1

elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerLevel(cid) >= config.level then

if getPlayerStorageValue(cid,config.storage) <= os.time() then

if doPlayerRemoveMoney(cid, config.price[getPlayerPVPMode(cid)]) then

setPlayerPVPMode(cid, getPlayerPVPMode(cid) == 0 and 1 or 0)

doPlayerSetExperienceRate(cid, rate, getPlayerPVPMode(cid) == 1 and 1 or 0)

doPlayerSetExperienceRate(cid, 1.0 , getPlayerPVPMode(cid) == 0 and 1 or 0)

setPlayerStorageValue(cid, config.storage, os.time()+config.days*86400)

npcHandler:say("Now you set pvp mode to "..(getPlayerPVPMode(cid) == 0 and "off" or "on")..".", cid)

else

npcHandler:say("Sorry, You don't have money!", cid)

talkState[talkUser] = 0

end

else

npcHandler:say("Sorry, but you must wait until "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." to change your pvp again!", cid)

talkState[talkUser] = 0

end

else

npcHandler:say("Sorry, You need level "..config.level.." or more to change your pvp!", cid)

talkState[talkUser] = 0

end

elseif isInArray({"no","nao"}, msg) then

selfSay("Then not.", cid)

talkState[talkUser] = 0

npcHandler:releaseFocus(cid)

end

return TRUE

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

a modificaçao foi a seguinte

 

coloquei a rate local pra 0.5 (metade)

 

 

local config = {

price = {[0] = 100000,[1] = 300000},

level = 100,

days = 7,

rate = 0.5,

storage = 321523

}

 

 

doPlayerSetExperienceRate(cid, rate, getPlayerPVPMode(cid) == 1 and 1 or 0)

doPlayerSetExperienceRate(cid, 1.0 , getPlayerPVPMode(cid) == 0 and 1 or 0)

 

ou seja, se o pvp estiver on == 1 (variavel 1 pra ligado) e off_nopvp == variavel 0 (ou seja pvp n existe variavel 0)

 

esquece, baixei um server aqui pra testar mas n consigo falar com o npc... deixa kieto

 

Obrigado por tentar, e testar rep

pena que não conseguiu :\

Link para o comentário
https://xtibia.com/forum/topic/213522-talkaction-mudar-pvp/#findComment-1516484
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...