Ir para conteúdo
  • 0

SelfDestruction - bug - atke pz


kbpaulo

Pergunta

tenho problema com esse spell

 

 

 

 

elseif spell == "Selfdestruct" then
                                         
local function death(cid)
if isCreature(cid) then
  if pokeHaveReflect(cid) then return true end    --alterado v1.6
  doCreatureAddHealth(cid, -getCreatureMaxHealth(cid))
end
end


        doMoveInArea2(cid, 5, selfArea1, NORMALDAMAGE, min, max, spell)    --alterado v1.6
        addEvent(death, 300, cid)

Eles esta acertando os player em protect zone e mesmo com o servidor em no-pvp ele mata digimon dos outros players... alguem pode ajudar a nao acerta no pz e nao atka o player de outros player se o servidor tiver no modo no-pvp...
Link para o comentário
Compartilhar em outros sites

9 respostass a esta questão

Posts Recomendados

  • 0
elseif spell == "Selfdestruct" then
                                         
local function death(cid)
if isCreature(cid) then
if getTilePzInfo(getCreaturePosition(cid)) then return true end
  if pokeHaveReflect(cid) then return true end    --alterado v1.6
  doCreatureAddHealth(cid, -getCreatureMaxHealth(cid))
end
end


        doMoveInArea2(cid, 5, selfArea1, NORMALDAMAGE, min, max, spell)    --alterado v1.6
        addEvent(death, 300, cid)

tenta ai

Link para o comentário
Compartilhar em outros sites

  • 0

 

 

function doMoveInArea2(cid, eff, area, element, min, max, spell, ret)
if not isCreature(cid) then return true end
   
   local pos = getPosfromArea(cid, area)  --alterado v1.8
   setPlayerStorageValue(cid, 21101, -1) 
   
   local skills = {"Skull Bash", "Gust", "Water Pulse", "Stick Throw", "Overheat", "Toxic", "Take Down", "Gyro Ball"} --alterado v1.7
   local n = 0 
   local l = 0


while n < #pos do
if not isCreature(cid) then return true end 
if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end   
if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end


   n = n+1
   thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
   local pid = getThingFromPosWithProtect(thing)
   ----
   if pid ~= cid then
   if spell and isInArray(skills, spell) then
      if spell == "Stick Throw" then
         addEvent(sendEffWithProtect, l*300, cid, pos[n], eff)
         addEvent(sendMoveBack, 1200, cid, pos, eff, min, max)
         addEvent(doMoveDano2, l*300, cid, pid, element, min, max, ret, spell) --alterado v1.6  
      elseif spell and spell == "Gyro Ball" then   --alterado v1.7
         pos[n].x = pos[n].x+1
         addEvent(sendEffWithProtect, l*200, cid, pos[n], eff)
         addEvent(doMoveDano2, l*200, cid, pid, element, min, max, ret, spell) 
      else
         addEvent(sendEffWithProtect, l*200, cid, pos[n], eff)
         addEvent(doMoveDano2, l*200, cid, pid, element, min, max, ret, spell)  --alterado v1.6  
      end
   elseif spell and spell == "Epicenter" then
      local random = math.random(50, 500)   
      addEvent(sendEffWithProtect, random, cid, pos[n], eff)
      addEvent(doDanoWithProtect, random, cid, GROUNDDAMAGE, pos[n], crusher, -min, -max, 255)
   elseif spell and spell == "Shadowave" then
      posi = {x=pos[n].x, y=pos[n].y+1, z=pos[n].z}
      sendEffWithProtect(cid, posi, eff)
      doMoveDano2(cid, pid, element, min, max, ret, spell) --alterado v1.6 
   elseif spell and spell == "Surf" then
      addEvent(sendEffWithProtect, math.random(50, 500), cid, pos[n], eff)
      addEvent(doMoveDano2, 400, cid, pid, element, min, max, ret, spell)  --alterado v1.6 
   elseif spell and spell == "Sand Attack" then
      addEvent(sendEffWithProtect, n*200, cid, pos[n], eff)
      addEvent(doMoveDano2, n*200, cid, pid, element, min, max, ret, spell) --alterado v1.6 
   elseif spell and (spell == "Muddy Water" or spell == "Venom Motion") then
      local arr = {
      [1] = 0, [2] = 0, [3] = 0, [4] = 200, [5] = 200, [6] = 200, [7] = 400, [8] = 400, [9] = 400, [10] = 600, [11] = 600,
      [12] = 600, [13] = 800, [14] = 800, [15] = 800
      }


      local time = {0, 200, 400, 600, 800}
             
      addEvent(sendEffWithProtect, arr[n], cid, pos[n], eff)
      addEvent(doMoveDano2, arr[n], cid, pid, element, min, max, ret, spell)
   elseif spell and (spell == "Inferno" or spell == "Fissure" or spell == "Volcano Burst") then  --alterado v1.8
      addEvent(sendEffWithProtect, math.random(0, 500), cid, pos[n], eff)
      addEvent(doMoveDano2, math.random(0, 500), cid, pid, element, min, max, ret, spell)     
   else
      sendEffWithProtect(cid, pos[n], eff)
      doMoveDano2(cid, pid, element, min, max, ret, spell) 
   end
   end
   l = l+1
end
end
---

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

 

 

-------------------------------------------
function doMoveDano2(cid, pid, element, min, max, ret, spell)
if isCreature(pid) and isCreature(cid) and cid ~= pid then
   if isNpcSummon(pid) and getCreatureTarget(pid) ~= cid then
      return true                             --alterado v1.6
   end
   if ehNPC(pid) then return true end
   ---
   local canAtk = true     --alterado v1.6
   if getPlayerStorageValue(pid, 21099) >= 1 then
      doSendMagicEffect(getThingPosWithDebug(pid), 135)
      doSendAnimatedText(getThingPosWithDebug(pid), "REFLECT", COLOR_GRASS)
      addEvent(docastspell, 100, pid, spell)
      if getCreatureName(pid) == "Wobbuffet" then
         doRemoveCondition(pid, CONDITION_OUTFIT)    
      end
      canAtk = false
      setPlayerStorageValue(pid, 21099, -1)
      setPlayerStorageValue(pid, 21100, 1)
      setPlayerStorageValue(pid, 21101, cid)
      setPlayerStorageValue(pid, 21103, getTableMove(cid, getPlayerStorageValue(cid, 21102)).f)
   end
   ---   
   if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
   if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
      if isSummon(cid) and (ehMonstro(pid) or (isSummon(pid) and canAttackOther(cid, pid) == "Can") or (isPlayer(pid) and canAttackOther(cid, pid) == "Can" and #getCreatureSummons(pid) <= 0)) and pid ~= cid then
         if canAtk then     --alterado v1.6
            if ret and ret.cond then
               ret.id = pid
               ret.check = getPlayerStorageValue(pid, conds[ret.cond])
               doCondition2(ret)
            end
            if spell == "Selfdestruct" then
               if getPlayerStorageValue(pid, 9658783) <= 0 then
                  doSendAnimatedText(getThingPosWithDebug(pid), "-"..max.."", COLOR_NORMAL)
                  doCreatureAddHealth(pid, -max)    --alterado v1.6
               end
            else
               doTargetCombatHealth(cid, pid, element, -(math.abs(min)), -(math.abs(max)), 255)
            end
         end
      elseif ehMonstro(cid) and (isSummon(pid) or (isPlayer(pid) and #getCreatureSummons(pid) <= 0)) and pid ~= cid then
         if canAtk then    --alterado v1.6
            if ret and ret.cond then
               ret.id = pid
               ret.check = getPlayerStorageValue(pid, conds[ret.cond])
               doCondition2(ret)
            end
            if spell == "Selfdestruct" then
               if getPlayerStorageValue(pid, 9658783) <= 0 then
                  doSendAnimatedText(getThingPosWithDebug(pid), "-"..max.."", COLOR_NORMAL)
                  doCreatureAddHealth(pid, -max)    --alterado v1.6
               end
            else
               doTargetCombatHealth(cid, pid, element, -(math.abs(min)), -(math.abs(max)), 255)
            end
         end
      elseif isPlayer(cid) and ehMonstro(pid) and pid ~= cid then
         if canAtk then    --alterado v1.6
            if ret and ret.cond then
               ret.id = pid
               ret.check = getPlayerStorageValue(pid, conds[ret.cond])
               doCondition2(ret)
            end
            if spell == "Selfdestruct" then
               if getPlayerStorageValue(pid, 9658783) <= 0 then
                  doSendAnimatedText(getThingPosWithDebug(pid), "-"..max.."", COLOR_NORMAL)
                  doCreatureAddHealth(pid, -max)    --alterado v1.6
               end
            else
               doTargetCombatHealth(cid, pid, element, -(math.abs(min)), -(math.abs(max)), 255)
            end
         end
      end
end
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

na funcao doMoveInArea2, está assim:

if pid ~= cid then

Deixe assim:

if pid ~= cid then
   if getTilePzInfo(getCreaturePosition(pid)) then return true end
Editado por Wuva
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...