Ir para conteúdo

Posts Recomendados

estou tentando arrumar o duel system do server mas estou tendo um probleminha, quando o server esta non-pvp e eu dou duel, msm depois do duel ativo n da pra atacar o outro poke mas quando o server esta pvp da para atacar o poke do outro player mesmo fora do duel.

Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1693886
Compartilhar em outros sites

  Em 24/05/2016 em 01:43, Justiceiro751 disse:

Alguém conseguiu arrumar o Fly ?

Expand  

fly só ir no data/movements/movements.xml

 

e adicionar os ids 11675,11676 e 11677 nessa linha:

    <movevent type="StepIn" itemid="460;1022;1023" event="script" value="fly.lua"/>

 

ficando assim:

    <movevent type="StepIn" itemid="460;1022;1023;11675-11677" event="script" value="fly.lua"/>

Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1693933
Compartilhar em outros sites

eu consegui adaptar o sistema de duel, 1x1 pelo menos, mas tive q mecher em muita coisa para deixar 10/10, vou tentar fazer um tutorial se eu conseguir compilar essa source, compilei com um dev c++ de todos jeitos mas n funcionou o .exe, vou tentar compilar com msvc2010 e depois informo aqui.

Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1693934
Compartilhar em outros sites

  Em 24/05/2016 em 21:37, Scizorgame disse:

fly só ir no data/movements/movements.xml

 

e adicionar os ids 11675,11676 e 11677 nessa linha:

    <movevent type="StepIn" itemid="460;1022;1023" event="script" value="fly.lua"/>

 

ficando assim:

    <movevent type="StepIn" itemid="460;1022;1023;11675-11677" event="script" value="fly.lua"/>

Expand  

Obrigado Scizorgame, você me ajudou muito cara.

Obrigadão mesmo cara.

Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1693944
Compartilhar em outros sites

  Em 24/05/2016 em 21:47, Scizorgame disse:

eu consegui adaptar o sistema de duel, 1x1 pelo menos, mas tive q mecher em muita coisa para deixar 10/10, vou tentar fazer um tutorial se eu conseguir compilar essa source, compilei com um dev c++ de todos jeitos mas n funcionou o .exe, vou tentar compilar com msvc2010 e depois informo aqui.

Expand  

Cara se você fizer esse tutorial contendo o sistema, irá ajudar varias pessoas aqui do fórum, seremos eternamente gratos pelo seu ato de bondade e colaboração.

Estou fazendo um projeto serio de Poketibia, irei bancar VPS, Domínio e hospedagem, caso se interessa, entre em contato comigo.

Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1693945
Compartilhar em outros sites

fiz um tutorial enquanto instalava o msvc2010 estou tendo uns problemas com o msvc mas vou postar logo o duelsystem para vocês irem testando, não sei se esta 100%

 

TUTORIAL DUEL SYSTEM BASE BOLZ 2.5

1)vai no config.lua e troque o worldType para pvp e o protectionLevel para 1000 ficando assim: 
    worldType = "pvp"
    protectionLevel = 1000

OBS: Isso vai liberar para que os players possam atacar pelo menos o summon de um dos outros.

 

2)vai em data/creaturescripts no creaturescripts.xml e adicione:
<!-- TV SYSTEM e DUEL SYSTEM -->
    <event type="joinchannel" name="WatchTv" event="script" value="tvsys.lua"/>
    <event type="leavechannel" name="StopWatchingTv" event="script" value="tvsys.lua"/>

    <event type="walk" name="WalkTv" event="script" value="tvsys.lua"/>

    <event type="textedit" name="RecordTv" event="script" value="tvsys.lua"/>
OBS: Apesar de estar como tvsystem tambem é o script responsavel para funcionar os channels do duel(1x1, numero de pokes, etc).

 

3)agora precisamos fazer funcionar para atacar só quando estiver em duel, para isso conto com a colaboração de vocês para me ajudar a relembrar
tudo que eu fiz vou postar o que eu lembro vocês testam e qualquer erro postem de preferencia com o conteudo do script que a distro acusar,
vamos trabalhar encima do storage 6598754, o que acredito eu antes liberava para atacar em duel e agora nos vamos fazer ele bloquear para não atacar
fora do duel va em data/creaturescripts/scripts no login.lua e procure pelo storage 6598754 você vai encontrar algo como:

    if not getPlayerStorageValue(cid, 6598754) == -1 or not getPlayerStorageValue(cid, 6598755) == -1 then
       setPlayerStorageValue(cid, 6598754, -1)
       setPlayerStorageValue(cid, 6598755, -1)
       doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/
       doTeleportThing(cid, posBackPVP, false)
       doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    end

na segunda linha troque o -1 por "cant" e deixe só essa e a 3ª linha, desabilite ou delete as outras linhas ficando:
    --if not getPlayerStorageValue(cid, 6598754) == -1 or not getPlayerStorageValue(cid, 6598755) == -1 then
       setPlayerStorageValue(cid, 6598754, "cant")
       setPlayerStorageValue(cid, 6598755, -1)
       --doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/
       --doTeleportThing(cid, posBackPVP, false)
       --doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
   -- end

ou só:

     setPlayerStorageValue(cid, 6598754, "cant")
     setPlayerStorageValue(cid, 6598755, -1)


4)vai em data/actions/scripts no revive.lua e procure por "if getPlayerStorageValue(cid,6598754)" bem no inicio, e delete e desabilite dali até o proximo end.
OBS:isso era uma tentativa de proteção para não usar revive em duel mas logo embaixo tem outra proteção que faz o mesmo sem dar possiveis bugs e erros
(do storage 52481).

 

5)vai em data/lib no some functions.lua procure por "function canAttackOther" e substitua toda função por:
function canAttackOther(cid, pid)         --Function q verifica se um poke/player pode atacar outro poke/player

if not isCreature(cid) or not isCreature(pid) then return "Cant" end

local master1 = isSummon(cid) and getCreatureMaster(cid) or cid
local master2 = isSummon(pid) and getCreatureMaster(pid) or pid
   
   ----             
   if getPlayerStorageValue(master1, 6598754) ~= "cant" and getPlayerStorageValue(master2, 6598754) ~= "cant" then
      if getPlayerStorageValue(master1, 6598754) ~= getPlayerStorageValue(master2, 6598754) then
         if isDuelingAgainst(master1, master2) then   --alterado v1.8
            if isSummon(cid) and isPlayer(pid) then
               return "Cant"
            else
               return "Can"
            end
         end
      end
   end
   ----              pvp system
   if getPlayerStorageValue(cid, 6598754) == "cant" then
      return "Cant"
     else
      return "Can"
   end
    -- if getPlayerStorageValue(master1, 6598754) >= 1 and getPlayerStorageValue(master2, 6598755) >= 1 then
     -- return "Can" 
    -- end
    -- if getPlayerStorageValue(master1, 6598755) >= 1 and getPlayerStorageValue(master2, 6598754) >= 1 then  ---estar em times diferentes
    --  return "Can"
    -- end
   ----
   if ehMonstro(cid) or ehMonstro(pid) then
      return "Can"
   end
   
if getTileInfo(getThingPos(cid)).pvp then
return "Can"
end

return "Cant"
end

 

6)agora em data/lib no Duel System.lua procure por "function doEndDuel" e substitua toda função por:
function doEndDuel(cid, desisto)
if isCreature(cid) then
if getPlayerStorageValue(cid, 52482) ~= -1 then
   t1 = string.explode(getPlayerStorageValue(cid, 52482), ",")
   t2 = string.explode(getPlayerStorageValue(cid, 52483), ",")
end

local invit = getPlayerByName(getPlayerStorageValue(cid, 52485))
if isCreature(invit) then
   table1 = string.explode(getPlayerStorageValue(invit, 52482), ",") 
   table2 = string.explode(getPlayerStorageValue(invit, 52483), ",")
end

if getPlayerStorageValue(cid, 52484) ~= 10 then
   if getPlayerStorageValue(cid, 52482) ~= -1 then
      for a = 1, 3 do
          local pid, sid = getPlayerByName(t1[a]), getPlayerByName(t2[a])
          if isCreature(pid) then doCreatureSetSkullType(pid, 0) doRemoveCondition(pid, CONDITION_INFIGHT) end
          if isCreature(sid) then doCreatureSetSkullType(sid, 0) doRemoveCondition(sid, CONDITION_INFIGHT) end 
          for i = 1, #storagesDuel do
              if isCreature(pid) then setPlayerStorageValue(pid, storagesDuel, -1) setPlayerStorageValue(pid, 6598754, "cant") end
              if isCreature(sid) then setPlayerStorageValue(sid, storagesDuel, -1) setPlayerStorageValue(sid, 6598754, "cant") end
          end
      end
   else
       for i = 1, #storagesDuel do
           setPlayerStorageValue(cid, storagesDuel, -1)
           setPlayerStorageValue(cid, 6598754, "cant")
       end
       doCreatureSetSkullType(cid, 0) 
       doRemoveCondition(cid, CONDITION_INFIGHT)
       ---------------------------------   
       if table2 then
          local numero = 0
          for i = 1, #table2 do
              local ppid = getPlayerByName(table2)              
              if not isCreature(ppid) or getPlayerStorageValue(ppid, 52480) ~= -1 then
                 numero = numero+1
              end
          end
          if numero == 0 then doEndDuel(invit) sendMsgToPlayer(invit, 20, "The opponents are give up! Duel is canceled!") end
       end
       --------------------------------
   end
   if desisto then doSendAnimatedText(getThingPosWithDebug(cid), "GIVE UP", COLOR_BLUE) end
   return true
end 

   for a = 1, #t1 do
       local pid, sid = getPlayerByName(t1[a]), getPlayerByName(t2[a])
       removeFromTableDuel(pid, getCreatureName(cid))
       removeFromTableDuel(sid, getCreatureName(cid))
   end 
   
   local t3 = string.explode(getPlayerStorageValue(cid, 52482), ",")
   local t4 = string.explode(getPlayerStorageValue(cid, 52483), ",")
   if (#t3 == 0 and #t4 >= 1) or (#t4 == 0 and #t3 >= 1) then  
      
      for j = 1, (#t3 > 0 and #t3 or #t4) do
          local winner = #t3 > 0 and getPlayerByName(t3[j]) or getPlayerByName(t4[j])
          if isCreature(winner) then
             addEvent(doSendAnimatedText, 500, getThingPosWithDebug(winner), "WIN", COLOR_ELECTRIC) 
             for i = 1, #storagesDuel do
                 setPlayerStorageValue(winner, storagesDuel, -1)
                 setPlayerStorageValue(winner, 6598754, "cant")
             end
             doCreatureSetSkullType(winner, 0)
             doRemoveCondition(winner, CONDITION_INFIGHT)
          end
      end
      addEvent(doSendAnimatedText, 500, getThingPosWithDebug(cid), "LOSE", COLOR_BURN)
      for i = 1, #storagesDuel do
          setPlayerStorageValue(cid, storagesDuel, -1)
          setPlayerStorageValue(cid, 6598754, "cant")
      end
      doCreatureSetSkullType(cid, 0)
      doRemoveCondition(cid, CONDITION_INFIGHT)
      
   else 
      for i = 1, #storagesDuel do
          setPlayerStorageValue(cid, storagesDuel, -1)
          setPlayerStorageValue(cid, 6598754, "cant")
      end
      doCreatureSetSkullType(cid, 0)
      doRemoveCondition(cid, CONDITION_INFIGHT)
      if desisto then
         doSendAnimatedText(getThingPosWithDebug(cid), "GIVE UP", COLOR_BLUE)
      else
         addEvent(doSendAnimatedText, 500, getThingPosWithDebug(cid), "LOSE", COLOR_BURN)
      end
   end
end
end

 

7)por ultimo va em data/lib no level system.lua procure pelo storage 6598754 e delete ou desabilite do if ao end assim:
  --  if getPlayerStorageValue(getCreatureMaster(pk), 6598754) >= 1 then
   --     setPlayerStorageValue(pk, 6598754, 1)                               
   -- elseif getPlayerStorageValue(getCreatureMaster(pk), 6598755) >= 1 then
   --     setPlayerStorageValue(pk, 6598755, 1)
   -- end

Editado por Scizorgame
Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1693947
Compartilhar em outros sites

  Em 25/05/2016 em 01:54, Scizorgame disse:

fiz um tutorial enquanto instalava o msvc2010 estou tendo uns problemas com o msvc mas vou postar logo o duelsystem para vocês irem testando, não sei se esta 100%

 

TUTORIAL DUEL SYSTEM BASE BOLZ 2.5

1)vai no config.lua e troque o worldType para pvp e o protectionLevel para 1000 ficando assim: 

    worldType = "pvp"

    protectionLevel = 1000

OBS: Isso vai liberar para que os players possam atacar pelo menos o summon de um dos outros.

 

2)vai em data/creaturescripts no creaturescripts.xml e adicione:

<!-- TV SYSTEM e DUEL SYSTEM -->

    <event type="joinchannel" name="WatchTv" event="script" value="tvsys.lua"/>

    <event type="leavechannel" name="StopWatchingTv" event="script" value="tvsys.lua"/>

    <event type="walk" name="WalkTv" event="script" value="tvsys.lua"/>

    <event type="textedit" name="RecordTv" event="script" value="tvsys.lua"/>

OBS: Apesar de estar como tvsystem tambem é o script responsavel para funcionar os channels do duel(1x1, numero de pokes, etc).

 

3)agora precisamos fazer funcionar para atacar só quando estiver em duel, para isso conto com a colaboração de vocês para me ajudar a relembrar

tudo que eu fiz vou postar o que eu lembro vocês testam e qualquer erro postem de preferencia com o conteudo do script que a distro acusar,

vamos trabalhar encima do storage 6598754, o que acredito eu antes liberava para atacar em duel e agora nos vamos fazer ele bloquear para não atacar

fora do duel va em data/creaturescripts/scripts no login.lua e procure pelo storage 6598754 você vai encontrar algo como:

    if not getPlayerStorageValue(cid, 6598754) == -1 or not getPlayerStorageValue(cid, 6598755) == -1 then

       setPlayerStorageValue(cid, 6598754, -1)

       setPlayerStorageValue(cid, 6598755, -1)

       doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/

       doTeleportThing(cid, posBackPVP, false)

       doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

    end

na segunda linha troque o -1 por "cant" e deixe só essa e a 3ª linha, desabilite ou delete as outras linhas ficando:

    --if not getPlayerStorageValue(cid, 6598754) == -1 or not getPlayerStorageValue(cid, 6598755) == -1 then

       setPlayerStorageValue(cid, 6598754, "cant")

       setPlayerStorageValue(cid, 6598755, -1)

       --doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/

       --doTeleportThing(cid, posBackPVP, false)

       --doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

   -- end

ou só:

     setPlayerStorageValue(cid, 6598754, "cant")

     setPlayerStorageValue(cid, 6598755, -1)

 

4)vai em data/actions/scripts no revive.lua e procure por "if getPlayerStorageValue(cid,6598754)" bem no inicio, e delete e desabilite dali até o proximo end.

OBS:isso era uma tentativa de proteção para não usar revive em duel mas logo embaixo tem outra proteção que faz o mesmo sem dar possiveis bugs e erros

(do storage 52481).

 

5)vai em data/lib no some functions.lua procure por "function canAttackOther" e substitua toda função por:

function canAttackOther(cid, pid)         --Function q verifica se um poke/player pode atacar outro poke/player

if not isCreature(cid) or not isCreature(pid) then return "Cant" end

local master1 = isSummon(cid) and getCreatureMaster(cid) or cid

local master2 = isSummon(pid) and getCreatureMaster(pid) or pid

   

   ----             

   if getPlayerStorageValue(master1, 6598754) ~= "cant" and getPlayerStorageValue(master2, 6598754) ~= "cant" then

      if getPlayerStorageValue(master1, 6598754) ~= getPlayerStorageValue(master2, 6598754) then

         if isDuelingAgainst(master1, master2) then   --alterado v1.8

            if isSummon(cid) and isPlayer(pid) then

               return "Cant"

            else

               return "Can"

            end

         end

      end

   end

   ----              pvp system

   if getPlayerStorageValue(cid, 6598754) == "cant" then

      return "Cant"

     else

      return "Can"

   end

    -- if getPlayerStorageValue(master1, 6598754) >= 1 and getPlayerStorageValue(master2, 6598755) >= 1 then

     -- return "Can" 

    -- end

    -- if getPlayerStorageValue(master1, 6598755) >= 1 and getPlayerStorageValue(master2, 6598754) >= 1 then  ---estar em times diferentes

    --  return "Can"

    -- end

   ----

   if ehMonstro(cid) or ehMonstro(pid) then

      return "Can"

   end

   

if getTileInfo(getThingPos(cid)).pvp then

return "Can"

end

return "Cant"

end

 

6)agora em data/lib no Duel System.lua procure por "function doEndDuel" e substitua toda função por:

function doEndDuel(cid, desisto)

if isCreature(cid) then

if getPlayerStorageValue(cid, 52482) ~= -1 then

   t1 = string.explode(getPlayerStorageValue(cid, 52482), ",")

   t2 = string.explode(getPlayerStorageValue(cid, 52483), ",")

end

local invit = getPlayerByName(getPlayerStorageValue(cid, 52485))

if isCreature(invit) then

   table1 = string.explode(getPlayerStorageValue(invit, 52482), ",") 

   table2 = string.explode(getPlayerStorageValue(invit, 52483), ",")

end

if getPlayerStorageValue(cid, 52484) ~= 10 then

   if getPlayerStorageValue(cid, 52482) ~= -1 then

      for a = 1, 3 do

          local pid, sid = getPlayerByName(t1[a]), getPlayerByName(t2[a])

          if isCreature(pid) then doCreatureSetSkullType(pid, 0) doRemoveCondition(pid, CONDITION_INFIGHT) end

          if isCreature(sid) then doCreatureSetSkullType(sid, 0) doRemoveCondition(sid, CONDITION_INFIGHT) end 

          for i = 1, #storagesDuel do

              if isCreature(pid) then setPlayerStorageValue(pid, storagesDuel, -1) setPlayerStorageValue(pid, 6598754, "cant") end

              if isCreature(sid) then setPlayerStorageValue(sid, storagesDuel, -1) setPlayerStorageValue(sid, 6598754, "cant") end

          end

      end

   else

       for i = 1, #storagesDuel do

           setPlayerStorageValue(cid, storagesDuel, -1)

           setPlayerStorageValue(cid, 6598754, "cant")

       end

       doCreatureSetSkullType(cid, 0) 

       doRemoveCondition(cid, CONDITION_INFIGHT)

       ---------------------------------   

       if table2 then

          local numero = 0

          for i = 1, #table2 do

              local ppid = getPlayerByName(table2)              

              if not isCreature(ppid) or getPlayerStorageValue(ppid, 52480) ~= -1 then

                 numero = numero+1

              end

          end

          if numero == 0 then doEndDuel(invit) sendMsgToPlayer(invit, 20, "The opponents are give up! Duel is canceled!") end

       end

       --------------------------------

   end

   if desisto then doSendAnimatedText(getThingPosWithDebug(cid), "GIVE UP", COLOR_BLUE) end

   return true

end 

   for a = 1, #t1 do

       local pid, sid = getPlayerByName(t1[a]), getPlayerByName(t2[a])

       removeFromTableDuel(pid, getCreatureName(cid))

       removeFromTableDuel(sid, getCreatureName(cid))

   end 

   

   local t3 = string.explode(getPlayerStorageValue(cid, 52482), ",")

   local t4 = string.explode(getPlayerStorageValue(cid, 52483), ",")

   if (#t3 == 0 and #t4 >= 1) or (#t4 == 0 and #t3 >= 1) then  

      

      for j = 1, (#t3 > 0 and #t3 or #t4) do

          local winner = #t3 > 0 and getPlayerByName(t3[j]) or getPlayerByName(t4[j])

          if isCreature(winner) then

             addEvent(doSendAnimatedText, 500, getThingPosWithDebug(winner), "WIN", COLOR_ELECTRIC) 

             for i = 1, #storagesDuel do

                 setPlayerStorageValue(winner, storagesDuel, -1)

                 setPlayerStorageValue(winner, 6598754, "cant")

             end

             doCreatureSetSkullType(winner, 0)

             doRemoveCondition(winner, CONDITION_INFIGHT)

          end

      end

      addEvent(doSendAnimatedText, 500, getThingPosWithDebug(cid), "LOSE", COLOR_BURN)

      for i = 1, #storagesDuel do

          setPlayerStorageValue(cid, storagesDuel, -1)

          setPlayerStorageValue(cid, 6598754, "cant")

      end

      doCreatureSetSkullType(cid, 0)

      doRemoveCondition(cid, CONDITION_INFIGHT)

      

   else 

      for i = 1, #storagesDuel do

          setPlayerStorageValue(cid, storagesDuel, -1)

          setPlayerStorageValue(cid, 6598754, "cant")

      end

      doCreatureSetSkullType(cid, 0)

      doRemoveCondition(cid, CONDITION_INFIGHT)

      if desisto then

         doSendAnimatedText(getThingPosWithDebug(cid), "GIVE UP", COLOR_BLUE)

      else

         addEvent(doSendAnimatedText, 500, getThingPosWithDebug(cid), "LOSE", COLOR_BURN)

      end

   end

end

end

 

7)por ultimo va em data/lib no level system.lua procure pelo storage 6598754 e delete ou desabilite do if ao end assim:

  --  if getPlayerStorageValue(getCreatureMaster(pk), 6598754) >= 1 then

   --     setPlayerStorageValue(pk, 6598754, 1)                               

   -- elseif getPlayerStorageValue(getCreatureMaster(pk), 6598755) >= 1 then

   --     setPlayerStorageValue(pk, 6598755, 1)

   -- end

Expand  

 

Boa, meus parabéns pela source do script Duel System, agradecemos pela colaboração, irei implementar em meu servidor agora.

Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1693948
Compartilhar em outros sites

coloquei a sprite pra otclient e tudo bem, só 1 probleminha ta mostrando o cliente ta mostrando o player com 6 pokes enquanto eles nao tem nemhum oO

criei um char fui la na rattata e logo q meu poke fica trapado o servidor crasha, acho que é pelo sistema do "grrrr"

edit 2: nao, desci sem poke e levei dano ai crashou

Editado por Josegvb
Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1694536
Compartilhar em outros sites

  Em 25/05/2016 em 01:54, Scizorgame disse:

fiz um tutorial enquanto instalava o msvc2010 estou tendo uns problemas com o msvc mas vou postar logo o duelsystem para vocês irem testando, não sei se esta 100%

 

TUTORIAL DUEL SYSTEM BASE BOLZ 2.5

1)vai no config.lua e troque o worldType para pvp e o protectionLevel para 1000 ficando assim: 

    worldType = "pvp"

    protectionLevel = 1000

OBS: Isso vai liberar para que os players possam atacar pelo menos o summon de um dos outros.

 

2)vai em data/creaturescripts no creaturescripts.xml e adicione:

<!-- TV SYSTEM e DUEL SYSTEM -->

    <event type="joinchannel" name="WatchTv" event="script" value="tvsys.lua"/>

    <event type="leavechannel" name="StopWatchingTv" event="script" value="tvsys.lua"/>

    <event type="walk" name="WalkTv" event="script" value="tvsys.lua"/>

    <event type="textedit" name="RecordTv" event="script" value="tvsys.lua"/>

OBS: Apesar de estar como tvsystem tambem é o script responsavel para funcionar os channels do duel(1x1, numero de pokes, etc).

 

3)agora precisamos fazer funcionar para atacar só quando estiver em duel, para isso conto com a colaboração de vocês para me ajudar a relembrar

tudo que eu fiz vou postar o que eu lembro vocês testam e qualquer erro postem de preferencia com o conteudo do script que a distro acusar,

vamos trabalhar encima do storage 6598754, o que acredito eu antes liberava para atacar em duel e agora nos vamos fazer ele bloquear para não atacar

fora do duel va em data/creaturescripts/scripts no login.lua e procure pelo storage 6598754 você vai encontrar algo como:

    if not getPlayerStorageValue(cid, 6598754) == -1 or not getPlayerStorageValue(cid, 6598755) == -1 then

       setPlayerStorageValue(cid, 6598754, -1)

       setPlayerStorageValue(cid, 6598755, -1)

       doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/

       doTeleportThing(cid, posBackPVP, false)

       doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

    end

na segunda linha troque o -1 por "cant" e deixe só essa e a 3ª linha, desabilite ou delete as outras linhas ficando:

    --if not getPlayerStorageValue(cid, 6598754) == -1 or not getPlayerStorageValue(cid, 6598755) == -1 then

       setPlayerStorageValue(cid, 6598754, "cant")

       setPlayerStorageValue(cid, 6598755, -1)

       --doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/

       --doTeleportThing(cid, posBackPVP, false)

       --doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

   -- end

ou só:

     setPlayerStorageValue(cid, 6598754, "cant")

     setPlayerStorageValue(cid, 6598755, -1)

 

4)vai em data/actions/scripts no revive.lua e procure por "if getPlayerStorageValue(cid,6598754)" bem no inicio, e delete e desabilite dali até o proximo end.

OBS:isso era uma tentativa de proteção para não usar revive em duel mas logo embaixo tem outra proteção que faz o mesmo sem dar possiveis bugs e erros

(do storage 52481).

 

5)vai em data/lib no some functions.lua procure por "function canAttackOther" e substitua toda função por:

function canAttackOther(cid, pid)         --Function q verifica se um poke/player pode atacar outro poke/player

if not isCreature(cid) or not isCreature(pid) then return "Cant" end

local master1 = isSummon(cid) and getCreatureMaster(cid) or cid

local master2 = isSummon(pid) and getCreatureMaster(pid) or pid

   

   ----             

   if getPlayerStorageValue(master1, 6598754) ~= "cant" and getPlayerStorageValue(master2, 6598754) ~= "cant" then

      if getPlayerStorageValue(master1, 6598754) ~= getPlayerStorageValue(master2, 6598754) then

         if isDuelingAgainst(master1, master2) then   --alterado v1.8

            if isSummon(cid) and isPlayer(pid) then

               return "Cant"

            else

               return "Can"

            end

         end

      end

   end

   ----              pvp system

   if getPlayerStorageValue(cid, 6598754) == "cant" then

      return "Cant"

     else

      return "Can"

   end

    -- if getPlayerStorageValue(master1, 6598754) >= 1 and getPlayerStorageValue(master2, 6598755) >= 1 then

     -- return "Can" 

    -- end

    -- if getPlayerStorageValue(master1, 6598755) >= 1 and getPlayerStorageValue(master2, 6598754) >= 1 then  ---estar em times diferentes

    --  return "Can"

    -- end

   ----

   if ehMonstro(cid) or ehMonstro(pid) then

      return "Can"

   end

   

if getTileInfo(getThingPos(cid)).pvp then

return "Can"

end

return "Cant"

end

 

6)agora em data/lib no Duel System.lua procure por "function doEndDuel" e substitua toda função por:

function doEndDuel(cid, desisto)

if isCreature(cid) then

if getPlayerStorageValue(cid, 52482) ~= -1 then

   t1 = string.explode(getPlayerStorageValue(cid, 52482), ",")

   t2 = string.explode(getPlayerStorageValue(cid, 52483), ",")

end

local invit = getPlayerByName(getPlayerStorageValue(cid, 52485))

if isCreature(invit) then

   table1 = string.explode(getPlayerStorageValue(invit, 52482), ",") 

   table2 = string.explode(getPlayerStorageValue(invit, 52483), ",")

end

if getPlayerStorageValue(cid, 52484) ~= 10 then

   if getPlayerStorageValue(cid, 52482) ~= -1 then

      for a = 1, 3 do

          local pid, sid = getPlayerByName(t1[a]), getPlayerByName(t2[a])

          if isCreature(pid) then doCreatureSetSkullType(pid, 0) doRemoveCondition(pid, CONDITION_INFIGHT) end

          if isCreature(sid) then doCreatureSetSkullType(sid, 0) doRemoveCondition(sid, CONDITION_INFIGHT) end 

          for i = 1, #storagesDuel do

              if isCreature(pid) then setPlayerStorageValue(pid, storagesDuel, -1) setPlayerStorageValue(pid, 6598754, "cant") end

              if isCreature(sid) then setPlayerStorageValue(sid, storagesDuel, -1) setPlayerStorageValue(sid, 6598754, "cant") end

          end

      end

   else

       for i = 1, #storagesDuel do

           setPlayerStorageValue(cid, storagesDuel, -1)

           setPlayerStorageValue(cid, 6598754, "cant")

       end

       doCreatureSetSkullType(cid, 0) 

       doRemoveCondition(cid, CONDITION_INFIGHT)

       ---------------------------------   

       if table2 then

          local numero = 0

          for i = 1, #table2 do

              local ppid = getPlayerByName(table2)              

              if not isCreature(ppid) or getPlayerStorageValue(ppid, 52480) ~= -1 then

                 numero = numero+1

              end

          end

          if numero == 0 then doEndDuel(invit) sendMsgToPlayer(invit, 20, "The opponents are give up! Duel is canceled!") end

       end

       --------------------------------

   end

   if desisto then doSendAnimatedText(getThingPosWithDebug(cid), "GIVE UP", COLOR_BLUE) end

   return true

end 

   for a = 1, #t1 do

       local pid, sid = getPlayerByName(t1[a]), getPlayerByName(t2[a])

       removeFromTableDuel(pid, getCreatureName(cid))

       removeFromTableDuel(sid, getCreatureName(cid))

   end 

   

   local t3 = string.explode(getPlayerStorageValue(cid, 52482), ",")

   local t4 = string.explode(getPlayerStorageValue(cid, 52483), ",")

   if (#t3 == 0 and #t4 >= 1) or (#t4 == 0 and #t3 >= 1) then  

      

      for j = 1, (#t3 > 0 and #t3 or #t4) do

          local winner = #t3 > 0 and getPlayerByName(t3[j]) or getPlayerByName(t4[j])

          if isCreature(winner) then

             addEvent(doSendAnimatedText, 500, getThingPosWithDebug(winner), "WIN", COLOR_ELECTRIC) 

             for i = 1, #storagesDuel do

                 setPlayerStorageValue(winner, storagesDuel, -1)

                 setPlayerStorageValue(winner, 6598754, "cant")

             end

             doCreatureSetSkullType(winner, 0)

             doRemoveCondition(winner, CONDITION_INFIGHT)

          end

      end

      addEvent(doSendAnimatedText, 500, getThingPosWithDebug(cid), "LOSE", COLOR_BURN)

      for i = 1, #storagesDuel do

          setPlayerStorageValue(cid, storagesDuel, -1)

          setPlayerStorageValue(cid, 6598754, "cant")

      end

      doCreatureSetSkullType(cid, 0)

      doRemoveCondition(cid, CONDITION_INFIGHT)

      

   else 

      for i = 1, #storagesDuel do

          setPlayerStorageValue(cid, storagesDuel, -1)

          setPlayerStorageValue(cid, 6598754, "cant")

      end

      doCreatureSetSkullType(cid, 0)

      doRemoveCondition(cid, CONDITION_INFIGHT)

      if desisto then

         doSendAnimatedText(getThingPosWithDebug(cid), "GIVE UP", COLOR_BLUE)

      else

         addEvent(doSendAnimatedText, 500, getThingPosWithDebug(cid), "LOSE", COLOR_BURN)

      end

   end

end

end

 

7)por ultimo va em data/lib no level system.lua procure pelo storage 6598754 e delete ou desabilite do if ao end assim:

  --  if getPlayerStorageValue(getCreatureMaster(pk), 6598754) >= 1 then

   --     setPlayerStorageValue(pk, 6598754, 1)                               

   -- elseif getPlayerStorageValue(getCreatureMaster(pk), 6598755) >= 1 then

   --     setPlayerStorageValue(pk, 6598755, 1)

   -- end

Expand  

 

@Scizorgame , infelizmente está ocorrendo um erro na distro quando vai tentar Duelar. Veja logo abaixo o erro e a Script que está sendo acusada.

 

Erro:

[04/06/2016 12:13:09] [Error - Action Interface]

[04/06/2016 12:13:09] data/actions/scripts/order.lua:onUse

[04/06/2016 12:13:09] Description:

[04/06/2016 12:13:09] data/actions/scripts/order.lua:81: attempt to compare string with number

[04/06/2016 12:13:09] stack traceback:

[04/06/2016 12:13:09]     data/actions/scripts/order.lua:81: in function <data/actions/scripts/order.lua:20>

 

Script:

  Mostrar conteúdo oculto

 

Link para o comentário
https://xtibia.com/forum/topic/240645-base-bolz-25-com-source/page/3/#findComment-1694643
Compartilhar em outros sites

×
×
  • Criar Novo...