Ir para conteúdo
  • Cadastre-se

Posts Recomendados

ola geral, eu estou pegando 1 erro no meu distro q faz o meu server ficar muiiiiiiiito lagado, msm com 3 players da um lag horrivel

 

o erro é o siguente:

 

[07/07/2015 13:00:18] [Error - CreatureScript Interface] 
[07/07/2015 13:00:19] data/creaturescripts/scripts/exp2.0.lua:onStatsChange
[07/07/2015 13:00:19] Description: 
[07/07/2015 13:00:19] data/lib/clan system.lua:286: attempt to index field '?' (a nil value)
[07/07/2015 13:00:20] stack traceback:
[07/07/2015 13:00:20] data/lib/clan system.lua:286: in function 'getClanPorcent'
[07/07/2015 13:00:20] data/creaturescripts/scripts/exp2.0.lua:457: in function <data/creaturescripts/scripts/exp2.0.lua:64>
 
isso começa a dar spam la no distro e o servidor fica lagado demais
 
o meu exp2.0:

local combats = {                        
[PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC},
[GRASSDAMAGE] = {cor = COLOR_GRASS},
[POISONEDDAMAGE] = {cor = COLOR_GRASS},
[FIREDAMAGE] = {cor = COLOR_FIRE2},                         
[bURNEDDAMAGE] = {cor = COLOR_BURN},
[WATERDAMAGE] = {cor = COLOR_WATER},
[iCEDAMAGE] = {cor = COLOR_ICE},
[NORMALDAMAGE] = {cor = COLOR_NORMAL},
[FLYDAMAGE] = {cor = COLOR_FLYING},           
[GHOSTDAMAGE] = {cor = COLOR_GHOST},
[GROUNDDAMAGE] = {cor = COLOR_GROUND},
[ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC},
[ROCKDAMAGE] = {cor = COLOR_ROCK},
[bUGDAMAGE] = {cor = COLOR_BUG},
[FIGHTDAMAGE] = {cor = COLOR_FIGHTING},
[DRAGONDAMAGE] = {cor = COLOR_DRAGON},
[POISONDAMAGE] = {cor = COLOR_POISON},
[DARKDAMAGE] = {cor = COLOR_DARK},               
[sTEELDAMAGE] = {cor = COLOR_STEEL},
[MIRACLEDAMAGE] = {cor = COLOR_PSYCHIC},  
[DARK_EYEDAMAGE] = {cor = COLOR_GHOST},
[sEED_BOMBDAMAGE] = {cor = COLOR_GRASS},
[sACREDDAMAGE] = {cor = COLOR_FIRE2}, 
}
 
local function sendPlayerDmgMsg(cid, text)
if not isCreature(cid) then return true end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, text)
end
 
local races = {
[4] = {cor = COLOR_FIRE2},
[6] = {cor = COLOR_WATER},
[7] = {cor = COLOR_NORMAL},
[8] = {cor = COLOR_FIRE2},
[9] = {cor = COLOR_FIGHTING},
[10] = {cor = COLOR_FLYING},
[11] = {cor = COLOR_GRASS},
[12] = {cor = COLOR_POISON},
[13] = {cor = COLOR_ELECTRIC},
[14] = {cor = COLOR_GROUND},
[15] = {cor = COLOR_PSYCHIC},
[16] = {cor = COLOR_ROCK},
[17] = {cor = COLOR_ICE},
[18] = {cor = COLOR_BUG},
[19] = {cor = COLOR_DRAGON},
[20] = {cor = COLOR_GHOST},
[21] = {cor = COLOR_STEEL},
[22] = {cor = COLOR_DARK},
[1] = {cor = 180},
[2] = {cor = 180},
[3] = {cor = 180},
[5] = {cor = 180},
}
 
local damages = {GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE, DARKDAMAGE, STEELDAMAGE}
local fixdmgs = {PSYCHICDAMAGE, COMBAT_PHYSICALDAMAGE, GRASSDAMAGE, FIREDAMAGE, WATERDAMAGE, ICEDAMAGE, NORMALDAMAGE, GHOSTDAMAGE}
local ignored = {POISONEDDAMAGE, BURNEDDAMAGE}                
local cannotkill = {BURNEDDAMAGE, POISONEDDAMAGE}
 
function onStatsChange(cid, attacker, type, combat, value)
 
if combat == FLYSYSTEMDAMAGE then return false end
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV
 
if not isCreature(attacker) then  
if not isInArray(fixdamages, combat) and combats[combat] then
doSendAnimatedText(getThingPos(cid), value, combats[combat].cor)
end
return true
end
 
local damageCombat = combat
--------------------------------------------------
if type == STATSCHANGE_HEALTHGAIN then
if cid == attacker then
return true
end
if isSummon(cid) and isSummon(attacker) and canAttackOther(cid, attacker) == "Cant" then
return false
end
return true
end
--------------------------------------------------
if isMonster(cid) then
local valor = value
   if not pokes[getCreatureName(cid)] and damageCombat == COMBAT_PHYSICALDAMAGE then
      valor = getOffense(attacker) * playerDamageReduction
      doCreatureAddHealth(cid, -math.abs(valor), 3, races[7].cor)                       
      return false
   elseif not pokes[getCreatureName(cid)] and damageCombat ~= COMBAT_PHYSICALDAMAGE then
      doCreatureAddHealth(cid, -math.abs(valor), 3, combats[damageCombat].cor)
      return false
   end
end
--------------------------------------------------
if isPlayer(attacker) then
 
local valor = value
if valor > getCreatureHealth(cid) then
valor = getCreatureHealth(cid)
end
 
if combat == COMBAT_PHYSICALDAMAGE then
return false
end
 
if combat == PHYSICALDAMAGE then
doSendMagicEffect(getThingPos(cid), 3)
doSendAnimatedText(getThingPos(cid), valor, races[getMonsterInfo(getCreatureName(cid)).race].cor)
end
 
if combats[damageCombat] and not isInArray(fixdmgs, damageCombat) then
doSendAnimatedText(getThingPos(cid), valor, combats[damageCombat].cor)
end
 
if #getCreatureSummons(attacker) >= 1 and not isInArray({POISONEDDAMAGE, BURNEDDAMAGE}, combat) then
doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "Your "..getPokeName(getCreatureSummons(attacker)[1]).." dealt "..valor.." damage to "..getSomeoneDescription(cid)..".")
end
 
return true
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) >= 1 and type == STATSCHANGE_HEALTHLOSS then
return false                                                                           
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then
 
if isSummon(attacker) or isPlayer(attacker) then
   if canAttackOther(cid, attacker) == "Cant" then return false end
end
 
local valor = 0
if combat == COMBAT_PHYSICALDAMAGE then
valor = getOffense(attacker)
else
valor = getSpecialAttack(attacker)
end
 
valor = valor * playerDamageReduction
valor = valor * math.random(83, 117) / 100
 
if valor >= getCreatureHealth(cid) then
valor = getCreatureHealth(cid)
end
 
valor = math.floor(valor)
 
    if valor >= getCreatureHealth(cid) then
       if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
          setPlayerStorageValue(cid, 6598754, -1)
          setPlayerStorageValue(cid, 6598755, -1)
          doRemoveCondition(cid, CONDITION_OUTFIT)             
          doTeleportThing(cid, posBackPVP, false)
             doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
          return false --alterado v1.8
       end
       
       if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
          doRemoveCondition(cid, CONDITION_OUTFIT)
          setPlayerStorageValue(cid, 17000, 0)
          setPlayerStorageValue(cid, 17001, 0)
          setPlayerStorageValue(cid, 63215, -1) 
          doChangeSpeed(cid, PlayerSpeed)
          local item = getPlayerSlotItem(cid, 8)
          local btype = getPokeballType(item.itemid)
          if #getCreatureSummons(cid) <= 0 then
      if isInArray(pokeballs[btype].all, item.itemid) then
     doTransformItem(item.uid, pokeballs[btype].off)
     doItemSetAttribute(item.uid, "hp", 0)
             end
          end
       end
 
 
      ------------Edited Golden Arena------------------   --alterado v1.7 \/\/
      if getPlayerStorageValue(cid, 22545) == 1 then
         if getGlobalStorageValue(22550) == 1 then
            doPlayerSendTextMessage(cid, 20, "You are the last survivor of the golden arena! Take your reward!")
            doPlayerAddItem(cid, 2152, getPlayerStorageValue(cid, 22551)*50)
            doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 60)
            setPlayerStorageValue(cid, 22545, -1)
            doTeleportThing(cid, getClosestFreeTile(cid, getClosestFreeTile(cid, posBackGolden)), false)  
            doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
            setPlayerRecordWaves(cid)     
            endGoldenArena()
            return false --alterado v1.8           
         else
             setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
             setPlayerStorageValue(cid, 22545, -1)
             doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)    
             doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
             setPlayerRecordWaves(cid)     
             return true
         end 
     end
     -------------------------------------------    /\/\ 
 
       local corpse = doCreateItem(3058, 1, getThingPos(cid))
       doDecayItem(corpse)
       doItemSetAttribute(corpse, "pName", getCreatureName(cid))          --alterado v1.7 coloca corpse quando o player morre!
       doItemSetAttribute(corpse, "attacker", getCreatureName(attacker))
       doItemSetAttribute(corpse, "article", getPlayerSex(cid) == 0 and "She" or "He")
       
       if getPlayerStorageValue(cid, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) <= 10 then
          setPlayerStorageValue(cid, Agatha.stoIni, -1)
          setPlayerStorageValue(cid, Agatha.stoRec, -1)
          setPlayerStorageValue(cid, Agatha.stoPer, -1)
          setPlayerStorageValue(cid, Agatha.stoEni, -1)        --alterado v1.9  agatha quest
          setPlayerStorageValue(cid, Agatha.stoRes, -1)
       end 
    end
doCreatureAddHealth(cid, -valor, 3, 180)
 
local possafi = {x=1152,y=1412,z=7}
       if getPlayerStorageValue(cid, 98796) >= 1 then
          setPlayerStorageValue(cid, 98796, -1) 
          setPlayerStorageValue(cid, 98797, -1)                      --alterado v1.8
             doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
          doTeleportThing(cid, possafi, false)
          doSendMagicEffect(getThingPos(cid), 21)
          doPlayerSendTextMessage(cid, 27, "You die in the saffari... Best luck in the next time!")
          return false --alterado v1.8
       end
 
 
local posquest = {x=1084,y=1713,z=10}
       if getPlayerStorageValue(cid, 121212) >= 1 then
          setPlayerStorageValue(cid, 121212, -1) 
          setPlayerStorageValue(cid, 12123, -1) 
             doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
          doTeleportThing(cid, posquest, false)
          doPlayerSendTextMessage(cid, 27, "You die in the Master Quest... Good Luck in Next Time!")
          return false --alterado v1.8
       end
 
if not isPlayer(cid) then
  addEvent(sendPlayerDmgMsg, 5, cid, "You lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end
return false
end
--------------------------------------------------
if isMonster(attacker) and getPlayerStorageValue(attacker, 201) ~= -1 then
if isPlayer(cid) then
return false
end
if getPlayerStorageValue(getCreatureMaster(cid), ginasios[getPlayerStorageValue(attacker, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
if isMonster(cid) and getPlayerStorageValue(cid, 201) ~= -1 then
if getPlayerStorageValue(getCreatureMaster(attacker), ginasios[getPlayerStorageValue(cid, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
if ehMonstro(cid) and ehMonstro(attacker) and not isSummon(cid) and not isSummon(attacker) then 
return false                                          --alterado v1.9 /\
end
--------------------------------------------------
--------------------REFLECT-----------------------
if getPlayerStorageValue(cid, 21099) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then
   if not isInArray({"Team Claw", "Team Slice"}, getPlayerStorageValue(attacker, 21102)) then
      doSendMagicEffect(getThingPosWithDebug(cid), 135)
      doSendAnimatedText(getThingPosWithDebug(cid), "REFLECT", COLOR_GRASS)
      addEvent(docastspell, 100, cid, getPlayerStorageValue(attacker, 21102))
      if getCreatureName(cid) == "Wobbuffet" then
         doRemoveCondition(cid, CONDITION_OUTFIT)    
      end
      setPlayerStorageValue(cid, 21099, -1)                    
      setPlayerStorageValue(cid, 21100, 1)
      setPlayerStorageValue(cid, 21101, attacker)
      setPlayerStorageValue(cid, 21103, getTableMove(attacker, getPlayerStorageValue(attacker, 21102)).f)
      setPlayerStorageValue(cid, 21104, getCreatureOutfit(attacker).lookType)
      return false
   end
end
-------------------------------------------------
 
local multiplier = 1
 
   if isCreature(cid) then
      poketype1 = pokes[getCreatureName(cid)].type        
      poketype2 = pokes[getCreatureName(cid)].type2
   end
   if not poketype1 or not poketype2 then return false end  
   
if getCreatureCondition(cid, CONDITION_INVISIBLE) then
return false
end
if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
if isInArray(effectiveness[damageCombat].super, poketype1) then
multiplier = multiplier + 0.5
end
if isInArray(effectiveness[damageCombat].super, poketype2) then
multiplier = multiplier + 0.5
end
if isInArray(effectiveness[damageCombat].weak, poketype1) then    
multiplier = multiplier - 0.25
end
if isInArray(effectiveness[damageCombat].weak, poketype2) then
multiplier = multiplier - 0.25
end
if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
      if isInArray(specialabilities["foresight"], getCreatureName(attacker)) then   
         multiplier = 0.5                 
      end                         --alterado v1.6
    end
elseif combat == COMBAT_PHYSICALDAMAGE then
if isGhostPokemon(cid) then               
       if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then  --passiva Foresight!!
          doSendMagicEffect(getThingPos(cid), 3)     
     return false
       end
    end
local cd = getPlayerStorageValue(attacker, conds["Miss"])
        local cd2 = getPlayerStorageValue(attacker, conds["Confusion"]) 
        local cd3 = getPlayerStorageValue(attacker, conds["Stun"]) 
        if cd >= 0 or cd2 >= 0 or cd3 >= 0 then
           if math.random(1, 100) > 50 then  
     doSendMagicEffect(getThingPos(cid), 211)
     doSendAnimatedText(getThingPos(attacker), "MISS", 215)         
     return false
           end
        end
end
--------------------------------------------------
local valor = value
 
if multiplier == 1.5 and poketype2 == "no type" then
        multiplier = 2                                         
    elseif multiplier == 1.5 and poketype2 ~= "no type" then
    multiplier = 1.75       
elseif multiplier == 1.25 then    
multiplier = 1    
end
 
--------------------------------------------------
    if isSummon(cid) and isSummon(attacker) then
        if getCreatureMaster(cid) == getCreatureMaster(attacker) then
           return false
        end
if canAttackOther(cid, attacker) == "Cant" then
           return false
        end
end
 
valor = valor * multiplier
 
if isSummon(attacker) then
valor = valor * getHappinessRate(attacker)
else
valor = valor * summonReduction
end
                                                              
valor = math.floor(valor)                                 
 
if combat == COMBAT_PHYSICALDAMAGE then
       
       local value = getOffense(attacker) > 1000 and 3 or 2
       block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid))) --alterado v1.9 testem essa nova formula plzzz '--'
   valor = (getOffense(attacker)/value) * block
  
   if valor <= 0 then
     valor = math.random(5, 10) --alterado v1.9
       end
  
       if isInArray(specialabilities["counter"], getCreatureName(cid)) then
     if math.random(1, 100) <= 10 then
        doCreatureAddHealth(attacker, -valor, 3, 180)    
        valor = 0
        doSendAnimatedText(getThingPosWithDebug(cid), "COUNTER", 215)
          end
       end      
    else
       valor = valor / getDefense(cid)
    end
    
    -------------------------Edited CLAN SYSTEM-----------------------------------
    if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then
       valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk")                           
    elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then
       valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2))
    end
    -----------------------------------------------------------------------
    ---------------------- FEAR / ROAR ------------------------------------
    if getPlayerStorageValue(attacker, conds["Fear"]) >= 1 then         
    return true
    end
--------------------------------------------------------------------------
if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
   if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
      if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then     
         valor = valor * 0                      
      end
   end
end
 
if damageCombat == GROUNDDAMAGE then
   if isInArray(specialabilities["levitate"], getCreatureName(cid)) then
      valor = 0                      
   end
end
-----------------------------------------------------------------------------
local p = getThingPos(cid)                     
if p.x == 1 and p.y == 1 and p.z == 10 then
return false                                    
end
 
if getPlayerStorageValue(cid, 9658783) == 1 then
return false     --imune
end
-----------------------------------------------------------------------------
 
--------------- FIGHT MODE -----------------------
if useOTClient then
if isSummon(cid) then                                  
   local master = getCreatureMaster(cid)
   if getPlayerStorageValue(master, 248759) == 1 then
      valor = valor * 1.1
   elseif getPlayerStorageValue(master, 248759) == 3 then
      valor = valor * 0.9
   end
end
if isSummon(attacker) then
   local master = getCreatureMaster(attacker)
   if getPlayerStorageValue(master, 248759) == 1 then
      valor = valor * 1.1
   elseif getPlayerStorageValue(master, 248759) == 3 then
      valor = valor * 0.9
   end
end 
end   
-----------------------------------------------------------------------------
if valor >= getCreatureHealth(cid) then
if isInArray(cannotKill, combat) and isPlayer(cid) then
valor = getCreatureHealth(cid) - 1
else
valor = getCreatureHealth(cid)
end
end
valor = math.floor(valor)            
 
------------------ SKILLs Q CURAM O ATTACKER ---------------------------------
local function doHeal(cid, amount)
if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
   amount = math.abs(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
end
if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then           
   doCreatureAddHealth(cid, amount)
   doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65) 
end
end
          
if damageCombat == PSYCHICDAMAGE or damageCombat == MIRACLEDAMAGE then
   if getPlayerStorageValue(attacker, 95487) >= 1 then
      doHeal(attacker, valor)
      setPlayerStorageValue(attacker, 95487, -1)                  
   end
elseif damageCombat == SEED_BOMBDAMAGE then
   doHeal(attacker, valor)
end
--------------------------------------------
----------SACRED FIRE-----------------------
if combat == SACREDDAMAGE and not ehNPC(cid) then    
   local ret = {}
   ret.id = cid
   ret.cd = 9
   ret.check = getPlayerStorageValue(cid, conds["Silence"])
   ret.eff = 39
   ret.cond = "Silence"
 
   doCondition2(ret)
elseif combat == MUDBOMBDAMAGE and not ehNPC(cid) then
   local ret = {}                                        
   ret.id = cid
   ret.cd = 9
   ret.eff = 34
   ret.check = getPlayerStorageValue(cid, conds["Miss"])
   ret.spell = "Mud Bomb"       --alterado v1.9
   ret.cond = "Miss"
   
   doCondition2(ret)
end
---------------------------------------------
--------------Passiva Lifesteal Clobat------------
if combat == COMBAT_PHYSICALDAMAGE then
   if getCreatureName(attacker) == "Crobat" then                    
      doCreatureAddHealth(attacker, math.floor(valor))
      doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(valor), 30)
   end
end
--------------------------------------------
    valor = math.abs(valor)    --alterado v1.9
    if isSummon(attacker) then
if combat == COMBAT_PHYSICALDAMAGE then
doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
addEvent(doDoubleHit, 1000, attacker, cid, valor, races)      
else
doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255)
end
else
if combat ~= COMBAT_PHYSICALDAMAGE then
doCreatureAddHealth(cid, -valor, 3, combats[damageCombat].cor)  
else
            addEvent(doDoubleHit, 1000, attacker, cid, valor, races)   
        end
 
if isSummon(cid) and valor ~= 0 then
addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end
 
end
 
if damageCombat == FIREDAMAGE and not isBurning(cid) then
  local ret = {}
  ret.id = cid
  ret.cd = math.random(5, 12)
  ret.check = getPlayerStorageValue(cid, conds["Burn"])
  ret.damage = isSummon(attacker) and getMasterLevel(attacker)+getPokemonBoost(attacker) or getPokemonLevel(attacker)
  ret.cond = "Burn"
  
  doCondition2(ret)
    elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then
       local ret = {}
  ret.id = cid
  ret.cd = math.random(6, 15)
  ret.check = getPlayerStorageValue(cid, conds["Poison"])
  local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
       ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2)
  ret.cond = "Poison"
  
  doCondition2(ret)
    end
--[[---------------CD BAR-----------------------
if isSummon(cid) then
   doCreatureExecuteTalkAction(getCreatureMaster(cid), "/pokeread")
end  ]]
------------------------------------POTIONS-------------------------------------------
if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
   if getPlayerStorageValue(cid, 173) >= 1 then
      if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
         setPlayerStorageValue(cid, 173, -1)  
         doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
      end
   end
end
----------------------------------------PASSIVAS-------------------------------------  
-------------------------------------------Counter Helix------------------------------------
if passivesChances["Helix"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Helix"][getCreatureName(cid)] then
   docastspell(cid, "Counter Helix")
end
-------------------------------------------Lava Counter/Electricity----------------------------
if passivesChances["Fire_Thunder"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Fire_Thunder"][getCreatureName(cid)] then
   docastspell(cid, "Lava-Electricity")
end
---------------------------------------Stunning Confusion-----------------------------------------
if passivesChances["Stunning"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning"][getCreatureName(cid)] then  
   docastspell(cid, "Stunning Confusion")
end
-----------------------------------------Groundshock-----------------------------------
if passivesChances["Groundshock"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Groundshock"][getCreatureName(cid)] then
   docastspell(cid, "Groundshock")
end
--------------------------------------Electric Charge---------------------------------------------
if passivesChances["Electric Charge"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Electric Charge"][getCreatureName(cid)] then
   docastspell(cid, "Electric Charge", 0, 0)
end
-------------------------------------Melody------------------------------------
if passivesChances["Melody"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Melody"][getCreatureName(cid)] then 
   docastspell(cid, "Melody")
end
------------------------------------- Dragon Fury / Fury ---------------------------------------
if passivesChances["Dragon Fury"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Dragon Fury"][getCreatureName(cid)] then
   docastspell(cid, "Dragon Fury", 0, 0)
end
------------------------------------- Mega Drain ---------------------------------------
if passivesChances["Mega Drain"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mega Drain"][getCreatureName(cid)] then
   docastspell(cid, "Mega Drain")
end
------------------------------------- Spores Reaction ---------------------------------------
if passivesChances["Spores Reaction"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Spores Reaction"][getCreatureName(cid)] then
   docastspell(cid, "Spores Reaction")
end
------------------------------------ Amnesia ----------------------------------------   
if passivesChances["Amnesia"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Amnesia"][getCreatureName(cid)] then 
   docastspell(cid, "Amnesia", 0, 0)
end
----------------------------------- Zen Mind -----------------------------------------
if passivesChances["Zen Mind"][getCreatureName(cid)] and isWithCondition(cid) and math.random(1, 100) <= passivesChances["Zen Mind"][getCreatureName(cid)] then
   docastspell(cid, "Zen Mind", 0, 0)
end
---------------------------------- Mirror Coat ---------------------------------------
if passivesChances["Mirror Coat"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mirror Coat"][getCreatureName(cid)] then   
   docastspell(cid, "Mirror Coat", 0, 0)
end
--------------------------------- Illusion -----------------------------------------
return false
end

Link para o post
Compartilhar em outros sites

Amigo, seu personagem, está em algum clan, se sim, poste aqui o npc de clan e a lib clansystem.lua

Editado por lorenzo2014 (veja o histórico de edições)

                                                                                               1zcn2mb.jpg

 

                                                                                                                       Danera Global Server

                                                                                                                       Versão: 10.77 - 10.79

                                                                                                                       Sem Items VIP

                                                                                                                       Venha se divertir

Link para o post
Compartilhar em outros sites

Essa função, "getClanPorcent" está retornando nulo, caso saiba onde ela fica e puder postar aqui, ficará mais fácil de ajuda-lo

 

Nessa parte:

    if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then
       valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk")                           
    elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then
       valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2))
    end
Editado por Orochi Elf (veja o histórico de edições)

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

Amigo, seu personagem, está em algum clan, se sim, poste aqui o npc de clan e a lib clansystem.lua

 

 

Essa função, "getClanPorcent" está retornando nulo, caso saiba onde ela fica e puder postar aqui, ficará mais fácil de ajuda-lo

 

Nessa parte:

    if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then
       valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk")                           
    elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then
       valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2))
    end

 

a coisa é que nem sei msm ql cla poderia estar causando esses bugs :(

 

meu lib/clan system

 

local clansAtk = {
[1] = {
[FIREDAMAGE] = {
[1] = {atk = 1.17},
[2] = {atk = 1.22},
[3] = {atk = 1.27},
[4] = {atk = 1.32},
[5] = {atk = 1.37},
},
["null"] =   {
},
},
[2] = {
[WATERDAMAGE] = {
[1] = {atk = 1.05},
[2] = {atk = 1.10},
[3] = {atk = 1.15},
[4] = {atk = 1.20},
[5] = {atk = 1.25},
},
[iCEDAMAGE] =   {
[1] = {atk = 1.10},
[2] = {atk = 1.15},
[3] = {atk = 1.20},
[4] = {atk = 1.25},
[5] = {atk = 1.30},
},
},
[3] = {
[ROCKDAMAGE] =  {
[1] = {atk = 1.05},
[2] = {atk = 1.10},
[3] = {atk = 1.15},
[4] = {atk = 1.20},
[5] = {atk = 1.25},
},
  [GROUNDDAMAGE] = {
[1] = {atk = 1.05},
[2] = {atk = 1.10},
[3] = {atk = 1.15},
[4] = {atk = 1.20},
[5] = {atk = 1.25},
},
},
[4] = {
[FLYDAMAGE] =   {
[1] = {atk = 1.15},
[2] = {atk = 1.20},
[3] = {atk = 1.25},
[4] = {atk = 1.30},
[5] = {atk = 1.35},
},
  [DRAGONDAMAGE] = {
[1] = {atk = 1.10},
[2] = {atk = 1.15},
[3] = {atk = 1.20},
[4] = {atk = 1.25},
[5] = {atk = 1.30},
},
},
[5] = {
  [GHOSTDAMAGE] =  {
[1] = {atk = 1.05},
[2] = {atk = 1.10},
[3] = {atk = 1.15},
[4] = {atk = 1.20},
[5] = {atk = 1.25},
},
  [POISONDAMAGE] = {
[1] = {atk = 1.08},
[2] = {atk = 1.13},
[3] = {atk = 1.18},
[4] = {atk = 1.23},
[5] = {atk = 1.28},
},
},
[6] = {
[FIGHTDAMAGE] = {
[1] = {atk = 1.05},
[2] = {atk = 1.10},
[3] = {atk = 1.15},
[4] = {atk = 1.20},
[5] = {atk = 1.25},
},
  [NORMALDAMAGE] = {
[1] = {atk = 1.05},
[2] = {atk = 1.10},
[3] = {atk = 1.15},
[4] = {atk = 1.20},
[5] = {atk = 1.25},
},
},
[7] = {
[PSYCHICDAMAGE] =  {
[1] = {atk = 1.10},
[2] = {atk = 1.15},
[3] = {atk = 1.20},
[4] = {atk = 1.25},
[5] = {atk = 1.30},
},
["null"] = {
},
},
[8] = {
  [GRASSDAMAGE] =  {
[1] = {atk = 1.05},
[2] = {atk = 1.10},
[3] = {atk = 1.15},
[4] = {atk = 1.20},
[5] = {atk = 1.25},
},
  [bUGDAMAGE] = {
[1] = {atk = 1.05},
[2] = {atk = 1.10},
[3] = {atk = 1.15},
[4] = {atk = 1.20},
[5] = {atk = 1.25},
},
},
[9] = {
[ELECTRICDAMAGE] = {
[1] = {atk = 1.12},
[2] = {atk = 1.17},
[3] = {atk = 1.22},
[4] = {atk = 1.27},
[5] = {atk = 1.32},
},
["null"] = {
},
}
}
 
local clansDef = {
[1] = {
["fire"] = {
[1] = {def = 0.17},
[2] = {def = 0.22},
[3] = {def = 0.27},
[4] = {def = 0.32},
[5] = {def = 0.37},
},
["null"] =  {
},
        },
[2] =   {
["water"] = {
[1] = {def = 0.05},
[2] = {def = 0.10},
[3] = {def = 0.15},
[4] = {def = 0.20},
[5] = {def = 0.25},
},
["ice"] = {
[1] = {def = 0.10},
[2] = {def = 0.15},
[3] = {def = 0.20},
[4] = {def = 0.25},
[5] = {def = 0.30},
},
},
[3] = {
["rock"] = {
[1] = {def = 0.05},
[2] = {def = 0.10},
[3] = {def = 0.15},
[4] = {def = 0.20},
[5] = {def = 0.25},
},
  ["ground"] = {
[1] = {def = 0.10},
[2] = {def = 0.15},
[3] = {def = 0.20},
[4] = {def = 0.25},
[5] = {def = 0.30},
},
},
[4] =   {
 ["flying"] =  {
[1] = {def = 0.15},
[2] = {def = 0.20},
[3] = {def = 0.25},
[4] = {def = 0.30},
[5] = {def = 0.35},
},
  ["dragon"] = {
[1] = {def = 0.10},
[2] = {def = 0.15},
[3] = {def = 0.20},
[4] = {def = 0.25},
[5] = {def = 0.30},
},
},
[5] = {
["ghost"] = {
[1] = {def = 0.05},
[2] = {def = 0.10},
[3] = {def = 0.15},
[4] = {def = 0.20},
[5] = {def = 0.25},
},
  ["poison"] = {
[1] = {def = 0.08},
[2] = {def = 0.13},
[3] = {def = 0.18},
[4] = {def = 0.23},
[5] = {def = 0.28},
},
},
[6] =   {
["fighting"] = {
[1] = {def = 0.05},
[2] = {def = 0.10},
[3] = {def = 0.15},
[4] = {def = 0.20},
[5] = {def = 0.25},
},
  ["normal"] = {
[1] = {def = 0.05},
[2] = {def = 0.10},
[3] = {def = 0.15},
[4] = {def = 0.20},
[5] = {def = 0.25},
},
},
[7] =   {
 ["psychic"] = {
[1] = {def = 0.10},
[2] = {def = 0.15},
[3] = {def = 0.20},
[4] = {def = 0.25},
[5] = {def = 0.30},
},
["null"] =  {
},
},
[8] =   {
["grass"] = {
[1] = {def = 0.05},
[2] = {def = 0.10},
[3] = {def = 0.15},
[4] = {def = 0.20},
[5] = {def = 0.25},
},
["bug"] =   {
[1] = {def = 0.05},
[2] = {def = 0.10},
[3] = {def = 0.15},
[4] = {def = 0.20},
[5] = {def = 0.25},
},
},
[9] =   {
["electric"] = {
[1] = {def = 0.12},
[2] = {def = 0.17},
[3] = {def = 0.22},
[4] = {def = 0.27},
[5] = {def = 0.32},
},
}
}                        
 
local clansName = {
--[num do clan] = {nome do clan, storage outfit normal, storage outfit rank5},
[1] = {'Volcanic', 181613, 181625},
[2] = {'Seavell', 181619, 181622},
[3] = {'Orebound', 181620, 181627},
[4] = {'Wingeon', 181616, 181626},
[5] = {'Malefic', 181615, 181624},
[6] = {'Gardestrike', 181614, 181628},
[7] = {'Psycraft', 181618, 181629},
[8] = {'Naturia', 181612, 181623},
[9] = {'Raibolt', 181617, 181621},
}
 
 
function getClanPorcent(master, combat, option, type, type2)         --alterado v1.9 \/
if getPlayerClanNum(master) >= 1 then        
   local clanAtk = clansAtk[getPlayerClanNum(master)]
   local clanDef = clansDef[getPlayerClanNum(master)]
 
   if option == "atk" and clanAtk[combat] then
      return clanAtk[combat][getPlayerClanRank(master)].atk
   else
      if option == "def" and clanDef[type] then                                
         return clanDef[type][getPlayerClanRank(master)].def
      elseif option == "def" and clanDef[type2] then
         return clanDef[type2][getPlayerClanRank(master)].def
      end
   end
end 
return option == "atk" and 1 or 0
end
 
function getPlayerClanName(cid)
if not isCreature(cid) then return 'No Clan!' end
return clansName[getPlayerClanNum(cid)] and clansName[getPlayerClanNum(cid)][1] or 'No Clan!'
end
 
function getPlayerClanNum(cid)
if not isCreature(cid) then return -1 end
return getPlayerStorageValue(cid, 86228)
end
 
function getPlayerClanRank(cid)
if not isCreature(cid) then return -1 end
return getPlayerStorageValue(cid, 862281)
end
 
function setPlayerClan(cid, clan)
if not isCreature(cid) or not clan then return false end
if removePlayerClan(cid) then  --para evitar possiveis problemas!
   if type(clan) == "number" and (clan >= 1 and clan <= 9) then
      setPlayerStorageValue(cid, 86228, clan)    --sto clan
      setPlayerClanRank(cid, 1)                  --set rank 1
      setPlayerStorageValue(cid, clansName[clan][2], 1)   --sto roupa
      return true
   elseif type(clan) == "string" then
      clan = string.lower(clan)
      for e, f in pairs(clansName) do
          local clan2 = string.lower(f[1])
          if clan == clan2 then
             setPlayerStorageValue(cid, 86228, e)  --sto clan
             setPlayerClanRank(cid, 1)             --set rank 1
             setPlayerStorageValue(cid, clansName[e][2], 1)   --sto roupa
             return true
          end
      end
   end
end
return false 
end
 
function setPlayerClanRank(cid, rank)
if not isCreature(cid) or not rank then return false end
if type(rank) == "number" and (rank >= 1 and rank <= 5) then
   setPlayerStorageValue(cid, 862281, rank)
   if rank == 5 then 
      setPlayerStorageValue(cid, clansName[getPlayerClanNum(cid)][3], 1)
   end
   return true
end
return false
end 
 
function removePlayerClan(cid)
if not isCreature(cid) then return false end
if getPlayerStorageValue(cid, 854789) >= 1 then return false end --nao pode remover o clan se o player tiver fazendo missoes de rank!
   setPlayerStorageValue(cid, 86228, -1) --sto do clan
   setPlayerStorageValue(cid, 862281, -1) --sto do rank
   setPlayerStorageValue(cid, 854789, -1) --sto da quest de rank
   setPlayerStorageValue(cid, 854788, -1) --sto catch, quest de rank
   setPlayerStorageValue(cid, 854787, -1) --sto task, quest de rank
   for i = 181612, 181638 do
       setPlayerStorageValue(cid, i, -1)  --sto das roupas de clan
   end
return true
end    
 
function checkItensForTask(cid, itens)
local check = 0 
local array = {}
local missing = {}
table.insert(missing, "Are missing: ")
local c = 0
    for i = 1, #itens do
        if getPlayerItemCount(cid, itens[1]) >= itens[2] then
           check = check + 1
        else
           table.insert(array, {itens[1], (itens[2]-getPlayerItemCount(cid, itens[1]))})
        end       
    end
if check == #itens then
   for b = 1, #itens do
       doPlayerRemoveItem(cid, itens[1], itens[2])
   end
   return 0 
else
   for a = 1, #array do
       table.insert(missing, ((a == #array and c ~= 0) and " and " or a ~= 1 and ", " or "{")..(array[a][2]).." "..(getItemNameById(array[a][1])))
       c = c+1
   end
   table.insert(missing, "} yet.") 
   return table.concat(missing)
end
end
 
function checkPokemonForTask(cid, poke)
local pbs = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
local slot = getPlayerSlotItem(cid, 8)
if slot.itemid > 0 and isPokeball(slot.itemid) then
   if getItemAttribute(slot.uid, "poke") == poke and getItemAttribute(slot.uid, "task") and getItemAttribute(slot.uid, "task") >= 1 then
      doRemoveItem(slot.uid, 1)
      doTransformItem(getPlayerSlotItem(cid, CONST_SLOT_LEGS).uid, 2395)
      return true
   end
end
for i = 1, #pbs do
    if getItemAttribute(pbs, "poke") == poke and getItemAttribute(pbs, "task") and getItemAttribute(pbs, "task") >= 1 then
      doRemoveItem(pbs, 1)
      return true
   end
end
return false
end      

 
pfv alguem me ajuda? estou tentando ver com quem é q da o bug mas ainda nao achei 
 
agora ta dando esse ai tb
 
[08/07/2015 06:29:38] [Error - CreatureScript Interface] 
[08/07/2015 06:29:38] data/creaturescripts/scripts/exp2.0.lua:onStatsChange
[08/07/2015 06:29:38] Description: 
[08/07/2015 06:29:38] data/lib/clan system.lua:283: attempt to index field '?' (a nil value)
[08/07/2015 06:29:38] stack traceback:
[08/07/2015 06:29:39] data/lib/clan system.lua:283: in function 'getClanPorcent'
[08/07/2015 06:29:39] data/creaturescripts/scripts/exp2.0.lua:455: in function <data/creaturescripts/scripts/exp2.0.lua:64>
[08/07/2015 06:29:39] [C]: in function 'doTargetCombatHealth'
[08/07/2015 06:29:39] data/lib/newStatusSyst.lua:1152: in function <data/lib/newStatusSyst.lua:1148>
 
meu newStatusSyst:

conds = {
["Slow"] = 3890,
["Confusion"] = 3891,  
["Burn"] = 3892,
["Poison"] = 3893,
["Fear"] = 3894,
["Stun"] = 3895,
["Paralyze"] = 3896,                               --alterado v1.6 \/ peguem o script todo!
["Leech"] = 3897,
["Buff1"] = 3898,
["Buff2"] = 3899,
["Buff3"] = 3900,
["Miss"] = 32659,   
["Silence"] = 32698,     
["Sleep"] = 98271,
}
 
injuries2 = {
[1] = {n = "slow", m = 3890},
[2] = {n = "confuse", m = 3891},  
[3] = {n = "burn", m = 3892},
[4] = {n = "poison", m = 3893},
[5] = {n = "fear", m = 3894},
[6] = {n = "stun", m = 3895},
[7] = {n = "paralyze", m = 3896},
[8] = {n = "leech", m = 3897},
[9] = {n = "Buff1", m = 3898},
[10] = {n = "Buff2", m = 3899},
[11] = {n = "Buff3", m = 3900},
[12] = {n = "miss", m = 32659},   
[13] = {n = "silence", m = 32698},     
[14] = {n = "sleep", m = 98271},
}
 
Buffs = {
[1] = {"Buff1", 3898},
[2] = {"Buff2", 3899},
[3] = {"Buff3", 3900},
}
 
paralizeArea2 = createConditionObject(CONDITION_PARALYZE)
setConditionParam(paralizeArea2, CONDITION_PARAM_TICKS, 50000)
setConditionFormula(paralizeArea2, -0.63, -0.63, -0.63, -0.63)
 
local roardirections = {
[NORTH] = {SOUTH},
[sOUTH] = {NORTH},
[WEST] = {EAST},           --edited sistema de roar
[EAST] = {WEST}}
 
function doSendSleepEffect(cid)
if not isCreature(cid) or not isSleeping(cid) then return true end
doSendMagicEffect(getThingPos(cid), 32)
addEvent(doSendSleepEffect, 1500, cid)
end
 
local outFurys = {
["Shiny Charizard"] = {outFury = 1073}, 
["Elder Charizard"] = {outFury = 1073},  
["Shiny Blastoise"] = {outFury = 1074},   
["Ancient Blastoise"] = {outFury = 1074}, 
["Ditto"] = {outFury = null},   
}
 
local outImune = {
["Camouflage"] = 1445,
["Acid Armor"] = 1453,
["Iron Defense"] = 1401,
["Minimize"] = 1455,
["Future Sight"] = 1446,
["Psychic Sight"] = 1536,
["Heal Bell"] = 946,
}
            
local function transBack(cid)
if isCreature(cid) then
   if getPlayerStorageValue(cid, 974848) >= 1 then
      setPlayerStorageValue(cid, 974848, 0)
      doRemoveCondition(cid, CONDITION_OUTFIT)
   end
end
end
 
function doCondition2(ret)
--
function doMiss2(cid, cd, eff, check, spell)
local stg = conds["Miss"]
    if not isCreature(cid) then return true end  --is creature?
    if getPlayerStorageValue(cid, 21100) >= 1 and getPlayerStorageValue(cid, stg) <= -1 then return true end --alterado v1.6  reflect
    if not canDoMiss(cid, spell) then return true end
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end 
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "miss", a)
       doItemSetAttribute(item.uid, "missEff", eff)
       doItemSetAttribute(item.uid, "missSpell", spell)
    end
 
    if a <= -1 then 
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
        
    doSendMagicEffect(getThingPos(cid), eff)
    addEvent(doMiss2, 1000, cid, -1, eff, a, spell)   
end 
 
function doSilence2(cid, cd, eff, check)
local stg = conds["Silence"]
    if not isCreature(cid) then return true end  --is creature?
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "silence", a)
       doItemSetAttribute(item.uid, "silenceEff", eff)
    end
 
    if a <= -1 then 
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
        
    doSendMagicEffect(getThingPos(cid), eff)
    addEvent(doSilence2, 1000, cid, -1, eff, a)   
end       
 
function doSlow2(cid, cd, eff, check, first)
local stg = conds["Slow"]
    if not isCreature(cid) then return true end  --is creature?
     if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "slow", a)
       doItemSetAttribute(item.uid, "slowEff", eff)
    end
 
    if a <= -1 then 
    doRemoveCondition(cid, CONDITION_PARALYZE)
    if not isSleeping(cid) and not isParalyze(cid) then
       addEvent(doRegainSpeed, 50, cid)     --alterado
    end
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
    
    if first then
       doAddCondition(cid, paralizeArea2) 
    end  
      
    doSendMagicEffect(getThingPos(cid), eff)
    addEvent(doSlow2, 1000, cid, -1, eff, a)   
end    
 
function doConfusion2(cid, cd, check)
local stg = conds["Confusion"]
    if not isCreature(cid) then return true end  --is creature?
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "confuse", a)
    end
 
    if a <= -1 then 
    if getCreatureCondition(cid, CONDITION_PARALYZE) == true then
       doRemoveCondition(cid, CONDITION_PARALYZE)
  addEvent(doAddCondition, 10, cid, paralizeArea2)            
    end
    if not isSleeping(cid) and not isParalyze(cid) then
       doRegainSpeed(cid)            --alterado 
    end
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
    
    if math.random(1, 6) >= 4 then
doSendMagicEffect(getThingPos(cid), 31)
end
 
    local isTarget = isSummon(cid) and getCreatureTarget(getCreatureMaster(cid)) or getCreatureTarget(cid)
    if isCreature(isTarget) and not isSleeping(cid) and not isParalyze(cid) and getPlayerStorageValue(cid, 654878) <= 0 then --alterado v1.6
doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, 100)
        doPushCreature(cid, math.random(0, 3), 1, 0)    --alterado v1.6
doChangeSpeed(cid, -100)
end
 
local pos = getThingPos(cid)
addEvent(doSendMagicEffect, math.random(0, 450), pos, 31)
 
    addEvent(doConfusion2, 1000, cid, -1, a)   
end           
 
function doBurn2(cid, cd, check, damage)
local stg = conds["Burn"]
    if not isCreature(cid) then return true end  --is creature?
   if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "burn", a)
       doItemSetAttribute(item.uid, "burndmg", damage)
    end
 
    if a <= -1 then 
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
    
    doCreatureAddHealth(cid, -damage, 15, COLOR_BURN)  
    addEvent(doBurn2, 3500, cid, -1, a, damage)   
end 
 
function doPoison2(cid, cd, check, damage)
local stg = conds["Poison"]
    if not isCreature(cid) then return true end  --is creature?
    ----------
    if isSummon(cid) or ehMonstro(cid) and pokes[getCreatureName(cid)] then --alterado v1.6
       local type = pokes[getCreatureName(cid)].type
       local type2 = pokes[getCreatureName(cid)].type2
       if isInArray({"poison", "steel"}, type) or isInArray({"poison", "steel"}, type2) then
          return true
       end
    end
    ---------
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "poison", a)
       doItemSetAttribute(item.uid, "poisondmg", damage)
    end
 
    if a <= -1 or getCreatureHealth(cid) == 1 then 
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
   
    local dano = getCreatureHealth(cid)-damage <= 0 and getCreatureHealth(cid)-1 or damage 
    doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS)  
    
    addEvent(doPoison2, 1500, cid, -1, a, damage)   
end       
 
function doFear2(cid, cd, check, skill)
local stg = conds["Fear"]
    if not isCreature(cid) then return true end  --is creature?
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "fear", a)
       doItemSetAttribute(item.uid, "fearSkill", skill)
    end
 
    if a <= -1 then 
    if getCreatureCondition(cid, CONDITION_PARALYZE) == true then
       doRemoveCondition(cid, CONDITION_PARALYZE)
  addEvent(doAddCondition, 10, cid, paralizeArea2)            
    end
    if not isSleeping(cid) and not isParalyze(cid) then
       doRegainSpeed(cid)         --alterado 
    end
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
    
    if skill == "Roar" then
       eff = 244
    else                --edited Roar
       eff = 139
    end
    
    if math.random(1, 6) >= 4 then
doSendMagicEffect(getThingPos(cid), eff)
end
 
    local isTarget = isSummon(cid) and getCreatureTarget(getCreatureMaster(cid)) or getCreatureTarget(cid)
    if isCreature(isTarget) and not isSleeping(cid) and not isParalyze(cid) and getPlayerStorageValue(cid, 654878) <= 0 then --alterado v1.6
local dir = getCreatureDirectionToTarget(cid, isTarget)
        doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, 250)
        doPushCreature(cid, roardirections[dir][1], 1, 0)  --alterado v1.6
doChangeSpeed(cid, -250)
end
 
local pos = getThingPos(cid)
addEvent(doSendMagicEffect, math.random(0, 450), pos, eff)
 
    addEvent(doFear2, 400, cid, -1, a, skill)   
end      
 
function doStun2(cid, cd, eff, check, spell)
local stg = conds["Stun"]
    if not isCreature(cid) then return true end  --is creature?
    if not canDoMiss(cid, spell) then return true end
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "stun", a)
       doItemSetAttribute(item.uid, "stunEff", eff)
       doItemSetAttribute(item.uid, "stunSpell", spell)
    end
 
    if a <= -1 then
    doRemoveCondition(cid, CONDITION_PARALYZE)
    if not isSleeping(cid) and not isParalyze(cid) then
       addEvent(doRegainSpeed, 50, cid)   --alterado 
    end
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
    
    if getCreatureCondition(cid, CONDITION_PARALYZE) == false then
       doAddCondition(cid, paralizeArea2)
    end    
    doSendMagicEffect(getThingPos(cid), eff)
    addEvent(doStun2, 1000, cid, -1, eff, a, spell)   
end 
 
function doParalyze2(cid, cd, eff, check, first)
local stg = conds["Paralyze"]
    if not isCreature(cid) then return true end  --is creature?
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "paralyze", a)
       doItemSetAttribute(item.uid, "paralyzeEff", eff)
    end
 
    if a <= -1 then 
    if isPlayer(cid) then
       if not isSleeping(cid) then   --alterado
          mayNotMove(cid, false)
       end
    else
       if getCreatureCondition(cid, CONDITION_PARALYZE) == true then
          doRemoveCondition(cid, CONDITION_PARALYZE)
          addEvent(doAddCondition, 10, cid, paralizeArea2)            
       end
       if not isSleeping(cid) then
          doRegainSpeed(cid)          --alterado
       end
    end   
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
    
    if isPlayer(cid) then
       mayNotMove(cid, true)
    else                        --alterado v1.6
       doChangeSpeed(cid, -2000)
    end 
    doSendMagicEffect(getThingPos(cid), eff)
    addEvent(doParalyze2, 1000, cid, -1, eff, a, false)   
end       
 
function doSleep2(cid, cd, check, first)        
local stg = conds["Sleep"]
    if not isCreature(cid) then return true end  --is creature?
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not isSleeping(cid) then
addEvent(doSendSleepEffect, 500, cid)
end
 
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
          
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "sleep", a)
    end
 
    if a <= -1 then 
    if not isPlayer(cid) then
  local dittoStg = getPlayerStorageValue(cid, 1010) 
       if getCreatureName(cid) == "Ditto" and isSummon(cid) and tostring(dittoStg) and dittoStg ~= "Ditto" then
     doSetCreatureOutfit(cid, {lookType = getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "transOutfit")}, -1)
       else
     doRemoveCondition(cid, CONDITION_OUTFIT)
  end
  if getPlayerStorageValue(cid, 625877) ~= -1 then 
     doSetCreatureOutfit(cid, {lookType = getPlayerStorageValue(cid, 625877)}, -1)   --alterado v1.6
       end 
    end
    if isPlayer(cid) then
       if not isParalyze(cid) then
          mayNotMove(cid, false)   --alterado
       end
    else
       if getCreatureCondition(cid, CONDITION_PARALYZE) == true then
          doRemoveCondition(cid, CONDITION_PARALYZE)
          addEvent(doAddCondition, 10, cid, paralizeArea2)            
       end
       if not isParalyze(cid) then
          doRegainSpeed(cid)   --alterado
       end
end
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
    
    if first then 
       if getCreatureName(cid) == "Ursaring" and getCreatureCondition(cid, CONDITION_OUTFIT) == true then
             
       elseif not isPlayer(cid) then
          if isInArray({604, 605, 1015, 1016, 1183, 1184}, getCreatureOutfit(cid).lookType) then
             Info = 0                                                                            --alterado v1.6
          else
             Info = getMonsterInfo(getCreatureName(cid)).lookCorpse                
          end                
          local look = getCreatureOutfit(cid) 
          ---------
          local dittoStg = getPlayerStorageValue(cid, 1010) 
          if getCreatureName(cid) == "Ditto" and isSummon(cid) and tostring(dittoStg) and dittoStg ~= "Ditto" then
        local InfoDitto = getMonsterInfo(tostring(dittoStg)).lookCorpse
             if InfoDitto ~= 0 and look.lookType ~= 0 then             
                --doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(tostring(dittoStg)).lookCorpse}, -1)
             end   
          else
             if getCreatureName(cid) == "Shiny Golem" and getCreatureOutfit(cid).lookType == 1403 then
                doRemoveCondition(cid, CONDITION_OUTFIT)                                                                                                  
             elseif Info ~= 0 and look.lookType ~= 0 then
   --doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(cid)).lookCorpse}, -1)
             end
          end
       end
    end
                                      --alterado v1.6
    if isPlayer(cid) then
       mayNotMove(cid, true)
    else
       doChangeSpeed(cid, -getCreatureSpeed(cid))
    end
    addEvent(doSleep2, 1000, cid, -1, a, false)
end   
 
function doLeech2(cid, attacker, cd, check, damage)
local stg = conds["Leech"]
    if not isCreature(cid) then return true end  --is creature?
    if attacker ~= 0 and not isCreature(attacker) then return true end  --is creature?
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then 
       setPlayerStorageValue(cid, stg, cd)    --allterado v1.8
       return true 
    end
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, "leech", a)
       doItemSetAttribute(item.uid, "leechdmg", damage)
    end
 
    if a <= -1 then 
    setPlayerStorageValue(cid, stg, -1)
    return true 
    end
    
    local life = getCreatureHealth(cid)
    ------
    doCreatureAddHealth(cid, -damage)
    doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144)
    doSendMagicEffect(getThingPos(cid), 45)
    ------
    local newlife = life - getCreatureHealth(cid)
    if newlife >= 1 and attacker ~= 0 then
       doSendMagicEffect(getThingPos(attacker), 14)
       doCreatureAddHealth(attacker, newlife)
       doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32)
    end 
    addEvent(doLeech2, 2000, cid, attacker, -1, a, damage)   
end 
 
function doBuff2(cid, cd, eff, check, buff, first, attr)
    if not isCreature(cid) then return true end  --is creature?
---------------------
local atributo = attr and attr or ""
if first and atributo == "" then
for i = 1, 3 do 
    if getPlayerStorageValue(cid, Buffs[2]) <= 0 then
       atributo = Buffs[1]
       break
    end
end
end
if atributo == "" then return true end
if ehMonstro(cid) then atributo = "Buff1" end
----------------------
local stg = conds[atributo]
 
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then return true end  --n usar 2x
 
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
       setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
           
    local a = getPlayerStorageValue(cid, stg)
           
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
       local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
       doItemSetAttribute(item.uid, atributo, a)
       doItemSetAttribute(item.uid, atributo.."eff", eff)
       doItemSetAttribute(item.uid, atributo.."skill", buff)
    end
 
    if a <= -1 then               --alterado v1.6
    if isInArray({"Psychic Sight", "Heal Bell", "Future Sight", "Camouflage", "Acid Armor", "Iron Defense", "Minimize", "Bug Fighter", "Ancient Fury"}, buff) then
       if not isSleeping(cid) then
          doRemoveCondition(cid, CONDITION_OUTFIT)
       end
       setPlayerStorageValue(cid, 9658783, -1)
       setPlayerStorageValue(cid, 625877, -1) --alterado v1.6 
    end 
    if isInArray({"Eruption", "Elecball", "Strafe", "Agility", "Ancient Fury", "War Dog", "Fighter Spirit", "Furious Legs", "Ultimate Champion", "Bug Fighter"}, buff) then
       setPlayerStorageValue(cid, 374896, -1)   --alterado v1.6
    end                                        
    setPlayerStorageValue(cid, stg, -1)      
    return true 
    end
     
    doSendMagicEffect(getThingPos(cid), eff)
        
    if first then
    if buff == "Strafe" or buff == "Agility" then
       setPlayerStorageValue(cid, 374896, 1) --velo atk --alterado v1.6
       doRaiseStatus(cid, 0, 0, 100, a)
    elseif buff == "Eruption" or buff == "Elecball" then
       setPlayerStorageValue(cid, 374896, 1) --velo atk --alterado v1.6
       doRaiseStatus(cid, 2, 0, 150, a)
    elseif buff == "Tailwind" then
       doRaiseStatus(cid, 0, 0, 200, a)
    elseif buff == "Rage" then
       doRaiseStatus(cid, 2, 0, 0, a)
    elseif buff == "Harden" then
       doRaiseStatus(cid, 0, 2, 0, a)
    elseif buff == "Calm Mind" then
       doRaiseStatus(cid, 0, 2, 0, a)
    elseif buff == "Ancient Fury" then
       doSetCreatureOutfit(cid, {lookType = outFurys[getCreatureName(cid)].outFury}, a*1000)
       setPlayerStorageValue(cid, 374896, 1)  --velo atk
       if getCreatureName(cid) == "Shiny Charizard" or getCreatureName(cid) == "Elder Charizard" then 
          doRaiseStatus(cid, 2, 0, 0, a)    --atk melee     --alterado v1.6
       else
          doRaiseStatus(cid, 0, 2, 0, a)    --def
       end   
       setPlayerStorageValue(cid, 625877, outFurys[getCreatureName(cid)].outFury)     --alterado v1.6
    elseif buff == "War Dog" then
       doRaiseStatus(cid, 1.5, 1.5, 0, a)
       setPlayerStorageValue(cid, 374896, 1)  --velo atk
    elseif buff == "Rest" then
       doSleep2(cid, cd, getPlayerStorageValue(cid, conds["Sleep"]), true) 
       doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    elseif isInArray({"Fighter Spirit", "Furious Legs", "Ultimate Champion"}, buff) then
       doRaiseStatus(cid, 1.5, 0, 0, a)    --atk melee    --alterado v1.6
       setPlayerStorageValue(cid, 374896, 1)  --velo atk 
       addEvent(setPlayerStorageValue, a*1000, cid, 465987, -1)                                              
    elseif isInArray({"Psychic Sight", "Heal Bell", "Future Sight", "Camouflage", "Acid Armor", "Iron Defense", "Minimize"}, buff) then
       doSetCreatureOutfit(cid, {lookType = outImune[buff]}, -1)
       setPlayerStorageValue(cid, 9658783, 1)  
       setPlayerStorageValue(cid, 625877, outImune[buff]) --alterado v1.6                             
    elseif buff == "Bug Fighter" then
       setPlayerStorageValue(cid, 374896, 1)  --velo atk  --alterado v1.6
       doRaiseStatus(cid, 1.5, 1.5, 100, a)
       doSetCreatureOutfit(cid, {lookType = 1448}, a*1000)
       setPlayerStorageValue(cid, 625877, 1448)  --alterado v1.6
    end                                                                            
    end 
    addEvent(doBuff2, 1000, cid, -1, eff, a, buff, false, atributo)   
end
 
if ret.buff and ret.buff ~= "" then
   doBuff2(ret.id, ret.cd, ret.eff, ret.check, ret.buff, ret.first, (ret.attr and ret.attr or false))
end
 
if isSummon(ret.id) and getPokemonBoost(ret.id) ~= 0 and math.random(1, 100) <= getPokemonBoost(ret.id) then   --sistema "pegou no boost"
   if ret.cond and not isInArray({"Poison", "Leech", "Fear"}, ret.cond) then 
      doSendMagicEffect(getThingPosWithDebug(ret.id), 114)
 doSendAnimatedText(getThingPosWithDebug(ret.id), "BOOST", 215)   --alterado v1.8     
      return true
   end
end
 
if ret.cond and ret.cond == "Miss" then
doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell)
elseif ret.cond and ret.cond == "Silence" then
doSilence2(ret.id, ret.cd, ret.eff, ret.check)
elseif ret.cond and ret.cond == "Slow" then
doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first)
elseif ret.cond and ret.cond == "Confusion" then
doConfusion2(ret.id, ret.cd, ret.check)
elseif ret.cond and ret.cond == "Burn" then
doBurn2(ret.id, ret.cd, ret.check, ret.damage)
elseif ret.cond and ret.cond == "Poison" then
doPoison2(ret.id, ret.cd, ret.check, ret.damage)
elseif ret.cond and ret.cond == "Fear" then
doFear2(ret.id, ret.cd, ret.check, ret.skill)
elseif ret.cond and ret.cond == "Stun" then
doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell)
elseif ret.cond and ret.cond == "Paralyze" then
doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first)
elseif ret.cond and ret.cond == "Sleep" then
doSleep2(ret.id, ret.cd, ret.check, ret.first)
elseif ret.cond and ret.cond == "Leech" then
doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage)
end
end
 
--------------------------------
function cleanBuffs2(item)
if item ~= 0 then
   for i = 1, 3 do
       doItemEraseAttribute(item, Buffs[1])
       doItemEraseAttribute(item, Buffs[1].."eff")
       doItemEraseAttribute(item, Buffs[1].."skill")
   end   
end
end 
--------------------------------
function doCureStatus(cid, type, playerballs)
if not isCreature(cid) then return true end
if playerballs and isPlayer(cid) then
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
local mb = getPlayerSlotItem(cid, 8)
if isPokeball(mb.itemid) then
if not type or type == "all" then
for b = 1, #injuries2 do
doItemSetAttribute(mb.uid, ""..injuries2.n.."", -1)
end
else
doItemSetAttribute(mb.uid, ""..type.."", -1)
end
end
for bname, balls in pairs (pokeballs) do
for times = 1,3 do
local items = getItemsInContainerById(bp.uid, balls.all[times]) 
for _, uid in pairs(items) do
if not type or type == "all" then
for b = 1, #injuries2 do
doItemSetAttribute(uid, ""..injuries2.n.."", -1)
end
else
doItemSetAttribute(uid, ""..type.."", -1)
end
end
end
end
end
if type == "all" then
for a = 1, #injuries2 do
setPlayerStorageValue(cid, injuries2[a].m, -1)
end
return true
end
for a, b in pairs (injuries2) do
if b.n == type then
setPlayerStorageValue(cid, b.m, -1)
end
end
end 
---------------------------------
function isWithCondition(cid)
for i = 1, #injuries2 do 
   if getPlayerStorageValue(cid, injuries2.m) >= 1 then
      return true
   end
end
return false
end
---------------------------------
function doCureBallStatus(item, type)
if not type or type == "all" then
for b = 1, #injuries2 do
doItemSetAttribute(item, ""..injuries2.n.."", -1)
end
else
doItemSetAttribute(item, ""..type.."", -1)
end
end
---------------------------------
function isBurning(cid)
if not isCreature(cid) then return false end
if getPlayerStorageValue(cid, conds["Burn"]) >= 0 then return true end
return false
end
 
function isPoisoned(cid)
if not isCreature(cid) then return false end
if getPlayerStorageValue(cid, conds["Poison"]) >= 0 then return true end
return false
end
 
function isSilence(cid)
    if not isCreature(cid) then return false end
    if getPlayerStorageValue(cid, conds["Silence"]) >= 0 then return true end
return false
end
 
function isParalyze(cid)      
    if not isCreature(cid) then return false end
    if getPlayerStorageValue(cid, conds["Paralyze"]) >= 0 then return true end
return false
end
    
function isSleeping(cid)
    if not isCreature(cid) then return false end
    if getPlayerStorageValue(cid, conds["Sleep"]) >= 0 then return true end
return false
end
 
function isWithFear(cid)
    if not isCreature(cid) then return false end
    if getPlayerStorageValue(cid, conds["Fear"]) >= 0 then return true end
return false
end 
-----------------------------------
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", "Last Resort", "Ground Crusher", "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") then
      addEvent(sendEffWithProtect, math.random(0, 500), cid, pos[n], eff)
      addEvent(doMoveDano2, math.random(0, 500), cid, pid, element, min, max, ret, spell) 
   elseif spell == "Last Resort" then
 
local pos = getThingPosWithDebug(cid)
local areas = {rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1}
 
for i = 0, 9 do
    addEvent(doMoveInArea2, i*400, cid, 3, areas[i+1], NORMALDAMAGE, min, max, spell)
    addEvent(doMoveInArea2, i*410, cid, 3, areas[i+1], NORMALDAMAGE, 0, 0, spell)
end
   else
      sendEffWithProtect(cid, pos[n], eff)
      doMoveDano2(cid, pid, element, min, max, ret, spell) 
   end
   end
   l = l+1
end
end
-------------------------------------------
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" or getCreatureName(pid) == "Reflector Wobbuffet" or getCreatureName(pid) == "Wowofet" 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
--------------------------------------------------------------------------------
function sendEffWithProtect(cid, pos, eff)  --Manda algum magic effect com proteçoes 
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
local checkpos = pos
checkpos.stackpos = 0
if not hasTile(checkpos) then
return true
end
if not canWalkOnPos2(pos, false, true, false, true, false) then --alterado v1.6
return true
end
 
   doSendMagicEffect(pos, eff)
end
---------------------------------------------------------------------------------
function getThingPosWithDebug(what)
if not isCreature(what) or getCreatureHealth(what) <= 0 then
return {x = 1, y = 1, z = 10}
end
return getThingPos(what)
end
---------------------------------------------------------------------------------
function doDanoWithProtect(cid, element, pos, area, min, max, eff)  --Da dano com proteçoes
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
   doAreaCombatHealth(cid, element, pos, area, -(math.abs(min)), -(math.abs(max)), eff)
end
---------------------------------------------------------------------------------
function doDanoWithProtectWithDelay(cid, target, element, min, max, eff, area)
const_distance_delay = 56
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
   if target ~= 0 and isCreature(target) and not area then
      delay = getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(target)) * const_distance_delay
      addEvent(doDanoWithProtect, delay, cid, element, getThingPosWithDebug(target), 0, min, max, eff)
      return true
   end
addEvent(doDanoWithProtect, 200, cid, element, getThingPosWithDebug(target), area, min, max, eff)
end   
--------------------------------------------------------------------------------
function sendDistanceShootWithProtect(cid, frompos, topos, eff)    --Manda um efeito de distancia com proteçoes
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
   doSendDistanceShoot(frompos, topos, eff)
end
---------------------------------------------------------------------------------
function sendMoveBack(cid, pos, eff, min, max)     --Manda o Atk do farfetchd de volta...
local m = #pos+1
for i = 1, #pos do
    if not isCreature(cid) then return true end
    ---
    m = m-1
    thing = {x=pos[m].x,y=pos[m].y,z=pos[m].z,stackpos=253}
    local pid = getThingFromPosWithProtect(thing)
    addEvent(doMoveDano2, i*200, cid, pid, FLYINGDAMAGE, min/4, max/4)  
    addEvent(sendEffWithProtect, i*200, cid, pos[m], eff)   --alterado v1.3
    -- 
end
end  
---------------------------------------------------------------------------------
function upEffect(cid, effDis)
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
pos = getThingPos(cid)
frompos = {x = pos.x+1, y = pos.y, z = pos.z}
frompos.x = pos.x - math.random(4, 7)
frompos.y = pos.y - math.random(5, 8)
doSendDistanceShoot(getThingPos(cid), frompos, effDis)
end
---------------------------------------------------------------------------------
function fall(cid, master, element, effDis, effArea)   --Function pra jogar efeitos pra cima e cair depois... tpw falling rocks e blizzard
if isCreature(cid) then
if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
   pos = getThingPos(cid)
   pos.x = pos.x + math.random(-4,4)
   pos.y = pos.y + math.random(-4,4)
   if isMonster(cid) or isPlayer(cid) then
      frompos = {x = pos.x+1, y = pos.y, z = pos.z}
   elseif isSummon(cid) then
      frompos = getThingPos(master)
   end
   frompos.x = pos.x - 7
   frompos.y = pos.y - 6
   if effDis ~= -1 then                --alterado!
      doSendDistanceShoot(frompos, pos, effDis)
   end
   doAreaCombatHealth(cid, element, pos, 0, 0, 0, effArea)
end
end
---------------------------------------------------------------------------------
function canDoMiss(cid, nameAtk)                                            --alterado v1.5
local atkTerra = {"Sand Attack", "Mud Shot", "Mud Bomb", "Stomp", "Crusher Stomp", "Mud Slap", "Sand Tomb"} --alterado v1.7
local atkElectric = {"Electric Storm", "Thunder Wave", "Thunder", "Electricity", "Wild Charge"}  --alterado v1.7
if not isCreature(cid) then return false end
if isPlayer(cid) then return true end
if not pokes[getCreatureName(cid)] then return true end
 
if isInArray(atkTerra, nameAtk) then
   if (pokes[getCreatureName(cid)].type == "flying") or (pokes[getCreatureName(cid)].type2 == "flying") or isInArray(specialabilities["levitate"], getCreatureName(cid))  then
      return false      
   end
elseif isInArray(atkElectric, nameAtk) then
   if (pokes[getCreatureName(cid)].type == "ground") or (pokes[getCreatureName(cid)].type2 == "ground") then
      return false      
   end
end
 
return true
end
---------------------------------------------------------------------------------
function doMoveInAreaMulti(cid, effDis, effMagic, areaEff, areaDano, element, min, max, ret)   --alterado v1.7
if not isCreature(cid) then return true end                     
local pos = getPosfromArea(cid, areaEff)
local pos2 = getPosfromArea(cid, areaDano)
local n = 0
 
while n < #pos2 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=pos2[n].x,y=pos2[n].y,z=pos2[n].z,stackpos=253}
      if n < #pos then
         addEvent(sendDistanceShootWithProtect, 50, cid, getThingPos(cid), pos[n], effDis) --39
         addEvent(sendEffWithProtect, 100, cid, pos[n], effMagic)  -- 112
         ---                                                                                        --alterado v1.6.1
         if math.random(1, 2) == 2 then
            addEvent(sendDistanceShootWithProtect, 450, cid, getThingPos(cid), pos[n], effDis) --550
            addEvent(sendEffWithProtect, 550, cid, pos[n], effMagic)  -- 650
         end
      end   
      local pid = getThingFromPosWithProtect(thing)
      if isCreature(pid) then
         if ret and ret.id == 0 then     --alterado v1.8
            ret.id = pid
            ret.check = getPlayerStorageValue(pid, conds[ret.cond])
         end
         if not ret then ret = {} end --alterado v1.7
         doMoveDano2(cid, pid, element, min, max, ret, getPlayerStorageValue(cid, 21102))
      end
end       
end 
---------------------------------------------------------------------------------------
function doDoubleHit(cid, pid, valor, races)           --alterado v1.6
if isCreature(cid) and isCreature(pid) then
   if getPlayerStorageValue(cid, 374896) >= 1 then
      if getMasterTarget(cid) == pid then
         if isInArray({"Kadabra", "Alakazam", "Mew", "Shiny Abra", "Shiny Alakazam"}, getCreatureName(cid)) then
            doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(pid), 39)
         end
         if isSummon(cid) then
            doTargetCombatHealth(getCreatureMaster(cid), pid, PHYSICALDAMAGE, -math.abs(valor), -math.abs(valor), 255)
         else
            doCreatureAddHealth(pid, -math.abs(valor), 3, races[getMonsterInfo(getCreatureName(pid)).race].cor)
         end
      end
   end
end
end
---------------------------------------------------------------------------------------
function doDanoInTarget(cid, target, combat, min, max, eff)   --alterado v1.7
if not isCreature(cid) or not isCreature(target) 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
   doTargetCombatHealth(cid, target, combat, -math.abs(min), -math.abs(max), eff)
end 
-----------------------------------------------------------------------------------------
function doDanoInTargetWithDelay(cid, target, combat, min, max, eff)     --alterado v1.7
const_distance_delay = 56
if not isCreature(cid) or not isCreature(target) 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
   local delay = getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(target)) * const_distance_delay
   addEvent(doDanoInTarget, delay, cid, target, combat, min, max, eff)
end 

 

[08/07/2015 05:36:19] [Error - CreatureScript Interface] 
[08/07/2015 05:36:19] data/creaturescripts/scripts/exp2.0.lua:onStatsChange
[08/07/2015 05:36:19] Description: 
[08/07/2015 05:36:19] data/lib/clan system.lua:283: attempt to index field '?' (a nil value)
[08/07/2015 05:36:19] stack traceback:
[08/07/2015 05:36:19] data/lib/clan system.lua:283: in function 'getClanPorcent'
[08/07/2015 05:36:19] data/creaturescripts/scripts/exp2.0.lua:455: in function <data/creaturescripts/scripts/exp2.0.lua:64>
[08/07/2015 05:36:19] [C]: in function 'doAreaCombatHealth'
[08/07/2015 05:36:19] data/lib/newStatusSyst.lua:1008: in function <data/lib/newStatusSyst.lua:1004>
 
e agora bugou o "look" de um cara mas tem tb a ver com o clan
ele é Volcanic
 
[08/07/2015 06:42:53] [Error - CreatureScript Interface] 
[08/07/2015 06:42:53] data/creaturescripts/scripts/look.lua:onLook
[08/07/2015 06:42:53] Description: 
[08/07/2015 06:42:53] data/lib/some functions.lua:149: attempt to concatenate local 'rank' (a nil value)
[08/07/2015 06:42:53] stack traceback:
[08/07/2015 06:42:54] data/lib/some functions.lua:149: in function 'getPlayerDesc'
[08/07/2015 06:42:54] data/creaturescripts/scripts/look.lua:218: in function <data/creaturescripts/scripts/look.lua:89>
 
look.lua:

local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"}, 
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},         --alterado v1.9 \/ peguem tudo!
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}
 
local shinys = {
["Shiny Abra"] = "Dark Abra",
["Shiny Onix"] = "Crystal Onix",
["Shiny Gyarados"] = "Red Gyarados",
["Shiny Charizard"] = "Elder Charizard",
["Shiny Venusaur"] = "Ancient Venusaur",
["Shiny Blastoise"] = "Ancient Blastoise",
["Shiny Farfetch'd"] = "Elite Farfetch'd",
["Shiny Hitmonlee"] = "Elite Hitmonlee",
["Shiny Himonchan"] = "Elite Hitmonchan",
["Shiny Snorlax"] = "Big Snorlax",
}
 
-- tabela adicionado ao configuration só procura por price = ..--
 
local xhelds = {
[1] = {name = "X-Defense(Tier: 1)"},
[2] = {name = "X-Defense(Tier: 2)"},
[3] = {name = "X-Defense(Tier: 3)"},
[4] = {name = "X-Defense(Tier: 4)"},
[5] = {name = "X-Defense(Tier: 5)"},
[6] = {name = "X-Defense(Tier: 6)"},
[7] = {name = "X-Defense(Tier: 7)"},
[8] = {name = "X-Attack(Tier : 1)"},
[9] = {name = "X-Attack(Tier : 2)"},
[10] = {name = "X-Attack(Tier: 3)"},
[11] = {name = "X-Attack(Tier: 4)"},
[12] = {name = "X-Attack(Tier: 5)"},
[13] = {name = "X-Attack(Tier: 6)"},
[14] = {name = "X-Attack(Tier: 7)"},
[15] = {name = "X-Return(Tier: 1)"},
[16] = {name = "X-Return(Tier: 2)"},
[17] = {name = "X-Return(Tier: 3)"},
[18] = {name = "X-Return(Tier: 4)"},
[19] = {name = "X-Return(Tier: 5)"},
[20] = {name = "X-Return(Tier: 6)"},
[21] = {name = "X-Return(Tier: 7)"},
[22] = {name = "X-Hellfire(Tier: 1)"},
[23] = {name = "X-Hellfire(Tier: 2)"},
[24] = {name = "X-Hellfire(Tier: 3)"},
[25] = {name = "X-Hellfire(Tier: 4)"},
[26] = {name = "X-Hellfire(Tier: 5)"},
[27] = {name = "X-Hellfire(Tier: 6)"},
[28] = {name = "X-Hellfire(Tier: 7)"},
[29] = {name = "X-Poison(Tier: 1)"},
[30] = {name = "X-Poison(Tier: 2)"},
[31] = {name = "X-Poison(Tier: 3)"},
[32] = {name = "X-Poison(Tier: 4)"},
[33] = {name = "X-Poison(Tier: 5)"},
[34] = {name = "X-Poison(Tier: 6)"},
[35] = {name = "X-Poison(Tier: 7)"},
[36] = {name = "X-Boost(Tier: 1)"},
[37] = {name = "X-Boost(Tier: 2)"},
[38] = {name = "X-Boost(Tier: 3)"},
[39] = {name = "X-Boost(Tier: 4)"},
[40] = {name = "X-Boost(Tier: 5)"},
[41] = {name = "X-Boost(Tier: 6)"},
[42] = {name = "X-Boost(Tier: 7)"},
}
 
local yhelds = {
[1] = {name = "Y-Regeneration(Tier: 1)"},
[2] = {name = "Y-Regeneration(Tier: 2)"},
[3] = {name = "Y-Regeneration(Tier: 3)"},
[4] = {name = "Y-Regeneration(Tier: 4)"},
[5] = {name = "Y-Regeneration(Tier: 5)"},
[6] = {name = "Y-Regeneration(Tier: 6)"},
[7] = {name = "Y-Regeneration(Tier: 7)"},
[8] = {name = "Y-Cure(Tier: 1)"},
[9] = {name = "Y-Cure(Tier: 2)"},
[10] = {name = "Y-Cure(Tier: 3)"},
[11] = {name = "Y-Cure(Tier: 4)"},
[12] = {name = "Y-Cure(Tier: 5)"},
[13] = {name = "Y-Cure(Tier: 6)"},
[14] = {name = "Y-Cure(Tier: 7)"},
}
 
function onLook(cid, thing, position, lookDistance)
                                                          
local str = {}
                                              
if not isCreature(thing.uid) then
   local iname = getItemInfo(thing.itemid)
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then
      
      unLock(thing.uid)
      local lock = getItemAttribute(thing.uid, "lock")        
      local pokename = getItemAttribute(thing.uid, "poke")
      local heldx = getItemAttribute(thing.uid, "heldx")
local heldy = getItemAttribute(thing.uid, "heldy")
      table.insert(str, "You see "..iname.article.." "..iname.name..".")   
      if getItemAttribute(thing.uid, "unique") then               
         table.insert(str, " It's an unique item.")   
      end
      if getItemAttribute(thing.uid, "ehditto") == 1 then
table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Ditto).\n")   
else
table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") 
end  
      if lock and lock > 0 then
         table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n")  
      end
      local boost = getItemAttribute(thing.uid, "boost") or 0
      if boost > 0 then
         table.insert(str, "Boost level: +"..boost..".\n")
      end
      if getItemAttribute(thing.uid, "nick") then
         table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
      end
      if heldx and heldy then
table.insert(str, "Holding: "..(xhelds[heldx].name).." and "..(yhelds[heldy].name)..". ")
elseif heldx then
table.insert(str, "Holding: "..(xhelds[heldx].name)..". ")
elseif heldy then
table.insert(str, "Holding: "..(yhelds[heldy].name)..". ")
end
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then     
 
      table.insert(str, "You see a "..string.lower(iname.name)..". ")     
      if isContainer(thing.uid) then
         table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      end
      table.insert(str, "\n")
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
 
   elseif isContainer(thing.uid) then     --containers
 
      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else   
         table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")     
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")  
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif getItemAttribute(thing.uid, "unique") then    
      local p = getThingPos(thing.uid)
   
      table.insert(str, "You see ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      table.insert(str, " It's an unique item.\n"..iname.description)
      
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
   
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
   else
      return true
   end
end
 
local npcname = getCreatureName(thing.uid)
if ehNPC(thing.uid) and NPCBattle[npcname] then    --npcs duel
   table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then    
   table.insert(str, getPlayerStorageValue(thing.uid, 697548))                                   
   local pos = getThingPos(thing.uid)
   if youAre[getPlayerGroupId(cid)] then
      table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))  
   return false
end
 
if not isPlayer(thing.uid) and not isMonster(thing.uid) then    --outros npcs
   table.insert(str, "You see "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
 
if isPlayer(thing.uid) then     --player
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false))  
return false
end
 
if getCreatureName(thing.uid) == "Evolution" then return false end
 
if not isSummon(thing.uid) then   --monstros
   
   table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n")
   table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
   if getPokemonGender(thing.uid) == SEX_MALE then
      table.insert(str, "It is male.")
   elseif getPokemonGender(thing.uid) == SEX_FEMALE then
      table.insert(str, "It is female.")
   else
      table.insert(str, "It is genderless.")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
 
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then  --summons
 
   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   if getCreatureMaster(thing.uid) == cid then
      local myball = getPlayerSlotItem(cid, 8).uid
      table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".")
      if boostlevel > 0 then
         table.insert(str, "\nBoost level: +"..boostlevel..".")
      end
      table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
      table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
   end
   return false
end
return true
end

 

 
nem sei se tem alguma coisa a ver com o primer bug 
eu testei virando volcanic e dando look em min e td da certo

Achei, o problema é com o cara q eu falei, 

 

1º nao tem como dar look nele

2º qndo ele usa pokemons tipo Fire eles nao estao apanhando nemhum dano, nem batendo nd tb

3º ele é volcanic

 

tomara q alguem ter como me ajudar com isso ai pfv

@up

Editado por joseiz (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

resolvi falar pra o cara criar outro char e dar o lvl devolta pra ele.... foda q ja era lvl 500 e tem como fazer tds as quest dnovo...

achei que ia ficar pronto porem agora bugou outro char, dessa vez um naturia, qndo ele colocar um pokemon do tipo naturia começa a dar esse erro... e o pokemon nao leva nem faz dano algum igual ao outro... pfv alguem me ajude

Link para o post
Compartilhar em outros sites

...............

ainda ninguem aparesce... posso pagar pra quem me der 1 soluçao.

eu achei 1 jeito de como arrumar... é o siguente:

trocar de clan, apenas trocar pra um e despois voltar pra o clan q eles estabam.

facil neh?

mas nem é... o servidor começa a lagar e é dificil achar o char bugado pra falar q ele precisa mudar de clan

hoje finalmente descubri q era apenas trocar de clan começei a procurar os bugados e falar pra trocar porem paresce q isso só fez o bug acontecer + rapido... tipo antes aparesce 1-2 bugados no dia, hoje veio uns 3 em 3-4h +- 

Link para o post
Compartilhar em outros sites
  • Sub-Admin

remova o clãn system uai pra frente vc coloca dnv e vai testando offline em sue pc pra ver o erro

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo