Ir para conteúdo
  • Cadastre-se

Anti Clone System [GlobalEvents] Shop.lua[Gesior] / CheckItens.lua


Posts Recomendados

Em GlobalEvents crie um Arquivo chamado Check.lua 

local function CheckPlayer_Items()
query = db.getResult("SELECT *, SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) AS  'serial' FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE  '%description%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) having count(*) > 1")
if (query:getID() == -1) then
textquery = "\n Check Items : Nenhum item encontrado."
print(textquery)
return true 
end
if (query:getID() ~= -1) then
text = "\n[!] -> Deleting item player_items: [Player ID: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. " - Sid: "..(query:getDataInt("sid")).." - Pid: "..(query:getDataInt("pid")).." - Itemtype: "..(query:getDataInt("itemtype")).." - Serial: " .. query:getDataString("serial") ..""
db.query("DELETE FROM  `otservs`.`player_items` WHERE  `player_items`.`player_id` =" .. (query:getDataInt("player_id")) .. " AND  `player_items`.`sid` ="..(query:getDataInt("sid")).." AND  `player_items`.`pid` ="..(query:getDataInt("pid"))..";")
db.query("DELETE FROM  `otservs`.`player_depotitems` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";")
db.query("DELETE FROM  `otservs`.`tile_items` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";")
f = io.open("data/logs/AntiClone.txt", "a+")
f:write("Player: "..text.." - " .. os.date("%d %B %Y - %X.", os.time()) .."\n\n----------------------------------------------------------\n")
f:close() 
print(text)
if (query:getID() == -1) then
textplayer_items = "\n Check Items : Todos os Items Foram Removidos."
print(textplayer_items)
return true
end
CheckPlayer_Items()
end
return true
end

local function CheckPlayer_DepotItems()
query = db.getResult("SELECT *, SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) AS  'serial' FROM player_depotitems WHERE CONVERT( attributes USING latin1 ) LIKE  '%description%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) having count(*) > 1")
if (query:getID() == -1) then
textquery = "\n Check Items : Nenhum item encontrado."
print(textquery)
return true 
end
if (query:getID() ~= -1) then
text = "\n[!] -> Deleting item player_depotitems: [Player ID: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. " - Sid: "..(query:getDataInt("sid")).." - Pid: "..(query:getDataInt("pid")).." - Itemtype: "..(query:getDataInt("itemtype")).." - Serial: " .. query:getDataString("serial") ..""
db.query("DELETE FROM  `otservs`.`player_items` WHERE  `player_items`.`player_id` =" .. (query:getDataInt("player_id")) .. " AND  `player_items`.`sid` ="..(query:getDataInt("sid")).." AND  `player_items`.`pid` ="..(query:getDataInt("pid"))..";")
db.query("DELETE FROM  `otservs`.`player_depotitems` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";")
db.query("DELETE FROM  `otservs`.`tile_items` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";")
f = io.open("data/logs/AntiClone.txt", "a+")
f:write("Player: "..text.." - " .. os.date("%d %B %Y - %X.", os.time()) .."\n\n----------------------------------------------------------\n")
f:close() 
print(text)
if (query:getID() == -1) then
textplayer_items = "\n Check Items : Todos os Items Foram Removidos."
print(textplayer_items)
return true
end
CheckPlayer_DepotItems()
end
return true
end
function onStartup()
CheckPlayer_Items()
CheckPlayer_DepotItems()
return true
end

em globalevents.xml Adicione

<globalevent name="AntiClone" type="start" event="script" value="Check.lua"/>

Para Adicionar a Opção de Verificar itens Clonados Adicione um Serial em todos os Itens Vips :

 

em shop.lua Adicione ( Modern Acc )

function onThink(interval, lastExecution, thinkInterval)

   local result = db.getResult("SELECT * FROM shop_history WHERE `processed` = 0;")
   
      if(result:getID() ~= -1) then
         while(true) do
            cid = getCreatureByName(getPlayerNameByGUID(tonumber(result:getDataInt("player"))))
            product = tonumber(result:getDataInt("product"))
            itemr = db.getResult("SELECT * FROM shop_offer WHERE `id` = "..product..";")
               if isPlayer(cid) then
local um_um = {1,2,3,4,5,6,7,8,9,0}
um = um_um[math.random(1, #um_um)]

local dois_dois = {1,2,3,4,5,6,7,8,9,0}
dois = dois_dois[math.random(1, #dois_dois)]

local tres_tres = {1,2,3,4,5,6,7,8,9,0}
tres = tres_tres[math.random(1, #tres_tres)]

local quatro_quatro = {1,2,3,4,5,6,7,8,9,0}
quatro = quatro_quatro[math.random(1, #quatro_quatro)]

                  local id = tonumber(itemr:getDataInt("item"))
                  local tid = tonumber(result:getDataInt("id"))
                  local count = tonumber(itemr:getDataInt("count"))
                  local tipe = tonumber(itemr:getDataInt("type"))
                  local productn = tostring(itemr:getDataString("name"))
                     if isInArray({5,8},tipe) then
                        if getPlayerFreeCap(cid) >= getItemWeightById(id, count) then
                           if isContainer(getPlayerSlotItem(cid, 3).uid) then
                              received = doPlayerAddItem(cid, id, count, false)
                              if received then
                              doItemSetAttribute(received, "description", ''.. productn ..' by ' .. getCreatureName(cid) .. ' [ID:' .. um .. '' .. dois .. '' .. tres .. '' .. quatro .. '].')
                                 doPlayerSendTextMessage(cid,19, "You have received >> "..productn.." << from our shop system")
                                 db.query("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";")
								f = io.open("data/logs/Shop.txt", "a+")
								f:write("Player : '".. productn .." by ".. getCreatureName(cid) .." [ID: ".. um .."".. dois .."".. tres .."".. quatro .."] Item : "..productn.." - "..getCreatureName(cid).."- " .. os.date("%d %B %Y - %X.", os.time()) .."\n----------------------------------------------------------\n")
								f:close()
                              else
                                 doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough space on container to receive >> "..productn.." <<")
                              end
                           else
                              doPlayerSendTextMessage(cid,19, "Sorry, you don't have a container to receive >> "..productn.." <<")
                           end
                        else
                           doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough capacity to receive >> "..productn.." << (You need: "..getItemWeightById(id, count).." Capacity)")
                        end
                     elseif isInArray({6,7},tipe) then
                           if tipe == 6 then
                              bcap = 8
                              bid = 1987
                           elseif tipe == 7 then
                              bcap = 20
                              bid = 1988
                           end
                           if isItemRune(id) then
                              count = 1
                           end
                           if getPlayerFreeCap(cid) >= (getItemWeightById(1987, 1) + getItemWeightById(id,count * bcap)) then
                              local bag = doCreateItemEx(bid, 1)
                                 for i = 1,bcap do
                                    doAddContainerItem(bag, id, count)
                                 end
                              received = doPlayerAddItemEx(getPlayerSlotItem(cid, 3).uid, bag)
                              if received == RETURNVALUE_NOERROR then
                                 doPlayerSendTextMessage(cid,19, "You have received >> "..productn.." << from our shop system")
                                 db.query("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";")
                              else
                                 doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough space to receive >> "..productn.." <<")
                              end
                           else
                              doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough capacity to receive >> "..productn.." << (You need: "..getItemWeightById(id, count).." Capacity)")
                           end
                     end
               end
            itemr:free()
            if not(result:next()) then
               break
            end
         end
         result:free()
      end
   return true
end

Tag : 

<globalevent name="shop" interval="3000" event="script" value="shop.lua"/>

Creditos : Emerson Henrique < DBO INFINITY>

 

Comandos e Codigos Adaptados de varios sistemas 

 

Ajuda : Arthur Luna (Ajudou no limite de Caracteres)

 

PS : Meu Shop salva na db. apenas o ID do player e não o nome essa Adaptação não vou disponibilizar.

 

Hidden Content

    Give reaction to this post to see the hidden content.
Servidor Derivado Dragon Ball Online 8.6 + Cast System + War System entre outros sistemas.

 

[ADM] Aaron

 

Autorizo modificações e Postar em Qualquer Forum, esse codigo é meu e fiz de graça e forneço de Graça.

 

PS2 : Se Possivel mudar o Titulo para 

 

Anti Clone System [GlobalEvents] Shop.lua[Modern Acc] / CheckItens.lua Editado por Emersonssss (veja o histórico de edições)

Skype : emersonaaron Se Te ajudei não me REP+ isso não muda nada! kkkkkkkkkkkk

Link para o post
Compartilhar em outros sites
  • Respostas 16
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Em GlobalEvents crie um Arquivo chamado Check.lua  local function CheckPlayer_Items() query = db.getResult("SELECT *, SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) AS 'serial' FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE '%description%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) having count(*) > 1") if (query:getID() == -1) then textquery = "\n Check Items : Nenhum item encontrado." print(textquery) return true end if (query:getID() ~= -1

Se possivel passa seu Gesior que eu faço a adaptação

:/ modern eu nao tenho, uso gesior msm :S queria adaptação pro gesior, mas bom trabalho, não vou poder testar mas vai levar meu rep pelo conteudo

Se Ajudei Rep+ pra mim ^^

tumblr_lyd1xtGgx81qf9l6uo1_500.gif

Link para o post
Compartilhar em outros sites
  Em 04/06/2014 em 11:51, Schiffert disse:

:/ modern eu nao tenho, uso gesior msm :S queria adaptação pro gesior, mas bom trabalho, não vou poder testar mas vai levar meu rep pelo conteudo

Expand   Mostrar mais  

Se possivel passa seu Gesior que eu faço a adaptação

Skype : emersonaaron Se Te ajudei não me REP+ isso não muda nada! kkkkkkkkkkkk

Link para o post
Compartilhar em outros sites

Ai Ermeson , tem como se mim ajudar velho? a coloca meu NTO OT para 8.60 com war sistema , so que com account manager tem como?

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.

  • Estatísticas dos Fóruns

    96841
    Tópicos
    519584
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo