Ir para conteúdo

[Killer Up] pvp-e mata player e upar 854+


Posts Recomendados

esse sistema funciona assim você mata um player e upa só que vc não upa sozinho upa junto com os seus colegas q ajudou mata player igual os ot 840 que tem pvp-e

exemplo

idx0ed.jpg

todos que atacou test x upo mesmo sendo só notle que mato

você vai ter uma lista que pode ser checada você pode ataca ate 5 player e se um deles for morto você vai upa tbm

aqui lista a baixo eu ataquei esses 5 players se um deles morre vai sair da lista e vc vai poder ataca outro e se lista tiver com os 5 e vc ataca outro o primeiro da lista sair e vem o novo assim por diante

1hzdlf.jpg

pra instalar vai em

data\talkactions\scripts

e

cria listplayer.lua

coloca isso la

 

 

--configuration by uotl£
local t = {frase="     Checado Lista De Players",id=5669,storage=2828} -- usa a mesma storage dos outros script
--configuration by uotl£

function onSay(cid, words, param, channel)
    return doShowTextDialog(cid,t.id,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "..t.frase.." \66\121 \78\111\116\108\101\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \n 1 - " ..
    string.explode(getPlayerStorageValue(cid, t.storage), ",")[1]..
    "\n 2 - "..string.explode(getPlayerStorageValue(cid, t.storage), ",")[2]..
    "\n 3 - "..string.explode(getPlayerStorageValue(cid, t.storage), ",")[3]..
    "\n 4 - "..string.explode(getPlayerStorageValue(cid, t.storage), ",")[4]..
    "\n 5 - "..string.explode(getPlayerStorageValue(cid, t.storage), ",")[5].."\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") and true
end

talkactions.xml

<talkaction words="!checklist" event="script" value="listplayer.lua"/>

para check usa !checklist

 

 

agora vai em

data\creaturescripts\scripts\

cria

addplayer.lua

coloca isso la

 

 

--configuration by uotl£
local config = {
tempo = 1, -- aqui quantos minutos vc tem pra mata player (exemplo se passar 3 minutos e player não morre e ele morre dps os outros upa e vc não)
storage = 2828} -- storage tem que ser a mesma do outro script
--configuration by uotl£

function onCombat(cid, target)
    local stg = string.explode(getPlayerStorageValue(cid, config.storage), ",")
    local gcn,check = getCreatureName(target),getPlayerStorageValue(cid, config.storage+1)

    for i = 1, #stg do
        if getCreatureName(target) == stg[i] then
            return true
        end
    end

    if isPlayer(target) then
        if (getPlayerStorageValue(cid, config.storage) == "a,a,a,a,a," and getPlayerStorageValue(cid, config.storage+1) == -1) or getPlayerStorageValue(cid, config.storage+1) == -1 then
            setPlayerStorageValue(cid,config.storage,gcn..","..stg[2]..","..stg[3]..","..stg[4]..","..stg[5]..",")
            setPlayerStorageValue(cid, config.storage+1,1)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,1)
        elseif stg[2] == "a" then
            setPlayerStorageValue(cid,config.storage,stg[1]..","..gcn..","..stg[3]..","..stg[4]..","..stg[5]..",")
            setPlayerStorageValue(cid, config.storage+1,2)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,2)
        elseif stg[3] == "a"  then
            setPlayerStorageValue(cid,config.storage,stg[1]..","..stg[2]..","..gcn..","..stg[4]..","..stg[5]..",")
            setPlayerStorageValue(cid, config.storage+1,3)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,3)
        elseif stg[4] == "a"  then
            setPlayerStorageValue(cid,config.storage,stg[1]..","..stg[2]..","..stg[3]..","..gcn..","..stg[5]..",")
            setPlayerStorageValue(cid, config.storage+1,4)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,4)
        elseif stg[5] == "a"  then
            setPlayerStorageValue(cid,config.storage,stg[1]..","..stg[2]..","..stg[3]..","..stg[4]..","..gcn..",")
            setPlayerStorageValue(cid, config.storage+1,-1)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,5)
        elseif check == 1 then
            setPlayerStorageValue(cid,config.storage,stg[1]..","..gcn..","..stg[3]..","..stg[4]..","..stg[5]..",")
            setPlayerStorageValue(cid, config.storage+1,2)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,2)
        elseif check == 2 then
            setPlayerStorageValue(cid,config.storage,stg[1]..","..stg[2]..","..gcn..","..stg[4]..","..stg[5]..",")
            setPlayerStorageValue(cid, config.storage+1,3)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,3)
        elseif check == 3 then
            setPlayerStorageValue(cid,config.storage,stg[1]..","..stg[2]..","..stg[3]..","..gcn..","..stg[5]..",")
            setPlayerStorageValue(cid, config.storage+1,4)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,4)
        elseif check == 4 then
            setPlayerStorageValue(cid,config.storage,stg[1]..","..stg[2]..","..stg[3]..","..stg[4]..","..gcn..",")
            setPlayerStorageValue(cid, config.storage+1,-1)
            addEvent(onRemoverStoragePlayer,config.tempo*60*1000,cid,5)
            return true
        end
        return true
    end
    return true
end


function onRemoverStoragePlayer(cid,Value)
    if (not isPlayer(cid)) then
        return true
    end

    if Value == 1 then
        setPlayerStorageValue(cid,config.storage, "a,"..
        string.explode(getPlayerStorageValue(cid, config.storage), ",")[2]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[3]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[4]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[5]..
        ",")
    elseif Value == 2 then
        setPlayerStorageValue(cid,config.storage,string.explode(getPlayerStorageValue(cid, config.storage), ",")[1]..
        ",a,"..string.explode(getPlayerStorageValue(cid, config.storage), ",")[3]..","..
        string.explode(getPlayerStorageValue(cid, config.storage), ",")[4]..","..
        string.explode(getPlayerStorageValue(cid, config.storage), ",")[5]..",")
    elseif Value == 3 then
        setPlayerStorageValue(cid,config.storage,string.explode(getPlayerStorageValue(cid, config.storage), ",")[1]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[2]..
        ",a,"..string.explode(getPlayerStorageValue(cid, config.storage), ",")[4]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[5]..
        ",")
    elseif Value == 4 then
        setPlayerStorageValue(cid,config.storage,string.explode(getPlayerStorageValue(cid, config.storage), ",")[1]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[2]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[3]..
        ",a,"..string.explode(getPlayerStorageValue(cid, config.storage), ",")[5]..
        ",")
    elseif Value == 5 then
        setPlayerStorageValue(cid,config.storage,string.explode(getPlayerStorageValue(cid, config.storage), ",")[1]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[2]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[3]..
        ","..string.explode(getPlayerStorageValue(cid, config.storage), ",")[4]..
        ",a,")
    end
    return true
end

login.lua

adiciona isso

registerCreatureEvent(cid, "addplayer")

creaturescripts.xml

adiciona isso

<event type="combat" name="addplayer" script="addplayer.lua"/>

 

 

agora vai em

data\creaturescripts\scripts

cria playerkiller.lua

coloca isso la

 

 

local config = {storage = 2828,porcentagem = 10}
local online = {}
function onKill(cid, target, lastHit)
    if isPlayer(target) then
        for sinal, valor in ipairs(getPlayersOnline()) do
            online[sinal] = valor
        end

        for oo = 1, (#online) do
            A = oo
            exp = (getPlayerExperience(target)/config.porcentagem)
            for numero = 1,5 do
                B = numero
                onCheckAssasino (cid, target, lastHit)
            end
        end
    end
    return true
end


function onCheckAssasino (cid, target, lastHit)
    if string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1] == getCreatureName(target) then
        setPlayerStorageValue(online[A],config.storage, "a,"..
        string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]..
        ",")
        doPlayerAddExp(online[A], exp)
        doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
		doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
        onCheckPos (cid, target, lastHit)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2] == getCreatureName(target) then
        setPlayerStorageValue(online[A],config.storage,string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1]..
        ",a,"..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]..","..
        string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]..","..
        string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]..",")
        doPlayerAddExp(online[A], exp)
        doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
		doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
        onCheckPos (cid, target, lastHit)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3] == getCreatureName(target) then
        setPlayerStorageValue(online[A],config.storage,string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2]..
        ",a,"..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]..
        ",")
        doPlayerAddExp(online[A], exp)
        doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
		doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
        onCheckPos (cid, target, lastHit)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4] == getCreatureName(target) then
        setPlayerStorageValue(online[A],config.storage,string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]..
        ",a,"..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]..
        ",")
        doPlayerAddExp(online[A], exp)
        doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
		doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
        onCheckPos (cid, target, lastHit)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5] == getCreatureName(target) then
        setPlayerStorageValue(online[A],config.storage,string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]..
        ","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]..
        ",a,")
        doPlayerAddExp(online[A], exp)
        doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
		doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
        onCheckPos (cid, target, lastHit)
        return true
    end
    return true
end

function onCheckPos (cid, target, lastHit)
    if string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2] == "a" then
        setPlayerStorageValue(online[A], config.storage+1,1)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]  == "a" then
        setPlayerStorageValue(online[A], config.storage+1,2)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]  == "a" then
        setPlayerStorageValue(online[A], config.storage+1,3)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]  == "a" then
        setPlayerStorageValue(online[A], config.storage+1,4)
        if string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2] ~= "a"
        and string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3] ~= "a"
        and string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4] ~= "a" and
        string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5] ~= "a" then
        return true
    end
    return true
end
return true
end

login.lua

adiciona isso

registerCreatureEvent(cid, "playerkiller")

creaturescripts.xml

<event type="Kill" name="playerkiller" script="playerkiller.lua"/>

 

 

e por FIM

 

 

login.lua

adiciona isso de baixo da primeira function

local storagex = 2828
setPlayerStorageValue(cid,storagex, "a,a,a,a,a,")
setPlayerStorageValue(cid,storagex+1, -1)

 

 

Esse Sistema é Exclusivo Para o Xtibia, Não autorizo a publicação em outros fórums.

Editado por notle2012
Link para o comentário
Compartilhar em outros sites

Tem como por uma restrição de level para poder começar a ganhar xp ?

exemplo : um player level 300 só poderá matar outro player level 300 ou acima para ganhar xp
assim evitaria matar level 100 ou player abaixo do 300 para para upar e fica bugando ...

Link para o comentário
Compartilhar em outros sites

Tem como por uma restrição de level para poder começar a ganhar xp ?

 

exemplo : um player level 300 só poderá matar outro player level 300 ou acima para ganhar xp

assim evitaria matar level 100 ou player abaixo do 300 para para upar e fica bugando ...

 

blz só usa esse aqui

e editar level em config

playerkiller.lua

 

 

--configuration by uotl£
local config = {storage = 2828, -- storage tem que ser a mesma storage em todos scripts
porcentagem = 10, -- aqui porcetagem que upa 10% do level do q morreu
level = 100 -- aqui ate level 100 menor (exemplo level 400 mata level 300 ainda upa agora 299 não upa)

}
--configuration by uotl£
local online = {}
function onKill(cid, target, lastHit)
    if isPlayer(target) then
        for sinal, valor in ipairs(getPlayersOnline()) do
            online[sinal] = valor
        end

        for oo = 1, (#online) do
            A = oo
            exp = (getPlayerExperience(target)/config.porcentagem)
            for numero = 1,5 do
                B = numero
                onCheckAssasino (cid, target, lastHit)
            end
        end
    end
    return true
end


function onCheckAssasino (cid, target, lastHit)
if (getPlayerLevel(target)+config.level) >= getPlayerLevel(online[A]) then
	if string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1] == getCreatureName(target) then
			setPlayerStorageValue(online[A],config.storage, "a,"..
			string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]..
			",")
			doPlayerAddExp(online[A], exp)
			doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
			doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
			onCheckPos (cid, target, lastHit)
		elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2] == getCreatureName(target) then
			setPlayerStorageValue(online[A],config.storage,string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1]..
			",a,"..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]..","..
			string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]..","..
			string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]..",")
			doPlayerAddExp(online[A], exp)
			doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
			doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
			onCheckPos (cid, target, lastHit)
		elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3] == getCreatureName(target) then
			setPlayerStorageValue(online[A],config.storage,string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2]..
			",a,"..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]..
			",")
			doPlayerAddExp(online[A], exp)
			doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
			doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
			onCheckPos (cid, target, lastHit)
		elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4] == getCreatureName(target) then
			setPlayerStorageValue(online[A],config.storage,string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]..
			",a,"..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]..
			",")
			doPlayerAddExp(online[A], exp)
			doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
			doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
			onCheckPos (cid, target, lastHit)
		elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5] == getCreatureName(target) then
			setPlayerStorageValue(online[A],config.storage,string.explode(getPlayerStorageValue(online[A], config.storage), ",")[1]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]..
			","..string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]..
			",a,")
			doPlayerAddExp(online[A], exp)
			doSendAnimatedText(getPlayerPosition(online[A]),exp,215)
			doPlayerSendTextMessage(online[A], MESSAGE_STATUS_CONSOLE_BLUE, "Upoo ["..getCreatureName(target).."] ".."foi morto por ["..getCreatureName(cid).."]")
			onCheckPos (cid, target, lastHit)
			return true
		end
		return true
	end
   return true
end


function onCheckPos (cid, target, lastHit)
    if string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2] == "a" then
        setPlayerStorageValue(online[A], config.storage+1,1)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3]  == "a" then
        setPlayerStorageValue(online[A], config.storage+1,2)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4]  == "a" then
        setPlayerStorageValue(online[A], config.storage+1,3)
    elseif string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5]  == "a" then
        setPlayerStorageValue(online[A], config.storage+1,4)
        if string.explode(getPlayerStorageValue(online[A], config.storage), ",")[2] ~= "a"
        and string.explode(getPlayerStorageValue(online[A], config.storage), ",")[3] ~= "a"
        and string.explode(getPlayerStorageValue(online[A], config.storage), ",")[4] ~= "a" and
        string.explode(getPlayerStorageValue(online[A], config.storage), ",")[5] ~= "a" then
        return true
    end
    return true
end
return true
end

 

 

Editado por notle2012
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...